diff --git a/lib/sdk/Applications/EvKitExamples/BLE_beacon/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_beacon/Makefile index c56dd6d0d9308032b1ef6e0d80497c4b0a05883d..d2501105cc47219712166b2d431013cdf3ab39b4 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_beacon/Makefile +++ b/lib/sdk/Applications/EvKitExamples/BLE_beacon/Makefile @@ -29,10 +29,15 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # -# $Id: Makefile 41870 2019-03-26 14:20:03Z nathan.goldstick $ +# $Id: Makefile 44505 2019-07-09 20:32:03Z nathan.goldstick $ # ################################################################################ +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + # This is the name of the build output file ifeq "$(PROJECT)" "" PROJECT=max32665 @@ -55,29 +60,6 @@ endif TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) -# Beacon App Defines -ifneq "$(BEACON_APP_BEACON_APP_ADV_TYPE)" "" -PROJ_CFLAGS+=-DBEACON_APP_BEACON_APP_ADV_TYPE -endif -ifneq "$(BEACON_APP_MODE)" "" -PROJ_CFLAGS+=-DBEACON_APP_MODE -endif -ifneq "$(BEACON_APP_PEER_ADDR)" "" -PROJ_CFLAGS+=-DBEACON_APP_PEER_ADDR -endif -ifneq "$(BEACON_APP_USE_LEGACY_PDU)" "" -PROJ_CFLAGS+=-DBEACON_APP_USE_LEGACY_PDU -endif -ifneq "$(BEACON_APP_USE_ANON_ADV)" "" -PROJ_CFLAGS+=-DBEACON_APP_USE_ANON_ADV -endif -ifneq "$(BEACON_APP_USE_FRAG_PREF)" "" -PROJ_CFLAGS+=-DBEACON_APP_USE_FRAG_PREF -endif -ifneq "$(BEACON_APP_USE_PER_ADV)" "" -PROJ_CFLAGS+=-DBEACON_APP_USE_PER_ADV -endif - # Last octet address modifier ifneq "$(BLE_ADDR_LSB)" "" PROJ_CFLAGS+=-DBLE_ADDR_LSB=$(BLE_ADDR_LSB) @@ -90,10 +72,8 @@ endif # This is the path to the CMSIS root directory ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -NDALIBS_DIR=../../../NDALibraries else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -NDALIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/NDALibraries) endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS @@ -101,23 +81,105 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS SRCS = main.c SRCS += stack_beacon.c SRCS += beacon_main.c + # Where to find source files for this test VPATH = . -VPATH += fcl/src # Where to find header files for this test IPATH = . + +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifdef BTLE_APP_USE_LEGACY_API +ifeq "$(BTLE_APP_USE_LEGACY_API)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +endif +endif +endif +endif + +ifdef CONSOLE_UART +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif +endif + +ifdef ENABLE_SDMA +ifneq "$(ENABLE_SDMA)" "" +ifeq "$(ENABLE_SDMA)" "0" +undefine ENABLE_SDMA +else +ifeq "$(ENABLE_SDMA)" "FALSE" +undefine ENABLE_SDMA +else +ENABLE_SDMA=1 +endif +endif +endif +endif + +ifneq "$(ENABLE_SDMA)" "" +ifdef BTLE_APP_USE_LEGACY_API +ifneq "$(BTLE_APP_USE_LEGACY_API)" "" +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +endif +endif +endif + +#------------------------------------------------------------------------------- +# Configuration specified here. + +#-------------------- +# Stack configuration + # Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE -PROJ_CFLAGS+=-DASYMMETRIC -DWORD32 +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE=TRUE +PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_MS_PER_TICK=1 + + +#-------------------- +# Application CFLAGS configuration + +#-------------------- +# Stack CFLAGS configuration + +PROJ_CFLAGS+=-DINIT_BROADCASTER +# PROJ_CFLAGS+=-DINIT_OBSERVER +# PROJ_CFLAGS+=-DINIT_CENTRAL +PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +ENABLE_LL_TESTER?=#1 +# Use this variable to override default compilier optimization. #MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer # Point this variable to a linker file to override the default file #LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld ################################################################################ # Include external library makefiles here +DEBUG=1 # Include the BSP BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) @@ -128,7 +190,7 @@ PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver include ${PERIPH_DRIVER_DIR}/periphdriver.mk # Include Cordio BTLE Library -CORDIO_DIR=$(NDALIBS_DIR)/BTLE +CORDIO_DIR=$(LIBS_DIR)/BTLE include ${CORDIO_DIR}/btle.mk # Include MAXUSB library diff --git a/lib/sdk/Applications/EvKitExamples/BLE_beacon/beacon_main.c b/lib/sdk/Applications/EvKitExamples/BLE_beacon/beacon_main.c index 74b8dbc4d156343c6f0dc6196b79999c39da0ad8..d8cad00138e4788aa6dd0a9d3380fe8b252fae95 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_beacon/beacon_main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_beacon/beacon_main.c @@ -26,7 +26,7 @@ #include "wsf_buf.h" #include "wsf_assert.h" #include "hci_api.h" -#include "sec_api.h" +#include "hci_vs.h" #include "dm_api.h" #include "smp_api.h" #include "att_api.h" @@ -34,9 +34,6 @@ #include "app_main.h" #include "app_db.h" #include "app_ui.h" -#include "svc_ch.h" -#include "svc_core.h" -#include "svc_wp.h" #include "util/calc128.h" #include "beacon_api.h" @@ -44,100 +41,41 @@ Macros **************************************************************************************************/ -/*! Enumeration of client characteristic configuration descriptors */ -enum -{ - BEACON_GATT_SC_CCC_IDX, /*! GATT service, service changed characteristic */ - BEACON_WP_DAT_CCC_IDX, /*! ARM Ltd. proprietary service, data transfer characteristic */ - BEACON_NUM_CCC_IDX -}; - -#ifndef BEACON_APP_ADV_TYPE - -/* Non-scannable and connectable undirected advertising */ -//#define BEACON_APP_ADV_TYPE DM_EXT_ADV_CONN_UNDIRECT - -/* Scannable and non-connectable directed advertising */ -//#define BEACON_APP_ADV_TYPE DM_EXT_ADV_SCAN_DIRECT - -/* Non-scannable and non-connectable directed advertising */ -#define BEACON_APP_ADV_TYPE DM_EXT_ADV_NONCONN_DIRECT - -#endif /* BEACON_APP_ADV_TYPE */ - -#ifndef BEACON_APP_MODE -#define BEACON_APP_MODE APP_MODE_DISCOVERABLE -//#define BEACON_APP_MODE APP_MODE_CONNECTABLE -#endif /* BEACON_PP_MODEE */ - -#ifndef BEACON_APP_PEER_ADDR -#define BEACON_APP_PEER_ADDR "\x01\x03\x44\x8B\x05" -#endif /* BEACON_APP_PEER_ADDR */ - -#ifndef BEACON_APP_USE_LEGACY_PDU -#define BEACON_APP_USE_LEGACY_PDU 0 -#endif /* BEACON_APP_USE_LEGACY_PDU */ - -#ifndef BLE_BEACON_USE_ANON_ADV -#define BLE_BEACON_USE_ANON_ADV 0 -#endif /* BLE_BEACON_USE_ANON_ADV */ - -#ifndef BLE_BEACON_USE_FRAG_PREF -#define BLE_BEACON_USE_FRAG_PREF 1 -#endif /* BLE_BEACON_USE_FRAG_PREF */ - -#ifndef BLE_BEACON_USE_PER_ADV -#define BLE_BEACON_USE_PER_ADV 0 -#endif /* BLE_BEACON_USE_PER_ADV */ - /************************************************************************************************** Configurable Parameters **************************************************************************************************/ /*! configurable parameters for advertising */ +/* These intervals directly impact energy usage during the non-connected/advertising mode */ +#ifdef BTLE_APP_USE_LEGACY_API +static const appAdvCfg_t beaconAdvCfg = +{ + { 1000, 0, 0}, /*! Advertising durations in ms */ + { 96, 200, 0} /*! Advertising intervals in 0.625 ms units */ +}; +#else /* BTLE_APP_USE_LEGACY_API */ static const appExtAdvCfg_t beaconExtAdvCfg = { - { 0}, /*!< \brief Advertising durations for extended advertising in ms */ - { 200}, /*!< \brief Advertising intervals for extended advertising in 0.625 - ms units (20 ms to 10.24 s). */ - { 0}, /*!< \brief Maximum number of extended advertising events Controller - will send prior to terminating extended advertising */ - - /*! \brief Whether to use legacy advertising PDUs with extended - advertising. If set to TRUE then length of advertising - data cannot exceed 31 octets. */ -#if BEACON_APP_USE_LEGACY_PDU - {FALSE}, -#else /* BEACON_APP_USE_LEGACY_PDU */ - {TRUE}, -#endif /* BEACON_APP_USE_LEGACY_PDU */ - - { 0} /*!< \brief Advertising intervals for periodic advertising in 1.25 - ms units (7.5 ms to 81.91875 s). */ + { 0, 0, 0}, /*! Advertising durations for extended advertising in ms */ + { 96, 200, 0}, /*! Advertising intervals for extended advertising in 0.625 ms units (20 ms to 10.24 s). */ + { 0, 0, 0}, /*! Maximum number of extended advertising events controller will send prior to terminating extended advertising */ + { 0, 0, 0}, /*! Whether to use legacy advertising PDUs with extended advertising. If set to TRUE then length of advertising data cannot exceed 31 octets. */ + { 6, 0, 0} /*! Advertising intervals for periodic advertising in 1.25 ms units (7.5 ms to 81.91875 s). */ }; +#endif /* BTLE_APP_USE_LEGACY_API */ + /*! configurable parameters for slave */ static const appSlaveCfg_t beaconSlaveCfg = { 1, /*! Maximum connections */ }; -/*! TRUE if Out-of-band pairing data is to be sent */ -static const bool_t beaconSendOobData = FALSE; - -/*! SMP security parameter configuration */ -static const attCfg_t beaconAttCfg = -{ - 15, /* ATT server service discovery connection idle timeout in seconds */ - 241, /* desired ATT MTU */ - ATT_MAX_TRANS_TIMEOUT, /* transcation timeout in seconds */ - 4 /* number of queued prepare writes supported by server */ -}; - /************************************************************************************************** Advertising Data **************************************************************************************************/ +#ifdef BTLE_APP_USE_LEGACY_API /*! advertising data, discoverable mode */ static const uint8_t beaconAdvDataDisc[] = { @@ -150,279 +88,66 @@ static const uint8_t beaconAdvDataDisc[] = /*! manufacturer specific data */ 3, /*! length */ DM_ADV_TYPE_MANUFACTURER, /*! AD type */ - UINT16_TO_BYTES(HCI_ID_ARM), /*! company ID */ + UINT16_TO_BYTES(HCI_ID_ARM) /*! company ID */ +}; +/*! scan data, discoverable mode */ +static const uint8_t beaconScanDataDisc[] = +{ /*! device name */ -#if BEACON_APP_USE_LEGACY_PDU - 17, /*! length */ -#else /* BEACON_APP_USE_LEGACY_PDU */ - 102, /*! length */ -#endif /* BEACON_APP_USE_LEGACY_PDU */ + 8, /*! length */ DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ - 'e', - 'x', - 't', - ' ', - 'a', - 'd', - 'v', - ' ', - 'b', - 'a', - 's', - 'i', - 'c', - ' ', - 'c', - 'o' -#if ! BEACON_APP_USE_LEGACY_PDU - , - 'n', - 'n', - 'e', - 'c', - 't', - 'i', - 'o', - 'n', - ' ', - 'd', + 'D', 'a', 't', 's', ' ', - 'a', - 'p', - 'p', - ' ', - 'e', - 'x', - 't', - ' ', - 'a', - 'd', - 'v', - ' ', - 'b', - 'a', - 's', - 'i', - 'c', - ' ', - 'c', - 'o', - 'n', - 'n', - 'e', - 'c', - 't', - 'i', - 'o', - 'n', - ' ', - 'd', - 'a', - 't', - 's', - ' ', - 'a', - 'p', - 'p', - ' ', - 'e', - 'x', - 't', - ' ', - 'a', - 'd', - 'v', - ' ', - 'b', - 'a', - 's', - 'i', - 'c', - ' ', - 'c', - 'o', - 'n', - 'n', - 'e', - 'c', - 't', - 'i', - 'o', - 'n', - ' ', - 'd', - 'a', - 't', - 's', - ' ', - 'a', - 'p', - 'p' -#endif /* BEACON_APP_USE_LEGACY_PDU */ + 'T', + 'X' }; -/*! scan data, discoverable mode */ -static const uint8_t beaconScanDataDisc[] = +#else /* BTLE_APP_USE_LEGACY_API */ +/*! extended advertising and scan data, discoverable mode */ +static const uint8_t beaconExtAdvDataDisc[] = { + /*! flags */ + 2, /*! length */ + DM_ADV_TYPE_FLAGS, /*! AD type */ + DM_FLAG_LE_GENERAL_DISC | /*! flags */ + DM_FLAG_LE_BREDR_NOT_SUP, + + /*! manufacturer specific data */ + 3, /*! length */ + DM_ADV_TYPE_MANUFACTURER, /*! AD type */ + UINT16_TO_BYTES(HCI_ID_ARM), /*! company ID */ + /*! device name */ - 11, /*! length */ - DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ - 'B', - 'L', - 'E', - ' ', - 'b', - 'e', - 'a', - 'c', - 'o', - 'n', - /*! device name */ -#if BEACON_APP_USE_LEGACY_PDU - 18, /*! length */ -#else /* BEACON_APP_USE_LEGACY_PDU */ - 102, /*! length */ -#endif /* BEACON_APP_USE_LEGACY_PDU */ + 8, /*! length */ DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ - 's', - 'c', + 'D', 'a', - 'n', - ' ', - 'r', - 'e', - 's', - 'p', - 'o', - 'n', - 's', - 'e', - ' ', 't', - 'o', - ' ' -#if BEACON_APP_USE_LEGACY_PDU - , - 'a', - 'u', - 'x', - ' ', 's', - 'c', - 'a', - 'n', ' ', - 'r', - 'e', - 'q', - 'u', - 'e', - 's', - 't', - ' ', - 's', - 'c', - 'a', - 'n', - ' ', - 'r', - 'e', - 's', - 'p', - 'o', - 'n', - 's', - 'e', - ' ', - 't', - 'o', - ' ', - 'a', - 'u', - 'x', - ' ', - 's', - 'c', - 'a', - 'n', - ' ', - 'r', - 'e', - 'q', - 'u', - 'e', - 's', - 't', - ' ', - 's', - 'c', - 'a', - 'n', - ' ', - 'r', - 'e', - 's', - 'p', - 'o', - 'n', - 's', - 'e', - ' ', - 't', - 'o', - ' ', - 'a', - 'u', - 'x', - ' ', - 's', - 'c', - 'a', - 'n', - ' ', - 'r', - 'e', - 'q', - 'u', - 'e', - 's', - 't' -#endif /* BEACON_APP_USE_LEGACY_PDU */ + 'T', + 'X' }; -/*! advertising data, connactable mode */ -static const uint8_t datsAdvDataConn[] = +static const uint8_t beaconExtScanDataDisc[] = { /*! device name */ - 11, /*! length */ + 8, /*! length */ DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ - 'B', - 'L', - 'E', - ' ', - 'b', - 'e', + 'D', 'a', - 'c', - 'o', - 'n' + 't', + 's', + ' ', + 'T', + 'X' }; -/************************************************************************************************** - Client Characteristic Configuration Descriptors -**************************************************************************************************/ - -/*! client characteristic configuration descriptors settings, indexed by above enumeration */ -static const attsCccSet_t beaconCccSet[BEACON_NUM_CCC_IDX] = -{ - /* cccd handle value range security level */ - {GATT_SC_CH_CCC_HDL, ATT_CLIENT_CFG_INDICATE, DM_SEC_LEVEL_NONE}, /* BEACON_GATT_SC_CCC_IDX */ - {WP_DAT_CH_CCC_HDL, ATT_CLIENT_CFG_NOTIFY, DM_SEC_LEVEL_NONE} /* BEACON_WP_DAT_CCC_IDX */ -}; +#endif /* BTLE_APP_USE_LEGACY_API */ /************************************************************************************************** Local Variables @@ -434,28 +159,6 @@ static struct wsfHandlerId_t handlerId; /* WSF handler ID */ } beaconCb; -/* LESC OOB configuration */ -static dmSecLescOobCfg_t *beaconOobCfg; - -/*************************************************************************************************/ -/*! - * \brief Send notification containing data. - * - * \param connId DM connection ID. - * - * \return None. - */ -/*************************************************************************************************/ -static void beaconSendData(dmConnId_t connId) -{ - uint8_t str[] = "hello back"; - - if (AttsCccEnabled(connId, BEACON_WP_DAT_CCC_IDX)) - { - /* send notification */ - AttsHandleValueNtf(connId, WP_DAT_HDL, sizeof(str), str); - } -} /*************************************************************************************************/ /*! @@ -471,173 +174,12 @@ static void beaconDmCback(dmEvt_t *pDmEvt) dmEvt_t *pMsg; uint16_t len; - if (pDmEvt->hdr.event == DM_SEC_ECC_KEY_IND) - { - DmSecSetEccKey(&pDmEvt->eccMsg.data.key); - - // If the local device sends OOB data. - if (beaconSendOobData) - { - uint8_t oobLocalRandom[SMP_RAND_LEN]; - SecRand(oobLocalRandom, SMP_RAND_LEN); - DmSecCalcOobReq(oobLocalRandom, pDmEvt->eccMsg.data.key.pubKey_x); - } - } - else if (pDmEvt->hdr.event == DM_SEC_CALC_OOB_IND) - { - if (beaconOobCfg == NULL) - { - beaconOobCfg = WsfBufAlloc(sizeof(dmSecLescOobCfg_t)); - } - - if (beaconOobCfg) - { - Calc128Cpy(beaconOobCfg->localConfirm, pDmEvt->oobCalcInd.confirm); - Calc128Cpy(beaconOobCfg->localRandom, pDmEvt->oobCalcInd.random); - } - } - else - { - len = DmSizeOfEvt(pDmEvt); - - if ((pMsg = WsfMsgAlloc(len)) != NULL) - { - memcpy(pMsg, pDmEvt, len); - WsfMsgSend(beaconCb.handlerId, pMsg); - } - } -} - -/*************************************************************************************************/ -/*! - * \brief Application ATT callback. - * - * \param pEvt ATT callback event - * - * \return None. - */ -/*************************************************************************************************/ -static void beaconAttCback(attEvt_t *pEvt) -{ -} - -/*************************************************************************************************/ -/*! - * \brief Application ATTS client characteristic configuration callback. - * - * \param pDmEvt DM callback event - * - * \return None. - */ -/*************************************************************************************************/ -static void beaconCccCback(attsCccEvt_t *pEvt) -{ - appDbHdl_t dbHdl; - - /* if CCC not set from initialization and there's a device record */ - if ((pEvt->handle != ATT_HANDLE_NONE) && - ((dbHdl = AppDbGetHdl((dmConnId_t) pEvt->hdr.param)) != APP_DB_HDL_NONE)) - { - /* store value in device database */ - AppDbSetCccTblValue(dbHdl, pEvt->idx, pEvt->value); - } -} - -/*************************************************************************************************/ -/*! - * \brief ATTS write callback for proprietary data service. - * - * \return ATT status. - */ -/*************************************************************************************************/ -uint8_t beaconWpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation, - uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr) -{ - /* print received data */ - APP_TRACE_INFO0((const char*) pValue); - - /* send back some data */ - beaconSendData(connId); - - return ATT_SUCCESS; -} - -/*************************************************************************************************/ -/*! -* -* \brief Get peer key from a device database record. -* -* \param pMsg Pointer to DM callback event message. -* -* \return Pointer to peer key if key is valid or NULL if not valid. -*/ -/*************************************************************************************************/ -static dmSecKey_t *beaconGetPeerKey(dmEvt_t *pMsg) -{ - appConnCb_t *pCb; - - /* look up app connection control block from DM connection ID */ - pCb = &appConnCb[pMsg->hdr.param - 1]; - - /* if database record handle valid */ - if (pCb->dbHdl != APP_DB_HDL_NONE) - { - return AppDbGetKey(pCb->dbHdl, DM_KEY_IRK, NULL); - } - - return NULL; -} - -/*************************************************************************************************/ -/*! -* -* \brief Handle add device to resolving list indication. -* -* \param pMsg Pointer to DM callback event message. -* -* \return None. -*/ -/*************************************************************************************************/ -static void beaconPrivAddDevToResListInd(dmEvt_t *pMsg) -{ - dmSecKey_t *pPeerKey; - - /* if peer IRK present */ - if ((pPeerKey = beaconGetPeerKey(pMsg)) != NULL) - { - /* set advertising peer address */ - AppExtSetAdvPeerAddr(DM_ADV_HANDLE_DEFAULT, pPeerKey->irk.addrType, pPeerKey->irk.bdAddr); - } -} - -/*************************************************************************************************/ -/*! -* -* \brief Handle remove device from resolving list indication. -* -* \param pMsg Pointer to DM callback event message. -* -* \return None. -*/ -/*************************************************************************************************/ -static void beaconPrivRemDevFromResListInd(dmEvt_t *pMsg) -{ - uint8_t * pPeerAddr; + len = DmSizeOfEvt(pDmEvt); - if (pMsg->hdr.status == HCI_SUCCESS) + if ((pMsg = WsfMsgAlloc(len)) != NULL) { - appConnCb_t *pCb; - - /* look up app connection control block from DM connection ID */ - pCb = &appConnCb[pMsg->hdr.param - 1]; - - if (pCb->dbHdl != APP_DB_HDL_NONE) - { - pPeerAddr = (uint8_t *) BEACON_APP_PEER_ADDR; - - /* clear advertising peer address and its type */ - AppExtSetAdvPeerAddr(DM_ADV_HANDLE_DEFAULT, HCI_ADDR_TYPE_PUBLIC, pPeerAddr); - } + memcpy(pMsg, pDmEvt, len); + WsfMsgSend(beaconCb.handlerId, pMsg); } } @@ -668,52 +210,32 @@ void beaconDisplayStackVersion(const char *pVersion) /*************************************************************************************************/ static void beaconSetup(dmEvt_t *pMsg) { +#ifndef BTLE_APP_USE_LEGACY_API uint8_t advHandle; -#if BLE_BEACON_USE_PER_ADV - uint8_t periodicAdvHandle; -#endif /* BLE_BEACON_USE_PER_ADV */ - uint8_t chmap; +#endif /* BTLE_APP_USE_LEGACY_API */ - chmap = 0x7; // Bit 0 -> Channel 37; Bit 1 -> Channel 38; Bit 2 -> Channel 39; + /* Send scannable advertisements. */ + AppSetAdvType(DM_ADV_SCAN_UNDIRECT); /* set advertising and scan response data for discoverable mode */ - AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_ADV_DATA_DISCOVERABLE, sizeof(beaconAdvDataDisc), (uint8_t *) beaconAdvDataDisc, HCI_EXT_ADV_DATA_LEN); - AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_SCAN_DATA_DISCOVERABLE, sizeof(beaconScanDataDisc), (uint8_t *) beaconScanDataDisc, HCI_EXT_ADV_DATA_LEN); - - /* set advertising data for connectable mode */ - AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_ADV_DATA_CONNECTABLE, sizeof(datsAdvDataConn), (uint8_t *) datsAdvDataConn, HCI_EXT_ADV_DATA_LEN); - - /* set advertising type */ - AppExtSetAdvType(DM_ADV_HANDLE_DEFAULT, BEACON_APP_ADV_TYPE); - - /* Primary_Advertising_Channel_Map update */ - DmAdvSetChannelMap(DM_ADV_HANDLE_DEFAULT, chmap); - DmAdvIncTxPwr(DM_ADV_HANDLE_DEFAULT, TRUE, HCI_TX_PWR_MIN); - -#if BLE_BEACON_USE_ANON_ADV - /* Anonymous Advertising */ - DmAdvOmitAdvAddr(DM_ADV_HANDLE_DEFAULT, TRUE); -#endif /* BLE_BEACON_USE_ANON_ADV */ - -#if BLE_BEACON_USE_FRAG_PREF - DmAdvSetFragPref(DM_ADV_HANDLE_DEFAULT, HCI_ADV_DATA_FRAG_PREF_FRAG); -#else /* BLE_BEACON_USE_FRAG_PREF */ - DmAdvSetFragPref(DM_ADV_HANDLE_DEFAULT, HCI_ADV_DATA_FRAG_PREF_NO_FRAG); -#endif /* BLE_BEACON_USE_FRAG_PREF */ +#ifdef BTLE_APP_USE_LEGACY_API + AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(beaconAdvDataDisc), (uint8_t *) beaconAdvDataDisc); + AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(beaconScanDataDisc), (uint8_t *) beaconScanDataDisc); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_ADV_DATA_DISCOVERABLE, sizeof(beaconExtAdvDataDisc), (uint8_t *) beaconExtAdvDataDisc, HCI_EXT_ADV_DATA_LEN); + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_SCAN_DATA_DISCOVERABLE, sizeof(beaconExtScanDataDisc), (uint8_t *) beaconExtScanDataDisc, HCI_EXT_ADV_DATA_LEN); +#endif /* BTLE_APP_USE_LEGACY_API */ /* start advertising; automatically set connectable/discoverable mode and bondable mode */ +#ifndef BTLE_APP_USE_LEGACY_API advHandle = DM_ADV_HANDLE_DEFAULT; +#endif /* BTLE_APP_USE_LEGACY_API */ - // Set advertising mode. - AppExtAdvStart(1, &advHandle, BEACON_APP_MODE); - -#if BLE_BEACON_USE_PER_ADV - // Select handle used for periodic advertising. - periodicAdvHandle = DM_ADV_HANDLE_DEFAULT; - - // Start periodic advertising. - AppPerAdvStart(perAdvHandle); -#endif /* BLE_BEACON_USE_PER_ADV */ +#ifdef BTLE_APP_USE_LEGACY_API + AppAdvStart(APP_MODE_DISCOVERABLE); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtAdvStart(1, &advHandle, APP_MODE_DISCOVERABLE); +#endif /* BTLE_APP_USE_LEGACY_API */ } /*************************************************************************************************/ @@ -732,7 +254,6 @@ static void beaconProcMsg(dmEvt_t *pMsg) switch(pMsg->hdr.event) { case DM_RESET_CMPL_IND: - DmSecGenerateEccKeyReq(); beaconSetup(pMsg); uiEvent = APP_UI_RESET_CMPL; break; @@ -741,79 +262,23 @@ static void beaconProcMsg(dmEvt_t *pMsg) uiEvent = APP_UI_ADV_START; break; - case DM_ADV_STOP_IND: - uiEvent = APP_UI_ADV_STOP; - break; - +#ifndef BTLE_APP_IGNORE_EXT_EVENTS case DM_ADV_SET_START_IND: uiEvent = APP_UI_ADV_SET_START_IND; break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ - case DM_ADV_SET_STOP_IND: - uiEvent = APP_UI_ADV_SET_STOP_IND; - break; - - case DM_CONN_OPEN_IND: - uiEvent = APP_UI_CONN_OPEN; - break; - - case DM_CONN_CLOSE_IND: - uiEvent = APP_UI_CONN_CLOSE; - break; - - case DM_SEC_PAIR_CMPL_IND: - uiEvent = APP_UI_SEC_PAIR_CMPL; - break; - - case DM_SEC_PAIR_FAIL_IND: - uiEvent = APP_UI_SEC_PAIR_FAIL; - break; - - case DM_SEC_ENCRYPT_IND: - uiEvent = APP_UI_SEC_ENCRYPT; - break; - - case DM_SEC_ENCRYPT_FAIL_IND: - uiEvent = APP_UI_SEC_ENCRYPT_FAIL; - break; - - case DM_SEC_AUTH_REQ_IND: - - if (pMsg->authReq.oob) - { - dmConnId_t connId = (dmConnId_t) pMsg->hdr.param; - - /* TODO: Perform OOB Exchange with the peer. */ - - - /* TODO: Fill beaconOobCfg peerConfirm and peerRandom with value passed out of band */ - - if (beaconOobCfg != NULL) - { - DmSecSetOob(connId, beaconOobCfg); - } - - DmSecAuthRsp(connId, 0, NULL); - } - else - { - AppHandlePasskey(&pMsg->authReq); - } - break; - - case DM_SEC_COMPARE_IND: - AppHandleNumericComparison(&pMsg->cnfInd); - break; - - case DM_PRIV_ADD_DEV_TO_RES_LIST_IND: - beaconPrivAddDevToResListInd(pMsg); + case DM_ADV_STOP_IND: + uiEvent = APP_UI_ADV_STOP; break; - case DM_PRIV_REM_DEV_FROM_RES_LIST_IND: - beaconPrivRemDevFromResListInd(pMsg); +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_ADV_SET_STOP_IND: + uiEvent = APP_UI_ADV_SET_STOP_IND; break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ - case DM_ADV_NEW_ADDR_IND: + case DM_VENDOR_SPEC_IND: break; default: @@ -844,8 +309,11 @@ void BeaconHandlerInit(wsfHandlerId_t handlerId) /* Set configuration pointers */ pAppSlaveCfg = (appSlaveCfg_t *) &beaconSlaveCfg; +#ifdef BTLE_APP_USE_LEGACY_API + pAppAdvCfg = (appAdvCfg_t *) &beaconAdvCfg; +#else /* BTLE_APP_USE_LEGACY_API */ pAppExtAdvCfg = (appExtAdvCfg_t *) &beaconExtAdvCfg; - pAttCfg = (attCfg_t *) &beaconAttCfg; +#endif /* BTLE_APP_USE_LEGACY_API */ /* Initialize application framework */ AppSlaveInit(); @@ -885,13 +353,10 @@ void BeaconHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) { APP_TRACE_INFO1("Beacon got evt 0x%x", pMsg->event); - if (pMsg->event >= DM_CBACK_START && pMsg->event <= DM_CBACK_END && pMsg->event != DM_ADV_SET_STOP_IND) + if (pMsg->event >= DM_CBACK_START && pMsg->event <= DM_CBACK_END) { /* process advertising and connection-related messages */ AppSlaveProcDmMsg((dmEvt_t *) pMsg); - - /* process security-related messages */ - AppSlaveSecProcDmMsg((dmEvt_t *) pMsg); } /* perform profile and user interface-related operations */ @@ -910,15 +375,6 @@ void BeaconStart(void) { /* Register for stack callbacks */ DmRegister(beaconDmCback); - DmConnRegister(DM_CLIENT_ID_APP, beaconDmCback); - AttRegister(beaconAttCback); - AttConnRegister(AppServerConnCback); - AttsCccRegister(BEACON_NUM_CCC_IDX, (attsCccSet_t *) beaconCccSet, beaconCccCback); - - /* Initialize attribute server database */ - SvcCoreAddGroup(); - SvcWpCbackRegister(NULL, beaconWpWriteCback); - SvcWpAddGroup(); WsfBufDiagRegister(beaconWsfBufDiagnostics); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_beacon/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_beacon/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..a9d91770ceea1214e0138b3bf92f12cbcfbcaf79 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_beacon/config.mk @@ -0,0 +1,12 @@ +# Specifies whether the legacy 4.2 api should be used. +# 1 by default. +# Set to 1 to use 4.2 advertisements. +# Set to 0 to use 5.0 extended advertisements. +BTLE_APP_USE_LEGACY_API?=1 + +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# Run link layer using SDMA. +ENABLE_SDMA?=0 diff --git a/lib/sdk/Applications/EvKitExamples/BLE_beacon/main.c b/lib/sdk/Applications/EvKitExamples/BLE_beacon/main.c index a68777d60bb33fda25029575109699ecf8e0dbe8..60cd2f5d370a671bf7dc79e3410dc99059a3947b 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_beacon/main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_beacon/main.c @@ -29,48 +29,47 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-03-26 14:20:03 +0000 (Tue, 26 Mar 2019) $ - * $Revision: 41870 $ + * $Date: 2019-07-12 10:56:57 -0500 (Fri, 12 Jul 2019) $ + * $Revision: 44598 $ * ******************************************************************************/ #include <stdio.h> #include <string.h> +#include "mxc_config.h" #include "wsf_types.h" #include "wsf_os.h" #include "wsf_buf.h" #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "ll_api.h" -#include "sch_api.h" #include "beacon_api.h" -#include "mxc_config.h" -#include "gcr_regs.h" -#include "mcr_regs.h" #include "app_ui.h" +#include "hci_vs.h" #include "hci_core.h" /************************************************************************************************** Macros **************************************************************************************************/ -/* Number of WSF buffer pools */ -#define WSF_BUF_POOLS 6 +/* Size of buffer for stdio functions */ +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 /* Size of buffer for stdio functions */ -#define PRINTF_BUF_SIZE 128 +#define PRINTF_BUF_SIZE 128 /************************************************************************************************** Local Variables **************************************************************************************************/ +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + /*! Buffer for stdio functions */ char printf_buffer[PRINTF_BUF_SIZE]; -/*! Free memory for pool buffers (use word elements for word alignment). */ -static uint32_t mainBufMem[3584/sizeof(uint32_t)+96]; - /*! Default pool descriptor. */ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { @@ -79,7 +78,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { 64, 4 }, { 128, 4 }, { 256, 4 }, - { 384, 4 } + { 512, 4 } }; /************************************************************************************************** @@ -89,6 +88,12 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = /*! \brief Stack initialization for app. */ extern void StackInitBeacon(void); +/*************************************************************************************************/ +void PalSysAssertTrap(void) +{ + while(1) {} +} + /*************************************************************************************************/ void SysTick_Handler(void) { @@ -96,15 +101,17 @@ void SysTick_Handler(void) } /*************************************************************************************************/ -static void myTrace(const char *pStr, va_list args) +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) { extern uint8_t wsfCsNesting; if (wsfCsNesting == 0) { - vprintf(pStr, args); - printf("\r\n"); + fwrite(pBuf, len, 1, stdout); + return TRUE; } + + return FALSE; } /*************************************************************************************************/ @@ -116,47 +123,23 @@ static void myTrace(const char *pStr, va_list args) /*************************************************************************************************/ static void WsfInit(void) { - WsfTimerInit(); - WsfBufInit(sizeof(mainBufMem), (uint8_t*)mainBufMem, WSF_BUF_POOLS, mainPoolDesc); - WsfTraceRegister(myTrace); -} - -/*************************************************************************************************/ -/*! - * \brief Initialize platform. - * - * \param msPerTick Milliseconds per timer tick. - * - * \return None. - */ -/*************************************************************************************************/ -void PlatformInit(void) -{ - /* Change the pullup on the RST pin to 25K */ - MXC_MCR->ctrl = 0x202; - - /* Set VREGO_D to 1.3V */ - *((volatile uint32_t*)0x40004410) = 0x50; - - /* Set TX LDO to 1.1V and enable LDO. Set RX LDO to 0.9V and enable LDO */ - MXC_GCR->btleldocn = 0xD9; // TX 1.1V RX 0.9V - - /* Power up the 32MHz XO */ - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_X32M_EN; - - /* Enable peripheral clocks */ - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_GPIO0D | MXC_F_GCR_PERCKCN0_GPIO1D); // Clear GPIO0 and GPIO1 Disable - MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_BTLED | MXC_F_GCR_PERCKCN1_TRNGD ); // Clear BTLE and ICACHE0 disable - - /* setup the systick */ + uint32_t bytesUsed; + /* setup the systick for 1MS timer*/ SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; SysTick->VAL = 0; SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); -#ifndef __IAR_SYSTEMS_ICC__ - /* Added to prevent printf() and friends from using malloc() */ - setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); -#endif + WsfTimerInit(); + + SystemHeapStart = (uint32_t)&SystemHeap; + memset(SystemHeap, 0, sizeof(SystemHeap)); + printf("SystemHeapStart = 0x%x\n", SystemHeapStart); + printf("SystemHeapSize = 0x%x\n", SystemHeapSize); + bytesUsed = WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + printf("bytesUsed = 0x%x\n", bytesUsed); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); } /* @@ -167,42 +150,18 @@ void PlatformInit(void) */ void SetAddress(uint8_t event) { - uint8_t bdAddr[6] = {0x20, 0x05, 0x44, 0x8B, 0x05, 0x00}; + uint8_t bdAddr[6] = {0x02, 0x00, 0x44, 0x8B, 0x05, 0x00}; switch (event) { - case APP_UI_RESET_CMPL: - printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); - LlSetBdAddr((uint8_t*)&bdAddr); - LlGetBdAddr(hciCoreCb.bdAddr); - break; - default: - break; + case APP_UI_RESET_CMPL: + printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); + HciVsSetBdAddr(bdAddr); + break; + default: + break; } } -/*************************************************************************************************/ -/*! - * \brief Initialize MAC layer. - * - * \param None. - * - * \return None. - */ -/*************************************************************************************************/ -void MacInit(void) -{ - wsfHandlerId_t handlerId; - - /* Initialize link layer. */ - BbInit(); - handlerId = WsfOsSetNextHandler(SchHandler); - SchInit(handlerId); - LlAdvSlaveInit(); - LlConnSlaveInit(); - handlerId = WsfOsSetNextHandler(LlHandler); - LlHandlerInit(handlerId); -} - /*************************************************************************************************/ /*! * \fn main @@ -216,11 +175,15 @@ void MacInit(void) /*************************************************************************************************/ int main(void) { + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + printf("\n\n***** MAX32665 BLE Beacon *****\n"); - PlatformInit(); + /* Initialize Radio */ WsfInit(); - MacInit(); StackInitBeacon(); BeaconStart(); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_beacon/stack_beacon.c b/lib/sdk/Applications/EvKitExamples/BLE_beacon/stack_beacon.c index 9e1920ca7c0294b2c79ab6de3046929077a938c5..4a52a098be0176015a507cdf781caba1b6c60fdf 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_beacon/stack_beacon.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_beacon/stack_beacon.c @@ -17,13 +17,14 @@ */ /*************************************************************************************************/ +#include <stdio.h> +#include <string.h> #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" #include "beacon_api.h" #include "wdxs/wdxs_api.h" #include "hci_handler.h" -#include "hci_api.h" #include "dm_handler.h" #include "l2c_handler.h" #include "att_handler.h" @@ -35,6 +36,56 @@ #include "svc_dis.h" #include "svc_core.h" #include "sec_api.h" +#include "ll_init_api.h" + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0xc152 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 4, // 4 Extended Advertising Sets + /*maxAdvReports*/ 8, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 2, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 10000, + + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ TRUE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; /*************************************************************************************************/ /*! @@ -47,21 +98,51 @@ void StackInitBeacon(void) { wsfHandlerId_t handlerId; +#ifndef ENABLE_SDMA + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; + + memUsed = LlInitControllerExtInit(&ll_init_cfg); + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } +#endif + + handlerId = WsfOsSetNextHandler(HciHandler); + HciHandlerInit(handlerId); + SecInit(); SecAesInit(); SecCmacInit(); SecEccInit(); - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - HciLeReadMaxAdvDataLen(); - HciLeReadNumSupAdvSets(); - handlerId = WsfOsSetNextHandler(DmHandler); DmDevVsInit(0); +#ifdef BTLE_APP_USE_LEGACY_API + DmAdvInit(); + //DmConnInit(); + //DmConnSlaveInit(); +#else /* BTLE_APP_USE_LEGACY_API */ DmExtAdvInit(); - DmConnInit(); - DmExtConnSlaveInit(); + //DmConnInit(); + //DmExtConnSlaveInit(); +#endif /* BTLE_APP_USE_LEGACY_API */ + DmSecInit(); + DmSecLescInit(); + DmPrivInit(); DmHandlerInit(handlerId); handlerId = WsfOsSetNextHandler(L2cSlaveHandler); @@ -90,4 +171,5 @@ void StackInitBeacon(void) handlerId = WsfOsSetNextHandler(WdxsHandler); WdxsHandlerInit(handlerId); #endif + } diff --git a/lib/sdk/Applications/EvKitExamples/BLE_datc/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_datc/Makefile index f470aa1dbe1712049804e4f5add89bae031576f6..892ad155688bc0e7ced106af80889c2259253de1 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_datc/Makefile +++ b/lib/sdk/Applications/EvKitExamples/BLE_datc/Makefile @@ -29,10 +29,15 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # -# $Id: Makefile 38151 2018-09-27 21:32:49Z zach.metzinger $ +# $Id: Makefile 44515 2019-07-09 23:06:13Z nathan.goldstick $ # ################################################################################ +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + # This is the name of the build output file ifeq "$(PROJECT)" "" PROJECT=max32665 @@ -67,10 +72,8 @@ endif # This is the path to the CMSIS root directory ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -NDALIBS_DIR=../../../NDALibraries else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -NDALIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/NDALibraries) endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS @@ -78,23 +81,119 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS SRCS = main.c SRCS += stack_datc.c SRCS += datc_main.c + # Where to find source files for this test VPATH = . -VPATH += fcl/src # Where to find header files for this test IPATH = . + +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifdef BTLE_APP_USE_LEGACY_API +ifeq "$(BTLE_APP_USE_LEGACY_API)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +endif +endif +endif +endif + +ifdef BTLE_APP_USE_ACTIVE_SCANNING +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_ACTIVE_SCANNING=TRUE +else +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "0" +else +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_ACTIVE_SCANNING=TRUE +endif +endif +endif +endif + +ifdef CONSOLE_UART +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif +endif + +ifdef ENABLE_SDMA +ifneq "$(ENABLE_SDMA)" "" +ifeq "$(ENABLE_SDMA)" "0" +undefine ENABLE_SDMA +else +ifeq "$(ENABLE_SDMA)" "FALSE" +undefine ENABLE_SDMA +else +ENABLE_SDMA=1 +endif +endif +endif +endif + +ifneq "$(ENABLE_SDMA)" "" +ifdef BTLE_APP_USE_LEGACY_API +ifneq "$(BTLE_APP_USE_LEGACY_API)" "" +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +endif +endif +endif + +#------------------------------------------------------------------------------- +# Configuration specified here. + +#-------------------- +# Stack configuration + # Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE -PROJ_CFLAGS+=-DASYMMETRIC -DWORD32 +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE=TRUE +# PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_MS_PER_TICK=1 + + +#-------------------- +# Application CFLAGS configuration + +#-------------------- +# Stack CFLAGS configuration + +# PROJ_CFLAGS+=-DINIT_BROADCASTER +PROJ_CFLAGS+=-DINIT_OBSERVER +PROJ_CFLAGS+=-DINIT_CENTRAL +# PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +ENABLE_LL_TESTER?=#1 +# Use this variable to override default compilier optimization. #MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer # Point this variable to a linker file to override the default file #LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld ################################################################################ # Include external library makefiles here +DEBUG=1 # Include the BSP BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) @@ -105,7 +204,7 @@ PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver include ${PERIPH_DRIVER_DIR}/periphdriver.mk # Include Cordio BTLE Library -CORDIO_DIR=$(NDALIBS_DIR)/BTLE +CORDIO_DIR=$(LIBS_DIR)/BTLE include ${CORDIO_DIR}/btle.mk # Include MAXUSB library diff --git a/lib/sdk/Applications/EvKitExamples/BLE_datc/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_datc/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..69273d8356054fefe03cf9eb49df0e1cf3c01899 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_datc/config.mk @@ -0,0 +1,15 @@ +# Specifies whether the legacy 4.2 api should be used. +# 1 by default. +# Set to 1 to use 4.2 advertisements. +# Set to 0 to use 5.0 extended advertisements. +BTLE_APP_USE_LEGACY_API?=1 + +# Specifies whether scan requests should be transmitted. +BTLE_APP_USE_ACTIVE_SCANNING?=1 + +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# Run link layer using SDMA. +ENABLE_SDMA?=0 diff --git a/lib/sdk/Applications/EvKitExamples/BLE_datc/datc_main.c b/lib/sdk/Applications/EvKitExamples/BLE_datc/datc_main.c index c45df6ab2a0e8434a1096f082cdc9c1996602a97..2bdfda04f63b68ac39993399106a2b8ff55742ac 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_datc/datc_main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_datc/datc_main.c @@ -86,6 +86,7 @@ struct Configurable Parameters **************************************************************************************************/ +#ifdef BTLE_APP_USE_LEGACY_API /*! configurable parameters for master */ static const appMasterCfg_t datcMasterCfg = { @@ -93,9 +94,46 @@ static const appMasterCfg_t datcMasterCfg = 420, /*! The scan window, in 0.625 ms units */ 0, /*! The scan duration in ms */ DM_DISC_MODE_NONE, /*! The GAP discovery mode */ - DM_SCAN_TYPE_ACTIVE /*! The scan type (active or passive) */ +#ifdef BTLE_APP_USE_ACTIVE_SCANNING + DM_SCAN_TYPE_ACTIVE +#else /* BTLE_APP_USE_ACTIVE_SCANNING */ + DM_SCAN_TYPE_PASSIVE +#endif /* BTLE_APP_USE_ACTIVE_SCANNING */ + /*!< The scan type (active or passive) */ }; +#else /* BTLE_APP_USE_LEGACY_API */ +/*! configurable parameters for extended master */ +static const uint8_t datcExtMasterScanPhysCfg = + HCI_SCAN_PHY_LE_1M_BIT | + //HCI_SCAN_PHY_LE_2M_BIT | + //HCI_SCAN_PHY_LE_CODED_BIT | + 0; +static const appExtMasterCfg_t datcExtMasterCfg = +{ + { 420, 420, 420 }, /*! \brief The scan interval, in 0.625 ms units */ + { 420, 420, 420 }, /*! \brief The scan window, in 0.625 ms units. Must be less than or equal to scan interval. */ + 0, /*! \brief The scan duration in ms. Set to zero or both duration and period to non-zero to scan until stopped. */ + 0, /*! \brief The scan period, in 1.28 sec units. Set to zero to disable periodic scanning. */ + DM_DISC_MODE_NONE, /*! \brief The GAP discovery mode (general, limited, or none) */ +#ifdef BTLE_APP_USE_ACTIVE_SCANNING + { + DM_SCAN_TYPE_ACTIVE, + DM_SCAN_TYPE_ACTIVE, + DM_SCAN_TYPE_ACTIVE + } +#else /* BTLE_APP_USE_ACTIVE_SCANNING */ + { + DM_SCAN_TYPE_PASSIVE, + DM_SCAN_TYPE_PASSIVE, + DM_SCAN_TYPE_PASSIVE + } +#endif /* BTLE_APP_USE_ACTIVE_SCANNING */ + /*!< \brief The scan type (active or passive) */ +}; + +#endif /* BTLE_APP_USE_LEGACY_API */ + /*! configurable parameters for security */ static const appSecCfg_t datcSecCfg = { @@ -123,8 +161,8 @@ static const smpCfg_t datcSmpCfg = /*! Connection parameters */ static const hciConnSpec_t datcConnCfg = { - 40, /*! Minimum connection interval in 1.25ms units */ - 40, /*! Maximum connection interval in 1.25ms units */ + 6, /*! Minimum connection interval in 1.25ms units */ + 6, /*! Maximum connection interval in 1.25ms units */ 0, /*! Connection latency */ 600, /*! Supervision timeout in 10ms units */ 0, /*! Minimum CE length, in 0.625 ms units */ @@ -355,7 +393,11 @@ static void datcScanStop(dmEvt_t *pMsg) /* Open connection */ if (datcConnInfo.doConnect) { +#ifdef BTLE_APP_USE_LEGACY_API testCb.connId = AppConnOpen(datcConnInfo.addrType, datcConnInfo.addr, datcConnInfo.dbHdl); +#else + testCb.connId = AppExtConnOpen(datcExtMasterScanPhysCfg, datcConnInfo.addrType, datcConnInfo.addr, datcConnInfo.dbHdl); +#endif datcConnInfo.doConnect = FALSE; } } @@ -453,6 +495,119 @@ static void datcScanReport(dmEvt_t *pMsg) } } +#ifndef BTLE_APP_IGNORE_EXT_EVENTS +/*************************************************************************************************/ +/*! + * \brief Handle a scan report. + * + * \param pMsg Pointer to DM callback event message. + * + * \return None. + */ +/*************************************************************************************************/ +static void datcExtScanReport(dmEvt_t *pMsg) +{ + uint8_t *pData; + appDbHdl_t dbHdl; + bool_t connect = FALSE; + + /* disregard if not scanning or autoconnecting */ + if (!datcCb.scanning || !datcCb.autoConnect) + { + return; + } + + printf("datcExtScanReport() %x : %02x:%02x:%02x:%02x:%02x:%02x\n", + pMsg->extScanReport.addrType, + pMsg->extScanReport.addr[5], + pMsg->extScanReport.addr[4], + pMsg->extScanReport.addr[3], + pMsg->extScanReport.addr[2], + pMsg->extScanReport.addr[1], + pMsg->extScanReport.addr[0]); + + printf(" directedAddr ( %x : %02x:%02x:%02x:%02x:%02x:%02x )\n", + pMsg->extScanReport.directAddrType, + pMsg->extScanReport.directAddr[5], + pMsg->extScanReport.directAddr[4], + pMsg->extScanReport.directAddr[3], + pMsg->extScanReport.directAddr[2], + pMsg->extScanReport.directAddr[1], + pMsg->extScanReport.directAddr[0]); + + printf(" evtType %x,\n", pMsg->extScanReport.eventType); + printf(" addrType %x,\n", pMsg->extScanReport.addrType); + printf(" priPhy %u,\n", pMsg->extScanReport.priPhy); + printf(" secPhy %u,\n", pMsg->extScanReport.secPhy); + printf(" advSid 0x%02x,\n", pMsg->extScanReport.advSid); + printf(" txPower %i,\n", pMsg->extScanReport.txPower); + printf(" rssi %d,\n", pMsg->extScanReport.rssi); + printf(" perAdvInter %i,\n", pMsg->extScanReport.perAdvInter); + printf(" directAddrType %x,\n", pMsg->extScanReport.directAddrType); + printf(" len %u,\n", pMsg->extScanReport.len); + + if (pMsg->extScanReport.pData[1] == DM_ADV_TYPE_LOCAL_NAME) + { + uint8_t name[32]; + memset(name, 0, sizeof(name)); + memcpy(name, &pMsg->extScanReport.pData[2], pMsg->extScanReport.pData[0]); + printf(" | %s\n", name); + } + else { + printf(", data"); + int i; + for (i = 0; i < pMsg->extScanReport.len; i++) { + printf(" %02x", pMsg->extScanReport.pData[i]); + } + printf("\n"); + } + + /* if we already have a bond with this device then connect to it */ + if ((dbHdl = AppDbFindByAddr(pMsg->extScanReport.addrType, pMsg->extScanReport.addr)) != APP_DB_HDL_NONE) + { + /* if this is a directed advertisement where the initiator address is an RPA */ + if (DM_RAND_ADDR_RPA(pMsg->extScanReport.directAddr, pMsg->extScanReport.directAddrType)) + { + /* resolve direct address to see if it's addressed to us */ + AppMasterResolveAddr(pMsg, dbHdl, APP_RESOLVE_DIRECT_RPA); + } + else + { + connect = TRUE; + } + } + /* if the peer device uses an RPA */ + else if (DM_RAND_ADDR_RPA(pMsg->extScanReport.addr, pMsg->extScanReport.addrType)) + { + /* resolve advertiser's RPA to see if we already have a bond with this device */ + AppMasterResolveAddr(pMsg, APP_DB_HDL_NONE, APP_RESOLVE_ADV_RPA); + } + /* find vendor-specific advertising data */ + else if ((pData = DmFindAdType(DM_ADV_TYPE_MANUFACTURER, pMsg->extScanReport.len, + pMsg->extScanReport.pData)) != NULL) + { + /* check length and vendor ID */ + if (pData[DM_AD_LEN_IDX] >= 3 && BYTES_UINT16_CMP(&pData[DM_AD_DATA_IDX], HCI_ID_ARM)) + { + connect = TRUE; + } + } + + if (connect) + { + /* stop scanning and connect */ + datcCb.autoConnect = FALSE; + AppExtScanStop(); + + /* Store peer information for connect on scan stop */ + datcConnInfo.addrType = DmHostAddrType(pMsg->extScanReport.addrType); + memcpy(datcConnInfo.addr, pMsg->extScanReport.addr, sizeof(bdAddr_t)); + datcConnInfo.dbHdl = dbHdl; + datcConnInfo.doConnect = TRUE; + } +} +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + /*************************************************************************************************/ /*! * \brief Perform UI actions on connection open. @@ -483,7 +638,16 @@ static void datcClose(dmEvt_t *pMsg) if (!datcCb.scanning) { datcCb.autoConnect = TRUE; +#ifdef BTLE_APP_USE_LEGACY_API AppScanStart(datcMasterCfg.discMode, datcMasterCfg.scanType, datcMasterCfg.scanDuration); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtScanStart( + datcExtMasterScanPhysCfg, + datcExtMasterCfg.discMode, + datcExtMasterCfg.scanType, + datcExtMasterCfg.scanDuration, + datcExtMasterCfg.scanPeriod); +#endif /* BTLE_APP_USE_LEGACY_API */ } } @@ -522,16 +686,13 @@ static void datcSetup(dmEvt_t *pMsg) WsfTimerStartMs(&testCb.timer, 1000); testCb.connectCount = 0x80000000; - /* If this is defined to one, scanning will be limited to the EvKit dats peer */ -#if 0 + /* Scanning will be limited to the EvKit dats peer */ DmDevWhiteListAdd(DM_ADDR_PUBLIC, (bdAddr_t){0x02, 0x00, 0x44, 0x8B, 0x05, 0x00}); DmDevSetFilterPolicy(DM_FILT_POLICY_MODE_SCAN, HCI_FILT_WHITE_LIST); DmDevSetFilterPolicy(DM_FILT_POLICY_MODE_INIT, HCI_FILT_WHITE_LIST); -#endif - /* 0x3 : 1M and 2M PHYs */ - DmSetDefaultPhy(0, 0x3, 0x3); - testCb.phy = 0x1; + DmSetDefaultPhy(0, HCI_PHY_LE_1M_BIT | HCI_PHY_LE_2M_BIT, HCI_PHY_LE_1M_BIT | HCI_PHY_LE_2M_BIT); + testCb.phy = HCI_PHY_LE_1M_BIT; DmConnSetConnSpec((hciConnSpec_t *) &datcConnCfg); } @@ -676,7 +837,16 @@ static void testTimerHandler(void) if (testCb.counter == 2) { datcCb.autoConnect = TRUE; +#ifdef BTLE_APP_USE_LEGACY_API AppScanStart(datcMasterCfg.discMode, datcMasterCfg.scanType, datcMasterCfg.scanDuration); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtScanStart( + datcExtMasterScanPhysCfg, + datcExtMasterCfg.discMode, + datcExtMasterCfg.scanType, + datcExtMasterCfg.scanDuration, + datcExtMasterCfg.scanPeriod); +#endif /* BTLE_APP_USE_LEGACY_API */ } if ((((testCb.counter - testCb.connectCount) % 5) == 0) && @@ -684,18 +854,19 @@ static void testTimerHandler(void) (datcCb.discState[testCb.connId-1] == DATC_DISC_SVC_MAX)) { datcSendData(testCb.connId); + DmConnReadRssi(testCb.connId); } if ((((testCb.counter - testCb.connectCount) % 10) == 0) && (testCb.connId != DM_CONN_ID_NONE) && (datcCb.discState[testCb.connId-1] == DATC_DISC_SVC_MAX)) { - if(testCb.phy == 0x1) { + if(testCb.phy == HCI_PHY_LE_1M_BIT) { /* Change from 1M to 2M PHY */ - testCb.phy = 0x2; + testCb.phy = HCI_PHY_LE_2M_BIT; } else { /* Change from Coded to 1M PHY */ - testCb.phy = 0x1; + testCb.phy = HCI_PHY_LE_1M_BIT; } DmSetPhy(testCb.connId, 0, testCb.phy, testCb.phy, 0); @@ -723,6 +894,9 @@ static void datcProcMsg(dmEvt_t *pMsg) datcValueNtf((attEvt_t *) pMsg); break; + case ATTC_WRITE_CMD_RSP: + break; + case DM_RESET_CMPL_IND: DmSecGenerateEccKeyReq(); datcSetup(pMsg); @@ -734,20 +908,44 @@ static void datcProcMsg(dmEvt_t *pMsg) uiEvent = APP_UI_SCAN_START; break; +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_EXT_SCAN_START_IND: + datcScanStart(pMsg); + uiEvent = APP_UI_EXT_SCAN_START_IND; + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_SCAN_STOP_IND: datcScanStop(pMsg); uiEvent = APP_UI_SCAN_STOP; break; +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_EXT_SCAN_STOP_IND: + datcScanStop(pMsg); + uiEvent = APP_UI_EXT_SCAN_STOP_IND; + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_SCAN_REPORT_IND: datcScanReport(pMsg); break; +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_EXT_SCAN_REPORT_IND: + datcExtScanReport(pMsg); + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_CONN_OPEN_IND: datcOpen(pMsg); uiEvent = APP_UI_CONN_OPEN; break; + case DM_CONN_READ_RSSI_IND: + printf("Connection 0x%x RSSI: %d\n", pMsg->readRssi.handle, pMsg->readRssi.rssi); + break; + case DM_CONN_CLOSE_IND: printf("Connection closed status 0x%x, reason 0x%x", pMsg->connClose.status, pMsg->connClose.reason); switch (pMsg->connClose.reason) @@ -758,9 +956,6 @@ static void datcProcMsg(dmEvt_t *pMsg) case HCI_ERR_CONN_FAIL: printf(" FAIL ESTABLISH\n"); break; case HCI_ERR_MIC_FAILURE: printf(" MIC FAILURE\n"); break; } -#if 0 - WSF_ASSERT(0); -#endif datcClose(pMsg); uiEvent = APP_UI_CONN_CLOSE; break; @@ -816,6 +1011,13 @@ static void datcProcMsg(dmEvt_t *pMsg) testTimerHandler(); break; + case DM_VENDOR_SPEC_IND: + break; + + case DM_PHY_UPDATE_IND: + APP_TRACE_INFO2("DM_PHY_UPDATE_IND - RX: %d, TX: %d", pMsg->phyUpdate.rxPhy, pMsg->phyUpdate.txPhy); + break; + default: break; } @@ -846,7 +1048,11 @@ void DatcHandlerInit(wsfHandlerId_t handlerId) datcCb.hdlListLen = DATC_DISC_HDL_LIST_LEN; /* Set configuration pointers */ +#ifdef BTLE_APP_USE_LEGACY_API pAppMasterCfg = (appMasterCfg_t *) &datcMasterCfg; +#else /* BTLE_APP_USE_LEGACY_API */ + pAppExtMasterCfg = (appExtMasterCfg_t *) &datcExtMasterCfg; +#endif /* BTLE_APP_USE_LEGACY_API */ pAppSecCfg = (appSecCfg_t *) &datcSecCfg; pAppDiscCfg = (appDiscCfg_t *) &datcDiscCfg; pAppCfg = (appCfg_t *)&datcAppCfg; diff --git a/lib/sdk/Applications/EvKitExamples/BLE_datc/main.c b/lib/sdk/Applications/EvKitExamples/BLE_datc/main.c index 0d5dd9f113c7759e8a6b50cd6bf85b79ecd8f6db..4396a6b342df4d5008cd4e8e7ef14cdff6be4d80 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_datc/main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_datc/main.c @@ -29,47 +29,48 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-02-11 23:36:35 +0000 (Mon, 11 Feb 2019) $ - * $Revision: 40967 $ + * $Date: 2019-07-11 13:33:24 -0500 (Thu, 11 Jul 2019) $ + * $Revision: 44549 $ * ******************************************************************************/ #include <stdio.h> #include <string.h> +#include "mxc_config.h" #include "wsf_types.h" #include "wsf_os.h" #include "wsf_buf.h" #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "ll_api.h" -#include "sch_api.h" #include "datc/datc_api.h" -#include "mxc_config.h" -#include "gcr_regs.h" -#include "mcr_regs.h" +#include "app_ui.h" +#include "radio_drv.h" #include "hci_core.h" +#include "hci_vs.h" /************************************************************************************************** Macros **************************************************************************************************/ /* Number of WSF buffer pools */ -#define WSF_BUF_POOLS 6 +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 /* Size of buffer for stdio functions */ -#define PRINTF_BUF_SIZE 128 +#define PRINTF_BUF_SIZE 128 /************************************************************************************************** Local Variables **************************************************************************************************/ +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + /*! Buffer for stdio functions */ char printf_buffer[PRINTF_BUF_SIZE]; -/*! Free memory for pool buffers (use word elements for word alignment). */ -static uint32_t mainBufMem[3584/sizeof(uint32_t)+96]; - /*! Default pool descriptor. */ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { @@ -78,7 +79,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { 64, 4 }, { 128, 4 }, { 256, 4 }, - { 384, 4 } + { 512, 4 } }; /************************************************************************************************** @@ -95,67 +96,53 @@ void SysTick_Handler(void) } /*************************************************************************************************/ -static void myTrace(const char *pStr, va_list args) +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) { extern uint8_t wsfCsNesting; if (wsfCsNesting == 0) { - vprintf(pStr, args); - printf("\r\n"); + fwrite(pBuf, len, 1, stdout); + return TRUE; } + + return FALSE; } /*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void WsfInit(void) +void PalSysAssertTrap(void) { - WsfTimerInit(); - WsfBufInit(sizeof(mainBufMem), (uint8_t*)mainBufMem, WSF_BUF_POOLS, mainPoolDesc); - WsfTraceRegister(myTrace); + printf("Assertion detected\n"); + while(1) {} } /*************************************************************************************************/ /*! - * \brief Initialize platform. - * - * \param msPerTick Milliseconds per timer tick. + * \brief Initialize WSF. * * \return None. */ /*************************************************************************************************/ -void PlatformInit(void) +static void WsfInit(void) { - /* Change the pullup on the RST pin to 25K */ - MXC_MCR->ctrl = 0x202; + uint32_t bytesUsed; - /* Set VREGO_D to 1.3V */ - *((volatile uint32_t*)0x40004410) = 0x50; - - /* Set TX LDO to 1.1V and enable LDO. Set RX LDO to 0.9V and enable LDO */ - MXC_GCR->btleldocn = 0xD9; // TX 1.1V RX 0.9V - - /* Power up the 32MHz XO */ - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_X32M_EN; - - /* Enable peripheral clocks */ - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_GPIO0D | MXC_F_GCR_PERCKCN0_GPIO1D); // Clear GPIO0 and GPIO1 Disable - MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_BTLED | MXC_F_GCR_PERCKCN1_TRNGD ); // Clear BTLE and ICACHE0 disable - - /* setup the systick */ + /* setup the systick for 1MS timer*/ SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; SysTick->VAL = 0; SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); -#ifndef __IAR_SYSTEMS_ICC__ - /* Added to prevent printf() and friends from using malloc() */ - setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); -#endif + WsfTimerInit(); + + SystemHeapStart = (uint32_t)&SystemHeap; + memset(SystemHeap, 0, sizeof(SystemHeap)); + printf("SystemHeapStart = 0x%x\n", SystemHeapStart); + printf("SystemHeapSize = 0x%x\n", SystemHeapSize); + bytesUsed = WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + printf("bytesUsed = 0x%x\n", bytesUsed); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); } /* @@ -169,39 +156,15 @@ void SetAddress(uint8_t event) uint8_t bdAddr[6] = {0x02, 0x01, 0x44, 0x8B, 0x05, 0x00}; switch (event) { - case APP_UI_RESET_CMPL: - printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); - LlSetBdAddr((uint8_t*)&bdAddr); - LlGetBdAddr(hciCoreCb.bdAddr); - break; - default: - break; + case APP_UI_RESET_CMPL: + printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); + HciVsSetBdAddr(bdAddr); + break; + default: + break; } } -/*************************************************************************************************/ -/*! - * \brief Initialize MAC layer. - * - * \param None. - * - * \return None. - */ -/*************************************************************************************************/ -void MacInit(void) -{ - wsfHandlerId_t handlerId; - - /* Initialize link layer. */ - BbInit(); - handlerId = WsfOsSetNextHandler(SchHandler); - SchInit(handlerId); - LlScanMasterInit(); - LlConnMasterInit(); - handlerId = WsfOsSetNextHandler(LlHandler); - LlHandlerInit(handlerId); -} - /*************************************************************************************************/ /*! * \fn main @@ -215,11 +178,15 @@ void MacInit(void) /*************************************************************************************************/ int main(void) { + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + printf("\n\n***** MAX32665 BLE Data Collector *****\n"); - PlatformInit(); + /* Initialize Radio */ WsfInit(); - MacInit(); StackInitDatc(); DatcStart(); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_datc/stack_datc.c b/lib/sdk/Applications/EvKitExamples/BLE_datc/stack_datc.c index 0212d204af594a62855be6b41cae1fa65ced6f7f..5b42e1326f63d78ef5d093d9b886516535072c0b 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_datc/stack_datc.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_datc/stack_datc.c @@ -17,12 +17,12 @@ */ /*************************************************************************************************/ +#include <stdio.h> +#include <string.h> #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" - #include "datc/datc_api.h" - #include "hci_handler.h" #include "dm_handler.h" #include "l2c_handler.h" @@ -35,6 +35,57 @@ #include "svc_dis.h" #include "svc_core.h" #include "sec_api.h" +#include "ll_init_api.h" + + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0xc152 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 4, // 4 Extended Advertising Sets + /*maxAdvReports*/ 8, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 2, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 10000, + + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ FALSE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; /*************************************************************************************************/ /*! @@ -46,29 +97,54 @@ void StackInitDatc(void) { wsfHandlerId_t handlerId; - uint8_t features[sizeof(uint64_t)]; - uint8_t mask[sizeof(uint64_t)]; + +#ifndef ENABLE_SDMA + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; + + memUsed = LlInitControllerExtInit(&ll_init_cfg); + // memUsed = LlInitControllerInit(&ll_init_cfg); + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } +#endif SecInit(); + SecRandInit(); SecAesInit(); SecCmacInit(); SecEccInit(); - // Only use legacy API. - Uint64ToBstream(features, 0); - Uint64ToBstream(mask, HCI_LE_SUP_FEAT_LE_EXT_ADV); - HciVsSetFeatures(features, mask); - handlerId = WsfOsSetNextHandler(HciHandler); HciHandlerInit(handlerId); handlerId = WsfOsSetNextHandler(DmHandler); DmDevVsInit(0); DmDevPrivInit(); +#ifdef BTLE_APP_USE_LEGACY_API DmScanInit(); DmConnInit(); DmConnMasterInit(); +#else /* BTLE_APP_USE_LEGACY_API */ + DmExtScanInit(); + DmConnInit(); + DmExtConnMasterInit(); +#endif /* BTLE_APP_USE_LEGACY_API */ DmSecInit(); + DmPhyInit(); DmSecLescInit(); DmPrivInit(); DmHandlerInit(handlerId); @@ -81,6 +157,7 @@ void StackInitDatc(void) AttsInit(); AttsIndInit(); AttcInit(); + AttsSignInit(); handlerId = WsfOsSetNextHandler(SmpHandler); SmpHandlerInit(handlerId); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_dats/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_dats/Makefile index fed30ce9f2465b4305749332d7b21f6b06e1c530..91c09a71a882a4c2b8f7b369ec1dbe27dbd9805a 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_dats/Makefile +++ b/lib/sdk/Applications/EvKitExamples/BLE_dats/Makefile @@ -29,10 +29,15 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # -# $Id: Makefile 38151 2018-09-27 21:32:49Z zach.metzinger $ +# $Id: Makefile 44505 2019-07-09 20:32:03Z nathan.goldstick $ # ################################################################################ +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + # This is the name of the build output file ifeq "$(PROJECT)" "" PROJECT=max32665 @@ -67,10 +72,8 @@ endif # This is the path to the CMSIS root directory ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -NDALIBS_DIR=../../../NDALibraries else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -NDALIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/NDALibraries) endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS @@ -78,21 +81,105 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS SRCS = main.c SRCS += stack_dats.c SRCS += dats_main.c + # Where to find source files for this test VPATH = . # Where to find header files for this test IPATH = . + +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifdef BTLE_APP_USE_LEGACY_API +ifeq "$(BTLE_APP_USE_LEGACY_API)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +endif +endif +endif +endif + +ifdef CONSOLE_UART +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif +endif + +ifdef ENABLE_SDMA +ifneq "$(ENABLE_SDMA)" "" +ifeq "$(ENABLE_SDMA)" "0" +undefine ENABLE_SDMA +else +ifeq "$(ENABLE_SDMA)" "FALSE" +undefine ENABLE_SDMA +else +ENABLE_SDMA=1 +endif +endif +endif +endif + +ifneq "$(ENABLE_SDMA)" "" +ifdef BTLE_APP_USE_LEGACY_API +ifneq "$(BTLE_APP_USE_LEGACY_API)" "" +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +endif +endif +endif + +#------------------------------------------------------------------------------- +# Configuration specified here. + +#-------------------- +# Stack configuration + # Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE=TRUE +# PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_MS_PER_TICK=1 + + +#-------------------- +# Application CFLAGS configuration + +#-------------------- +# Stack CFLAGS configuration + +PROJ_CFLAGS+=-DINIT_BROADCASTER +# PROJ_CFLAGS+=-DINIT_OBSERVER +# PROJ_CFLAGS+=-DINIT_CENTRAL +PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +ENABLE_LL_TESTER?=#1 +# Use this variable to override default compilier optimization. #MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer # Point this variable to a linker file to override the default file #LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld ################################################################################ # Include external library makefiles here +DEBUG=1 # Include the BSP BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) @@ -103,8 +190,7 @@ PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver include ${PERIPH_DRIVER_DIR}/periphdriver.mk # Include Cordio BTLE Library -TRACE=1 -CORDIO_DIR=$(NDALIBS_DIR)/BTLE +CORDIO_DIR=$(LIBS_DIR)/BTLE include ${CORDIO_DIR}/btle.mk # Include MAXUSB library diff --git a/lib/sdk/Applications/EvKitExamples/BLE_dats/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_dats/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..a9d91770ceea1214e0138b3bf92f12cbcfbcaf79 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_dats/config.mk @@ -0,0 +1,12 @@ +# Specifies whether the legacy 4.2 api should be used. +# 1 by default. +# Set to 1 to use 4.2 advertisements. +# Set to 0 to use 5.0 extended advertisements. +BTLE_APP_USE_LEGACY_API?=1 + +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# Run link layer using SDMA. +ENABLE_SDMA?=0 diff --git a/lib/sdk/Applications/EvKitExamples/BLE_dats/dats_main.c b/lib/sdk/Applications/EvKitExamples/BLE_dats/dats_main.c index e00e9c550860e6328c9746e5a5b122a522fea51d..6a3a5d25ac232cb30881f6f7fdc45777e68adb86 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_dats/dats_main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_dats/dats_main.c @@ -26,6 +26,7 @@ #include "wsf_buf.h" #include "wsf_assert.h" #include "hci_api.h" +#include "hci_vs.h" #include "sec_api.h" #include "dm_api.h" #include "smp_api.h" @@ -58,11 +59,23 @@ enum /*! configurable parameters for advertising */ /* These intervals directly impact energy usage during the non-connected/advertising mode */ +#ifdef BTLE_APP_USE_LEGACY_API static const appAdvCfg_t datsAdvCfg = { { 1000, 0, 0}, /*! Advertising durations in ms */ { 96, 200, 0} /*! Advertising intervals in 0.625 ms units */ }; +#else /* BTLE_APP_USE_LEGACY_API */ +static const appExtAdvCfg_t datsExtAdvCfg = +{ + { 0, 0, 0}, /*! Advertising durations for extended advertising in ms */ + { 96, 200, 0}, /*! Advertising intervals for extended advertising in 0.625 ms units (20 ms to 10.24 s). */ + { 0, 0, 0}, /*! Maximum number of extended advertising events controller will send prior to terminating extended advertising */ + { 0, 0, 0}, /*! Whether to use legacy advertising PDUs with extended advertising. If set to TRUE then length of advertising data cannot exceed 31 octets. */ + { 6, 0, 0} /*! Advertising intervals for periodic advertising in 1.25 ms units (7.5 ms to 81.91875 s). */ +}; + +#endif /* BTLE_APP_USE_LEGACY_API */ /*! configurable parameters for slave */ static const appSlaveCfg_t datsSlaveCfg = @@ -125,6 +138,7 @@ static uint8_t localIrk[] = Advertising Data **************************************************************************************************/ +#ifdef BTLE_APP_USE_LEGACY_API /*! advertising data, discoverable mode */ static const uint8_t datsAdvDataDisc[] = { @@ -149,12 +163,55 @@ static const uint8_t datsScanDataDisc[] = 'D', 'a', 't', + 's', + ' ', + 'T', + 'X' +}; + +#else /* BTLE_APP_USE_LEGACY_API */ +/*! extended advertising and scan data, discoverable mode */ +static const uint8_t datsExtAdvDataDisc[] = +{ + /*! flags */ + 2, /*! length */ + DM_ADV_TYPE_FLAGS, /*! AD type */ + DM_FLAG_LE_GENERAL_DISC | /*! flags */ + DM_FLAG_LE_BREDR_NOT_SUP, + + /*! manufacturer specific data */ + 3, /*! length */ + DM_ADV_TYPE_MANUFACTURER, /*! AD type */ + UINT16_TO_BYTES(HCI_ID_ARM), /*! company ID */ + + /*! device name */ + 8, /*! length */ + DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ + 'D', + 'a', + 't', + 's', + ' ', + 'T', + 'X' +}; + +static const uint8_t datsExtScanDataDisc[] = +{ + /*! device name */ + 8, /*! length */ + DM_ADV_TYPE_LOCAL_NAME, /*! AD type */ + 'D', 'a', + 't', + 's', ' ', 'T', 'X' }; +#endif /* BTLE_APP_USE_LEGACY_API */ + /************************************************************************************************** Client Characteristic Configuration Descriptors **************************************************************************************************/ @@ -343,13 +400,21 @@ static dmSecKey_t *datsGetPeerKey(dmEvt_t *pMsg) /*************************************************************************************************/ static void datsPrivAddDevToResListInd(dmEvt_t *pMsg) { +#ifndef BTLE_APP_USE_LEGACY_API + uint8_t addrZeros[BDA_ADDR_LEN] = { 0 }; +#endif /* BTLE_APP_USE_LEGACY_API */ + dmSecKey_t *pPeerKey; /* if peer IRK present */ if ((pPeerKey = datsGetPeerKey(pMsg)) != NULL) { /* set advertising peer address */ +#ifdef BTLE_APP_USE_LEGACY_API AppSetAdvPeerAddr(pPeerKey->irk.addrType, pPeerKey->irk.bdAddr); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtSetAdvPeerAddr(DM_ADV_HANDLE_DEFAULT, HCI_ADDR_TYPE_PUBLIC, addrZeros); +#endif /* BTLE_APP_USE_LEGACY_API */ } } @@ -377,7 +442,11 @@ static void datsPrivRemDevFromResListInd(dmEvt_t *pMsg) uint8_t addrZeros[BDA_ADDR_LEN] = { 0 }; /* clear advertising peer address and its type */ +#ifdef BTLE_APP_USE_LEGACY_API AppSetAdvPeerAddr(HCI_ADDR_TYPE_PUBLIC, addrZeros); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtSetAdvPeerAddr(DM_ADV_HANDLE_DEFAULT, HCI_ADDR_TYPE_PUBLIC, addrZeros); +#endif /* BTLE_APP_USE_LEGACY_API */ } } } @@ -409,25 +478,45 @@ void datsDisplayStackVersion(const char *pVersion) /*************************************************************************************************/ static void datsSetup(dmEvt_t *pMsg) { - /* If this is defined to one, scan responses and connections limited to the EvKit dats peer */ -#if 0 +#ifndef BTLE_APP_USE_LEGACY_API + uint8_t advHandle; +#endif /* BTLE_APP_USE_LEGACY_API */ + + /* Scan responses and connections limited to the EvKit dats peer */ DmDevWhiteListAdd(DM_ADDR_PUBLIC, (bdAddr_t){0x02, 0x01, 0x44, 0x8B, 0x05, 0x00}); DmDevSetFilterPolicy(DM_FILT_POLICY_MODE_ADV, HCI_FILT_WHITE_LIST); -#endif /* set advertising and scan response data for discoverable mode */ +#ifdef BTLE_APP_USE_LEGACY_API AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(datsAdvDataDisc), (uint8_t *) datsAdvDataDisc); AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(datsScanDataDisc), (uint8_t *) datsScanDataDisc); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_ADV_DATA_DISCOVERABLE, sizeof(datsExtAdvDataDisc), (uint8_t *) datsExtAdvDataDisc, HCI_EXT_ADV_DATA_LEN); + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_SCAN_DATA_DISCOVERABLE, sizeof(datsExtScanDataDisc), (uint8_t *) datsExtScanDataDisc, HCI_EXT_ADV_DATA_LEN); +#endif /* BTLE_APP_USE_LEGACY_API */ + /* set advertising and scan response data for connectable mode */ +#ifdef BTLE_APP_USE_LEGACY_API AppAdvSetData(APP_ADV_DATA_CONNECTABLE, sizeof(datsAdvDataDisc), (uint8_t *) datsAdvDataDisc); AppAdvSetData(APP_SCAN_DATA_CONNECTABLE, sizeof(datsScanDataDisc), (uint8_t *) datsScanDataDisc); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_ADV_DATA_CONNECTABLE, sizeof(datsExtAdvDataDisc), (uint8_t *) datsExtAdvDataDisc, HCI_EXT_ADV_DATA_LEN); + AppExtAdvSetData(DM_ADV_HANDLE_DEFAULT, APP_SCAN_DATA_CONNECTABLE, sizeof(datsExtScanDataDisc), (uint8_t *) datsExtScanDataDisc, HCI_EXT_ADV_DATA_LEN); +#endif /* BTLE_APP_USE_LEGACY_API */ - /* 0x3 : 1M and 2M PHYs */ - DmSetDefaultPhy(0, 0x3, 0x3); + DmSetDefaultPhy(0, HCI_PHY_LE_1M_BIT | HCI_PHY_LE_2M_BIT, HCI_PHY_LE_1M_BIT | HCI_PHY_LE_2M_BIT); /* start advertising; automatically set connectable/discoverable mode and bondable mode */ +#ifndef BTLE_APP_USE_LEGACY_API + advHandle = DM_ADV_HANDLE_DEFAULT; +#endif /* BTLE_APP_USE_LEGACY_API */ + +#ifdef BTLE_APP_USE_LEGACY_API AppAdvStart(APP_MODE_AUTO_INIT); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtAdvStart(1, &advHandle, APP_MODE_AUTO_INIT); +#endif /* BTLE_APP_USE_LEGACY_API */ } /*************************************************************************************************/ @@ -455,10 +544,22 @@ static void datsProcMsg(dmEvt_t *pMsg) uiEvent = APP_UI_ADV_START; break; +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_ADV_SET_START_IND: + uiEvent = APP_UI_ADV_SET_START_IND; + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_ADV_STOP_IND: uiEvent = APP_UI_ADV_STOP; break; +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_ADV_SET_STOP_IND: + uiEvent = APP_UI_ADV_SET_STOP_IND; + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_CONN_OPEN_IND: uiEvent = APP_UI_CONN_OPEN; break; @@ -534,6 +635,9 @@ static void datsProcMsg(dmEvt_t *pMsg) case DM_ADV_NEW_ADDR_IND: break; + case DM_VENDOR_SPEC_IND: + break; + default: break; } @@ -562,7 +666,11 @@ void DatsHandlerInit(wsfHandlerId_t handlerId) /* Set configuration pointers */ pAppSlaveCfg = (appSlaveCfg_t *) &datsSlaveCfg; +#ifdef BTLE_APP_USE_LEGACY_API pAppAdvCfg = (appAdvCfg_t *) &datsAdvCfg; +#else /* BTLE_APP_USE_LEGACY_API */ + pAppExtAdvCfg = (appExtAdvCfg_t *) &datsExtAdvCfg; +#endif /* BTLE_APP_USE_LEGACY_API */ pAppSecCfg = (appSecCfg_t *) &datsSecCfg; pAppUpdateCfg = (appUpdateCfg_t *) &datsUpdateCfg; pSmpCfg = (smpCfg_t *) &datsSmpCfg; diff --git a/lib/sdk/Applications/EvKitExamples/BLE_dats/main.c b/lib/sdk/Applications/EvKitExamples/BLE_dats/main.c index aa95b870d467e49bde189fc6b561df7bea2fd66c..b190be293a48c73b6476b7a22767cb2d7e3c1cd2 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_dats/main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_dats/main.c @@ -29,48 +29,47 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-02-11 23:36:35 +0000 (Mon, 11 Feb 2019) $ - * $Revision: 40967 $ + * $Date: 2019-07-11 13:33:24 -0500 (Thu, 11 Jul 2019) $ + * $Revision: 44549 $ * ******************************************************************************/ #include <stdio.h> #include <string.h> +#include "mxc_config.h" #include "wsf_types.h" #include "wsf_os.h" #include "wsf_buf.h" #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "ll_api.h" -#include "sch_api.h" #include "dats/dats_api.h" -#include "mxc_config.h" -#include "gcr_regs.h" -#include "mcr_regs.h" #include "app_ui.h" +#include "hci_vs.h" #include "hci_core.h" /************************************************************************************************** Macros **************************************************************************************************/ -/* Number of WSF buffer pools */ -#define WSF_BUF_POOLS 6 +/* Size of buffer for stdio functions */ +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 /* Size of buffer for stdio functions */ -#define PRINTF_BUF_SIZE 128 +#define PRINTF_BUF_SIZE 128 /************************************************************************************************** Local Variables **************************************************************************************************/ +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + /*! Buffer for stdio functions */ char printf_buffer[PRINTF_BUF_SIZE]; -/*! Free memory for pool buffers (use word elements for word alignment). */ -static uint32_t mainBufMem[3584/sizeof(uint32_t)+96]; - /*! Default pool descriptor. */ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { @@ -79,7 +78,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { 64, 4 }, { 128, 4 }, { 256, 4 }, - { 384, 4 } + { 512, 4 } }; /************************************************************************************************** @@ -89,6 +88,12 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = /*! \brief Stack initialization for app. */ extern void StackInitDats(void); +/*************************************************************************************************/ +void PalSysAssertTrap(void) +{ + while(1) {} +} + /*************************************************************************************************/ void SysTick_Handler(void) { @@ -96,15 +101,17 @@ void SysTick_Handler(void) } /*************************************************************************************************/ -static void myTrace(const char *pStr, va_list args) +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) { extern uint8_t wsfCsNesting; if (wsfCsNesting == 0) { - vprintf(pStr, args); - printf("\r\n"); + fwrite(pBuf, len, 1, stdout); + return TRUE; } + + return FALSE; } /*************************************************************************************************/ @@ -116,47 +123,23 @@ static void myTrace(const char *pStr, va_list args) /*************************************************************************************************/ static void WsfInit(void) { - WsfTimerInit(); - WsfBufInit(sizeof(mainBufMem), (uint8_t*)mainBufMem, WSF_BUF_POOLS, mainPoolDesc); - WsfTraceRegister(myTrace); -} - -/*************************************************************************************************/ -/*! - * \brief Initialize platform. - * - * \param msPerTick Milliseconds per timer tick. - * - * \return None. - */ -/*************************************************************************************************/ -void PlatformInit(void) -{ - /* Change the pullup on the RST pin to 25K */ - MXC_MCR->ctrl = 0x202; - - /* Set VREGO_D to 1.3V */ - *((volatile uint32_t*)0x40004410) = 0x50; - - /* Set TX LDO to 1.1V and enable LDO. Set RX LDO to 0.9V and enable LDO */ - MXC_GCR->btleldocn = 0xD9; // TX 1.1V RX 0.9V - - /* Power up the 32MHz XO */ - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_X32M_EN; - - /* Enable peripheral clocks */ - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_GPIO0D | MXC_F_GCR_PERCKCN0_GPIO1D); // Clear GPIO0 and GPIO1 Disable - MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_BTLED | MXC_F_GCR_PERCKCN1_TRNGD ); // Clear BTLE and ICACHE0 disable - - /* setup the systick */ + uint32_t bytesUsed; + /* setup the systick for 1MS timer*/ SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; SysTick->VAL = 0; SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); -#ifndef __IAR_SYSTEMS_ICC__ - /* Added to prevent printf() and friends from using malloc() */ - setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); -#endif + WsfTimerInit(); + + SystemHeapStart = (uint32_t)&SystemHeap; + memset(SystemHeap, 0, sizeof(SystemHeap)); + printf("SystemHeapStart = 0x%x\n", SystemHeapStart); + printf("SystemHeapSize = 0x%x\n", SystemHeapSize); + bytesUsed = WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + printf("bytesUsed = 0x%x\n", bytesUsed); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); } /* @@ -170,39 +153,15 @@ void SetAddress(uint8_t event) uint8_t bdAddr[6] = {0x02, 0x00, 0x44, 0x8B, 0x05, 0x00}; switch (event) { - case APP_UI_RESET_CMPL: - printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); - LlSetBdAddr((uint8_t*)&bdAddr); - LlGetBdAddr(hciCoreCb.bdAddr); - break; - default: - break; + case APP_UI_RESET_CMPL: + printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); + HciVsSetBdAddr(bdAddr); + break; + default: + break; } } -/*************************************************************************************************/ -/*! - * \brief Initialize MAC layer. - * - * \param None. - * - * \return None. - */ -/*************************************************************************************************/ -void MacInit(void) -{ - wsfHandlerId_t handlerId; - - /* Initialize link layer. */ - BbInit(); - handlerId = WsfOsSetNextHandler(SchHandler); - SchInit(handlerId); - LlAdvSlaveInit(); - LlConnSlaveInit(); - handlerId = WsfOsSetNextHandler(LlHandler); - LlHandlerInit(handlerId); -} - /*************************************************************************************************/ /*! * \fn main @@ -216,11 +175,15 @@ void MacInit(void) /*************************************************************************************************/ int main(void) { + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + printf("\n\n***** MAX32665 BLE Data Server *****\n"); - PlatformInit(); + /* Initialize Radio */ WsfInit(); - MacInit(); StackInitDats(); DatsStart(); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_dats/stack_dats.c b/lib/sdk/Applications/EvKitExamples/BLE_dats/stack_dats.c index 21059ecad9130a3a5b363b893f74b655fa07715d..072727164f6f7ee6915b8bfc003ba1dd7ed2558f 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_dats/stack_dats.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_dats/stack_dats.c @@ -17,13 +17,13 @@ */ /*************************************************************************************************/ +#include <stdio.h> +#include <string.h> #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" - #include "dats/dats_api.h" #include "wdxs/wdxs_api.h" - #include "hci_handler.h" #include "dm_handler.h" #include "l2c_handler.h" @@ -36,6 +36,56 @@ #include "svc_dis.h" #include "svc_core.h" #include "sec_api.h" +#include "ll_init_api.h" + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0xc152 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 4, // 4 Extended Advertising Sets + /*maxAdvReports*/ 8, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 2, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 10000, + + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ FALSE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; /*************************************************************************************************/ /*! @@ -47,27 +97,49 @@ void StackInitDats(void) { wsfHandlerId_t handlerId; - uint8_t features[sizeof(uint64_t)]; - uint8_t mask[sizeof(uint64_t)]; - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); +#ifndef ENABLE_SDMA + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; - // Only use legacy API. - Uint64ToBstream(features, 0); - Uint64ToBstream(mask, HCI_LE_SUP_FEAT_LE_EXT_ADV); - HciVsSetFeatures(features, mask); + memUsed = LlInitControllerExtInit(&ll_init_cfg); + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } +#endif handlerId = WsfOsSetNextHandler(HciHandler); HciHandlerInit(handlerId); + SecInit(); + SecAesInit(); + SecCmacInit(); + SecEccInit(); + handlerId = WsfOsSetNextHandler(DmHandler); DmDevVsInit(0); +#ifdef BTLE_APP_USE_LEGACY_API DmAdvInit(); DmConnInit(); DmConnSlaveInit(); +#else /* BTLE_APP_USE_LEGACY_API */ + DmExtAdvInit(); + DmConnInit(); + DmExtConnSlaveInit(); +#endif /* BTLE_APP_USE_LEGACY_API */ DmSecInit(); DmSecLescInit(); DmPrivInit(); @@ -99,4 +171,5 @@ void StackInitDats(void) handlerId = WsfOsSetNextHandler(WdxsHandler); WdxsHandlerInit(handlerId); #endif + } diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_fit/Makefile index 72c510016ae1d5ffff58ca7c64a0cb9d3c86a86b..6d489b133277a677c9c9e296efc7ddd5ce17729e 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_fit/Makefile +++ b/lib/sdk/Applications/EvKitExamples/BLE_fit/Makefile @@ -29,10 +29,15 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # -# $Id: Makefile 38694 2018-10-24 20:41:14Z zach.metzinger $ +# $Id: Makefile 44577 2019-07-11 21:47:07Z kevin.gillespie $ # ################################################################################ +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + # This is the name of the build output file ifeq "$(PROJECT)" "" PROJECT=max32665 @@ -67,10 +72,8 @@ endif # This is the path to the CMSIS root directory ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -NDALIBS_DIR=../../../NDALibraries else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -NDALIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/NDALibraries) endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS @@ -78,7 +81,6 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS SRCS = main.c SRCS += stack_fit.c SRCS += fit_main.c -SRCS += svc_dis.c # Where to find source files for this test VPATH = . @@ -86,10 +88,64 @@ VPATH = . # Where to find header files for this test IPATH = . +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifdef CONSOLE_UART +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif +endif + +ifdef ENABLE_SDMA +ifneq "$(ENABLE_SDMA)" "" +ifeq "$(ENABLE_SDMA)" "0" +undefine ENABLE_SDMA +else +ifeq "$(ENABLE_SDMA)" "FALSE" +undefine ENABLE_SDMA +else +ENABLE_SDMA=1 +endif +endif +endif +endif + +#------------------------------------------------------------------------------- +# Configuration specified here. + +#-------------------- +# Stack configuration + # Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE=TRUE +PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_MS_PER_TICK=1 + + +#-------------------- +# Application CFLAGS configuration + +#-------------------- +# Stack CFLAGS configuration + +PROJ_CFLAGS+=-DINIT_BROADCASTER +# PROJ_CFLAGS+=-DINIT_OBSERVER +# PROJ_CFLAGS+=-DINIT_CENTRAL +PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +ENABLE_LL_TESTER?=#1 +# Use this variable to override default compilier optimization. #MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer # Point this variable to a linker file to override the default file #LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld @@ -106,8 +162,7 @@ PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver include ${PERIPH_DRIVER_DIR}/periphdriver.mk # Include Cordio BTLE Library -TRACE=1 -CORDIO_DIR=$(NDALIBS_DIR)/BTLE +CORDIO_DIR=$(LIBS_DIR)/BTLE include ${CORDIO_DIR}/btle.mk # Include MAXUSB library diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_fit/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..cd58c33d59525339b3b8ed226fa8956b4c839f27 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_fit/config.mk @@ -0,0 +1,6 @@ +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# Run link layer using SDMA. +ENABLE_SDMA?=0 diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/fit_main.c b/lib/sdk/Applications/EvKitExamples/BLE_fit/fit_main.c index 6691b4eb94f4a8317720f4b418e1de14e1d410ec..05a6bdcabee0d092536831b9700548849369a352 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_fit/fit_main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_fit/fit_main.c @@ -23,6 +23,7 @@ #include "util/bstream.h" #include "wsf_msg.h" #include "wsf_trace.h" +#include "wsf_buf.h" #include "hci_api.h" #include "dm_api.h" #include "att_api.h" @@ -40,7 +41,8 @@ #include "bas/bas_api.h" #include "hrps/hrps_api.h" #include "rscp/rscp_api.h" -#include "fit_api.h" +#include "fit/fit_api.h" +#include "util/calc128.h" /************************************************************************************************** Macros @@ -88,7 +90,7 @@ static const appAdvCfg_t fitAdvCfg = /*! configurable parameters for slave */ static const appSlaveCfg_t fitSlaveCfg = { - FIT_CONN_MAX, /*! Maximum connections */ + 1, /*! Maximum connections */ }; /*! configurable parameters for security */ @@ -98,9 +100,12 @@ static const appSecCfg_t fitSecCfg = 0, /*! Initiator key distribution flags */ DM_KEY_DIST_LTK, /*! Responder key distribution flags */ FALSE, /*! TRUE if Out-of-band pairing data is present */ - TRUE /*! TRUE to initiate security upon connection */ + FALSE /*! TRUE to initiate security upon connection */ }; +/*! TRUE if Out-of-band pairing data is to be sent */ +static const bool_t fitSendOobData = FALSE; + /*! configurable parameters for connection parameter update */ static const appUpdateCfg_t fitUpdateCfg = { @@ -216,6 +221,9 @@ static uint16_t fitRscmPeriod = FIT_DEFAULT_RSCM_PERIOD; /* Heart Rate Monitor feature flags */ static uint8_t fitHrmFlags = CH_HRM_FLAGS_VALUE_8BIT | CH_HRM_FLAGS_ENERGY_EXP; +/* LESC OOB configuration */ +static dmSecLescOobCfg_t *fitOobCfg; + /*************************************************************************************************/ /*! * \brief Application DM callback. @@ -230,12 +238,40 @@ static void fitDmCback(dmEvt_t *pDmEvt) dmEvt_t *pMsg; uint16_t len; - len = DmSizeOfEvt(pDmEvt); + if (pDmEvt->hdr.event == DM_SEC_ECC_KEY_IND) + { + DmSecSetEccKey(&pDmEvt->eccMsg.data.key); - if ((pMsg = WsfMsgAlloc(len)) != NULL) + // If the local device sends OOB data. + if (fitSendOobData) + { + uint8_t oobLocalRandom[SMP_RAND_LEN]; + SecRand(oobLocalRandom, SMP_RAND_LEN); + DmSecCalcOobReq(oobLocalRandom, pDmEvt->eccMsg.data.key.pubKey_x); + } + } + else if (pDmEvt->hdr.event == DM_SEC_CALC_OOB_IND) { - memcpy(pMsg, pDmEvt, len); - WsfMsgSend(fitHandlerId, pMsg); + if (fitOobCfg == NULL) + { + fitOobCfg = WsfBufAlloc(sizeof(dmSecLescOobCfg_t)); + } + + if (fitOobCfg) + { + Calc128Cpy(fitOobCfg->localConfirm, pDmEvt->oobCalcInd.confirm); + Calc128Cpy(fitOobCfg->localRandom, pDmEvt->oobCalcInd.random); + } + } + else + { + len = DmSizeOfEvt(pDmEvt); + + if ((pMsg = WsfMsgAlloc(len)) != NULL) + { + memcpy(pMsg, pDmEvt, len); + WsfMsgSend(fitHandlerId, pMsg); + } } } diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/main.c b/lib/sdk/Applications/EvKitExamples/BLE_fit/main.c index a27747313a6d7a14e763ce0db6cef503bd0d0a46..201380e003f38cd89d216de48cbf757c7d5e28a3 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_fit/main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_fit/main.c @@ -29,47 +29,56 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-02-11 23:36:35 +0000 (Mon, 11 Feb 2019) $ - * $Revision: 40967 $ + * $Date: 2019-07-11 16:47:07 -0500 (Thu, 11 Jul 2019) $ + * $Revision: 44577 $ * ******************************************************************************/ #include <stdio.h> #include <string.h> +#include "mxc_config.h" #include "wsf_types.h" #include "wsf_os.h" #include "wsf_buf.h" #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "ll_api.h" -#include "sch_api.h" #include "fit/fit_api.h" -#include "mxc_config.h" -#include "gcr_regs.h" -#include "mcr_regs.h" +#include "app_ui.h" +#include "hci_vs.h" #include "hci_core.h" +#include "pb.h" +#include "tmr.h" /************************************************************************************************** Macros **************************************************************************************************/ -/* Number of WSF buffer pools */ -#define WSF_BUF_POOLS 6 +/* Size of buffer for stdio functions */ +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 /* Size of buffer for stdio functions */ -#define PRINTF_BUF_SIZE 128 +#define PRINTF_BUF_SIZE 128 + +/* Definitions for push button handling */ +#define BUTTON0_TMR MXC_TMR0 +#define BUTTON1_TMR MXC_TMR1 +#define BUTTON_SHORT_MS 200 +#define BUTTON_MED_MS 500 +#define BUTTON_LONG_MS 1000 /************************************************************************************************** Local Variables **************************************************************************************************/ +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + /*! Buffer for stdio functions */ char printf_buffer[PRINTF_BUF_SIZE]; -/*! Free memory for pool buffers (use word elements for word alignment). */ -static uint32_t mainBufMem[3584/sizeof(uint32_t)+96]; - /*! Default pool descriptor. */ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { @@ -78,7 +87,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { 64, 4 }, { 128, 4 }, { 256, 4 }, - { 384, 4 } + { 512, 4 } }; /************************************************************************************************** @@ -88,7 +97,11 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = /*! \brief Stack initialization for app. */ extern void StackInitFit(void); -void HciVsSetPublicAddr(uint8_t *bdAddr); +/*************************************************************************************************/ +void PalSysAssertTrap(void) +{ + while(1) {} +} /*************************************************************************************************/ void SysTick_Handler(void) @@ -97,15 +110,17 @@ void SysTick_Handler(void) } /*************************************************************************************************/ -static void myTrace(const char *pStr, va_list args) +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) { extern uint8_t wsfCsNesting; if (wsfCsNesting == 0) { - vprintf(pStr, args); - printf("\r\n"); + fwrite(pBuf, len, 1, stdout); + return TRUE; } + + return FALSE; } /*************************************************************************************************/ @@ -117,49 +132,24 @@ static void myTrace(const char *pStr, va_list args) /*************************************************************************************************/ static void WsfInit(void) { - WsfTimerInit(); - WsfBufInit(sizeof(mainBufMem), (uint8_t*)mainBufMem, WSF_BUF_POOLS, mainPoolDesc); - WsfTraceRegister(myTrace); -} - -/*************************************************************************************************/ -/*! - * \brief Initialize platform. - * - * \param msPerTick Milliseconds per timer tick. - * - * \return None. - */ -/*************************************************************************************************/ -void PlatformInit(void) -{ - /* Change the pullup on the RST pin to 25K */ - MXC_MCR->ctrl = 0x202; - - /* Set VREGO_D to 1.3V */ - *((volatile uint32_t*)0x40004410) = 0x50; - - /* Set TX LDO to 1.1V and enable LDO. Set RX LDO to 0.9V and enable LDO */ - MXC_GCR->btleldocn = 0xD9; // TX 1.1V RX 0.9V - - /* Power up the 32MHz XO */ - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_X32M_EN; - - /* Enable peripheral clocks */ - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_GPIO0D | MXC_F_GCR_PERCKCN0_GPIO1D); // Clear GPIO0 and GPIO1 Disable - MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_BTLED | MXC_F_GCR_PERCKCN1_TRNGD ); // Clear BTLE and ICACHE0 disable - - /* setup the systick */ + uint32_t bytesUsed; + /* setup the systick for 1MS timer*/ SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; SysTick->VAL = 0; SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); -#ifndef __IAR_SYSTEMS_ICC__ - /* Added to prevent printf() and friends from using malloc() */ - setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); -#endif -} + WsfTimerInit(); + SystemHeapStart = (uint32_t)&SystemHeap; + memset(SystemHeap, 0, sizeof(SystemHeap)); + printf("SystemHeapStart = 0x%x\n", SystemHeapStart); + printf("SystemHeapSize = 0x%x\n", SystemHeapSize); + bytesUsed = WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + printf("bytesUsed = 0x%x\n", bytesUsed); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); +} /* * In two-chip solutions, setting the address must wait until the HCI interface is initialized. @@ -172,37 +162,61 @@ void SetAddress(uint8_t event) uint8_t bdAddr[6] = {0x02, 0x02, 0x44, 0x8B, 0x05, 0x00}; switch (event) { - case APP_UI_RESET_CMPL: - printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); - LlSetBdAddr((uint8_t*)&bdAddr); - LlGetBdAddr(hciCoreCb.bdAddr); - break; - default: - break; + case APP_UI_RESET_CMPL: + printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); + HciVsSetBdAddr(bdAddr); + break; + default: + break; } } /*************************************************************************************************/ -/*! - * \brief Initialize MAC layer. - * - * \param None. - * - * \return None. - */ +void HandleButton(int button) +{ + mxc_tmr_regs_t* button_tmr = MXC_TMR_GET_TMR(button); + + // Check if rising or falling + if(PB_Get(button)) { + // Start timer + TMR_Enable(button_tmr); + } else { + uint32_t time; + tmr_unit_t unit; + + // Get the elapsed time since the button was pressed + TMR_GetTime(button_tmr, TMR_GetCount(button_tmr), &time, &unit); + TMR_Disable(button_tmr); + TMR_SetCount(button_tmr, 0); + + if(unit == TMR_UNIT_NANOSEC) { + time /= 1000000; + } else if(unit == TMR_UNIT_MICROSEC) { + time /= 1000; + } + + if(time < BUTTON_SHORT_MS) { + AppUiBtnTest(button ? APP_UI_BTN_2_SHORT : APP_UI_BTN_1_SHORT); + } else if (time < BUTTON_MED_MS) { + AppUiBtnTest(button ? APP_UI_BTN_2_MED : APP_UI_BTN_1_MED); + } else if (time < BUTTON_LONG_MS) { + AppUiBtnTest(button ? APP_UI_BTN_2_LONG : APP_UI_BTN_1_LONG); + } else { + AppUiBtnTest(button ? APP_UI_BTN_2_EX_LONG : APP_UI_BTN_1_EX_LONG); + } + } +} + +/*************************************************************************************************/ +void Button0Pressed(void* arg) +{ + HandleButton(0); +} + /*************************************************************************************************/ -void MacInit(void) +void Button1Pressed(void* arg) { - wsfHandlerId_t handlerId; - - /* Initialize link layer. */ - BbInit(); - handlerId = WsfOsSetNextHandler(SchHandler); - SchInit(handlerId); - LlAdvSlaveInit(); - LlConnSlaveInit(); - handlerId = WsfOsSetNextHandler(LlHandler); - LlHandlerInit(handlerId); + HandleButton(1); } /*************************************************************************************************/ @@ -218,17 +232,34 @@ void MacInit(void) /*************************************************************************************************/ int main(void) { + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + printf("\n\n***** MAX32665 BLE Fitness Profile *****\n"); - PlatformInit(); + /* Initialize Radio */ WsfInit(); - MacInit(); StackInitFit(); FitStart(); + /* Setup pushbuttons and timers */ + PB_RegisterRiseFallCallback(0, Button0Pressed); + PB_RegisterRiseFallCallback(1, Button1Pressed); + PB_IntEnable(0); + + TMR_Init(BUTTON0_TMR, TMR_PRES_16, NULL); + TMR_Init(BUTTON1_TMR, TMR_PRES_16, NULL); + + tmr_cfg_t button_config; + button_config.mode = TMR_MODE_CONTINUOUS; + TMR_Config(BUTTON0_TMR, &button_config); + TMR_Config(BUTTON1_TMR, &button_config); + /* Register a handler for Application events */ AppUiActionRegister(SetAddress); - + printf("Setup Complete\n"); while (1) @@ -236,3 +267,12 @@ int main(void) wsfOsDispatcher(); } } + +/*****************************************************************/ +void HardFault_Handler(void) +{ + printf("\nFaultISR: CFSR %08X, BFAR %08x\n", (unsigned int)SCB->CFSR, (unsigned int)SCB->BFAR); + + // Loop forever + while(1); +} diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/stack_fit.c b/lib/sdk/Applications/EvKitExamples/BLE_fit/stack_fit.c index db5f59997c59a2240c7588859a09e8a387bb112b..cdbfe1217aeebe1f60a3cfb5111186c1c0aca053 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_fit/stack_fit.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_fit/stack_fit.c @@ -17,6 +17,8 @@ */ /*************************************************************************************************/ +#include <stdio.h> +#include <string.h> #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" @@ -33,6 +35,56 @@ #include "svc_dis.h" #include "svc_core.h" #include "sec_api.h" +#include "ll_init_api.h" + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0xC152 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 4, // 4 Extended Advertising Sets + /*maxAdvReports*/ 8, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 2, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 10000, + + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ TRUE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; /*************************************************************************************************/ /*! @@ -44,22 +96,42 @@ void StackInitFit(void) { wsfHandlerId_t handlerId; - uint8_t features[sizeof(uint64_t)]; - uint8_t mask[sizeof(uint64_t)]; - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); +#ifndef ENABLE_SDMA + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; - // Only use legacy API. - Uint64ToBstream(features, 0); - Uint64ToBstream(mask, HCI_LE_SUP_FEAT_LE_EXT_ADV); - HciVsSetFeatures(features, mask); +#ifdef DATS_APP_USE_LEGACY_API + memUsed = LlInitControllerExtInit(&ll_init_cfg); +#else /* DATS_APP_USE_LEGACY_API */ + memUsed = LlInitControllerExtInit(&ll_init_cfg); +#endif /* DATS_APP_USE_LEGACY_API */ + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("Controller memory mismatch 0x%x != 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } +#endif handlerId = WsfOsSetNextHandler(HciHandler); HciHandlerInit(handlerId); + SecInit(); + SecAesInit(); + SecCmacInit(); + SecEccInit(); + handlerId = WsfOsSetNextHandler(DmHandler); DmDevVsInit(0); DmAdvInit(); @@ -68,6 +140,7 @@ void StackInitFit(void) DmSecInit(); DmSecLescInit(); DmPrivInit(); + DmPhyInit(); DmHandlerInit(handlerId); handlerId = WsfOsSetNextHandler(L2cSlaveHandler); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/svc_dis.c b/lib/sdk/Applications/EvKitExamples/BLE_fit/svc_dis.c deleted file mode 100644 index bbdf8cc18a0b8cbadf3077c80c61c41a9511277f..0000000000000000000000000000000000000000 --- a/lib/sdk/Applications/EvKitExamples/BLE_fit/svc_dis.c +++ /dev/null @@ -1,297 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file svc_dis.c - * - * \brief Example Device Information Service implementation. - * - * $Date: 2018-04-17 23:02:20 +0000 (Tue, 17 Apr 2018) $ - * $Revision: 34673 $ - * - * Copyright (c) 2011 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "att_api.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "svc_dis.h" -#include "svc_cfg.h" - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -/*! Characteristic read permissions */ -#ifndef DIS_SEC_PERMIT_READ -#define DIS_SEC_PERMIT_READ SVC_SEC_PERMIT_READ -#endif - -/************************************************************************************************** - Service variables -**************************************************************************************************/ - -/* Device information service declaration */ -static const uint8_t disValSvc[] = {UINT16_TO_BYTES(ATT_UUID_DEVICE_INFO_SERVICE)}; -static const uint16_t disLenSvc = sizeof(disValSvc); - -/* Manufacturer name string characteristic */ -static const uint8_t disValMfrCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_MFR_HDL), UINT16_TO_BYTES(ATT_UUID_MANUFACTURER_NAME)}; -static const uint16_t disLenMfrCh = sizeof(disValMfrCh); - -/* Manufacturer name string */ -static const uint8_t disUuMfr[] = {UINT16_TO_BYTES(ATT_UUID_MANUFACTURER_NAME)}; -static const uint8_t disValMfr[] = "Maxim Integrated"; -static const uint16_t disLenMfr = sizeof(disValMfr) - 1; - -/* System ID characteristic */ -static const uint8_t disValSidCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_SID_HDL), UINT16_TO_BYTES(ATT_UUID_SYSTEM_ID)}; -static const uint16_t disLenSidCh = sizeof(disValSidCh); - -/* System ID */ -static const uint8_t disUuSid[] = {UINT16_TO_BYTES(ATT_UUID_SYSTEM_ID)}; -static uint8_t disValSid[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; -static const uint16_t disLenSid = sizeof(disValSid); - -/* Model number string characteristic */ -static const uint8_t disValMnCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_MN_HDL), UINT16_TO_BYTES(ATT_UUID_MODEL_NUMBER)}; -static const uint16_t disLenMnCh = sizeof(disValMnCh); - -/* Model number string */ -static const uint8_t disUuMn[] = {UINT16_TO_BYTES(ATT_UUID_MODEL_NUMBER)}; -static const uint8_t disValMn[] = "MAX32565"; -static const uint16_t disLenMn = sizeof(disValMn) - 1; - -/* Serial number string characteristic */ -static const uint8_t disValSnCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_SN_HDL), UINT16_TO_BYTES(ATT_UUID_SERIAL_NUMBER)}; -static const uint16_t disLenSnCh = sizeof(disValSnCh); - -/* Serial number string */ -static const uint8_t disUuSn[] = {UINT16_TO_BYTES(ATT_UUID_SERIAL_NUMBER)}; -static const uint8_t disValSn[] = "serial num"; -static const uint16_t disLenSn = sizeof(disValSn) - 1; - -/* Firmware revision string characteristic */ -static const uint8_t disValFwrCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_FWR_HDL), UINT16_TO_BYTES(ATT_UUID_FIRMWARE_REV)}; -static const uint16_t disLenFwrCh = sizeof(disValFwrCh); - -/* Firmware revision string */ -static const uint8_t disUuFwr[] = {UINT16_TO_BYTES(ATT_UUID_FIRMWARE_REV)}; -static const uint8_t disValFwr[] = "fw rev"; -static const uint16_t disLenFwr = sizeof(disValFwr) - 1; - -/* Hardware revision string characteristic */ -static const uint8_t disValHwrCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_HWR_HDL), UINT16_TO_BYTES(ATT_UUID_HARDWARE_REV)}; -static const uint16_t disLenHwrCh = sizeof(disValHwrCh); - -/* Hardware revision string */ -static const uint8_t disUuHwr[] = {UINT16_TO_BYTES(ATT_UUID_HARDWARE_REV)}; -static const uint8_t disValHwr[] = "hw rev"; -static const uint16_t disLenHwr = sizeof(disValHwr) - 1; - -/* Software revision string characteristic */ -static const uint8_t disValSwrCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_SWR_HDL), UINT16_TO_BYTES(ATT_UUID_SOFTWARE_REV)}; -static const uint16_t disLenSwrCh = sizeof(disValSwrCh); - -/* Software revision string */ -static const uint8_t disUuSwr[] = {UINT16_TO_BYTES(ATT_UUID_SOFTWARE_REV)}; -static const uint8_t disValSwr[] = "sw rev"; -static const uint16_t disLenSwr = sizeof(disValSwr) - 1; - -/* Registration certificate data characteristic */ -static const uint8_t disValRcdCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(DIS_RCD_HDL), UINT16_TO_BYTES(ATT_UUID_11073_CERT_DATA)}; -static const uint16_t disLenRcdCh = sizeof(disValRcdCh); - -/* Registration certificate data */ -static const uint8_t disUuRcd[] = {UINT16_TO_BYTES(ATT_UUID_11073_CERT_DATA)}; -static const uint8_t disValRcd[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static const uint16_t disLenRcd = sizeof(disValRcd); - -/* Attribute list for dis group */ -static const attsAttr_t disList[] = -{ - { - attPrimSvcUuid, - (uint8_t *) disValSvc, - (uint16_t *) &disLenSvc, - sizeof(disValSvc), - 0, - ATTS_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValMfrCh, - (uint16_t *) &disLenMfrCh, - sizeof(disValMfrCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuMfr, - (uint8_t *) disValMfr, - (uint16_t *) &disLenMfr, - sizeof(disValMfr) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValSidCh, - (uint16_t *) &disLenSidCh, - sizeof(disValSidCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuSid, - disValSid, - (uint16_t *) &disLenSid, - sizeof(disValSid), - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValMnCh, - (uint16_t *) &disLenMnCh, - sizeof(disValMnCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuMn, - (uint8_t *) disValMn, - (uint16_t *) &disLenMn, - sizeof(disValMn) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValSnCh, - (uint16_t *) &disLenSnCh, - sizeof(disValSnCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuSn, - (uint8_t *) disValSn, - (uint16_t *) &disLenSn, - sizeof(disValSn) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValFwrCh, - (uint16_t *) &disLenFwrCh, - sizeof(disValFwrCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuFwr, - (uint8_t *) disValFwr, - (uint16_t *) &disLenFwr, - sizeof(disValFwr) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValHwrCh, - (uint16_t *) &disLenHwrCh, - sizeof(disValHwrCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuHwr, - (uint8_t *) disValHwr, - (uint16_t *) &disLenHwr, - sizeof(disValHwr) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValSwrCh, - (uint16_t *) &disLenSwrCh, - sizeof(disValSwrCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuSwr, - (uint8_t *) disValSwr, - (uint16_t *) &disLenSwr, - sizeof(disValSwr) - 1, - 0, - DIS_SEC_PERMIT_READ - }, - { - attChUuid, - (uint8_t *) disValRcdCh, - (uint16_t *) &disLenRcdCh, - sizeof(disValRcdCh), - 0, - ATTS_PERMIT_READ - }, - { - disUuRcd, - (uint8_t *) disValRcd, - (uint16_t *) &disLenRcd, - sizeof(disValRcd), - 0, - DIS_SEC_PERMIT_READ - }, -}; - -/* DIS group structure */ -static attsGroup_t svcDisGroup = -{ - NULL, - (attsAttr_t *) disList, - NULL, - NULL, - DIS_START_HDL, - DIS_END_HDL -}; - -/*************************************************************************************************/ -/*! - * \fn SvcDisAddGroup - * - * \brief Add the services to the attribute server. - * - * \return None. - */ -/*************************************************************************************************/ -void SvcDisAddGroup(void) -{ - AttsAddGroup(&svcDisGroup); -} - -/*************************************************************************************************/ -/*! - * \fn SvcDisRemoveGroup - * - * \brief Remove the services from the attribute server. - * - * \return None. - */ -/*************************************************************************************************/ -void SvcDisRemoveGroup(void) -{ - AttsRemoveGroup(DIS_START_HDL); -} diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.cproject b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.cproject new file mode 100644 index 0000000000000000000000000000000000000000..9b7799a8305a68f11a38070112d6c6fa8a29c399 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.cproject @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> + <storageModule moduleId="org.eclipse.cdt.core.settings"> + <cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <externalSettings/> + <extensions> + <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" name="Debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962"> + <folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962." name="/" resourcePath=""> + <toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.548125692" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1448195934" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.989348626" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.573934961" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.1195068176" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.1035348629" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.31679983" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.max" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1676901946" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1729767352" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="GNU Tools for ARM Embedded Processors" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1708484008" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.178519983" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m3" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.956545422" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1580514969" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1246670973" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1674926322" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.2051566192" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.408066731" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.1900584936" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.1096852527" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.937347953" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1468247042" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.1529750846" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.667765305" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/> + <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.786533016" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/> + <builder arguments="-r ECLIPSE=1" buildPath="${workspace_loc:/BLE_hci_uart}" command="make" id="ilg.gnuarmeclipse.managedbuild.cross.builder.592880777" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1648672385" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1969112665" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.507854261" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1576427906" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1576427906" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath"> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/CMSIS/Device/Maxim/MAX32665/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/MAX32665PeriphDriver/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/Boards/EvKit_V1/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/Boards/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/CMSIS/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/arm-none-eabi/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/arm-none-eabi/include/sys""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/lib/gcc/arm-none-eabi/6.3.1/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/wsf/common/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/wsf/common/include/util""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/platform/common/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/controller/sources/mac/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/ble-host/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/ble-profiles/include/app""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/ble-profiles/sources/profiles/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/ble-profiles/sources/apps""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/NDALibraries/BTLE/projects/ble-apps""/> + </option> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.68945223" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.794996645" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.675776866" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.185399645" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.246156916" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input"> + <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> + <additionalInput kind="additionalinput" paths="$(LIBS)"/> + </inputType> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.391142733" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.2099090970" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.399743328" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.822983655" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1050446219" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.335976671" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.964898349" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.972868647" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.890608562" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.1669392057" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.403251962" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1919947275" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="BLE_hci_uart.ilg.gnuarmeclipse.managedbuild.cross.target.elf.737306620" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + <scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1576427906;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.68945223"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + </scannerConfigBuildInfo> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="refreshScope" versionNumber="2"> + <configuration configurationName="Debug"> + <resource resourceType="PROJECT" workspacePath="/BLE_hci_uart"/> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> + <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +</cproject> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.project b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.project new file mode 100644 index 0000000000000000000000000000000000000000..5fc1d327c4aac5ac089a9cdbdb11fca49a93da41 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.project @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>BLE_hci_uart</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> + <triggers>full,incremental,</triggers> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> +</projectDescription> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.settings/language.settings.xml b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.settings/language.settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5a1647610f97197abe406e8ef1bb9e62065f5a1 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/.settings/language.settings.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<project> + <configuration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" name="Debug"> + <extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> + <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> + <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> + <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> + </extension> + </configuration> +</project> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/Abstract.txt b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/Abstract.txt new file mode 100644 index 0000000000000000000000000000000000000000..39ae9f09b852c47b7a35053b30533050494500d6 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/Abstract.txt @@ -0,0 +1 @@ +BLE direct test mode example diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvoptx b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvoptx similarity index 60% rename from lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvoptx rename to lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvoptx index 6dafcbba14040cba35257a370909161deefbe73c..c2dab2fd5d431bbc3b755e1a9b320c0bbf900728 100644 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvoptx +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvoptx @@ -8,7 +8,7 @@ <Extensions> <cExt>*.c</cExt> <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> + <oExt>*.obj; *.o</oExt> <lExt>*.lib</lExt> <tExt>*.txt; *.h; *.inc</tExt> <pExt>*.plm</pExt> @@ -22,11 +22,11 @@ </DaveTm> <Target> - <TargetName>datc-bt4</TargetName> + <TargetName>Flash Debug</TargetName> <ToolsetNumber>0x4</ToolsetNumber> <ToolsetName>ARM-ADS</ToolsetName> <TargetOption> - <CLKADS>12000000</CLKADS> + <CLKADS>96000000</CLKADS> <OPTTT> <gFlags>1</gFlags> <BeepAtEnd>1</BeepAtEnd> @@ -45,7 +45,7 @@ <PageWidth>79</PageWidth> <PageLength>66</PageLength> <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> + <ListingPath>.\Listings\</ListingPath> </OPTLEX> <ListingPage> <CreateCListing>1</CreateCListing> @@ -77,7 +77,7 @@ <tvExpOptDlg>0</tvExpOptDlg> <IsCurrentTarget>1</IsCurrentTarget> </OPTFL> - <CpuCode>7</CpuCode> + <CpuCode>255</CpuCode> <DebugOpt> <uSim>0</uSim> <uTrg>1</uTrg> @@ -100,7 +100,10 @@ <tRSysVw>1</tRSysVw> <sRunDeb>0</sRunDeb> <sLrtime>0</sLrtime> - <nTsel>4</nTsel> + <bEvRecOn>1</bEvRecOn> + <bSchkAxf>0</bSchkAxf> + <bTchkAxf>0</bTchkAxf> + <nTsel>2</nTsel> <sDll></sDll> <sDllPa></sDllPa> <sDlgDll></sDlgDll> @@ -110,7 +113,7 @@ <tDllPa></tDllPa> <tDlgDll></tDlgDll> <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> + <tIfile></tIfile> <pMon>BIN\CMSIS_AGDI.dll</pMon> </DebugOpt> <TargetDriverDllRegistry> @@ -131,18 +134,18 @@ </SetRegEntry> <SetRegEntry> <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> + <Key>DLGUARM</Key> + <Name></Name> </SetRegEntry> <SetRegEntry> <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> + <Key>CMSIS_AGDI</Key> + <Name>-X"CMSIS-DAP" -UMXIM00001c2400b00000000000000000 -O238 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO23 -FD20000000 -FC1000 -FN1 -FF0MAX32665.FLM -FS010000000 -FL0100000 -FP0($$Device:MAX32665$Flash\MAX32665.FLM)</Name> </SetRegEntry> <SetRegEntry> <Number>0</Number> <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> + <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000)</Name> </SetRegEntry> </TargetDriverDllRegistry> <Breakpoint/> @@ -151,7 +154,7 @@ </Tracepoint> <DebugFlag> <trace>0</trace> - <periodic>0</periodic> + <periodic>1</periodic> <aLwin>1</aLwin> <aCover>0</aCover> <aSer1>0</aSer1> @@ -178,9 +181,100 @@ <LintExecutable></LintExecutable> <LintConfigFile></LintConfigFile> <bLintAuto>0</bLintAuto> + <bAutoGenD>0</bAutoGenD> + <LntExFlags>0</LntExFlags> + <pMisraName></pMisraName> + <pszMrule></pszMrule> + <pSingCmds></pSingCmds> + <pMultCmds></pMultCmds> + <pMisraNamep></pMisraNamep> + <pszMrulep></pszMrulep> + <pSingCmdsp></pSingCmdsp> + <pMultCmdsp></pMultCmdsp> + <DebugDescription> + <Enable>1</Enable> + <EnableFlashSeq>1</EnableFlashSeq> + <EnableLog>1</EnableLog> + <Protocol>2</Protocol> + <DbgClock>2000000</DbgClock> + </DebugDescription> </TargetOption> </Target> + + <Group> + <GroupName>Source</GroupName> + <tvExp>1</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <cbSel>0</cbSel> + <RteFlg>0</RteFlg> + <File> + <GroupNumber>1</GroupNumber> + <FileNumber>1</FileNumber> + <FileType>1</FileType> + <tvExp>0</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <bDave2>0</bDave2> + <PathWithFileName>..\main.c</PathWithFileName> + <FilenameWithoutPath>main.c</FilenameWithoutPath> + <RteFlg>0</RteFlg> + <bShared>0</bShared> + </File> + <File> + <GroupNumber>1</GroupNumber> + <FileNumber>2</FileNumber> + <FileType>5</FileType> + <tvExp>0</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <bDave2>0</bDave2> + <PathWithFileName>.\Abstract.txt</PathWithFileName> + <FilenameWithoutPath>Abstract.txt</FilenameWithoutPath> + <RteFlg>0</RteFlg> + <bShared>0</bShared> + </File> + <File> + <GroupNumber>1</GroupNumber> + <FileNumber>3</FileNumber> + <FileType>1</FileType> + <tvExp>0</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <bDave2>0</bDave2> + <PathWithFileName>..\hci_tr.c</PathWithFileName> + <FilenameWithoutPath>hci_tr.c</FilenameWithoutPath> + <RteFlg>0</RteFlg> + <bShared>0</bShared> + </File> + </Group> + + <Group> + <GroupName>::BSP</GroupName> + <tvExp>1</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <cbSel>0</cbSel> + <RteFlg>1</RteFlg> + </Group> + + <Group> + <GroupName>::Bluetooth</GroupName> + <tvExp>1</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <cbSel>0</cbSel> + <RteFlg>1</RteFlg> + </Group> + + <Group> + <GroupName>::CMSIS</GroupName> + <tvExp>0</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <cbSel>0</cbSel> + <RteFlg>1</RteFlg> + </Group> + <Group> + <GroupName>::Device</GroupName> + <tvExp>1</tvExp> + <tvExpOptDlg>0</tvExpOptDlg> + <cbSel>0</cbSel> + <RteFlg>1</RteFlg> </Group> </ProjectOpt> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvprojx b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvprojx new file mode 100644 index 0000000000000000000000000000000000000000..2d4ba9d336ad919b814704e7f4f838113ad623dd --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/BTLE_hci_uart.uvprojx @@ -0,0 +1,522 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> + + <SchemaVersion>2.1</SchemaVersion> + + <Header>### uVision Project, (C) Keil Software</Header> + + <Targets> + <Target> + <TargetName>Flash Debug</TargetName> + <ToolsetNumber>0x4</ToolsetNumber> + <ToolsetName>ARM-ADS</ToolsetName> + <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed> + <uAC6>0</uAC6> + <TargetOption> + <TargetCommonOption> + <Device>MAX32665:Cortex-M4</Device> + <Vendor>Maxim</Vendor> + <PackID>Maxim.MAX32665.0.3.0</PackID> + <PackURL>http://www.mxim.net/microcontroller/pack/</PackURL> + <Cpu>IRAM(0x20000000,0x00080000) IROM(0x10000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(96000000) ELITTLE</Cpu> + <FlashUtilSpec></FlashUtilSpec> + <StartupFile></StartupFile> + <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000)</FlashDriverDll> + <DeviceId>0</DeviceId> + <RegisterFile>$$Device:MAX32665$Libraries\Device\Maxim\MAX32665\Include\max32665.h</RegisterFile> + <MemoryEnv></MemoryEnv> + <Cmp></Cmp> + <Asm></Asm> + <Linker></Linker> + <OHString></OHString> + <InfinionOptionDll></InfinionOptionDll> + <SLE66CMisc></SLE66CMisc> + <SLE66AMisc></SLE66AMisc> + <SLE66LinkerMisc></SLE66LinkerMisc> + <SFDFile>$$Device:MAX32665$SVD\MAX32665\max32665.svd</SFDFile> + <bCustSvd>0</bCustSvd> + <UseEnv>0</UseEnv> + <BinPath></BinPath> + <IncludePath></IncludePath> + <LibPath></LibPath> + <RegisterFilePath></RegisterFilePath> + <DBRegisterFilePath></DBRegisterFilePath> + <TargetStatus> + <Error>0</Error> + <ExitCodeStop>0</ExitCodeStop> + <ButtonStop>0</ButtonStop> + <NotGenerated>0</NotGenerated> + <InvalidFlash>1</InvalidFlash> + </TargetStatus> + <OutputDirectory>.\Objects\</OutputDirectory> + <OutputName>BLE_hci_uart</OutputName> + <CreateExecutable>1</CreateExecutable> + <CreateLib>0</CreateLib> + <CreateHexFile>0</CreateHexFile> + <DebugInformation>1</DebugInformation> + <BrowseInformation>1</BrowseInformation> + <ListingPath>.\Listings\</ListingPath> + <HexFormatSelection>1</HexFormatSelection> + <Merge32K>0</Merge32K> + <CreateBatchFile>0</CreateBatchFile> + <BeforeCompile> + <RunUserProg1>0</RunUserProg1> + <RunUserProg2>0</RunUserProg2> + <UserProg1Name></UserProg1Name> + <UserProg2Name></UserProg2Name> + <UserProg1Dos16Mode>0</UserProg1Dos16Mode> + <UserProg2Dos16Mode>0</UserProg2Dos16Mode> + <nStopU1X>0</nStopU1X> + <nStopU2X>0</nStopU2X> + </BeforeCompile> + <BeforeMake> + <RunUserProg1>0</RunUserProg1> + <RunUserProg2>0</RunUserProg2> + <UserProg1Name></UserProg1Name> + <UserProg2Name></UserProg2Name> + <UserProg1Dos16Mode>0</UserProg1Dos16Mode> + <UserProg2Dos16Mode>0</UserProg2Dos16Mode> + <nStopB1X>0</nStopB1X> + <nStopB2X>0</nStopB2X> + </BeforeMake> + <AfterMake> + <RunUserProg1>0</RunUserProg1> + <RunUserProg2>0</RunUserProg2> + <UserProg1Name></UserProg1Name> + <UserProg2Name></UserProg2Name> + <UserProg1Dos16Mode>0</UserProg1Dos16Mode> + <UserProg2Dos16Mode>0</UserProg2Dos16Mode> + <nStopA1X>0</nStopA1X> + <nStopA2X>0</nStopA2X> + </AfterMake> + <SelectedForBatchBuild>0</SelectedForBatchBuild> + <SVCSIdString></SVCSIdString> + </TargetCommonOption> + <CommonProperty> + <UseCPPCompiler>0</UseCPPCompiler> + <RVCTCodeConst>0</RVCTCodeConst> + <RVCTZI>0</RVCTZI> + <RVCTOtherData>0</RVCTOtherData> + <ModuleSelection>0</ModuleSelection> + <IncludeInBuild>1</IncludeInBuild> + <AlwaysBuild>0</AlwaysBuild> + <GenerateAssemblyFile>0</GenerateAssemblyFile> + <AssembleAssemblyFile>0</AssembleAssemblyFile> + <PublicsOnly>0</PublicsOnly> + <StopOnExitCode>3</StopOnExitCode> + <CustomArgument></CustomArgument> + <IncludeLibraryModules></IncludeLibraryModules> + <ComprImg>1</ComprImg> + </CommonProperty> + <DllOption> + <SimDllName>SARMCM3.DLL</SimDllName> + <SimDllArguments> </SimDllArguments> + <SimDlgDll>DCM.DLL</SimDlgDll> + <SimDlgDllArguments>-pCM4</SimDlgDllArguments> + <TargetDllName>SARMCM3.DLL</TargetDllName> + <TargetDllArguments></TargetDllArguments> + <TargetDlgDll>TCM.DLL</TargetDlgDll> + <TargetDlgDllArguments>-pCM4</TargetDlgDllArguments> + </DllOption> + <DebugOption> + <OPTHX> + <HexSelection>1</HexSelection> + <HexRangeLowAddress>0</HexRangeLowAddress> + <HexRangeHighAddress>0</HexRangeHighAddress> + <HexOffset>0</HexOffset> + <Oh166RecLen>16</Oh166RecLen> + </OPTHX> + </DebugOption> + <Utilities> + <Flash1> + <UseTargetDll>1</UseTargetDll> + <UseExternalTool>0</UseExternalTool> + <RunIndependent>0</RunIndependent> + <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging> + <Capability>1</Capability> + <DriverSelection>4096</DriverSelection> + </Flash1> + <bUseTDR>1</bUseTDR> + <Flash2>BIN\UL2CM3.DLL</Flash2> + <Flash3>"" ()</Flash3> + <Flash4></Flash4> + <pFcarmOut></pFcarmOut> + <pFcarmGrp></pFcarmGrp> + <pFcArmRoot></pFcArmRoot> + <FcArmLst>0</FcArmLst> + </Utilities> + <TargetArmAds> + <ArmAdsMisc> + <GenerateListings>0</GenerateListings> + <asHll>1</asHll> + <asAsm>1</asAsm> + <asMacX>1</asMacX> + <asSyms>1</asSyms> + <asFals>1</asFals> + <asDbgD>1</asDbgD> + <asForm>1</asForm> + <ldLst>0</ldLst> + <ldmm>1</ldmm> + <ldXref>1</ldXref> + <BigEnd>0</BigEnd> + <AdsALst>1</AdsALst> + <AdsACrf>1</AdsACrf> + <AdsANop>0</AdsANop> + <AdsANot>0</AdsANot> + <AdsLLst>1</AdsLLst> + <AdsLmap>1</AdsLmap> + <AdsLcgr>1</AdsLcgr> + <AdsLsym>1</AdsLsym> + <AdsLszi>1</AdsLszi> + <AdsLtoi>1</AdsLtoi> + <AdsLsun>1</AdsLsun> + <AdsLven>1</AdsLven> + <AdsLsxf>1</AdsLsxf> + <RvctClst>0</RvctClst> + <GenPPlst>0</GenPPlst> + <AdsCpuType>"Cortex-M4"</AdsCpuType> + <RvctDeviceName></RvctDeviceName> + <mOS>0</mOS> + <uocRom>0</uocRom> + <uocRam>0</uocRam> + <hadIROM>1</hadIROM> + <hadIRAM>1</hadIRAM> + <hadXRAM>0</hadXRAM> + <uocXRam>0</uocXRam> + <RvdsVP>2</RvdsVP> + <RvdsMve>0</RvdsMve> + <hadIRAM2>0</hadIRAM2> + <hadIROM2>0</hadIROM2> + <StupSel>8</StupSel> + <useUlib>1</useUlib> + <EndSel>0</EndSel> + <uLtcg>0</uLtcg> + <nSecure>0</nSecure> + <RoSelD>3</RoSelD> + <RwSelD>3</RwSelD> + <CodeSel>0</CodeSel> + <OptFeed>0</OptFeed> + <NoZi1>0</NoZi1> + <NoZi2>0</NoZi2> + <NoZi3>0</NoZi3> + <NoZi4>0</NoZi4> + <NoZi5>0</NoZi5> + <Ro1Chk>0</Ro1Chk> + <Ro2Chk>0</Ro2Chk> + <Ro3Chk>0</Ro3Chk> + <Ir1Chk>1</Ir1Chk> + <Ir2Chk>0</Ir2Chk> + <Ra1Chk>0</Ra1Chk> + <Ra2Chk>0</Ra2Chk> + <Ra3Chk>0</Ra3Chk> + <Im1Chk>1</Im1Chk> + <Im2Chk>0</Im2Chk> + <OnChipMemories> + <Ocm1> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm1> + <Ocm2> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm2> + <Ocm3> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm3> + <Ocm4> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm4> + <Ocm5> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm5> + <Ocm6> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </Ocm6> + <IRAM> + <Type>0</Type> + <StartAddress>0x20000000</StartAddress> + <Size>0x80000</Size> + </IRAM> + <IROM> + <Type>1</Type> + <StartAddress>0x10000000</StartAddress> + <Size>0x100000</Size> + </IROM> + <XRAM> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </XRAM> + <OCR_RVCT1> + <Type>1</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT1> + <OCR_RVCT2> + <Type>1</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT2> + <OCR_RVCT3> + <Type>1</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT3> + <OCR_RVCT4> + <Type>1</Type> + <StartAddress>0x10000000</StartAddress> + <Size>0x100000</Size> + </OCR_RVCT4> + <OCR_RVCT5> + <Type>1</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT5> + <OCR_RVCT6> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT6> + <OCR_RVCT7> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT7> + <OCR_RVCT8> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT8> + <OCR_RVCT9> + <Type>0</Type> + <StartAddress>0x20000000</StartAddress> + <Size>0x80000</Size> + </OCR_RVCT9> + <OCR_RVCT10> + <Type>0</Type> + <StartAddress>0x0</StartAddress> + <Size>0x0</Size> + </OCR_RVCT10> + </OnChipMemories> + <RvctStartVector></RvctStartVector> + </ArmAdsMisc> + <Cads> + <interw>1</interw> + <Optim>1</Optim> + <oTime>0</oTime> + <SplitLS>0</SplitLS> + <OneElfS>1</OneElfS> + <Strict>0</Strict> + <EnumInt>0</EnumInt> + <PlainCh>0</PlainCh> + <Ropi>0</Ropi> + <Rwpi>0</Rwpi> + <wLevel>2</wLevel> + <uThumb>0</uThumb> + <uSurpInc>0</uSurpInc> + <uC99>1</uC99> + <uGnu>0</uGnu> + <useXO>0</useXO> + <v6Lang>1</v6Lang> + <v6LangP>1</v6LangP> + <vShortEn>1</vShortEn> + <vShortWch>1</vShortWch> + <v6Lto>0</v6Lto> + <v6WtE>0</v6WtE> + <v6Rtti>0</v6Rtti> + <VariousControls> + <MiscControls></MiscControls> + <Define></Define> + <Undefine></Undefine> + <IncludePath></IncludePath> + </VariousControls> + </Cads> + <Aads> + <interw>1</interw> + <Ropi>0</Ropi> + <Rwpi>0</Rwpi> + <thumb>0</thumb> + <SplitLS>0</SplitLS> + <SwStkChk>0</SwStkChk> + <NoWarn>0</NoWarn> + <uSurpInc>0</uSurpInc> + <useXO>0</useXO> + <uClangAs>0</uClangAs> + <VariousControls> + <MiscControls></MiscControls> + <Define></Define> + <Undefine></Undefine> + <IncludePath></IncludePath> + </VariousControls> + </Aads> + <LDads> + <umfTarg>0</umfTarg> + <Ropi>0</Ropi> + <Rwpi>0</Rwpi> + <noStLib>0</noStLib> + <RepFail>1</RepFail> + <useFile>0</useFile> + <TextAddressRange>0x10000000</TextAddressRange> + <DataAddressRange>0x20000000</DataAddressRange> + <pXoBase></pXoBase> + <ScatterFile>.\ble_sdma.sct</ScatterFile> + <IncludeLibs></IncludeLibs> + <IncludeLibsPath></IncludeLibsPath> + <Misc></Misc> + <LinkerInputFile></LinkerInputFile> + <DisabledWarnings></DisabledWarnings> + </LDads> + </TargetArmAds> + </TargetOption> + <Groups> + <Group> + <GroupName>Source</GroupName> + <Files> + <File> + <FileName>main.c</FileName> + <FileType>1</FileType> + <FilePath>..\main.c</FilePath> + </File> + <File> + <FileName>Abstract.txt</FileName> + <FileType>5</FileType> + <FilePath>.\Abstract.txt</FilePath> + </File> + <File> + <FileName>hci_tr.c</FileName> + <FileType>1</FileType> + <FilePath>..\hci_tr.c</FilePath> + </File> + </Files> + </Group> + <Group> + <GroupName>::BSP</GroupName> + </Group> + <Group> + <GroupName>::Bluetooth</GroupName> + </Group> + <Group> + <GroupName>::CMSIS</GroupName> + </Group> + <Group> + <GroupName>::Device</GroupName> + </Group> + </Groups> + </Target> + </Targets> + + <RTE> + <apis/> + <components> + <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2" condition="ARMv6_7_8-M Device"> + <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="MAX32665 BSP" Cclass="BSP" Cgroup="EvKit V1" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 BSP DEP"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="GPIO" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 CMSIS GPIO"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 Family"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Timers" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 CMSIS TIMER"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="UART" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 CMSIS UART"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="XiP Flash" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 CMSIS SPI XIP FLASH"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + <component Cbundle="Maxim BTLE" Cclass="Bluetooth" Cgroup="Bluetooth LE - HCI UART" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 Family"> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </component> + </components> + <files> + <file attr="config" category="header" name="Libraries\Device\Maxim\MAX32665\Include\max32665.h" version="0.2.6-e"> + <instance index="0" removed="1">RTE\Device\MAX32665\max32665.h</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.2.6-e" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.2.6-e"/> + <targetInfos/> + </file> + <file attr="config" category="sourceAsm" condition="Startup ARM" name="Libraries\Device\Maxim\MAX32665\Source\ARM\startup_max32665.s" version="0.2.6-e"> + <instance index="0" removed="1">RTE\Device\MAX32665\startup_max32665.s</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.2.6-e" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.2.6-e"/> + <targetInfos/> + </file> + <file attr="config" category="sourceC" condition="Startup ARM" name="Libraries\Device\Maxim\MAX32665\Source\ARM\sub_main.c" version="0.2.6-e"> + <instance index="0" removed="1">RTE\Device\MAX32665\sub_main.c</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.2.6-e" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.2.6-e"/> + <targetInfos/> + </file> + <file attr="config" category="sourceC" name="Libraries\Device\Maxim\MAX32665\Source\system_max32665.c" version="0.2.6-e"> + <instance index="0" removed="1">RTE\Device\MAX32665\system_max32665.c</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.2.6-e" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.2.6-e"/> + <targetInfos/> + </file> + <file attr="config" category="header" name="Libraries\Device\Maxim\MAX32665\Include\max32665.h" version="0.3.0"> + <instance index="0">RTE\Device\MAX32665_Cortex-M4\max32665.h</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </file> + <file attr="config" category="sourceAsm" condition="Startup ARM" name="Libraries\Device\Maxim\MAX32665\Source\ARM\startup_max32665.s" version="0.3.0"> + <instance index="0">RTE\Device\MAX32665_Cortex-M4\startup_max32665.s</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </file> + <file attr="config" category="sourceC" name="Libraries\Device\Maxim\MAX32665\Source\system_max32665.c" version="0.3.0"> + <instance index="0">RTE\Device\MAX32665_Cortex-M4\system_max32665.c</instance> + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.3.0" condition="MAX32665 Family"/> + <package license="License/END_USER_LICENSE_AGREEMENT.rtf" name="MAX32665" schemaVersion="1.3" supportContact="support@maximintegrated.com" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + <targetInfos> + <targetInfo name="Flash Debug"/> + </targetInfos> + </file> + </files> + </RTE> + +</Project> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/ble_sdma.sct b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/ble_sdma.sct new file mode 100644 index 0000000000000000000000000000000000000000..ecc0540cbb900f73a30f81808151c203b842a305 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/ARM/ble_sdma.sct @@ -0,0 +1,45 @@ +#! armcc -E +#include "./RTE/_Flash_Debug/RTE_Components.h" + +LR_IROM1 0x10000000 0x00100000 { ; load region size_region + ER_IROM1 0x10000000 0x00100000 { ; load address = execution address + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + + #if BLE_SDMA + ER_OTP 0x20000000 0x00000040 { + .ANY (.otp) + } + ER_ARM_SHARED 0x20000040 0x00000200{ + .ANY (.arm_shared) + } + ER_SDMA_SHARED 0x20000240 0x00000200{ + .ANY (.sdma_shared) + } + #if BLE_SDMA_ADV + ER_SDMA 0x20000440 0x00027000{ + .ANY (.sdma_code) + } + RW_IRAM1 0x20027440 0x00058BC0 { ; RW data + .ANY (+RW +ZI) + } + #else + ER_SDMA 0x20000440 0x0002E000{ + .ANY (.sdma_code) + } + RW_IRAM1 0x2002E440 0x00051BC0 { ; RW data + .ANY (+RW +ZI) + } + #endif +#else + + RW_IRAM1 0x20000000 0x00080000 { ; RW data + .ANY (+RW +ZI) + } +#endif +} + + \ No newline at end of file diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/BLE_hci_uart.launch b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/BLE_hci_uart.launch new file mode 100644 index 0000000000000000000000000000000000000000..91811968a7da21800744077d5774b4f028e75475 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/BLE_hci_uart.launch @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.openocd.launchConfigurationType"> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doContinue" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.firstResetType" value="init"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="openocd"/> +<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerOther" value="-s ${env_var:TOOLCHAIN_PATH}/share/openocd/scripts -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f interface/ftdi/olimex-arm-jtag-swd.cfg -f target/max32665.cfg"/> +<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherRunCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.secondResetType" value="halt"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM OpenOCD"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> +<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> +<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> +<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> +<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/max32665.elf"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="BLE_hci_uart"/> +<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/BLE_hci_uart"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> +</listAttribute> +<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"> <memoryBlockExpression address="536918388" label="0x2000b974"/> </memoryBlockExpressionList> "/> +<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> +</launchConfiguration> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewd b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewd new file mode 100644 index 0000000000000000000000000000000000000000..13b6b1c0b8a3bc044a5d7274d48c1e631a48f7cd --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewd @@ -0,0 +1,2948 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <fileVersion>3</fileVersion> + <configuration> + <name>Debug</name> + <toolchain> + <name>ARM</name> + </toolchain> + <debug>1</debug> + <settings> + <name>C-SPY</name> + <archiveVersion>2</archiveVersion> + <data> + <version>30</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>CInput</name> + <state>1</state> + </option> + <option> + <name>CEndian</name> + <state>1</state> + </option> + <option> + <name>CProcessor</name> + <state>1</state> + </option> + <option> + <name>OCVariant</name> + <state>0</state> + </option> + <option> + <name>MacOverride</name> + <state>0</state> + </option> + <option> + <name>MacFile</name> + <state></state> + </option> + <option> + <name>MemOverride</name> + <state>0</state> + </option> + <option> + <name>MemFile</name> + <state>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\.iar\config\debugger\MAX32665.ddf</state> + </option> + <option> + <name>RunToEnable</name> + <state>1</state> + </option> + <option> + <name>RunToName</name> + <state>main</state> + </option> + <option> + <name>CExtraOptionsCheck</name> + <state>0</state> + </option> + <option> + <name>CExtraOptions</name> + <state></state> + </option> + <option> + <name>CFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>OCDDFArgumentProducer</name> + <state></state> + </option> + <option> + <name>OCDownloadSuppressDownload</name> + <state>0</state> + </option> + <option> + <name>OCDownloadVerifyAll</name> + <state>0</state> + </option> + <option> + <name>OCProductVersion</name> + <state>8.30.1.17146</state> + </option> + <option> + <name>OCDynDriverList</name> + <state>CMSISDAP_ID</state> + </option> + <option> + <name>OCLastSavedByProductVersion</name> + <state>8.30.1.17146</state> + </option> + <option> + <name>UseFlashLoader</name> + <state>1</state> + </option> + <option> + <name>CLowLevel</name> + <state>1</state> + </option> + <option> + <name>OCBE8Slave</name> + <state>1</state> + </option> + <option> + <name>MacFile2</name> + <state></state> + </option> + <option> + <name>CDevice</name> + <state>1</state> + </option> + <option> + <name>FlashLoadersV3</name> + <state>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\.iar\config\flashloader\FlashMAX32665.board</state> + </option> + <option> + <name>OCImagesSuppressCheck1</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath1</name> + <state></state> + </option> + <option> + <name>OCImagesSuppressCheck2</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath2</name> + <state></state> + </option> + <option> + <name>OCImagesSuppressCheck3</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath3</name> + <state></state> + </option> + <option> + <name>OverrideDefFlashBoard</name> + <state>0</state> + </option> + <option> + <name>OCImagesOffset1</name> + <state></state> + </option> + <option> + <name>OCImagesOffset2</name> + <state></state> + </option> + <option> + <name>OCImagesOffset3</name> + <state></state> + </option> + <option> + <name>OCImagesUse1</name> + <state>0</state> + </option> + <option> + <name>OCImagesUse2</name> + <state>0</state> + </option> + <option> + <name>OCImagesUse3</name> + <state>0</state> + </option> + <option> + <name>OCDeviceConfigMacroFile</name> + <state>1</state> + </option> + <option> + <name>OCDebuggerExtraOption</name> + <state>1</state> + </option> + <option> + <name>OCAllMTBOptions</name> + <state>1</state> + </option> + <option> + <name>OCMulticoreNrOfCores</name> + <state>1</state> + </option> + <option> + <name>OCMulticoreMaster</name> + <state>0</state> + </option> + <option> + <name>OCMulticorePort</name> + <state>53461</state> + </option> + <option> + <name>OCMulticoreWorkspace</name> + <state></state> + </option> + <option> + <name>OCMulticoreSlaveProject</name> + <state></state> + </option> + <option> + <name>OCMulticoreSlaveConfiguration</name> + <state></state> + </option> + <option> + <name>OCDownloadExtraImage</name> + <state>1</state> + </option> + <option> + <name>OCAttachSlave</name> + <state>0</state> + </option> + <option> + <name>MassEraseBeforeFlashing</name> + <state>0</state> + </option> + <option> + <name>OCMulticoreNrOfCoresSlave</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>ARMSIM_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCSimDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCSimEnablePSP</name> + <state>0</state> + </option> + <option> + <name>OCSimPspOverrideConfig</name> + <state>0</state> + </option> + <option> + <name>OCSimPspConfigFile</name> + <state></state> + </option> + </data> + </settings> + <settings> + <name>CADI_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>CCadiMemory</name> + <state>1</state> + </option> + <option> + <name>Fast Model</name> + <state></state> + </option> + <option> + <name>CCADILogFileCheck</name> + <state>0</state> + </option> + <option> + <name>CCADILogFileEditB</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>CMSISDAP_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>4</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCIarProbeScriptFile</name> + <state>1</state> + </option> + <option> + <name>CMSISDAPResetList</name> + <version>1</version> + <state>2</state> + </option> + <option> + <name>CMSISDAPHWResetDuration</name> + <state>300</state> + </option> + <option> + <name>CMSISDAPHWResetDelay</name> + <state>200</state> + </option> + <option> + <name>CMSISDAPDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CMSISDAPInterfaceRadio</name> + <state>1</state> + </option> + <option> + <name>CMSISDAPInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiTargetEnable</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPJtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CMSISDAPBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPRestoreBreakpointsCheck</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPUpdateBreakpointsEdit</name> + <state>_call_main</state> + </option> + <option> + <name>RDICatchReset</name> + <state>0</state> + </option> + <option> + <name>RDICatchUndef</name> + <state>1</state> + </option> + <option> + <name>RDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>RDICatchData</name> + <state>1</state> + </option> + <option> + <name>RDICatchPrefetch</name> + <state>1</state> + </option> + <option> + <name>RDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>RDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CatchMMERR</name> + <state>1</state> + </option> + <option> + <name>CatchNOCPERR</name> + <state>1</state> + </option> + <option> + <name>CatchCHKERR</name> + <state>1</state> + </option> + <option> + <name>CatchSTATERR</name> + <state>1</state> + </option> + <option> + <name>CatchBUSERR</name> + <state>1</state> + </option> + <option> + <name>CatchINTERR</name> + <state>1</state> + </option> + <option> + <name>CatchSFERR</name> + <state>1</state> + </option> + <option> + <name>CatchHARDERR</name> + <state>1</state> + </option> + <option> + <name>CatchDummy</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiCPUEnable</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiCPUNumber</name> + <state>0</state> + </option> + <option> + <name>OCProbeCfgOverride</name> + <state>0</state> + </option> + <option> + <name>OCProbeConfig</name> + <state></state> + </option> + <option> + <name>CMSISDAPProbeConfigRadio</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPSelectedCPUBehaviour</name> + <state></state> + </option> + <option> + <name>ICpuName</name> + <state></state> + </option> + <option> + <name>OCJetEmuParams</name> + <state>1</state> + </option> + <option> + <name>CCCMSISDAPUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCCMSISDAPUsbSerialNoSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>GDBSERVER_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>TCPIP</name> + <state>aaa.bbb.ccc.ddd</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCJTagBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCJTagDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCJTagUpdateBreakpoints</name> + <state>_call_main</state> + </option> + </data> + </settings> + <settings> + <name>IJET_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>8</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCIarProbeScriptFile</name> + <state>1</state> + </option> + <option> + <name>IjetResetList</name> + <version>1</version> + <state>10</state> + </option> + <option> + <name>IjetHWResetDuration</name> + <state>300</state> + </option> + <option> + <name>IjetHWResetDelay</name> + <state>200</state> + </option> + <option> + <name>IjetPowerFromProbe</name> + <state>1</state> + </option> + <option> + <name>IjetPowerRadio</name> + <state>0</state> + </option> + <option> + <name>IjetDoLogfile</name> + <state>0</state> + </option> + <option> + <name>IjetLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>IjetInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>IjetInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>IjetMultiTargetEnable</name> + <state>0</state> + </option> + <option> + <name>IjetMultiTarget</name> + <state>0</state> + </option> + <option> + <name>IjetScanChainNonARMDevices</name> + <state>0</state> + </option> + <option> + <name>IjetIRLength</name> + <state>0</state> + </option> + <option> + <name>IjetJtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IjetProtocolRadio</name> + <state>0</state> + </option> + <option> + <name>IjetSwoPin</name> + <state>0</state> + </option> + <option> + <name>IjetCpuClockEdit</name> + <state></state> + </option> + <option> + <name>IjetSwoPrescalerList</name> + <version>1</version> + <state>0</state> + </option> + <option> + <name>IjetBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>IjetRestoreBreakpointsCheck</name> + <state>0</state> + </option> + <option> + <name>IjetUpdateBreakpointsEdit</name> + <state>_call_main</state> + </option> + <option> + <name>RDICatchReset</name> + <state>0</state> + </option> + <option> + <name>RDICatchUndef</name> + <state>1</state> + </option> + <option> + <name>RDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>RDICatchData</name> + <state>1</state> + </option> + <option> + <name>RDICatchPrefetch</name> + <state>1</state> + </option> + <option> + <name>RDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>RDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CatchMMERR</name> + <state>1</state> + </option> + <option> + <name>CatchNOCPERR</name> + <state>1</state> + </option> + <option> + <name>CatchCHKERR</name> + <state>1</state> + </option> + <option> + <name>CatchSTATERR</name> + <state>1</state> + </option> + <option> + <name>CatchBUSERR</name> + <state>1</state> + </option> + <option> + <name>CatchINTERR</name> + <state>1</state> + </option> + <option> + <name>CatchSFERR</name> + <state>1</state> + </option> + <option> + <name>CatchHARDERR</name> + <state>1</state> + </option> + <option> + <name>CatchDummy</name> + <state>0</state> + </option> + <option> + <name>OCProbeCfgOverride</name> + <state>0</state> + </option> + <option> + <name>OCProbeConfig</name> + <state></state> + </option> + <option> + <name>IjetProbeConfigRadio</name> + <state>0</state> + </option> + <option> + <name>IjetMultiCPUEnable</name> + <state>0</state> + </option> + <option> + <name>IjetMultiCPUNumber</name> + <state>0</state> + </option> + <option> + <name>IjetSelectedCPUBehaviour</name> + <state>0</state> + </option> + <option> + <name>ICpuName</name> + <state></state> + </option> + <option> + <name>OCJetEmuParams</name> + <state>1</state> + </option> + <option> + <name>IjetPreferETB</name> + <state>1</state> + </option> + <option> + <name>IjetTraceSettingsList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IjetTraceSizeList</name> + <version>0</version> + <state>4</state> + </option> + <option> + <name>FlashBoardPathSlave</name> + <state>0</state> + </option> + <option> + <name>CCIjetUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCIjetUsbSerialNoSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>JLINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>16</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>JLinkSpeed</name> + <state>1000</state> + </option> + <option> + <name>CCJLinkDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCJLinkLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCJLinkHWResetDelay</name> + <state>0</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>JLinkInitialSpeed</name> + <state>1000</state> + </option> + <option> + <name>CCDoJlinkMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CCScanChainNonARMDevices</name> + <state>0</state> + </option> + <option> + <name>CCJLinkMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CCJLinkIRLength</name> + <state>0</state> + </option> + <option> + <name>CCJLinkCommRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkTCPIP</name> + <state>aaa.bbb.ccc.ddd</state> + </option> + <option> + <name>CCJLinkSpeedRadioV2</name> + <state>0</state> + </option> + <option> + <name>CCUSBDevice</name> + <version>1</version> + <state>1</state> + </option> + <option> + <name>CCRDICatchReset</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchUndef</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchData</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchPrefetch</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CCJLinkBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCJLinkUpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCJLinkInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkResetList</name> + <version>6</version> + <state>5</state> + </option> + <option> + <name>CCJLinkInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCCatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCCatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchDummy</name> + <state>0</state> + </option> + <option> + <name>OCJLinkScriptFile</name> + <state>1</state> + </option> + <option> + <name>CCJLinkUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCTcpIpAlt</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCJLinkTcpIpSerialNo</name> + <state></state> + </option> + <option> + <name>CCCpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCSwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCSwoClockEdit</name> + <state>2000</state> + </option> + <option> + <name>OCJLinkTraceSource</name> + <state>0</state> + </option> + <option> + <name>OCJLinkTraceSourceDummy</name> + <state>0</state> + </option> + <option> + <name>OCJLinkDeviceName</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>LMIFTDI_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>2</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>LmiftdiSpeed</name> + <state>500</state> + </option> + <option> + <name>CCLmiftdiDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCLmiftdiLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCLmiFtdiInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCLmiFtdiInterfaceCmdLine</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>NULINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + </data> + </settings> + <settings> + <name>PEMICRO_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>3</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCJPEMicroShowSettings</name> + <state>0</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + </data> + </settings> + <settings> + <name>STLINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>5</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCSTLinkInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkResetList</name> + <version>3</version> + <state>0</state> + </option> + <option> + <name>CCCpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCSwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCSwoClockEdit</name> + <state>2000</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCSTLinkDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCSTLinkCatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchDummy</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCSTLinkUsbSerialNoSelect</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkJtagSpeedList</name> + <version>1</version> + <state>0</state> + </option> + <option> + <name>CCSTLinkDAPNumber</name> + <state></state> + </option> + <option> + <name>CCSTLinkDebugAccessPortRadio</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUseServerSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>THIRDPARTY_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>CThirdPartyDriverDll</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>CThirdPartyLogFileCheck</name> + <state>0</state> + </option> + <option> + <name>CThirdPartyLogFileEditB</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>TIFET_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetResetList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCMSPFetInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetTargetVccTypeDefault</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetTargetVoltage</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>CCMSPFetVCCDefault</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetTargetSettlingtime</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetRadioJtagSpeedType</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetConnection</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCMSPFetUsbComPort</name> + <state>Automatic</state> + </option> + <option> + <name>CCMSPFetAllowAccessToBSL</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCMSPFetRadioEraseFlash</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>XDS100_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>8</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>TIPackageOverride</name> + <state>0</state> + </option> + <option> + <name>TIPackage</name> + <state></state> + </option> + <option> + <name>BoardFile</name> + <state></state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCXds100BreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCXds100DoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCXds100UpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCXds100CatchReset</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchUndef</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSWI</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchData</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchPrefetch</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchIRQ</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchDummy</name> + <state>0</state> + </option> + <option> + <name>CCXds100CpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCXds100SwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCXds100SwoClockEdit</name> + <state>1000</state> + </option> + <option> + <name>CCXds100HWResetDelay</name> + <state>0</state> + </option> + <option> + <name>CCXds100ResetList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCXds100UsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCXds100UsbSerialNoSelect</name> + <state>0</state> + </option> + <option> + <name>CCXds100JtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCXds100InterfaceRadio</name> + <state>2</state> + </option> + <option> + <name>CCXds100InterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCXds100ProbeList</name> + <version>0</version> + <state>2</state> + </option> + <option> + <name>CCXds100SWOPortRadio</name> + <state>0</state> + </option> + <option> + <name>CCXds100SWOPort</name> + <state>1</state> + </option> + <option> + <name>CCXDSTargetVccEnable</name> + <state>0</state> + </option> + <option> + <name>CCXDSTargetVoltage</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>OCXDSDigitalStatesConfigFile</name> + <state>1</state> + </option> + </data> + </settings> + <debuggerPlugins> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\FreeRtos\FreeRtosArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin2.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8BE.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file> + <loadFlag>1</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + </debuggerPlugins> + </configuration> + <configuration> + <name>Release</name> + <toolchain> + <name>ARM</name> + </toolchain> + <debug>0</debug> + <settings> + <name>C-SPY</name> + <archiveVersion>2</archiveVersion> + <data> + <version>30</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>CInput</name> + <state>1</state> + </option> + <option> + <name>CEndian</name> + <state>1</state> + </option> + <option> + <name>CProcessor</name> + <state>1</state> + </option> + <option> + <name>OCVariant</name> + <state>0</state> + </option> + <option> + <name>MacOverride</name> + <state>0</state> + </option> + <option> + <name>MacFile</name> + <state></state> + </option> + <option> + <name>MemOverride</name> + <state>0</state> + </option> + <option> + <name>MemFile</name> + <state></state> + </option> + <option> + <name>RunToEnable</name> + <state>1</state> + </option> + <option> + <name>RunToName</name> + <state>main</state> + </option> + <option> + <name>CExtraOptionsCheck</name> + <state>0</state> + </option> + <option> + <name>CExtraOptions</name> + <state></state> + </option> + <option> + <name>CFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>OCDDFArgumentProducer</name> + <state></state> + </option> + <option> + <name>OCDownloadSuppressDownload</name> + <state>0</state> + </option> + <option> + <name>OCDownloadVerifyAll</name> + <state>0</state> + </option> + <option> + <name>OCProductVersion</name> + <state>8.30.1.17146</state> + </option> + <option> + <name>OCDynDriverList</name> + <state>ARMSIM_ID</state> + </option> + <option> + <name>OCLastSavedByProductVersion</name> + <state></state> + </option> + <option> + <name>UseFlashLoader</name> + <state>1</state> + </option> + <option> + <name>CLowLevel</name> + <state>1</state> + </option> + <option> + <name>OCBE8Slave</name> + <state>1</state> + </option> + <option> + <name>MacFile2</name> + <state></state> + </option> + <option> + <name>CDevice</name> + <state>1</state> + </option> + <option> + <name>FlashLoadersV3</name> + <state></state> + </option> + <option> + <name>OCImagesSuppressCheck1</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath1</name> + <state></state> + </option> + <option> + <name>OCImagesSuppressCheck2</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath2</name> + <state></state> + </option> + <option> + <name>OCImagesSuppressCheck3</name> + <state>0</state> + </option> + <option> + <name>OCImagesPath3</name> + <state></state> + </option> + <option> + <name>OverrideDefFlashBoard</name> + <state>0</state> + </option> + <option> + <name>OCImagesOffset1</name> + <state></state> + </option> + <option> + <name>OCImagesOffset2</name> + <state></state> + </option> + <option> + <name>OCImagesOffset3</name> + <state></state> + </option> + <option> + <name>OCImagesUse1</name> + <state>0</state> + </option> + <option> + <name>OCImagesUse2</name> + <state>0</state> + </option> + <option> + <name>OCImagesUse3</name> + <state>0</state> + </option> + <option> + <name>OCDeviceConfigMacroFile</name> + <state>1</state> + </option> + <option> + <name>OCDebuggerExtraOption</name> + <state>1</state> + </option> + <option> + <name>OCAllMTBOptions</name> + <state>1</state> + </option> + <option> + <name>OCMulticoreNrOfCores</name> + <state></state> + </option> + <option> + <name>OCMulticoreMaster</name> + <state>0</state> + </option> + <option> + <name>OCMulticorePort</name> + <state>53461</state> + </option> + <option> + <name>OCMulticoreWorkspace</name> + <state></state> + </option> + <option> + <name>OCMulticoreSlaveProject</name> + <state></state> + </option> + <option> + <name>OCMulticoreSlaveConfiguration</name> + <state></state> + </option> + <option> + <name>OCDownloadExtraImage</name> + <state>1</state> + </option> + <option> + <name>OCAttachSlave</name> + <state>0</state> + </option> + <option> + <name>MassEraseBeforeFlashing</name> + <state>0</state> + </option> + <option> + <name>OCMulticoreNrOfCoresSlave</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>ARMSIM_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCSimDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCSimEnablePSP</name> + <state>0</state> + </option> + <option> + <name>OCSimPspOverrideConfig</name> + <state>0</state> + </option> + <option> + <name>OCSimPspConfigFile</name> + <state></state> + </option> + </data> + </settings> + <settings> + <name>CADI_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>CCadiMemory</name> + <state>1</state> + </option> + <option> + <name>Fast Model</name> + <state></state> + </option> + <option> + <name>CCADILogFileCheck</name> + <state>0</state> + </option> + <option> + <name>CCADILogFileEditB</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>CMSISDAP_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>4</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCIarProbeScriptFile</name> + <state>1</state> + </option> + <option> + <name>CMSISDAPResetList</name> + <version>1</version> + <state>10</state> + </option> + <option> + <name>CMSISDAPHWResetDuration</name> + <state>300</state> + </option> + <option> + <name>CMSISDAPHWResetDelay</name> + <state>200</state> + </option> + <option> + <name>CMSISDAPDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CMSISDAPInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiTargetEnable</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPJtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CMSISDAPBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPRestoreBreakpointsCheck</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPUpdateBreakpointsEdit</name> + <state>_call_main</state> + </option> + <option> + <name>RDICatchReset</name> + <state>0</state> + </option> + <option> + <name>RDICatchUndef</name> + <state>1</state> + </option> + <option> + <name>RDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>RDICatchData</name> + <state>1</state> + </option> + <option> + <name>RDICatchPrefetch</name> + <state>1</state> + </option> + <option> + <name>RDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>RDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CatchMMERR</name> + <state>1</state> + </option> + <option> + <name>CatchNOCPERR</name> + <state>1</state> + </option> + <option> + <name>CatchCHKERR</name> + <state>1</state> + </option> + <option> + <name>CatchSTATERR</name> + <state>1</state> + </option> + <option> + <name>CatchBUSERR</name> + <state>1</state> + </option> + <option> + <name>CatchINTERR</name> + <state>1</state> + </option> + <option> + <name>CatchSFERR</name> + <state>1</state> + </option> + <option> + <name>CatchHARDERR</name> + <state>1</state> + </option> + <option> + <name>CatchDummy</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiCPUEnable</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPMultiCPUNumber</name> + <state>0</state> + </option> + <option> + <name>OCProbeCfgOverride</name> + <state>0</state> + </option> + <option> + <name>OCProbeConfig</name> + <state></state> + </option> + <option> + <name>CMSISDAPProbeConfigRadio</name> + <state>0</state> + </option> + <option> + <name>CMSISDAPSelectedCPUBehaviour</name> + <state>0</state> + </option> + <option> + <name>ICpuName</name> + <state></state> + </option> + <option> + <name>OCJetEmuParams</name> + <state>1</state> + </option> + <option> + <name>CCCMSISDAPUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCCMSISDAPUsbSerialNoSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>GDBSERVER_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>TCPIP</name> + <state>aaa.bbb.ccc.ddd</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCJTagBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCJTagDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCJTagUpdateBreakpoints</name> + <state>_call_main</state> + </option> + </data> + </settings> + <settings> + <name>IJET_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>8</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>OCIarProbeScriptFile</name> + <state>1</state> + </option> + <option> + <name>IjetResetList</name> + <version>1</version> + <state>10</state> + </option> + <option> + <name>IjetHWResetDuration</name> + <state>300</state> + </option> + <option> + <name>IjetHWResetDelay</name> + <state>200</state> + </option> + <option> + <name>IjetPowerFromProbe</name> + <state>1</state> + </option> + <option> + <name>IjetPowerRadio</name> + <state>0</state> + </option> + <option> + <name>IjetDoLogfile</name> + <state>0</state> + </option> + <option> + <name>IjetLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>IjetInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>IjetInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>IjetMultiTargetEnable</name> + <state>0</state> + </option> + <option> + <name>IjetMultiTarget</name> + <state>0</state> + </option> + <option> + <name>IjetScanChainNonARMDevices</name> + <state>0</state> + </option> + <option> + <name>IjetIRLength</name> + <state>0</state> + </option> + <option> + <name>IjetJtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IjetProtocolRadio</name> + <state>0</state> + </option> + <option> + <name>IjetSwoPin</name> + <state>0</state> + </option> + <option> + <name>IjetCpuClockEdit</name> + <state></state> + </option> + <option> + <name>IjetSwoPrescalerList</name> + <version>1</version> + <state>0</state> + </option> + <option> + <name>IjetBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>IjetRestoreBreakpointsCheck</name> + <state>0</state> + </option> + <option> + <name>IjetUpdateBreakpointsEdit</name> + <state>_call_main</state> + </option> + <option> + <name>RDICatchReset</name> + <state>0</state> + </option> + <option> + <name>RDICatchUndef</name> + <state>1</state> + </option> + <option> + <name>RDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>RDICatchData</name> + <state>1</state> + </option> + <option> + <name>RDICatchPrefetch</name> + <state>1</state> + </option> + <option> + <name>RDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>RDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CatchMMERR</name> + <state>1</state> + </option> + <option> + <name>CatchNOCPERR</name> + <state>1</state> + </option> + <option> + <name>CatchCHKERR</name> + <state>1</state> + </option> + <option> + <name>CatchSTATERR</name> + <state>1</state> + </option> + <option> + <name>CatchBUSERR</name> + <state>1</state> + </option> + <option> + <name>CatchINTERR</name> + <state>1</state> + </option> + <option> + <name>CatchSFERR</name> + <state>1</state> + </option> + <option> + <name>CatchHARDERR</name> + <state>1</state> + </option> + <option> + <name>CatchDummy</name> + <state>0</state> + </option> + <option> + <name>OCProbeCfgOverride</name> + <state>0</state> + </option> + <option> + <name>OCProbeConfig</name> + <state></state> + </option> + <option> + <name>IjetProbeConfigRadio</name> + <state>0</state> + </option> + <option> + <name>IjetMultiCPUEnable</name> + <state>0</state> + </option> + <option> + <name>IjetMultiCPUNumber</name> + <state>0</state> + </option> + <option> + <name>IjetSelectedCPUBehaviour</name> + <state>0</state> + </option> + <option> + <name>ICpuName</name> + <state></state> + </option> + <option> + <name>OCJetEmuParams</name> + <state>1</state> + </option> + <option> + <name>IjetPreferETB</name> + <state>1</state> + </option> + <option> + <name>IjetTraceSettingsList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IjetTraceSizeList</name> + <version>0</version> + <state>4</state> + </option> + <option> + <name>FlashBoardPathSlave</name> + <state>0</state> + </option> + <option> + <name>CCIjetUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCIjetUsbSerialNoSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>JLINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>16</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>JLinkSpeed</name> + <state>1000</state> + </option> + <option> + <name>CCJLinkDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCJLinkLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCJLinkHWResetDelay</name> + <state>0</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>JLinkInitialSpeed</name> + <state>1000</state> + </option> + <option> + <name>CCDoJlinkMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CCScanChainNonARMDevices</name> + <state>0</state> + </option> + <option> + <name>CCJLinkMultiTarget</name> + <state>0</state> + </option> + <option> + <name>CCJLinkIRLength</name> + <state>0</state> + </option> + <option> + <name>CCJLinkCommRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkTCPIP</name> + <state>aaa.bbb.ccc.ddd</state> + </option> + <option> + <name>CCJLinkSpeedRadioV2</name> + <state>0</state> + </option> + <option> + <name>CCUSBDevice</name> + <version>1</version> + <state>1</state> + </option> + <option> + <name>CCRDICatchReset</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchUndef</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchSWI</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchData</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchPrefetch</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchIRQ</name> + <state>0</state> + </option> + <option> + <name>CCRDICatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CCJLinkBreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCJLinkUpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCJLinkInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCJLinkResetList</name> + <version>6</version> + <state>5</state> + </option> + <option> + <name>CCJLinkInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCCatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCCatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCCatchDummy</name> + <state>0</state> + </option> + <option> + <name>OCJLinkScriptFile</name> + <state>1</state> + </option> + <option> + <name>CCJLinkUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCTcpIpAlt</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCJLinkTcpIpSerialNo</name> + <state></state> + </option> + <option> + <name>CCCpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCSwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCSwoClockEdit</name> + <state>2000</state> + </option> + <option> + <name>OCJLinkTraceSource</name> + <state>0</state> + </option> + <option> + <name>OCJLinkTraceSourceDummy</name> + <state>0</state> + </option> + <option> + <name>OCJLinkDeviceName</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>LMIFTDI_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>2</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>LmiftdiSpeed</name> + <state>500</state> + </option> + <option> + <name>CCLmiftdiDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCLmiftdiLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCLmiFtdiInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCLmiFtdiInterfaceCmdLine</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>NULINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + </data> + </settings> + <settings> + <name>PEMICRO_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>3</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCJPEMicroShowSettings</name> + <state>0</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + </data> + </settings> + <settings> + <name>STLINK_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>5</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCSTLinkInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkResetList</name> + <version>3</version> + <state>0</state> + </option> + <option> + <name>CCCpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCSwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCSwoClockEdit</name> + <state>2000</state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCSTLinkDoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCSTLinkCatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkCatchDummy</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCSTLinkUsbSerialNoSelect</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkJtagSpeedList</name> + <version>1</version> + <state>0</state> + </option> + <option> + <name>CCSTLinkDAPNumber</name> + <state></state> + </option> + <option> + <name>CCSTLinkDebugAccessPortRadio</name> + <state>0</state> + </option> + <option> + <name>CCSTLinkUseServerSelect</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>THIRDPARTY_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>CThirdPartyDriverDll</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>CThirdPartyLogFileCheck</name> + <state>0</state> + </option> + <option> + <name>CThirdPartyLogFileEditB</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>TIFET_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetResetList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCMSPFetInterfaceRadio</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetInterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetTargetVccTypeDefault</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetTargetVoltage</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>CCMSPFetVCCDefault</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetTargetSettlingtime</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetRadioJtagSpeedType</name> + <state>1</state> + </option> + <option> + <name>CCMSPFetConnection</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCMSPFetUsbComPort</name> + <state>Automatic</state> + </option> + <option> + <name>CCMSPFetAllowAccessToBSL</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetDoLogfile</name> + <state>0</state> + </option> + <option> + <name>CCMSPFetLogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCMSPFetRadioEraseFlash</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>XDS100_ID</name> + <archiveVersion>2</archiveVersion> + <data> + <version>8</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OCDriverInfo</name> + <state>1</state> + </option> + <option> + <name>TIPackageOverride</name> + <state>0</state> + </option> + <option> + <name>TIPackage</name> + <state></state> + </option> + <option> + <name>BoardFile</name> + <state></state> + </option> + <option> + <name>DoLogfile</name> + <state>0</state> + </option> + <option> + <name>LogFile</name> + <state>$PROJ_DIR$\cspycomm.log</state> + </option> + <option> + <name>CCXds100BreakpointRadio</name> + <state>0</state> + </option> + <option> + <name>CCXds100DoUpdateBreakpoints</name> + <state>0</state> + </option> + <option> + <name>CCXds100UpdateBreakpoints</name> + <state>_call_main</state> + </option> + <option> + <name>CCXds100CatchReset</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchUndef</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSWI</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchData</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchPrefetch</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchIRQ</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchFIQ</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchCORERESET</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchMMERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchNOCPERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchCHRERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSTATERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchBUSERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchINTERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchSFERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchHARDERR</name> + <state>0</state> + </option> + <option> + <name>CCXds100CatchDummy</name> + <state>0</state> + </option> + <option> + <name>CCXds100CpuClockEdit</name> + <state></state> + </option> + <option> + <name>CCXds100SwoClockAuto</name> + <state>0</state> + </option> + <option> + <name>CCXds100SwoClockEdit</name> + <state>1000</state> + </option> + <option> + <name>CCXds100HWResetDelay</name> + <state>0</state> + </option> + <option> + <name>CCXds100ResetList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCXds100UsbSerialNo</name> + <state></state> + </option> + <option> + <name>CCXds100UsbSerialNoSelect</name> + <state>0</state> + </option> + <option> + <name>CCXds100JtagSpeedList</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCXds100InterfaceRadio</name> + <state>2</state> + </option> + <option> + <name>CCXds100InterfaceCmdLine</name> + <state>0</state> + </option> + <option> + <name>CCXds100ProbeList</name> + <version>0</version> + <state>2</state> + </option> + <option> + <name>CCXds100SWOPortRadio</name> + <state>0</state> + </option> + <option> + <name>CCXds100SWOPort</name> + <state>1</state> + </option> + <option> + <name>CCXDSTargetVccEnable</name> + <state>0</state> + </option> + <option> + <name>CCXDSTargetVoltage</name> + <state>###Uninitialized###</state> + </option> + <option> + <name>OCXDSDigitalStatesConfigFile</name> + <state>1</state> + </option> + </data> + </settings> + <debuggerPlugins> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\FreeRtos\FreeRtosArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin2.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8BE.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file> + <loadFlag>1</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + <plugin> + <file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file> + <loadFlag>0</loadFlag> + </plugin> + </debuggerPlugins> + </configuration> +</project> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewp b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewp new file mode 100644 index 0000000000000000000000000000000000000000..ec47978037466bdb91d14ac8f6d450da6f73c0e2 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/IAR/BLE_hci_uart.ewp @@ -0,0 +1,2388 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <fileVersion>3</fileVersion> + <configuration> + <name>Debug</name> + <toolchain> + <name>ARM</name> + </toolchain> + <debug>1</debug> + <settings> + <name>General</name> + <archiveVersion>3</archiveVersion> + <data> + <version>31</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>ExePath</name> + <state>Debug\Exe</state> + </option> + <option> + <name>ObjPath</name> + <state>Debug\Obj</state> + </option> + <option> + <name>ListPath</name> + <state>Debug\List</state> + </option> + <option> + <name>GEndianMode</name> + <state>0</state> + </option> + <option> + <name>Input description</name> + <state></state> + </option> + <option> + <name>Output description</name> + <state></state> + </option> + <option> + <name>GOutputBinary</name> + <state>0</state> + </option> + <option> + <name>OGCoreOrChip</name> + <state>2</state> + </option> + <option> + <name>GRuntimeLibSelect</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>GRuntimeLibSelectSlave</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>RTDescription</name> + <state></state> + </option> + <option> + <name>OGProductVersion</name> + <state>8.32.3.20186</state> + </option> + <option> + <name>OGLastSavedByProductVersion</name> + <state>8.32.3.20186</state> + </option> + <option> + <name>GeneralEnableMisra</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraVerbose</name> + <state>0</state> + </option> + <option> + <name>OGChipSelectEditMenu</name> + <state>Default None</state> + </option> + <option> + <name>GenLowLevelInterface</name> + <state>1</state> + </option> + <option> + <name>GEndianModeBE</name> + <state>0</state> + </option> + <option> + <name>OGBufferedTerminalOutput</name> + <state>0</state> + </option> + <option> + <name>GenStdoutInterface</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraRules98</name> + <version>0</version> + <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> + </option> + <option> + <name>GeneralMisraVer</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraRules04</name> + <version>0</version> + <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> + </option> + <option> + <name>RTConfigPath2</name> + <state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state> + </option> + <option> + <name>GBECoreSlave</name> + <version>27</version> + <state>38</state> + </option> + <option> + <name>OGUseCmsis</name> + <state>1</state> + </option> + <option> + <name>OGUseCmsisDspLib</name> + <state>0</state> + </option> + <option> + <name>GRuntimeLibThreads</name> + <state>0</state> + </option> + <option> + <name>CoreVariant</name> + <version>27</version> + <state>39</state> + </option> + <option> + <name>GFPUDeviceSlave</name> + <state>Default None</state> + </option> + <option> + <name>FPU2</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>NrRegs</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>NEON</name> + <state>0</state> + </option> + <option> + <name>GFPUCoreSlave2</name> + <version>27</version> + <state>39</state> + </option> + <option> + <name>OGCMSISPackSelectDevice</name> + </option> + <option> + <name>OgLibHeap</name> + <state>0</state> + </option> + <option> + <name>OGLibAdditionalLocale</name> + <state>0</state> + </option> + <option> + <name>OGPrintfVariant</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>OGPrintfMultibyteSupport</name> + <state>0</state> + </option> + <option> + <name>OGScanfVariant</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>OGScanfMultibyteSupport</name> + <state>0</state> + </option> + <option> + <name>GenLocaleTags</name> + <state></state> + </option> + <option> + <name>GenLocaleDisplayOnly</name> + <state></state> + </option> + <option> + <name>DSPExtension</name> + <state>1</state> + </option> + <option> + <name>TrustZone</name> + <state>0</state> + </option> + <option> + <name>TrustZoneModes</name> + <version>0</version> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>ICCARM</name> + <archiveVersion>2</archiveVersion> + <data> + <version>35</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>CCDefines</name> + <state>$CMSIS_PACK_DEVICE_DEFINES$</state> + <state>_RTE_</state> + </option> + <option> + <name>CCPreprocFile</name> + <state>0</state> + </option> + <option> + <name>CCPreprocComments</name> + <state>0</state> + </option> + <option> + <name>CCPreprocLine</name> + <state>1</state> + </option> + <option> + <name>CCListCFile</name> + <state>0</state> + </option> + <option> + <name>CCListCMnemonics</name> + <state>0</state> + </option> + <option> + <name>CCListCMessages</name> + <state>0</state> + </option> + <option> + <name>CCListAssFile</name> + <state>0</state> + </option> + <option> + <name>CCListAssSource</name> + <state>0</state> + </option> + <option> + <name>CCEnableRemarks</name> + <state>0</state> + </option> + <option> + <name>CCDiagSuppress</name> + <state></state> + </option> + <option> + <name>CCDiagRemark</name> + <state></state> + </option> + <option> + <name>CCDiagWarning</name> + <state></state> + </option> + <option> + <name>CCDiagError</name> + <state></state> + </option> + <option> + <name>CCObjPrefix</name> + <state>1</state> + </option> + <option> + <name>CCAllowList</name> + <version>1</version> + <state>00000000</state> + </option> + <option> + <name>CCDebugInfo</name> + <state>1</state> + </option> + <option> + <name>IEndianMode</name> + <state>1</state> + </option> + <option> + <name>IProcessor</name> + <state>1</state> + </option> + <option> + <name>IExtraOptionsCheck</name> + <state>0</state> + </option> + <option> + <name>IExtraOptions</name> + <state></state> + </option> + <option> + <name>CCLangConformance</name> + <state>0</state> + </option> + <option> + <name>CCSignedPlainChar</name> + <state>1</state> + </option> + <option> + <name>CCRequirePrototypes</name> + <state>0</state> + </option> + <option> + <name>CCDiagWarnAreErr</name> + <state>0</state> + </option> + <option> + <name>CCCompilerRuntimeInfo</name> + <state>0</state> + </option> + <option> + <name>IFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>OutputFile</name> + <state>$FILE_BNAME$.o</state> + </option> + <option> + <name>CCLibConfigHeader</name> + <state>1</state> + </option> + <option> + <name>PreInclude</name> + <state></state> + </option> + <option> + <name>CompilerMisraOverride</name> + <state>0</state> + </option> + <option> + <name>CCIncludePath2</name> + <state>$CMSIS_PACK_DEVICE_INCLUDES$</state> + <state>$CMSIS_PACK_INCLUDES$</state> + <state>$PROJ_DIR$\..</state> + <state>$PROJ_DIR$\..\RTE</state> + </option> + <option> + <name>CCStdIncCheck</name> + <state>0</state> + </option> + <option> + <name>CCCodeSection</name> + <state>.text</state> + </option> + <option> + <name>IProcessorMode2</name> + <state>1</state> + </option> + <option> + <name>CCOptLevel</name> + <state>1</state> + </option> + <option> + <name>CCOptStrategy</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCOptLevelSlave</name> + <state>1</state> + </option> + <option> + <name>CompilerMisraRules98</name> + <version>0</version> + <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> + </option> + <option> + <name>CompilerMisraRules04</name> + <version>0</version> + <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> + </option> + <option> + <name>CCPosIndRopi</name> + <state>0</state> + </option> + <option> + <name>CCPosIndRwpi</name> + <state>0</state> + </option> + <option> + <name>CCPosIndNoDynInit</name> + <state>0</state> + </option> + <option> + <name>IccLang</name> + <state>0</state> + </option> + <option> + <name>IccCDialect</name> + <state>1</state> + </option> + <option> + <name>IccAllowVLA</name> + <state>0</state> + </option> + <option> + <name>IccStaticDestr</name> + <state>1</state> + </option> + <option> + <name>IccCppInlineSemantics</name> + <state>0</state> + </option> + <option> + <name>IccCmsis</name> + <state>1</state> + </option> + <option> + <name>IccFloatSemantics</name> + <state>0</state> + </option> + <option> + <name>CCOptimizationNoSizeConstraints</name> + <state>0</state> + </option> + <option> + <name>CCNoLiteralPool</name> + <state>0</state> + </option> + <option> + <name>CCOptStrategySlave</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCGuardCalls</name> + <state>1</state> + </option> + <option> + <name>CCEncSource</name> + <state>0</state> + </option> + <option> + <name>CCEncOutput</name> + <state>0</state> + </option> + <option> + <name>CCEncOutputBom</name> + <state>1</state> + </option> + <option> + <name>CCEncInput</name> + <state>0</state> + </option> + <option> + <name>IccExceptions2</name> + <state>0</state> + </option> + <option> + <name>IccRTTI2</name> + <state>0</state> + </option> + <option> + <name>OICompilerExtraOption</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>AARM</name> + <archiveVersion>2</archiveVersion> + <data> + <version>10</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>AObjPrefix</name> + <state>1</state> + </option> + <option> + <name>AEndian</name> + <state>1</state> + </option> + <option> + <name>ACaseSensitivity</name> + <state>1</state> + </option> + <option> + <name>MacroChars</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>AWarnEnable</name> + <state>0</state> + </option> + <option> + <name>AWarnWhat</name> + <state>0</state> + </option> + <option> + <name>AWarnOne</name> + <state></state> + </option> + <option> + <name>AWarnRange1</name> + <state></state> + </option> + <option> + <name>AWarnRange2</name> + <state></state> + </option> + <option> + <name>ADebug</name> + <state>1</state> + </option> + <option> + <name>AltRegisterNames</name> + <state>0</state> + </option> + <option> + <name>ADefines</name> + <state>$CMSIS_PACK_DEVICE_DEFINES$</state> + <state>_RTE_</state> + </option> + <option> + <name>AList</name> + <state>0</state> + </option> + <option> + <name>AListHeader</name> + <state>1</state> + </option> + <option> + <name>AListing</name> + <state>1</state> + </option> + <option> + <name>Includes</name> + <state>0</state> + </option> + <option> + <name>MacDefs</name> + <state>0</state> + </option> + <option> + <name>MacExps</name> + <state>1</state> + </option> + <option> + <name>MacExec</name> + <state>0</state> + </option> + <option> + <name>OnlyAssed</name> + <state>0</state> + </option> + <option> + <name>MultiLine</name> + <state>0</state> + </option> + <option> + <name>PageLengthCheck</name> + <state>0</state> + </option> + <option> + <name>PageLength</name> + <state>80</state> + </option> + <option> + <name>TabSpacing</name> + <state>8</state> + </option> + <option> + <name>AXRef</name> + <state>0</state> + </option> + <option> + <name>AXRefDefines</name> + <state>0</state> + </option> + <option> + <name>AXRefInternal</name> + <state>0</state> + </option> + <option> + <name>AXRefDual</name> + <state>0</state> + </option> + <option> + <name>AProcessor</name> + <state>1</state> + </option> + <option> + <name>AFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>AOutputFile</name> + <state>$FILE_BNAME$.o</state> + </option> + <option> + <name>ALimitErrorsCheck</name> + <state>0</state> + </option> + <option> + <name>ALimitErrorsEdit</name> + <state>100</state> + </option> + <option> + <name>AIgnoreStdInclude</name> + <state>0</state> + </option> + <option> + <name>AUserIncludes</name> + <state>$CMSIS_PACK_DEVICE_INCLUDES$</state> + <state>$CMSIS_PACK_INCLUDES$</state> + <state>$PROJ_DIR$\..</state> + <state>$PROJ_DIR$\..\RTE</state> + </option> + <option> + <name>AExtraOptionsCheckV2</name> + <state>0</state> + </option> + <option> + <name>AExtraOptionsV2</name> + <state></state> + </option> + <option> + <name>AsmNoLiteralPool</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>OBJCOPY</name> + <archiveVersion>0</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>OOCOutputFormat</name> + <version>3</version> + <state>0</state> + </option> + <option> + <name>OCOutputOverride</name> + <state>0</state> + </option> + <option> + <name>OOCOutputFile</name> + <state></state> + </option> + <option> + <name>OOCCommandLineProducer</name> + <state>1</state> + </option> + <option> + <name>OOCObjCopyEnable</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>CUSTOM</name> + <archiveVersion>3</archiveVersion> + <data> + <extensions></extensions> + <cmdline></cmdline> + <hasPrio>0</hasPrio> + </data> + </settings> + <settings> + <name>BICOMP</name> + <archiveVersion>0</archiveVersion> + <data /> + </settings> + <settings> + <name>BUILDACTION</name> + <archiveVersion>1</archiveVersion> + <data> + <prebuild></prebuild> + <postbuild></postbuild> + </data> + </settings> + <settings> + <name>ILINK</name> + <archiveVersion>0</archiveVersion> + <data> + <version>22</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>IlinkLibIOConfig</name> + <state>1</state> + </option> + <option> + <name>XLinkMisraHandler</name> + <state>0</state> + </option> + <option> + <name>IlinkInputFileSlave</name> + <state>0</state> + </option> + <option> + <name>IlinkOutputFile</name> + <state>BLE_dats.out</state> + </option> + <option> + <name>IlinkDebugInfoEnable</name> + <state>1</state> + </option> + <option> + <name>IlinkKeepSymbols</name> + <state></state> + </option> + <option> + <name>IlinkRawBinaryFile</name> + <state></state> + </option> + <option> + <name>IlinkRawBinarySymbol</name> + <state></state> + </option> + <option> + <name>IlinkRawBinarySegment</name> + <state></state> + </option> + <option> + <name>IlinkRawBinaryAlign</name> + <state></state> + </option> + <option> + <name>IlinkDefines</name> + <state></state> + </option> + <option> + <name>IlinkConfigDefines</name> + <state></state> + </option> + <option> + <name>IlinkMapFile</name> + <state>1</state> + </option> + <option> + <name>IlinkLogFile</name> + <state>0</state> + </option> + <option> + <name>IlinkLogInitialization</name> + <state>0</state> + </option> + <option> + <name>IlinkLogModule</name> + <state>0</state> + </option> + <option> + <name>IlinkLogSection</name> + <state>0</state> + </option> + <option> + <name>IlinkLogVeneer</name> + <state>0</state> + </option> + <option> + <name>IlinkIcfOverride</name> + <state>1</state> + </option> + <option> + <name>IlinkIcfFile</name> + <state>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\.iar\config\linker\MAX32665_BLECO.icf</state> + </option> + <option> + <name>IlinkIcfFileSlave</name> + <state></state> + </option> + <option> + <name>IlinkEnableRemarks</name> + <state>0</state> + </option> + <option> + <name>IlinkSuppressDiags</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsRem</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsWarn</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsErr</name> + <state></state> + </option> + <option> + <name>IlinkWarningsAreErrors</name> + <state>0</state> + </option> + <option> + <name>IlinkUseExtraOptions</name> + <state>0</state> + </option> + <option> + <name>IlinkExtraOptions</name> + <state></state> + </option> + <option> + <name>IlinkLowLevelInterfaceSlave</name> + <state>1</state> + </option> + <option> + <name>IlinkAutoLibEnable</name> + <state>1</state> + </option> + <option> + <name>IlinkAdditionalLibs</name> + <state></state> + </option> + <option> + <name>IlinkOverrideProgramEntryLabel</name> + <state>0</state> + </option> + <option> + <name>IlinkProgramEntryLabelSelect</name> + <state>0</state> + </option> + <option> + <name>IlinkProgramEntryLabel</name> + <state>__iar_program_start</state> + </option> + <option> + <name>DoFill</name> + <state>0</state> + </option> + <option> + <name>FillerByte</name> + <state>0xFF</state> + </option> + <option> + <name>FillerStart</name> + <state>0x0</state> + </option> + <option> + <name>FillerEnd</name> + <state>0x0</state> + </option> + <option> + <name>CrcSize</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>CrcAlign</name> + <state>1</state> + </option> + <option> + <name>CrcPoly</name> + <state>0x11021</state> + </option> + <option> + <name>CrcCompl</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CrcBitOrder</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CrcInitialValue</name> + <state>0x0</state> + </option> + <option> + <name>DoCrc</name> + <state>0</state> + </option> + <option> + <name>IlinkBE8Slave</name> + <state>1</state> + </option> + <option> + <name>IlinkBufferedTerminalOutput</name> + <state>1</state> + </option> + <option> + <name>IlinkStdoutInterfaceSlave</name> + <state>1</state> + </option> + <option> + <name>CrcFullSize</name> + <state>0</state> + </option> + <option> + <name>IlinkIElfToolPostProcess</name> + <state>0</state> + </option> + <option> + <name>IlinkLogAutoLibSelect</name> + <state>0</state> + </option> + <option> + <name>IlinkLogRedirSymbols</name> + <state>0</state> + </option> + <option> + <name>IlinkLogUnusedFragments</name> + <state>0</state> + </option> + <option> + <name>IlinkCrcReverseByteOrder</name> + <state>0</state> + </option> + <option> + <name>IlinkCrcUseAsInput</name> + <state>1</state> + </option> + <option> + <name>IlinkOptInline</name> + <state>0</state> + </option> + <option> + <name>IlinkOptExceptionsAllow</name> + <state>1</state> + </option> + <option> + <name>IlinkOptExceptionsForce</name> + <state>0</state> + </option> + <option> + <name>IlinkCmsis</name> + <state>1</state> + </option> + <option> + <name>IlinkOptMergeDuplSections</name> + <state>0</state> + </option> + <option> + <name>IlinkOptUseVfe</name> + <state>1</state> + </option> + <option> + <name>IlinkOptForceVfe</name> + <state>0</state> + </option> + <option> + <name>IlinkStackAnalysisEnable</name> + <state>0</state> + </option> + <option> + <name>IlinkStackControlFile</name> + <state></state> + </option> + <option> + <name>IlinkStackCallGraphFile</name> + <state></state> + </option> + <option> + <name>CrcAlgorithm</name> + <version>1</version> + <state>1</state> + </option> + <option> + <name>CrcUnitSize</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IlinkThreadsSlave</name> + <state>1</state> + </option> + <option> + <name>IlinkLogCallGraph</name> + <state>0</state> + </option> + <option> + <name>IlinkIcfFile_AltDefault</name> + <state></state> + </option> + <option> + <name>IlinkEncInput</name> + <state>0</state> + </option> + <option> + <name>IlinkEncOutput</name> + <state>0</state> + </option> + <option> + <name>IlinkEncOutputBom</name> + <state>1</state> + </option> + <option> + <name>IlinkHeapSelect</name> + <state>1</state> + </option> + <option> + <name>IlinkLocaleSelect</name> + <state>1</state> + </option> + <option> + <name>IlinkTrustzoneImportLibraryOut</name> + <state>###Unitialized###</state> + </option> + <option> + <name>OILinkExtraOption</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>IARCHIVE</name> + <archiveVersion>0</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>1</debug> + <option> + <name>IarchiveInputs</name> + <state></state> + </option> + <option> + <name>IarchiveOverride</name> + <state>0</state> + </option> + <option> + <name>IarchiveOutput</name> + <state>###Unitialized###</state> + </option> + </data> + </settings> + <settings> + <name>BILINK</name> + <archiveVersion>0</archiveVersion> + <data /> + </settings> + </configuration> + <configuration> + <name>Release</name> + <toolchain> + <name>ARM</name> + </toolchain> + <debug>0</debug> + <settings> + <name>General</name> + <archiveVersion>3</archiveVersion> + <data> + <version>31</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>ExePath</name> + <state>Release\Exe</state> + </option> + <option> + <name>ObjPath</name> + <state>Release\Obj</state> + </option> + <option> + <name>ListPath</name> + <state>Release\List</state> + </option> + <option> + <name>GEndianMode</name> + <state>0</state> + </option> + <option> + <name>Input description</name> + <state></state> + </option> + <option> + <name>Output description</name> + <state></state> + </option> + <option> + <name>GOutputBinary</name> + <state>0</state> + </option> + <option> + <name>OGCoreOrChip</name> + <state>2</state> + </option> + <option> + <name>GRuntimeLibSelect</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>GRuntimeLibSelectSlave</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>RTDescription</name> + <state></state> + </option> + <option> + <name>OGProductVersion</name> + <state>8.32.3.20186</state> + </option> + <option> + <name>OGLastSavedByProductVersion</name> + <state>8.32.3.20186</state> + </option> + <option> + <name>GeneralEnableMisra</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraVerbose</name> + <state>0</state> + </option> + <option> + <name>OGChipSelectEditMenu</name> + <state></state> + </option> + <option> + <name>GenLowLevelInterface</name> + <state>0</state> + </option> + <option> + <name>GEndianModeBE</name> + <state>0</state> + </option> + <option> + <name>OGBufferedTerminalOutput</name> + <state>0</state> + </option> + <option> + <name>GenStdoutInterface</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraRules98</name> + <version>0</version> + <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> + </option> + <option> + <name>GeneralMisraVer</name> + <state>0</state> + </option> + <option> + <name>GeneralMisraRules04</name> + <version>0</version> + <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> + </option> + <option> + <name>RTConfigPath2</name> + <state></state> + </option> + <option> + <name>GBECoreSlave</name> + <version>27</version> + <state>38</state> + </option> + <option> + <name>OGUseCmsis</name> + <state>1</state> + </option> + <option> + <name>OGUseCmsisDspLib</name> + <state>0</state> + </option> + <option> + <name>GRuntimeLibThreads</name> + <state>0</state> + </option> + <option> + <name>CoreVariant</name> + <version>27</version> + <state>39</state> + </option> + <option> + <name>GFPUDeviceSlave</name> + <state>-</state> + </option> + <option> + <name>FPU2</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>NrRegs</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>NEON</name> + <state>0</state> + </option> + <option> + <name>GFPUCoreSlave2</name> + <version>27</version> + <state>38</state> + </option> + <option> + <name>OGCMSISPackSelectDevice</name> + </option> + <option> + <name>OgLibHeap</name> + <state>0</state> + </option> + <option> + <name>OGLibAdditionalLocale</name> + <state>0</state> + </option> + <option> + <name>OGPrintfVariant</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>OGPrintfMultibyteSupport</name> + <state>0</state> + </option> + <option> + <name>OGScanfVariant</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>OGScanfMultibyteSupport</name> + <state>0</state> + </option> + <option> + <name>GenLocaleTags</name> + <state></state> + </option> + <option> + <name>GenLocaleDisplayOnly</name> + <state></state> + </option> + <option> + <name>DSPExtension</name> + <state>0</state> + </option> + <option> + <name>TrustZone</name> + <state>0</state> + </option> + <option> + <name>TrustZoneModes</name> + <version>0</version> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>ICCARM</name> + <archiveVersion>2</archiveVersion> + <data> + <version>35</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>CCDefines</name> + <state>NDEBUG</state> + <state>$CMSIS_PACK_DEVICE_DEFINES$</state> + <state>_RTE_</state> + </option> + <option> + <name>CCPreprocFile</name> + <state>0</state> + </option> + <option> + <name>CCPreprocComments</name> + <state>0</state> + </option> + <option> + <name>CCPreprocLine</name> + <state>1</state> + </option> + <option> + <name>CCListCFile</name> + <state>0</state> + </option> + <option> + <name>CCListCMnemonics</name> + <state>0</state> + </option> + <option> + <name>CCListCMessages</name> + <state>0</state> + </option> + <option> + <name>CCListAssFile</name> + <state>0</state> + </option> + <option> + <name>CCListAssSource</name> + <state>0</state> + </option> + <option> + <name>CCEnableRemarks</name> + <state>0</state> + </option> + <option> + <name>CCDiagSuppress</name> + <state></state> + </option> + <option> + <name>CCDiagRemark</name> + <state></state> + </option> + <option> + <name>CCDiagWarning</name> + <state></state> + </option> + <option> + <name>CCDiagError</name> + <state></state> + </option> + <option> + <name>CCObjPrefix</name> + <state>1</state> + </option> + <option> + <name>CCAllowList</name> + <version>1</version> + <state>11111110</state> + </option> + <option> + <name>CCDebugInfo</name> + <state>0</state> + </option> + <option> + <name>IEndianMode</name> + <state>1</state> + </option> + <option> + <name>IProcessor</name> + <state>1</state> + </option> + <option> + <name>IExtraOptionsCheck</name> + <state>0</state> + </option> + <option> + <name>IExtraOptions</name> + <state></state> + </option> + <option> + <name>CCLangConformance</name> + <state>0</state> + </option> + <option> + <name>CCSignedPlainChar</name> + <state>1</state> + </option> + <option> + <name>CCRequirePrototypes</name> + <state>0</state> + </option> + <option> + <name>CCDiagWarnAreErr</name> + <state>0</state> + </option> + <option> + <name>CCCompilerRuntimeInfo</name> + <state>0</state> + </option> + <option> + <name>IFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>OutputFile</name> + <state></state> + </option> + <option> + <name>CCLibConfigHeader</name> + <state>1</state> + </option> + <option> + <name>PreInclude</name> + <state></state> + </option> + <option> + <name>CompilerMisraOverride</name> + <state>0</state> + </option> + <option> + <name>CCIncludePath2</name> + <state>$CMSIS_PACK_DEVICE_INCLUDES$</state> + <state>$CMSIS_PACK_INCLUDES$</state> + <state>$PROJ_DIR$\..</state> + <state>$PROJ_DIR$\..\RTE</state> + </option> + <option> + <name>CCStdIncCheck</name> + <state>0</state> + </option> + <option> + <name>CCCodeSection</name> + <state>.text</state> + </option> + <option> + <name>IProcessorMode2</name> + <state>1</state> + </option> + <option> + <name>CCOptLevel</name> + <state>3</state> + </option> + <option> + <name>CCOptStrategy</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCOptLevelSlave</name> + <state>1</state> + </option> + <option> + <name>CompilerMisraRules98</name> + <version>0</version> + <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> + </option> + <option> + <name>CompilerMisraRules04</name> + <version>0</version> + <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> + </option> + <option> + <name>CCPosIndRopi</name> + <state>0</state> + </option> + <option> + <name>CCPosIndRwpi</name> + <state>0</state> + </option> + <option> + <name>CCPosIndNoDynInit</name> + <state>0</state> + </option> + <option> + <name>IccLang</name> + <state>0</state> + </option> + <option> + <name>IccCDialect</name> + <state>1</state> + </option> + <option> + <name>IccAllowVLA</name> + <state>0</state> + </option> + <option> + <name>IccStaticDestr</name> + <state>1</state> + </option> + <option> + <name>IccCppInlineSemantics</name> + <state>0</state> + </option> + <option> + <name>IccCmsis</name> + <state>1</state> + </option> + <option> + <name>IccFloatSemantics</name> + <state>0</state> + </option> + <option> + <name>CCOptimizationNoSizeConstraints</name> + <state>0</state> + </option> + <option> + <name>CCNoLiteralPool</name> + <state>0</state> + </option> + <option> + <name>CCOptStrategySlave</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CCGuardCalls</name> + <state>1</state> + </option> + <option> + <name>CCEncSource</name> + <state>0</state> + </option> + <option> + <name>CCEncOutput</name> + <state>0</state> + </option> + <option> + <name>CCEncOutputBom</name> + <state>1</state> + </option> + <option> + <name>CCEncInput</name> + <state>0</state> + </option> + <option> + <name>IccExceptions2</name> + <state>0</state> + </option> + <option> + <name>IccRTTI2</name> + <state>0</state> + </option> + <option> + <name>OICompilerExtraOption</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>AARM</name> + <archiveVersion>2</archiveVersion> + <data> + <version>10</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>AObjPrefix</name> + <state>1</state> + </option> + <option> + <name>AEndian</name> + <state>1</state> + </option> + <option> + <name>ACaseSensitivity</name> + <state>1</state> + </option> + <option> + <name>MacroChars</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>AWarnEnable</name> + <state>0</state> + </option> + <option> + <name>AWarnWhat</name> + <state>0</state> + </option> + <option> + <name>AWarnOne</name> + <state></state> + </option> + <option> + <name>AWarnRange1</name> + <state></state> + </option> + <option> + <name>AWarnRange2</name> + <state></state> + </option> + <option> + <name>ADebug</name> + <state>0</state> + </option> + <option> + <name>AltRegisterNames</name> + <state>0</state> + </option> + <option> + <name>ADefines</name> + <state>$CMSIS_PACK_DEVICE_DEFINES$</state> + <state>_RTE_</state> + </option> + <option> + <name>AList</name> + <state>0</state> + </option> + <option> + <name>AListHeader</name> + <state>1</state> + </option> + <option> + <name>AListing</name> + <state>1</state> + </option> + <option> + <name>Includes</name> + <state>0</state> + </option> + <option> + <name>MacDefs</name> + <state>0</state> + </option> + <option> + <name>MacExps</name> + <state>1</state> + </option> + <option> + <name>MacExec</name> + <state>0</state> + </option> + <option> + <name>OnlyAssed</name> + <state>0</state> + </option> + <option> + <name>MultiLine</name> + <state>0</state> + </option> + <option> + <name>PageLengthCheck</name> + <state>0</state> + </option> + <option> + <name>PageLength</name> + <state>80</state> + </option> + <option> + <name>TabSpacing</name> + <state>8</state> + </option> + <option> + <name>AXRef</name> + <state>0</state> + </option> + <option> + <name>AXRefDefines</name> + <state>0</state> + </option> + <option> + <name>AXRefInternal</name> + <state>0</state> + </option> + <option> + <name>AXRefDual</name> + <state>0</state> + </option> + <option> + <name>AProcessor</name> + <state>1</state> + </option> + <option> + <name>AFpuProcessor</name> + <state>1</state> + </option> + <option> + <name>AOutputFile</name> + <state></state> + </option> + <option> + <name>ALimitErrorsCheck</name> + <state>0</state> + </option> + <option> + <name>ALimitErrorsEdit</name> + <state>100</state> + </option> + <option> + <name>AIgnoreStdInclude</name> + <state>0</state> + </option> + <option> + <name>AUserIncludes</name> + <state>$CMSIS_PACK_DEVICE_INCLUDES$</state> + <state>$CMSIS_PACK_INCLUDES$</state> + <state>$PROJ_DIR$\..</state> + <state>$PROJ_DIR$\..\RTE</state> + </option> + <option> + <name>AExtraOptionsCheckV2</name> + <state>0</state> + </option> + <option> + <name>AExtraOptionsV2</name> + <state></state> + </option> + <option> + <name>AsmNoLiteralPool</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>OBJCOPY</name> + <archiveVersion>0</archiveVersion> + <data> + <version>1</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>OOCOutputFormat</name> + <version>3</version> + <state>0</state> + </option> + <option> + <name>OCOutputOverride</name> + <state>0</state> + </option> + <option> + <name>OOCOutputFile</name> + <state></state> + </option> + <option> + <name>OOCCommandLineProducer</name> + <state>1</state> + </option> + <option> + <name>OOCObjCopyEnable</name> + <state>0</state> + </option> + </data> + </settings> + <settings> + <name>CUSTOM</name> + <archiveVersion>3</archiveVersion> + <data> + <extensions></extensions> + <cmdline></cmdline> + <hasPrio>0</hasPrio> + </data> + </settings> + <settings> + <name>BICOMP</name> + <archiveVersion>0</archiveVersion> + <data /> + </settings> + <settings> + <name>BUILDACTION</name> + <archiveVersion>1</archiveVersion> + <data> + <prebuild></prebuild> + <postbuild></postbuild> + </data> + </settings> + <settings> + <name>ILINK</name> + <archiveVersion>0</archiveVersion> + <data> + <version>22</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>IlinkLibIOConfig</name> + <state>1</state> + </option> + <option> + <name>XLinkMisraHandler</name> + <state>0</state> + </option> + <option> + <name>IlinkInputFileSlave</name> + <state>0</state> + </option> + <option> + <name>IlinkOutputFile</name> + <state>###Unitialized###</state> + </option> + <option> + <name>IlinkDebugInfoEnable</name> + <state>1</state> + </option> + <option> + <name>IlinkKeepSymbols</name> + <state></state> + </option> + <option> + <name>IlinkRawBinaryFile</name> + <state></state> + </option> + <option> + <name>IlinkRawBinarySymbol</name> + <state></state> + </option> + <option> + <name>IlinkRawBinarySegment</name> + <state></state> + </option> + <option> + <name>IlinkRawBinaryAlign</name> + <state></state> + </option> + <option> + <name>IlinkDefines</name> + <state></state> + </option> + <option> + <name>IlinkConfigDefines</name> + <state></state> + </option> + <option> + <name>IlinkMapFile</name> + <state>1</state> + </option> + <option> + <name>IlinkLogFile</name> + <state>0</state> + </option> + <option> + <name>IlinkLogInitialization</name> + <state>0</state> + </option> + <option> + <name>IlinkLogModule</name> + <state>0</state> + </option> + <option> + <name>IlinkLogSection</name> + <state>0</state> + </option> + <option> + <name>IlinkLogVeneer</name> + <state>0</state> + </option> + <option> + <name>IlinkIcfOverride</name> + <state>1</state> + </option> + <option> + <name>IlinkIcfFile</name> + <state>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\.iar\config\linker\MAX32665_BLECO.icf</state> + </option> + <option> + <name>IlinkIcfFileSlave</name> + <state></state> + </option> + <option> + <name>IlinkEnableRemarks</name> + <state>0</state> + </option> + <option> + <name>IlinkSuppressDiags</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsRem</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsWarn</name> + <state></state> + </option> + <option> + <name>IlinkTreatAsErr</name> + <state></state> + </option> + <option> + <name>IlinkWarningsAreErrors</name> + <state>0</state> + </option> + <option> + <name>IlinkUseExtraOptions</name> + <state>0</state> + </option> + <option> + <name>IlinkExtraOptions</name> + <state></state> + </option> + <option> + <name>IlinkLowLevelInterfaceSlave</name> + <state>1</state> + </option> + <option> + <name>IlinkAutoLibEnable</name> + <state>1</state> + </option> + <option> + <name>IlinkAdditionalLibs</name> + <state></state> + </option> + <option> + <name>IlinkOverrideProgramEntryLabel</name> + <state>0</state> + </option> + <option> + <name>IlinkProgramEntryLabelSelect</name> + <state>0</state> + </option> + <option> + <name>IlinkProgramEntryLabel</name> + <state></state> + </option> + <option> + <name>DoFill</name> + <state>0</state> + </option> + <option> + <name>FillerByte</name> + <state>0xFF</state> + </option> + <option> + <name>FillerStart</name> + <state>0x0</state> + </option> + <option> + <name>FillerEnd</name> + <state>0x0</state> + </option> + <option> + <name>CrcSize</name> + <version>0</version> + <state>1</state> + </option> + <option> + <name>CrcAlign</name> + <state>1</state> + </option> + <option> + <name>CrcPoly</name> + <state>0x11021</state> + </option> + <option> + <name>CrcCompl</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CrcBitOrder</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>CrcInitialValue</name> + <state>0x0</state> + </option> + <option> + <name>DoCrc</name> + <state>0</state> + </option> + <option> + <name>IlinkBE8Slave</name> + <state>1</state> + </option> + <option> + <name>IlinkBufferedTerminalOutput</name> + <state>1</state> + </option> + <option> + <name>IlinkStdoutInterfaceSlave</name> + <state>1</state> + </option> + <option> + <name>CrcFullSize</name> + <state>0</state> + </option> + <option> + <name>IlinkIElfToolPostProcess</name> + <state>0</state> + </option> + <option> + <name>IlinkLogAutoLibSelect</name> + <state>0</state> + </option> + <option> + <name>IlinkLogRedirSymbols</name> + <state>0</state> + </option> + <option> + <name>IlinkLogUnusedFragments</name> + <state>0</state> + </option> + <option> + <name>IlinkCrcReverseByteOrder</name> + <state>0</state> + </option> + <option> + <name>IlinkCrcUseAsInput</name> + <state>1</state> + </option> + <option> + <name>IlinkOptInline</name> + <state>1</state> + </option> + <option> + <name>IlinkOptExceptionsAllow</name> + <state>1</state> + </option> + <option> + <name>IlinkOptExceptionsForce</name> + <state>0</state> + </option> + <option> + <name>IlinkCmsis</name> + <state>1</state> + </option> + <option> + <name>IlinkOptMergeDuplSections</name> + <state>0</state> + </option> + <option> + <name>IlinkOptUseVfe</name> + <state>1</state> + </option> + <option> + <name>IlinkOptForceVfe</name> + <state>0</state> + </option> + <option> + <name>IlinkStackAnalysisEnable</name> + <state>0</state> + </option> + <option> + <name>IlinkStackControlFile</name> + <state></state> + </option> + <option> + <name>IlinkStackCallGraphFile</name> + <state></state> + </option> + <option> + <name>CrcAlgorithm</name> + <version>1</version> + <state>1</state> + </option> + <option> + <name>CrcUnitSize</name> + <version>0</version> + <state>0</state> + </option> + <option> + <name>IlinkThreadsSlave</name> + <state>1</state> + </option> + <option> + <name>IlinkLogCallGraph</name> + <state>0</state> + </option> + <option> + <name>IlinkIcfFile_AltDefault</name> + <state></state> + </option> + <option> + <name>IlinkEncInput</name> + <state>0</state> + </option> + <option> + <name>IlinkEncOutput</name> + <state>0</state> + </option> + <option> + <name>IlinkEncOutputBom</name> + <state>1</state> + </option> + <option> + <name>IlinkHeapSelect</name> + <state>1</state> + </option> + <option> + <name>IlinkLocaleSelect</name> + <state>1</state> + </option> + <option> + <name>IlinkTrustzoneImportLibraryOut</name> + <state>###Unitialized###</state> + </option> + <option> + <name>OILinkExtraOption</name> + <state>1</state> + </option> + </data> + </settings> + <settings> + <name>IARCHIVE</name> + <archiveVersion>0</archiveVersion> + <data> + <version>0</version> + <wantNonLocal>1</wantNonLocal> + <debug>0</debug> + <option> + <name>IarchiveInputs</name> + <state></state> + </option> + <option> + <name>IarchiveOverride</name> + <state>0</state> + </option> + <option> + <name>IarchiveOutput</name> + <state>###Unitialized###</state> + </option> + </data> + </settings> + <settings> + <name>BILINK</name> + <archiveVersion>0</archiveVersion> + <data /> + </settings> + </configuration> + <file> + <name>$PROJ_DIR$\..\main.c</name> + </file> + <file> + <name>$PROJ_DIR$\..\hci_tr.c</name> + </file> + <group> + <name>CMSIS-Pack</name> + <tag>CMSISPack.Component</tag> + <group> + <name>Maxim MAX32665 BSP _BSP.EvKit V1_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Boards/Maxim/MAX32665_EVKIT/Common/EvKit_V1/Source/board.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Boards/Maxim/MAX32665_EVKIT/Common/Source/led.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Boards/Maxim/MAX32665_EVKIT/Common/Source/mx25.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Boards/Maxim/MAX32665_EVKIT/Common/Source/pb.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Boards/Maxim/MAX32665_EVKIT/Common/Source/stdio.c</name> + </file> + </group> + <group> + <name>Maxim Maxim API _Device.GPIO_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/gpio.c</name> + </file> + </group> + <group> + <name>Maxim Maxim API _Device.Startup_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>$PROJ_DIR$\RTE\Device\MAX32665_Cortex-M4\cmain.s</name> + </file> + <file> + <name>$PROJ_DIR$\RTE\Device\MAX32665_Cortex-M4\low_level_init.c</name> + </file> + <file> + <name>$PROJ_DIR$\RTE\Device\MAX32665_Cortex-M4\max32665.h</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/mxc_assert.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/mxc_delay.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/mxc_lock.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/mxc_pins.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/mxc_sys.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/nvic_table.c</name> + </file> + <file> + <name>$PROJ_DIR$\RTE\Device\MAX32665_Cortex-M4\startup_max32665.s</name> + </file> + <file> + <name>$PROJ_DIR$\RTE\Device\MAX32665_Cortex-M4\system_max32665.c</name> + </file> + </group> + <group> + <name>Maxim Maxim API _Device.Timers_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/tmr.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/tmr_utils.c</name> + </file> + </group> + <group> + <name>Maxim Maxim API _Device.UART_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/uart.c</name> + </file> + </group> + <group> + <name>Maxim Maxim API _Device.XiP Flash_0.2.8-b</name> + <tag>CMSISPack.Component</tag> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/spixf.c</name> + </file> + <file> + <name>${CMSIS_PACK_PATH_Maxim#MAX32665#0.3.0}$\Libraries/MAX32665PeriphDriver/Source/spixfc.c</name> + </file> + </group> + <file> + <name>$PROJ_DIR$\RTE\RTE_Components.h</name> + </file> + </group> + <cmsisPackSettings> + <rte><?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"> + + <packages/> + + <device Dclock="96000000" Dcore="Cortex-M4" DcoreVersion="r0p1" Dendian="Little-endian" Dfamily="MAX32665-66" Dfpu="SP_FPU" Dmpu="NO_MPU" Dname="MAX32665" Dvendor="Maxim:23" Pname="Cortex-M4" Punits="2" info="ARM Cortex-M4 96 MHz, 512 kB RAM, 1 MB ROM" url="http://www.keil.com/dd2/maxim/max32665"> + + <package info="Maxim Integrated MAX32665 Series Device Support, Board Support Package and Examples" name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + </device> + + <toolchain Tcompiler="IAR" Toutput="exe"/> + + <components> + + <component Cbundle="MAX32665 BSP" Cclass="BSP" Cgroup="EvKit V1" Cvendor="Maxim" Cversion="0.3.0"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="include" name="Boards/Maxim/MAX32665_EVKIT/Common/EvKit_V1/Include/"/> + + <file category="include" name="Boards/Maxim/MAX32665_EVKIT/Common/Include/"/> + + <file category="sourceC" name="Boards/Maxim/MAX32665_EVKIT/Common/EvKit_V1/Source/board.c" version="0.3.0"/> + + <file category="sourceC" name="Boards/Maxim/MAX32665_EVKIT/Common/Source/stdio.c" version="0.3.0"/> + + <file category="sourceC" name="Boards/Maxim/MAX32665_EVKIT/Common/Source/pb.c" version="0.3.0"/> + + <file category="sourceC" name="Boards/Maxim/MAX32665_EVKIT/Common/Source/led.c" version="0.3.0"/> + + <file category="sourceC" name="Boards/Maxim/MAX32665_EVKIT/Common/Source/mx25.c" version="0.3.0"/> + + </component> + + <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1"> + + <package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/> + + <file category="doc" name="CMSIS/Documentation/Core/html/index.html"/> + + <file category="include" name="CMSIS/Include/"/> + + </component> + + <component Cbundle="Maxim API" Cclass="Device" Cgroup="GPIO" Cvendor="Maxim" Cversion="0.3.0" deviceDependent="1"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/gpio.c" version="0.3.0"/> + + </component> + + <component Cbundle="Maxim API" Cclass="Device" Cgroup="Startup" Cvendor="Maxim" Cversion="0.3.0" deviceDependent="1"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="include" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Include/" version="0.3.0"/> + + <file category="include" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Include/" version="0.3.0"/> + + <file attr="config" category="sourceAsm" condition="Startup IAR" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Source/IAR/startup_max32665.s" version="0.3.0"/> + + <file attr="config" category="sourceC" condition="Startup IAR" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Source/IAR/low_level_init.c" version="0.3.0"/> + + <file attr="config" category="sourceAsm" condition="Startup IAR" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Source/IAR/cmain.s" version="0.3.0"/> + + <file attr="config" category="sourceC" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Source/system_max32665.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/nvic_table.c" version="0.3.0"/> + + <file attr="config" category="header" deviceDependent="1" name="Libraries/Device/Maxim/MAX32665/Include/max32665.h" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/mxc_assert.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/mxc_delay.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/mxc_lock.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/mxc_pins.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/mxc_sys.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/nvic_table.c" version="0.3.0"/> + + </component> + + + <component Cbundle="Maxim API" Cclass="Device" Cgroup="UART" Cvendor="Maxim" Cversion="0.3.0" deviceDependent="1"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/uart.c" version="0.3.0"/> + + </component> + + <component Cbundle="Maxim API" Cclass="Device" Cgroup="XiP Flash" Cvendor="Maxim" Cversion="0.3.0" deviceDependent="1"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/spixfc.c" version="0.3.0"/> + + <file category="sourceC" deviceDependent="1" name="Libraries/MAX32665PeriphDriver/Source/spixf.c" version="0.3.0"/> + + </component> + + <component Cbundle="Maxim BTLE" Cclass="Bluetooth" Cgroup="Bluetooth LE - HCI UART" Cvendor="Maxim" Cversion="0.3.0"> + + <package name="MAX32665" url="http://www.mxim.net/microcontroller/pack/" vendor="Maxim" version="0.3.0"/> + + <file category="include" name="Libraries/BTLE/wsf/baremetal/sources/"/> + + <file category="include" name="Libraries/BTLE/wsf/common/include/"/> + + <file category="include" name="Libraries/BTLE/controller/sources/mac/include/"/> + + <file category="include" name="Libraries/BTLE/controller/sources/mac/ble/lhci/include/"/> + + <file category="include" name="Libraries/BTLE/wsf/common/include/util/"/> + + <file category="include" name="Libraries/BTLE/ble-host/include/"/> + + <file category="include" name="Libraries/BTLE/platform/common/include/"/> + + <file category="include" name="Libraries/BTLE/controller/sources/mac/cfg/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/sources/apps/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/sources/apps/app/"/> + + <file category="include" name="Libraries/BTLE/ble-host/sources/stack/cfg/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/sources/profiles/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/sources/profiles/include/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/include/app/"/> + + <file category="include" name="Libraries/BTLE/ble-profiles/sources/services/"/> + + <file category="include" name="Libraries/BTLE/ble-host/sources/stack/hci/"/> + + <file category="include" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_cmd_ae.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_cmd.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_cmd_phy.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_core_ps.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_evt.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_vs_ae.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/dual_chip/hci_vs.c"/> + + <file category="include" name="Libraries/BTLE/ble-host/sources/hci/max32665/"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/hci/max32665/hci_drv.c"/> + + <file category="sourceC" name="Libraries/BTLE/ble-host/sources/stack/hci/hci_main.c"/> + + <file category="sourceC" name="Libraries/BTLE/platform/max32665/sources/ll_math.c"/> + + <file category="sourceC" name="Libraries/BTLE/platform/max32665/sources/radio_drv.c"/> + + <file category="source" name="Libraries/BTLE/platform/max32665/sources/sdma.inc"/> + + <file category="include" name="Libraries/BTLE/controller/sources/config/max32665/"/> + + <file category="include" name="Libraries/BTLE/controller/sources/config/"/> + + <file category="include" name="Libraries/BTLE/platform/max32665/"/> + + <file category="library" name="Libraries/BTLE/lib/IAR/cordiolib.a" condition="Startup IAR"/> + + <file category="library" name="Libraries/BTLE/lib/IAR/cordiolibpub.a" condition="Startup IAR"/> + + <file category="library" name="Libraries/BTLE/lib/ARM/cordiolib.lib" condition="Startup ARM"/> + + </component> + + </components> + + <apis/> + +</configuration> + +</rte> + </cmsisPackSettings> +</project> diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..e35b6bd4c856b0c1070cd2da61af69d2e18f37b6 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/Makefile @@ -0,0 +1,152 @@ +################################################################################ +# Copyright (C) 2014 Maxim Integrated Products, Inc., All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +# OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of Maxim Integrated +# Products, Inc. shall not be used except as stated in the Maxim Integrated +# Products, Inc. Branding Policy. +# +# The mere transfer of this software does not imply any licenses +# of trade secrets, proprietary technology, copyrights, patents, +# trademarks, maskwork rights, or any other form of intellectual +# property whatsoever. Maxim Integrated Products, Inc. retains all +# ownership rights. +# +# $Id: Makefile 44318 2019-06-27 17:54:22Z kevin.gillespie $ +# +################################################################################ + +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + +# This is the name of the build output file +ifeq "$(PROJECT)" "" +PROJECT=max32665 +endif + +# Specify the target processor +ifeq "$(TARGET)" "" +TARGET=MAX32665 +endif + +# Select 'GCC' or 'IAR' compiler +COMPILER=GCC + +# Specify the board used +ifeq "$(BOARD)" "" +BOARD=EvKit_V1 +endif + +# Create Target name variables +TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) +TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) + +# Last octet address modifier +ifneq "$(BLE_ADDR_LSB)" "" +PROJ_CFLAGS+=-DBLE_ADDR_LSB=$(BLE_ADDR_LSB) +endif + +## Subsitute WSF critical section entry for default MAXUSB +#PROJ_CFLAGS+=-DMAXUSB_ENTER_CRITICAL=WsfCsEnter +#PROJ_CFLAGS+=-DMAXUSB_EXIT_CRITICAL=WsfCsExit + +# This is the path to the CMSIS root directory +ifeq "$(MAXIM_PATH)" "" +LIBS_DIR=../../../Libraries +else +LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) +endif +CMSIS_ROOT=$(LIBS_DIR)/CMSIS + +# Source files for this test (add path to VPATH below) +SRCS = main.c +SRCS += chci_drv.c +SRCS += stack_setup.c + +# Where to find source files for this test +VPATH = . + +# Where to find header files for this test +IPATH = . + +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif + +ifneq "$(HCI_UART)" "" +PROJ_CFLAGS+=-DHCI_UART=$(HCI_UART) +endif + +ifneq "$(HCI_UART_MAP)" "" +PROJ_CFLAGS+=-DHCI_UART_MAP=$(HCI_UART_MAP) +endif + +# Enable assertion checking for development +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLE=TRUE +PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE + +#-------------------- +# Stack CFLAGS configuration +PROJ_CFLAGS+=-DINIT_BROADCASTER +PROJ_CFLAGS+=-DINIT_OBSERVER +PROJ_CFLAGS+=-DINIT_CENTRAL +PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +LL_ENABLE_TESTER=1 + +# Use this variable to override default compilier optimization. +#MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer + +################################################################################ +# Include external library makefiles here +DEBUG=1 + +# Include the BSP +BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) +include $(BOARD_DIR)/board.mk + +# Include the Peripheral Driver Library +PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver +include ${PERIPH_DRIVER_DIR}/periphdriver.mk + +# Include Cordio BTLE Library +CORDIO_DIR=$(LIBS_DIR)/BTLE +include ${CORDIO_DIR}/btle.mk + +# Include MAXUSB library +MAXUSB_DIR=$(LIBS_DIR)/MAXUSB +include $(MAXUSB_DIR)/maxusb.mk + +################################################################################ +# Include the rules for building for this target. All other makefiles should be +# included before this one. +include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/chci_drv.c b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/chci_drv.c new file mode 100644 index 0000000000000000000000000000000000000000..e31f1f5cb36ae34ed4049d07cad441d8112920a2 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/chci_drv.c @@ -0,0 +1,159 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-27 10:54:45 -0700 (Thu, 27 Jun 2019) $ + * $Revision: 44319 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI interface to the Host + */ +/*************************************************************************************************/ + +#include <stdio.h> +#include "mxc_config.h" +#include "hci_defs.h" +#include "chci_api.h" +#include "chci_tr_serial.h" +#include "uart.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ +#define HCI_UART_REG MXC_UART_GET_UART(HCI_UART) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Asynchronous UART request for HCI UART */ +uart_req_t hci_read_req; +uint8_t hci_data; + +/*************************************************************************************************/ +void UART0_IRQHandler(void) +{ + UART_Handler(MXC_UART0); +} + +/*************************************************************************************************/ +void UART1_IRQHandler(void) +{ + UART_Handler(MXC_UART1); +} + +/*************************************************************************************************/ +void UART2_IRQHandler(void) +{ + UART_Handler(MXC_UART2); +} + +/*************************************************************************************************/ +void HCI_UART_Handler(uart_req_t* req, int error) +{ + if(error != E_NO_ERROR) { + printf("Error with UART_ReadAsync callback %d\n", error); + } + + // Write data to the Controller HCI + chciTrSerialRxIncoming(&hci_data, 1); + + /* Read next byte */ + UART_ReadAsync(HCI_UART_REG, &hci_read_req); +} + +/*************************************************************************************************/ +void chciDrvInit(void) +{ + IRQn_Type hci_irq = MXC_UART_GET_IRQ(HCI_UART); + + /* Configure the HCI UART */ + const uart_cfg_t hci_uart_cfg = { + .parity = UART_PARITY_DISABLE, + .size = UART_DATA_SIZE_8_BITS, + .stop = UART_STOP_1, + .flow = UART_FLOW_CTRL_DIS, + .pol = UART_FLOW_POL_DIS, + .baud = 115200, + .clksel = UART_CLKSEL_SYSTEM + }; + + const sys_cfg_uart_t hci_uart_sys_cfg = { + .map = HCI_UART_MAP, + .flow = Disable + }; + + UART_Init(HCI_UART_REG, &hci_uart_cfg, &hci_uart_sys_cfg); + + /* Setup Interrupt */ + hci_read_req.data = &hci_data; + hci_read_req.len = 1; + hci_read_req.callback = HCI_UART_Handler; + NVIC_EnableIRQ(hci_irq); + + /* Setup the asycnronous read */ + UART_ReadAsync(HCI_UART_REG, &hci_read_req); + UART_Enable(HCI_UART_REG); +} + +/*************************************************************************************************/ +uint16_t chciDrvWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData) +{ + uint16_t write_len = 0; + int error; + + // Convert CHCI_TR_TYPE to HCI_TYPE + uint8_t hciType = (type == CHCI_TR_TYPE_EVT) ? HCI_EVT_TYPE : HCI_ACL_TYPE; + + error = UART_Write(HCI_UART_REG, &hciType, 1); + if(error == 1) { + write_len = 1; + } else { + printf("Error writing to HCI_UART\n"); + return write_len; + } + + /* Write out to the Host from the UART */ + error = UART_Write(HCI_UART_REG, pData, len); + if(error >= 0) { + write_len += error; + } else { + printf("Error writing to HCI_UART\n"); + } + + return write_len; +} diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..913cdde2f0fb522057f24e6e0d5a27f2ce63b6d6 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/config.mk @@ -0,0 +1,12 @@ +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# UART used for HCI where used. +# 2 by default. +HCI_UART?=2 + +# HCI_UART_MAP used by default. +# Unset by default. +HCI_UART_MAP?=MAP_B + diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/main.c b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/main.c new file mode 100644 index 0000000000000000000000000000000000000000..63bca9572181042e2cab9477cbf6ce9ca2dc3ab9 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/main.c @@ -0,0 +1,174 @@ +/******************************************************************************* + * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-07 07:33:41 -0700 (Fri, 07 Jun 2019) $ + * $Revision: 43735 $ + * + ******************************************************************************/ + +#include <stdio.h> +#include <string.h> +#include "mxc_config.h" +#include "wsf_types.h" +#include "wsf_os.h" +#include "wsf_buf.h" +#include "wsf_timer.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Number of WSF buffer pools */ +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 + +/* Size of buffer for stdio functions */ +#define PRINTF_BUF_SIZE 128 + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + +/*! Buffer for stdio functions */ +char printf_buffer[PRINTF_BUF_SIZE]; + +/*! Default pool descriptor. */ +static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = +{ + { 16, 8 }, + { 32, 4 }, + { 64, 4 }, + { 128, 4 }, + { 256, 4 }, + { 512, 4 } +}; + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*! \brief Stack initialization for app. */ +extern void StackInit(void); + +/*************************************************************************************************/ +void SysTick_Handler(void) +{ + WsfTimerUpdate(1); +} + +/*************************************************************************************************/ +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) +{ + extern uint8_t wsfCsNesting; + + if (wsfCsNesting == 0) + { + fwrite(pBuf, len, 1, stdout); + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize WSF. + * + * \return None. + */ +/*************************************************************************************************/ +static void WsfInit(void) +{ + uint32_t bytesUsed; + + /* setup the systick for 1MS timer*/ + SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; + SysTick->VAL = 0; + SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); + + WsfTimerInit(); + + SystemHeapStart = (uint32_t)&SystemHeap; + if((bytesUsed = WsfBufCalcSize(WSF_BUF_POOLS, mainPoolDesc)) != SystemHeapSize) { + printf("SystemHeapSize 0x%x != bytesUsed 0x%x\n", SystemHeapSize, bytesUsed); + printf(" Adjust SystmeHeap size to match mainPoolDesc\n"); + while(1){} + } + WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); +} + +/*************************************************************************************************/ +/*! + * \fn main + * + * \brief Entry point for demo software. + * + * \param None. + * + * \return None. + */ +/*************************************************************************************************/ +int main(void) +{ + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + + printf("\n\n***** MAX32665 BLE HCI UART *****\n"); + + WsfInit(); + StackInit(); + + printf("Setup Complete\n"); + + while (1) + { + wsfOsDispatcher(); + } +} + +/*****************************************************************/ +void HardFault_Handler(void) +{ + printf("\nFaultISR: CFSR %08X, BFAR %08x\n", (unsigned int)SCB->CFSR, (unsigned int)SCB->BFAR); + + // Loop forever + while(1); +} diff --git a/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/stack_setup.c b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/stack_setup.c new file mode 100644 index 0000000000000000000000000000000000000000..c98be8a9458c0ff6cefdce6d9bc4d4b300a394f0 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_hci_uart/stack_setup.c @@ -0,0 +1,116 @@ +/*************************************************************************************************/ +/*! + * \file + * + * \brief Stack initialization for datc. + * + * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. + * ARM Ltd. confidential and proprietary. + * + * IMPORTANT. Your use of this file is governed by a Software License Agreement + * ("Agreement") that must be accepted in order to download or otherwise receive a + * copy of this file. You may not use or copy this file for any purpose other than + * as described in the Agreement. If you do not agree to all of the terms of the + * Agreement do not use this file and delete all copies in your possession or control; + * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior + * to any use, copying or further distribution of this software. + */ +/*************************************************************************************************/ + +#include <stdio.h> +#include <string.h> +#include "wsf_types.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include "hci_handler.h" +#include "ll_init_api.h" +#include "hci_api.h" + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0x9e92 +// #define LL_MEMORY_FOOTPRINT 0xEA0 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 1, // 4 Extended Advertising Sets + /*maxAdvReports*/ 1, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 1, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 1000, + + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ TRUE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize stack. + * + * \return None. + */ +/*************************************************************************************************/ +void StackInit(void) +{ + // wsfHandlerId_t handlerId; + uint8_t mask[HCI_LE_EVT_MASK_LEN]; + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; + + memUsed = LlInitControllerExtInit(&ll_init_cfg); + // memUsed = LlInitControllerInit(&ll_init_cfg); + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } + + // Enable LE Events + memset(mask, 0xFF, HCI_LE_EVT_MASK_LEN); + HciLeSetEventMaskCmd(mask); + HciSetEventMaskCmd(mask); +} diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/Makefile b/lib/sdk/Applications/EvKitExamples/BLE_scanner/Makefile index 551827fe32c94f6e00a8c69160bbb06d1b200686..ad8e670e9a18cb0453ad97c412d9a2047a87fd69 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/Makefile +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/Makefile @@ -29,10 +29,15 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # -# $Id: Makefile 34237 2018-03-27 13:55:37Z jeremy.brodt $ +# $Id: Makefile 44515 2019-07-09 23:06:13Z nathan.goldstick $ # ################################################################################ +# Include project configuration. +ifneq "$(wildcard config.mk)" "" +include config.mk +endif + # This is the name of the build output file ifeq "$(PROJECT)" "" PROJECT=max32665 @@ -67,36 +72,128 @@ endif # This is the path to the CMSIS root directory ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -NDALIBS_DIR=../../../NDALibraries else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -NDALIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/NDALibraries) endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS # Source files for this test (add path to VPATH below) SRCS = main.c -SRCS += scanner_main.c SRCS += stack_scanner.c +SRCS += scanner_main.c # Where to find source files for this test VPATH = . -VPATH += fcl/src # Where to find header files for this test IPATH = . +################################################################################ +# Project build configuration. + +#------------------------------------------------------------------------------- +# Configuration passed via environment vars. + +ifdef BTLE_APP_USE_LEGACY_API +ifeq "$(BTLE_APP_USE_LEGACY_API)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +else +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_LEGACY_API=TRUE +endif +endif +endif +endif + +ifdef BTLE_APP_USE_ACTIVE_SCANNING +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "" +PROJ_CFLAGS+=-DBTLE_APP_USE_ACTIVE_SCANNING=TRUE +else +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "0" +else +ifeq "$(BTLE_APP_USE_ACTIVE_SCANNING)" "FALSE" +else +PROJ_CFLAGS+=-DBTLE_APP_USE_ACTIVE_SCANNING=TRUE +endif +endif +endif +endif + +ifdef CONSOLE_UART +ifneq "$(CONSOLE_UART)" "" +PROJ_CFLAGS+=-DCONSOLE_UART=$(CONSOLE_UART) +endif +endif + +ifdef ENABLE_SDMA +ifneq "$(ENABLE_SDMA)" "" +ifeq "$(ENABLE_SDMA)" "0" +undefine ENABLE_SDMA +else +ifeq "$(ENABLE_SDMA)" "FALSE" +undefine ENABLE_SDMA +else +ENABLE_SDMA=1 +endif +endif +endif +endif + +ifneq "$(ENABLE_SDMA)" "" +ifdef BTLE_APP_USE_LEGACY_API +ifneq "$(BTLE_APP_USE_LEGACY_API)" "" +ifeq "$(BTLE_APP_USE_LEGACY_API)" "0" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +ifeq "$(BTLE_APP_USE_LEGACY_API)" "FALSE" +$(error SDMA currently requires BTLE_APP_USE_LEGACY_API) +endif +endif +endif +endif + +#------------------------------------------------------------------------------- +# Configuration specified here. + +#-------------------- +# Stack configuration + # Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE -PROJ_CFLAGS+=-DASYMMETRIC -DWORD32 +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE=TRUE +# PROJ_CFLAGS+=-DWSF_TRACE_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_ASSERT_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_TRACE_ENABLED=TRUE +# PROJ_CFLAGS+=-DLL_DBG_PIN_ENABLED=TRUE +PROJ_CFLAGS+=-DWSF_MS_PER_TICK=1 + +#-------------------- +# Application CFLAGS configuration + +#-------------------- +# Stack CFLAGS configuration + +# PROJ_CFLAGS+=-DINIT_BROADCASTER +PROJ_CFLAGS+=-DINIT_OBSERVER +PROJ_CFLAGS+=-DINIT_CENTRAL +# PROJ_CFLAGS+=-DINIT_PERIPHERAL +PROJ_CFLAGS+=-DINIT_ENCRYPTED + +ENABLE_LL_TESTER?=#1 + +# Use this variable to override default compilier optimization. #MXC_OPTIMIZE_CFLAGS=-Os +#MXC_OPTIMIZE_CFLAGS=-O0 -fomit-frame-pointer # Point this variable to a linker file to override the default file #LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld ################################################################################ # Include external library makefiles here +DEBUG=1 # Include the BSP BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) @@ -107,13 +204,13 @@ PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET)PeriphDriver include ${PERIPH_DRIVER_DIR}/periphdriver.mk # Include Cordio BTLE Library -CORDIO_DIR=$(NDALIBS_DIR)/BTLE +CORDIO_DIR=$(LIBS_DIR)/BTLE include ${CORDIO_DIR}/btle.mk # Include MAXUSB library MAXUSB_DIR=$(LIBS_DIR)/MAXUSB include $(MAXUSB_DIR)/maxusb.mk - + ################################################################################ # Include the rules for building for this target. All other makefiles should be # included before this one. diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/app_config.h b/lib/sdk/Applications/EvKitExamples/BLE_scanner/app_config.h deleted file mode 100644 index 2d24d7e0c99f4a4a58381a9913fd881ba1e5a804..0000000000000000000000000000000000000000 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/app_config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef APP_CONFIG_H -#define APP_CONFIG_H - -/** - * @brief If defined, enables scanning for extended advertisements - * as specified by BLE 5.0. - * Currently supports mode 00 (non-scannable, non-connectible) */ -//#define USE_EXTENDED_ADV -#undef USE_EXTENDED_ADV - -#endif /* APP_CONFIG_H */ diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/config.mk b/lib/sdk/Applications/EvKitExamples/BLE_scanner/config.mk new file mode 100644 index 0000000000000000000000000000000000000000..69273d8356054fefe03cf9eb49df0e1cf3c01899 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/config.mk @@ -0,0 +1,15 @@ +# Specifies whether the legacy 4.2 api should be used. +# 1 by default. +# Set to 1 to use 4.2 advertisements. +# Set to 0 to use 5.0 extended advertisements. +BTLE_APP_USE_LEGACY_API?=1 + +# Specifies whether scan requests should be transmitted. +BTLE_APP_USE_ACTIVE_SCANNING?=1 + +# UART used for console output. +# 1 by default. +CONSOLE_UART?=1 + +# Run link layer using SDMA. +ENABLE_SDMA?=0 diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/main.c b/lib/sdk/Applications/EvKitExamples/BLE_scanner/main.c index 1235ff0dc22e3593f16ff75be117a8a9a3b35bf0..55eeaed26978f640e535a91071a8e53ab4a4986d 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/main.c @@ -1,66 +1,76 @@ -/*************************************************************************************************/ -/*! - * \file main.c +/******************************************************************************* + * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved. * - * \brief Main module. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * $Date: 2019-02-11 23:36:35 +0000 (Mon, 11 Feb 2019) $ - * $Revision: 40967 $ + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-07-11 16:28:10 -0500 (Thu, 11 Jul 2019) $ + * $Revision: 44575 $ + * + ******************************************************************************/ #include <stdio.h> #include <string.h> +#include "mxc_config.h" #include "wsf_types.h" #include "wsf_os.h" #include "wsf_buf.h" #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "ll_api.h" -#include "sch_api.h" #include "scanner_api.h" -#include "mxc_config.h" -#include "gcr_regs.h" -#include "mcr_regs.h" -#include "app_config.h" +#include "app_ui.h" +#include "radio_drv.h" #include "hci_core.h" +#include "hci_vs.h" /************************************************************************************************** Macros **************************************************************************************************/ /* Number of WSF buffer pools */ -#ifdef USE_EXTENDED_ADV -#define WSF_BUF_POOLS 7 -#else /* USE_EXTENDED_ADV */ -#define WSF_BUF_POOLS 6 -#endif /* USE_EXTENDED_ADV */ +#define WSF_BUF_POOLS 6 +#define WSF_BUF_SIZE 0x1048 /* Size of buffer for stdio functions */ -#define PRINTF_BUF_SIZE 128 +#define PRINTF_BUF_SIZE 128 /************************************************************************************************** Local Variables **************************************************************************************************/ +uint32_t SystemHeapSize=WSF_BUF_SIZE; +uint32_t SystemHeap[WSF_BUF_SIZE/4]; +uint32_t SystemHeapStart; + /*! Buffer for stdio functions */ char printf_buffer[PRINTF_BUF_SIZE]; -/*! Free memory for pool buffers (use word elements for word alignment). */ -static uint32_t mainBufMem[3584/sizeof(uint32_t)+96]; - /*! Default pool descriptor. */ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { @@ -69,12 +79,7 @@ static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] = { 64, 4 }, { 128, 4 }, { 256, 4 }, -#ifdef USE_EXTENDED_ADV - { 384, 3 }, - { 512, 1 } -#else /* USE_EXTENDED_ADV */ - { 384, 4 } -#endif /* USE_EXTENDED_ADV */ + { 512, 4 } }; /************************************************************************************************** @@ -91,67 +96,53 @@ void SysTick_Handler(void) } /*************************************************************************************************/ -static void myTrace(const char *pStr, va_list args) +static bool_t myTrace(const uint8_t *pBuf, uint32_t len) { extern uint8_t wsfCsNesting; if (wsfCsNesting == 0) { - vprintf(pStr, args); - printf("\r\n"); + fwrite(pBuf, len, 1, stdout); + return TRUE; } + + return FALSE; } /*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void WsfInit(void) +void PalSysAssertTrap(void) { - WsfTimerInit(); - WsfBufInit(sizeof(mainBufMem), (uint8_t*)mainBufMem, WSF_BUF_POOLS, mainPoolDesc); - WsfTraceRegister(myTrace); + printf("Assertion detected\n"); + while(1) {} } /*************************************************************************************************/ /*! - * \brief Initialize platform. - * - * \param msPerTick Milliseconds per timer tick. + * \brief Initialize WSF. * * \return None. */ /*************************************************************************************************/ -void PlatformInit(void) +static void WsfInit(void) { - /* Change the pullup on the RST pin to 25K */ - MXC_MCR->ctrl = 0x202; - - /* Set VREGO_D to 1.3V */ - *((volatile uint32_t*)0x40004410) = 0x50; - - /* Set TX LDO to 1.1V and enable LDO. Set RX LDO to 0.9V and enable LDO */ - MXC_GCR->btleldocn = 0xD9; // TX 1.1V RX 0.9V + uint32_t bytesUsed; - /* Power up the 32MHz XO */ - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_X32M_EN; - - /* Enable peripheral clocks */ - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_GPIO0D | MXC_F_GCR_PERCKCN0_GPIO1D); // Clear GPIO0 and GPIO1 Disable - MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_BTLED | MXC_F_GCR_PERCKCN1_TRNGD ); // Clear BTLE and ICACHE0 disable - - /* setup the systick */ + /* setup the systick for 1MS timer*/ SysTick->LOAD = (SystemCoreClock / 1000) * WSF_MS_PER_TICK; SysTick->VAL = 0; SysTick->CTRL |= (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk); -#ifndef __IAR_SYSTEMS_ICC__ - /* Added to prevent printf() and friends from using malloc() */ - setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); -#endif + WsfTimerInit(); + + SystemHeapStart = (uint32_t)&SystemHeap; + memset(SystemHeap, 0, sizeof(SystemHeap)); + printf("SystemHeapStart = 0x%x\n", SystemHeapStart); + printf("SystemHeapSize = 0x%x\n", SystemHeapSize); + bytesUsed = WsfBufInit(WSF_BUF_POOLS, mainPoolDesc); + printf("bytesUsed = 0x%x\n", bytesUsed); + + WsfTraceRegisterHandler(myTrace); + WsfTraceEnable(TRUE); } /* @@ -165,38 +156,15 @@ void SetAddress(uint8_t event) uint8_t bdAddr[6] = {0x02, 0x01, 0x44, 0x8B, 0x05, 0x00}; switch (event) { - case APP_UI_RESET_CMPL: - printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); - LlSetBdAddr((uint8_t*)&bdAddr); - LlGetBdAddr(hciCoreCb.bdAddr); - break; - default: - break; + case APP_UI_RESET_CMPL: + printf("Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X\n", bdAddr[5], bdAddr[4], bdAddr[3], bdAddr[2], bdAddr[1], bdAddr[0]); + HciVsSetBdAddr(bdAddr); + break; + default: + break; } } -/*************************************************************************************************/ -/*! - * \brief Initialize MAC layer. - * - * \param None. - * - * \return None. - */ -/*************************************************************************************************/ -void MacInit(void) -{ - wsfHandlerId_t handlerId; - - /* Initialize link layer. */ - BbInit(); - handlerId = WsfOsSetNextHandler(SchHandler); - SchInit(handlerId); - LlScanMasterInit(); - handlerId = WsfOsSetNextHandler(LlHandler); - LlHandlerInit(handlerId); -} - /*************************************************************************************************/ /*! * \fn main @@ -210,20 +178,15 @@ void MacInit(void) /*************************************************************************************************/ int main(void) { - /* Workaround for Hard Fault caused by memory read of dmEvt_t object allocated on stack */ - volatile uint8_t workaround[100]; - workaround[0] = 0; - workaround[0]; - -#ifdef USE_EXTENDED_ADV - printf("\n\n***** MAX32665 Extended Scanner *****\n"); -#else /* USE_EXTENDED_ADV */ - printf("\n\n***** MAX32665 Scanner *****\n"); -#endif /* USE_EXTENDED_ADV */ - - PlatformInit(); + +#ifndef __IAR_SYSTEMS_ICC__ + setvbuf(stdout, printf_buffer, _IOLBF, PRINTF_BUF_SIZE); +#endif + + printf("\n\n***** MAX32665 BLE Scanner *****\n"); + + /* Initialize Radio */ WsfInit(); - MacInit(); StackInitScanner(); ScannerStart(); diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_api.h b/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_api.h index d69c1b257b0b412ecebaee341b48441ca6f0f2ff..9062d715047b259b5198223d0904aa4a9092f8ac 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_api.h +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_api.h @@ -1,21 +1,18 @@ /*************************************************************************************************/ /*! - * \file + * \file * - * \brief + * \brief Proprietary data transfer client sample application. * - * $Date: 2018-08-10 14:36:39 +0000 (Fri, 10 Aug 2018) $ - * $Revision: 36825 $ - * - * Copyright (c) 2012 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. + * Copyright (c) 2012-2018 Arm Ltd. All Rights Reserved. + * ARM Ltd. confidential and proprietary. * * IMPORTANT. Your use of this file is governed by a Software License Agreement * ("Agreement") that must be accepted in order to download or otherwise receive a * copy of this file. You may not use or copy this file for any purpose other than * as described in the Agreement. If you do not agree to all of the terms of the * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior + * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior * to any use, copying or further distribution of this software. */ /*************************************************************************************************/ @@ -33,8 +30,6 @@ extern "C" { **************************************************************************************************/ /*************************************************************************************************/ /*! - * \fn ScannerStart - * * \brief Start the application. * * \return None. @@ -44,8 +39,6 @@ void ScannerStart(void); /*************************************************************************************************/ /*! - * \fn ScannerHandlerInit - * * \brief Application handler init function called during system initialization. * * \param handlerID WSF handler ID for App. @@ -58,8 +51,6 @@ void ScannerHandlerInit(wsfHandlerId_t handlerId); /*************************************************************************************************/ /*! - * \fn ScannerHandler - * * \brief WSF event handler for the application. * * \param event WSF event mask. diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_main.c b/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_main.c index f1b1024bb485b64c7c6747fc50486f189dfc5b4b..bc068856f308ffc7533e533b297551b6798b4f04 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_main.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/scanner_main.c @@ -1,21 +1,18 @@ /*************************************************************************************************/ /*! - * \file + * \file * - * \brief + * \brief Proprietary data transfer client sample application for Nordic-ble. * - * $Date: 2018-11-15 02:01:14 +0000 (Thu, 15 Nov 2018) $ - * $Revision: 39269 $ - * - * Copyright (c) 2012 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. + * Copyright (c) 2012-2018 Arm Ltd. All Rights Reserved. + * ARM Ltd. confidential and proprietary. * * IMPORTANT. Your use of this file is governed by a Software License Agreement * ("Agreement") that must be accepted in order to download or otherwise receive a * copy of this file. You may not use or copy this file for any purpose other than * as described in the Agreement. If you do not agree to all of the terms of the * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior + * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior * to any use, copying or further distribution of this software. */ /*************************************************************************************************/ @@ -27,20 +24,28 @@ #include "wsf_msg.h" #include "wsf_trace.h" #include "wsf_assert.h" +#include "wsf_buf.h" #include "hci_api.h" #include "dm_api.h" +#include "gap/gap_api.h" #include "att_api.h" #include "smp_api.h" #include "app_cfg.h" #include "app_api.h" #include "app_db.h" #include "app_ui.h" +#include "svc_core.h" #include "svc_ch.h" #include "gatt/gatt_api.h" #include "wpc/wpc_api.h" #include "scanner_api.h" +#include "util/calc128.h" + +/************************************************************************************************** +Macros +**************************************************************************************************/ -#include "app_config.h" +#define TEST_TIMER_IND 0x99 /************************************************************************************************** Local Variables @@ -53,49 +58,84 @@ struct bool_t scanning; /*! TRUE if scanning */ } scannerCb; +/*! test control block */ +struct +{ + unsigned int counter; + wsfTimer_t timer; +} testCb; + /************************************************************************************************** Configurable Parameters **************************************************************************************************/ +#ifdef BTLE_APP_USE_LEGACY_API /*! configurable parameters for master */ - -#ifdef USE_EXTENDED_ADV -static const appExtMasterCfg_t scannerExtMasterCfg = +static const appMasterCfg_t scannerMasterCfg = { - {160}, /*! The scan interval, in 0.625 ms units */ - {160}, /*! The scan window, in 0.625 ms units */ + 420, /*! The scan interval, in 0.625 ms units */ + 420, /*! The scan window, in 0.625 ms units */ 0, /*! The scan duration in ms */ - 0, /*! The scan period in ms */ DM_DISC_MODE_NONE, /*! The GAP discovery mode */ +#ifdef BTLE_APP_USE_ACTIVE_SCANNING + DM_SCAN_TYPE_ACTIVE +#else /* BTLE_APP_USE_ACTIVE_SCANNING */ + DM_SCAN_TYPE_PASSIVE +#endif /* BTLE_APP_USE_ACTIVE_SCANNING */ + /*!< The scan type (active or passive) */ +}; + +#else /* BTLE_APP_USE_LEGACY_API */ +/*! configurable parameters for extended master */ +static const uint8_t scannerExtMasterScanPhysCfg = + HCI_SCAN_PHY_LE_1M_BIT | + //HCI_SCAN_PHY_LE_2M_BIT | + //HCI_SCAN_PHY_LE_CODED_BIT | + 0; +static const appExtMasterCfg_t scannerExtMasterCfg = +{ + { 420, 420, 420 }, /*! \brief The scan interval, in 0.625 ms units */ + { 420, 420, 420 }, /*! \brief The scan window, in 0.625 ms units. Must be less than or equal to scan interval. */ + 0, /*! \brief The scan duration in ms. Set to zero or both duration and period to non-zero to scan until stopped. */ + 0, /*! \brief The scan period, in 1.28 sec units. Set to zero to disable periodic scanning. */ + DM_DISC_MODE_NONE, /*! \brief The GAP discovery mode (general, limited, or none) */ +#ifdef BTLE_APP_USE_ACTIVE_SCANNING { -#if 0 - DM_SCAN_TYPE_ACTIVE /*! The scan type (active or passive) */ -#else - DM_SCAN_TYPE_PASSIVE /*! The scan type (active or passive) */ -#endif + DM_SCAN_TYPE_ACTIVE, + DM_SCAN_TYPE_ACTIVE, + DM_SCAN_TYPE_ACTIVE } +#else /* BTLE_APP_USE_ACTIVE_SCANNING */ + { + DM_SCAN_TYPE_PASSIVE, + DM_SCAN_TYPE_PASSIVE, + DM_SCAN_TYPE_PASSIVE + } +#endif /* BTLE_APP_USE_ACTIVE_SCANNING */ + /*!< \brief The scan type (active or passive) */ }; -#else /* USE_EXTENDED_ADV */ -static const appMasterCfg_t scannerMasterCfg = +#endif /* BTLE_APP_USE_LEGACY_API */ + +/************************************************************************************************** + ATT Client Discovery Data +**************************************************************************************************/ + +/*! Discovery states: enumeration of services to be discovered */ +enum { - 160, /*! The scan interval, in 0.625 ms units */ - 160, /*! The scan window, in 0.625 ms units */ - 0, /*! The scan duration in ms */ - DM_DISC_MODE_NONE, /*! The GAP discovery mode */ -#if 1 - DM_SCAN_TYPE_ACTIVE /*! The scan type (active or passive) */ -#else - DM_SCAN_TYPE_PASSIVE /*! The scan type (active or passive) */ -#endif + SCANNER_DISC_GATT_SVC, /*! GATT service */ + SCANNER_DISC_GAP_SVC, /*! GAP service */ + SCANNER_DISC_WP_SVC, /*! ARM Ltd. proprietary service */ + SCANNER_DISC_SVC_MAX /*! Discovery complete */ }; -#endif /* USE_EXTENDED_ADV */ +/************************************************************************************************** + ATT Client Configuration Data +**************************************************************************************************/ /*************************************************************************************************/ /*! - * \fn scannerDmCback - * * \brief Application DM callback. * * \param pDmEvt DM callback event @@ -111,23 +151,14 @@ static void scannerDmCback(dmEvt_t *pDmEvt) len = DmSizeOfEvt(pDmEvt); - reportLen = 0; if (pDmEvt->hdr.event == DM_SCAN_REPORT_IND) { reportLen = pDmEvt->scanReport.len; } -#ifdef USE_EXTENDED_ADV else { reportLen = 0; } -#else /* USE_EXTENDED_ADV */ - else if (pDmEvt->hdr.event == DM_EXT_SCAN_REPORT_IND) - { - if (pDmEvt->extScanReport.pData) - reportLen = pDmEvt->extScanReport.len; - } -#endif /* USE_EXTENDED_ADV */ if ((pMsg = WsfMsgAlloc(len + reportLen)) != NULL) { @@ -137,13 +168,6 @@ static void scannerDmCback(dmEvt_t *pDmEvt) pMsg->scanReport.pData = (uint8_t *) ((uint8_t *) pMsg + len); memcpy(pMsg->scanReport.pData, pDmEvt->scanReport.pData, reportLen); } -#ifdef USE_EXTENDED_ADV - else if (pDmEvt->hdr.event == DM_EXT_SCAN_REPORT_IND) - { - pMsg->extScanReport.pData = (uint8_t *) ((uint8_t *) pMsg + len); - memcpy(pMsg->extScanReport.pData, pDmEvt->extScanReport.pData, reportLen); - } -#endif /* USE_EXTENDED_ADV */ WsfMsgSend(scannerCb.handlerId, pMsg); } } @@ -159,7 +183,10 @@ static void scannerDmCback(dmEvt_t *pDmEvt) /*************************************************************************************************/ static void scannerScanStart(dmEvt_t *pMsg) { - scannerCb.scanning = TRUE; + if (pMsg->hdr.status == HCI_SUCCESS) + { + scannerCb.scanning = TRUE; + } } /*************************************************************************************************/ @@ -173,7 +200,10 @@ static void scannerScanStart(dmEvt_t *pMsg) /*************************************************************************************************/ static void scannerScanStop(dmEvt_t *pMsg) { - scannerCb.scanning = FALSE; + if (pMsg->hdr.status == HCI_SUCCESS) + { + scannerCb.scanning = FALSE; + } } /*************************************************************************************************/ @@ -193,7 +223,7 @@ static void scannerScanReport(dmEvt_t *pMsg) return; } - printf("scannerScanReport() %x : %02x:%02x:%02x:%02x:%02x:%02x\n", pMsg->scanReport.addrType, + printf("scannerScanReport() %x : %02x:%02x:%02x:%02x:%02x:%02x",pMsg->scanReport.addrType, pMsg->scanReport.addr[5], pMsg->scanReport.addr[4], pMsg->scanReport.addr[3], @@ -201,29 +231,13 @@ static void scannerScanReport(dmEvt_t *pMsg) pMsg->scanReport.addr[1], pMsg->scanReport.addr[0]); - printf(" len %u, rssi %d, evtType %x, addrType %x", pMsg->scanReport.len, pMsg->scanReport.rssi, pMsg->scanReport.eventType, pMsg->scanReport.addrType); - - if (pMsg->scanReport.pData[1] == DM_ADV_TYPE_LOCAL_NAME) - { - uint8_t name[32]; - memset(name, 0, sizeof(name)); - memcpy(name, &pMsg->scanReport.pData[2], pMsg->scanReport.pData[0]); - printf(" | %s\n", name); - } - else { - printf(", data %2u:", pMsg->scanReport.len); - int i; - for (i = 0; i < pMsg->scanReport.len; i++) { - printf(" %02x", pMsg->scanReport.pData[i]); - } - printf("\n"); - } + printf(" len %u, rssi %d, evtType %x, addrType %x\n", pMsg->scanReport.len, pMsg->scanReport.rssi, pMsg->scanReport.eventType, pMsg->scanReport.addrType); } -#ifdef USE_EXTENDED_ADV +#ifndef BTLE_APP_IGNORE_EXT_EVENTS /*************************************************************************************************/ /*! - * \brief Handle an extended scan report. + * \brief Handle a scan report. * * \param pMsg Pointer to DM callback event message. * @@ -238,33 +252,17 @@ static void scannerExtScanReport(dmEvt_t *pMsg) return; } - printf("scannerExtScanReport() %x : %02x:%02x:%02x:%02x:%02x:%02x\n", pMsg->extScanReport.addrType, - pMsg->extScanReport.addr[5], - pMsg->extScanReport.addr[4], - pMsg->extScanReport.addr[3], - pMsg->extScanReport.addr[2], - pMsg->extScanReport.addr[1], - pMsg->extScanReport.addr[0]); + printf("scannerExtScanReport() %x : %02x:%02x:%02x:%02x:%02x:%02x", pMsg->extScanReport.addrType, + pMsg->extScanReport.addr[5], + pMsg->extScanReport.addr[4], + pMsg->extScanReport.addr[3], + pMsg->extScanReport.addr[2], + pMsg->extScanReport.addr[1], + pMsg->extScanReport.addr[0]); - printf(" len %u, rssi %d, evtType %x, addrType %x", pMsg->extScanReport.len, pMsg->extScanReport.rssi, pMsg->extScanReport.eventType, pMsg->extScanReport.addrType); - - if (pMsg->extScanReport.pData[1] == DM_ADV_TYPE_LOCAL_NAME) - { - uint8_t name[32]; - memset(name, 0, sizeof(name)); - memcpy(name, &pMsg->extScanReport.pData[2], pMsg->extScanReport.pData[0]); - printf(" | %s\n", name); - } - else { - printf(", data %2u:", pMsg->extScanReport.len); - int i; - for (i = 0; i < pMsg->extScanReport.len; i++) { - printf(" %02x", pMsg->extScanReport.pData[i]); - } - printf("\n"); - } + printf(" len %u, rssi %d, evtType %x, addrType %x\n", pMsg->extScanReport.len, pMsg->extScanReport.rssi, pMsg->extScanReport.eventType, pMsg->extScanReport.addrType); } -#endif /* USE_EXTENDED_ADV */ +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ /*************************************************************************************************/ /*! @@ -275,35 +273,45 @@ static void scannerExtScanReport(dmEvt_t *pMsg) * \return None. */ /*************************************************************************************************/ -#ifdef USE_EXTENDED_ADV static void scannerSetup(dmEvt_t *pMsg) { scannerCb.scanning = FALSE; - - AppExtScanStart( - 0x01, // Support PHY 1M - scannerExtMasterCfg.discMode, - scannerExtMasterCfg.scanType, - scannerExtMasterCfg.scanDuration, - scannerExtMasterCfg.scanPeriod); -} -#else /* USE_EXTENDED_ADV */ -static void scannerSetup(dmEvt_t *pMsg) -{ + + testCb.timer.handlerId = scannerCb.handlerId; + testCb.timer.msg.event = TEST_TIMER_IND; + WsfTimerStartMs(&testCb.timer, 1000); + + /* If this is defined to one, scanning will be limited to the peer */ #if 0 - /* If this is defined to one, scanning will be limited to the EvKit dats peer */ DmDevWhiteListAdd(DM_ADDR_PUBLIC, (bdAddr_t){0x02, 0x00, 0x44, 0x8B, 0x05, 0x00}); DmDevSetFilterPolicy(DM_FILT_POLICY_MODE_SCAN, HCI_FILT_WHITE_LIST); + DmDevSetFilterPolicy(DM_FILT_POLICY_MODE_INIT, HCI_FILT_WHITE_LIST); #endif +} - scannerCb.scanning = FALSE; - AppScanStart(scannerMasterCfg.discMode, scannerMasterCfg.scanType, scannerMasterCfg.scanDuration); - /* 0x3 : 1M and 2M PHYs */ - DmSetDefaultPhy(0, 0x3, 0x3); +/*************************************************************************************************/ +static void testTimerHandler(void) +{ + testCb.counter++; + + if (testCb.counter == 2) + { +#ifdef BTLE_APP_USE_LEGACY_API + AppScanStart(scannerMasterCfg.discMode, scannerMasterCfg.scanType, scannerMasterCfg.scanDuration); +#else /* BTLE_APP_USE_LEGACY_API */ + AppExtScanStart( + scannerExtMasterScanPhysCfg, + scannerExtMasterCfg.discMode, + scannerExtMasterCfg.scanType, + scannerExtMasterCfg.scanDuration, + scannerExtMasterCfg.scanPeriod); +#endif /* BTLE_APP_USE_LEGACY_API */ + } + + WsfTimerStartMs(&testCb.timer, 1000); } -#endif /* USE_EXTENDED_ADV*/ /*************************************************************************************************/ /*! @@ -321,6 +329,7 @@ static void scannerProcMsg(dmEvt_t *pMsg) switch(pMsg->hdr.event) { case DM_RESET_CMPL_IND: + DmSecGenerateEccKeyReq(); scannerSetup(pMsg); uiEvent = APP_UI_RESET_CMPL; break; @@ -329,62 +338,38 @@ static void scannerProcMsg(dmEvt_t *pMsg) scannerScanStart(pMsg); uiEvent = APP_UI_SCAN_START; break; - + +#ifndef BTLE_APP_IGNORE_EXT_EVENTS + case DM_EXT_SCAN_START_IND: + scannerScanStart(pMsg); + uiEvent = APP_UI_EXT_SCAN_START_IND; + break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ + case DM_SCAN_STOP_IND: scannerScanStop(pMsg); uiEvent = APP_UI_SCAN_STOP; break; -#ifdef USE_EXTENDED_ADV - case DM_EXT_SCAN_START_IND: - scannerScanStart(pMsg); - uiEvent = APP_UI_SCAN_START; - break; - +#ifndef BTLE_APP_IGNORE_EXT_EVENTS case DM_EXT_SCAN_STOP_IND: scannerScanStop(pMsg); - uiEvent = APP_UI_SCAN_STOP; + uiEvent = APP_UI_EXT_SCAN_STOP_IND; break; -#endif /* USE_EXTENDED_ADV */ +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ case DM_SCAN_REPORT_IND: scannerScanReport(pMsg); break; -#ifdef USE_EXTENDED_ADV +#ifndef BTLE_APP_IGNORE_EXT_EVENTS case DM_EXT_SCAN_REPORT_IND: scannerExtScanReport(pMsg); break; -#endif /* USE_EXTENDED_ADV */ - - case DM_CONN_OPEN_IND: - uiEvent = APP_UI_CONN_OPEN; - break; +#endif /* BTLE_APP_IGNORE_EXT_EVENTS */ - case DM_CONN_CLOSE_IND: - uiEvent = APP_UI_CONN_CLOSE; - break; - - case DM_SEC_PAIR_CMPL_IND: - uiEvent = APP_UI_SEC_PAIR_CMPL; - break; - - case DM_SEC_PAIR_FAIL_IND: - uiEvent = APP_UI_SEC_PAIR_FAIL; - break; - - case DM_SEC_ENCRYPT_IND: - uiEvent = APP_UI_SEC_ENCRYPT; - break; - - case DM_SEC_ENCRYPT_FAIL_IND: - uiEvent = APP_UI_SEC_ENCRYPT_FAIL; - break; - - case DM_SEC_AUTH_REQ_IND: - break; - - default: + case TEST_TIMER_IND: + testTimerHandler(); break; } @@ -406,17 +391,17 @@ static void scannerProcMsg(dmEvt_t *pMsg) void ScannerHandlerInit(wsfHandlerId_t handlerId) { APP_TRACE_INFO0("ScannerHandlerInit"); - + /* store handler ID */ scannerCb.handlerId = handlerId; - + /* Set configuration pointers */ -#ifdef USE_EXTENDED_ADV - pAppExtMasterCfg = (appExtMasterCfg_t *) &scannerExtMasterCfg; -#else /* USE_EXTENDED_ADV */ +#ifdef BTLE_APP_USE_LEGACY_API pAppMasterCfg = (appMasterCfg_t *) &scannerMasterCfg; -#endif /* USE_EXTENDED_ADV */ - +#else /* BTLE_APP_USE_LEGACY_API */ + pAppExtMasterCfg = (appExtMasterCfg_t *) &scannerExtMasterCfg; +#endif /* BTLE_APP_USE_LEGACY_API */ + /* Initialize application framework */ AppMasterInit(); } @@ -432,13 +417,22 @@ void ScannerHandlerInit(wsfHandlerId_t handlerId) */ /*************************************************************************************************/ void ScannerHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) -{ +{ if (pMsg != NULL) { - APP_TRACE_INFO1("Scanner got evt 0x%x", pMsg->event); + if (pMsg->event != TEST_TIMER_IND) + { + APP_TRACE_INFO2("Scanner got evt 0x%x, param %u", pMsg->event, pMsg->param); + } + /* process ATT messages */ + if (pMsg->event <= ATT_CBACK_END) + { + /* process discovery-related ATT messages */ + AppDiscProcAttMsg((attEvt_t *) pMsg); + } /* process DM messages */ - if ((pMsg->event >= DM_CBACK_START) && (pMsg->event <= DM_CBACK_END)) + else if (pMsg->event <= DM_CBACK_END) { /* process advertising and connection-related messages */ AppMasterProcDmMsg((dmEvt_t *) pMsg); @@ -451,7 +445,7 @@ void ScannerHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) } /* perform profile and user interface-related operations */ - scannerProcMsg((dmEvt_t *) pMsg); + scannerProcMsg((dmEvt_t *) pMsg); } } @@ -463,11 +457,11 @@ void ScannerHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) */ /*************************************************************************************************/ void ScannerStart(void) -{ +{ + /* Register for stack callbacks */ DmRegister(scannerDmCback); - DmConnRegister(DM_CLIENT_ID_APP, scannerDmCback); /* Reset the device */ - DmDevReset(); + DmDevReset(); } diff --git a/lib/sdk/Applications/EvKitExamples/BLE_scanner/stack_scanner.c b/lib/sdk/Applications/EvKitExamples/BLE_scanner/stack_scanner.c index 816df21afe8c48476e1c33be25ade1ca4a22d683..48f6cd5af66c98b2df3ea2308c67c4f2aedd3787 100644 --- a/lib/sdk/Applications/EvKitExamples/BLE_scanner/stack_scanner.c +++ b/lib/sdk/Applications/EvKitExamples/BLE_scanner/stack_scanner.c @@ -2,7 +2,7 @@ /*! * \file * - * \brief Stack initialization for datc. + * \brief Stack initialization for scanner. * * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. * ARM Ltd. confidential and proprietary. @@ -17,12 +17,12 @@ */ /*************************************************************************************************/ +#include <stdio.h> +#include <string.h> #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" - #include "scanner_api.h" - #include "hci_handler.h" #include "dm_handler.h" #include "l2c_handler.h" @@ -35,8 +35,57 @@ #include "svc_dis.h" #include "svc_core.h" #include "sec_api.h" +#include "ll_init_api.h" + + +#define LL_IMPL_REV 0x2303 + +#define LL_MEMORY_FOOTPRINT 0xc152 + +uint8_t LlMem[LL_MEMORY_FOOTPRINT]; + +const LlRtCfg_t _ll_cfg = { + /* Device */ + /*compId*/ LL_COMP_ID_ARM, + /*implRev*/ LL_IMPL_REV, + /*btVer*/ LL_VER_BT_CORE_SPEC_5_0, + /*_align32 */ 0, // padding for alignment + + /* Advertiser */ + /*maxAdvSets*/ 4, // 4 Extended Advertising Sets + /*maxAdvReports*/ 8, + /*maxExtAdvDataLen*/ LL_MAX_ADV_DATA_LEN, + /*defExtAdvDataFrag*/ 64, + /*auxDelayUsec*/ 0, + + /* Scanner */ + /*maxScanReqRcvdEvt*/ 4, + /*maxExtScanDataLen*/ LL_MAX_ADV_DATA_LEN, + + /* Connection */ + /*maxConn*/ 2, + /*numTxBufs*/ 16, + /*numRxBufs*/ 16, + /*maxAclLen*/ 512, + /*defTxPwrLvl*/ 0, + /*ceJitterUsec*/ 0, + + /* DTM */ + /*dtmRxSyncMs*/ 10000, -#include "app_config.h" + /* PHY */ + /*phy2mSup*/ TRUE, + /*phyCodedSup*/ TRUE, + /*stableModIdxTxSup*/ FALSE, + /*stableModIdxRxSup*/ FALSE +}; + +const BbRtCfg_t _bb_cfg = { + /*clkPpm*/ 20, + /*rfSetupDelayUsec*/ BB_RF_SETUP_DELAY_US, + /*maxScanPeriodMsec*/ BB_MAX_SCAN_PERIOD_MS, + /*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US +}; /*************************************************************************************************/ /*! @@ -49,7 +98,32 @@ void StackInitScanner(void) { wsfHandlerId_t handlerId; +#ifndef ENABLE_SDMA + uint32_t memUsed; + + /* Initialize link layer. */ + LlInitRtCfg_t ll_init_cfg = + { + .pBbRtCfg = &_bb_cfg, + .wlSizeCfg = 4, + .rlSizeCfg = 4, + .plSizeCfg = 4, + .pLlRtCfg = &_ll_cfg, + .pFreeMem = LlMem, + .freeMemAvail = LL_MEMORY_FOOTPRINT + }; + + memUsed = LlInitControllerExtInit(&ll_init_cfg); + // memUsed = LlInitControllerInit(&ll_init_cfg); + if(memUsed != LL_MEMORY_FOOTPRINT) + { + printf("mem_used: 0x%x LL_MEMORY_FOOTPRINT: 0x%x\n", memUsed, + LL_MEMORY_FOOTPRINT); + } +#endif + SecInit(); + SecRandInit(); SecAesInit(); SecCmacInit(); SecEccInit(); @@ -60,16 +134,17 @@ void StackInitScanner(void) handlerId = WsfOsSetNextHandler(DmHandler); DmDevVsInit(0); DmDevPrivInit(); -#ifdef USE_EXTENDED_ADV - DmExtScanInit(); - DmConnInit(); - DmExtConnMasterInit(); -#else /* USE_EXTENDED_ADV */ +#ifdef BTLE_APP_USE_LEGACY_API DmScanInit(); DmConnInit(); DmConnMasterInit(); -#endif /* USE_EXTENDED_ADV */ +#else /* BTLE_APP_USE_LEGACY_API */ + DmExtScanInit(); + DmConnInit(); + DmExtConnMasterInit(); +#endif /* BTLE_APP_USE_LEGACY_API */ DmSecInit(); + DmPhyInit(); DmSecLescInit(); DmPrivInit(); DmHandlerInit(handlerId); @@ -82,6 +157,7 @@ void StackInitScanner(void) AttsInit(); AttsIndInit(); AttcInit(); + AttsSignInit(); handlerId = WsfOsSetNextHandler(SmpHandler); SmpHandlerInit(handlerId); diff --git a/lib/sdk/Applications/EvKitExamples/ECC/Makefile b/lib/sdk/Applications/EvKitExamples/ECC/Makefile index c68e009bf5b214083994e9964e644e62ad8853fe..c8055dbdd8259bfa4dbdfedb6511c2b67c80ee2f 100644 --- a/lib/sdk/Applications/EvKitExamples/ECC/Makefile +++ b/lib/sdk/Applications/EvKitExamples/ECC/Makefile @@ -1,5 +1,5 @@ ################################################################################ - # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + # Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -96,6 +96,9 @@ PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE # Point this variable to a linker file to override the default file # LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld +# Tell the compiler to use smaller SRAM size when ECC is enabled +SRAM_SIZE=0x70000 + ################################################################################ # Include external library makefiles here diff --git a/lib/sdk/Applications/EvKitExamples/ECC/main.c b/lib/sdk/Applications/EvKitExamples/ECC/main.c index 312c89c4089fd5eadfc1ea14148bb28c1a694782..6fe1c51fbf6933e74d19eabf6d6178d01f6373e1 100644 --- a/lib/sdk/Applications/EvKitExamples/ECC/main.c +++ b/lib/sdk/Applications/EvKitExamples/ECC/main.c @@ -1,5 +1,13 @@ + +/** + * @file main.c + * @brief Demonstration of SRAM ECC + * @details This program demonstrates single and double-bit error detection and + * single-bit correction for SRAM memories. + */ + /******************************************************************************* - * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -34,22 +42,17 @@ * ******************************************************************************/ -/** - * @file main.c - * @brief Hello World! - * @details This example uses the UART to print to a terminal and flashes an LED. - */ - /***** Includes *****/ #include <stdio.h> #include <stdint.h> #include "mxc_config.h" #include "led.h" #include "board.h" -#include "tmr_utils.h" #include "mcr_regs.h" /***** Definitions *****/ +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) /***** Globals *****/ volatile uint32_t badData; @@ -58,67 +61,152 @@ volatile uint32_t eccErr; volatile uint32_t eccDErr; volatile uint32_t eccAddr; - +// Find the highest address in RAM, subtract the portion taken away by ECC +uint32_t ramTop = (MXC_SRAM_MEM_BASE + (MXC_SRAM_MEM_SIZE*0.8)); /***** Functions *****/ +int PreInit(void) +{ + /* This PreInit overrides the default in system_max32665.c, so that + * ECC can be turned on before the C init routine. One must be + * careful not to use stack, bss/ibss, or heap in this routine. + */ + + // Turn on ECC for all banks + MXC_MCR->eccen = + MXC_F_MCR_ECCEN_SYSRAM0ECCEN | + MXC_F_MCR_ECCEN_SYSRAM1ECCEN | + MXC_F_MCR_ECCEN_SYSRAM2ECCEN | + MXC_F_MCR_ECCEN_SYSRAM3ECCEN | + MXC_F_MCR_ECCEN_SYSRAM4ECCEN | + MXC_F_MCR_ECCEN_SYSRAM5ECCEN; + + // Zeroize all banks, which ensures ECC bits are written for no errors + MXC_GCR->memzcn = + MXC_F_GCR_MEMZCN_SRAM0Z | + MXC_F_GCR_MEMZCN_SRAM1Z | + MXC_F_GCR_MEMZCN_SRAM2Z | + MXC_F_GCR_MEMZCN_SRAM3Z | + MXC_F_GCR_MEMZCN_SRAM4Z | + MXC_F_GCR_MEMZCN_SRAM5Z; + + while (MXC_GCR->memzcn & (MXC_F_GCR_MEMZCN_SRAM0Z | + MXC_F_GCR_MEMZCN_SRAM1Z | + MXC_F_GCR_MEMZCN_SRAM2Z | + MXC_F_GCR_MEMZCN_SRAM3Z | + MXC_F_GCR_MEMZCN_SRAM4Z | + MXC_F_GCR_MEMZCN_SRAM5Z)); + + // Per the API in system_max32665.c, return 0 so normal C init occurs + return 0; +} + void ECC_IRQHandler(void) { eccErr = MXC_GCR->eccerr; eccDErr = MXC_GCR->eccnded; eccAddr = MXC_GCR->eccerrad; - eccFlag = 1; + eccFlag = 1; - MXC_GCR->eccerr = 0xFFFFFFFF; - MXC_GCR->eccnded = 0xFFFFFFFF; + MXC_GCR->eccerr = MXC_GCR->eccerr; + MXC_GCR->eccnded = MXC_GCR->eccnded; } // ***************************************************************************** int main(void) { - printf("------------------------------------------------------\n"); - printf("ECC Example\n"); + unsigned int i, test_fail, test_pass; + volatile uint32_t *cursor; + + test_fail = test_pass = 0; + + printf("\n\n***** MAX" TOSTRING(TARGET) " SRAM ECC Example *****\n\n"); printf("This example will corrupt a word of data\n"); - printf("and ensure that the ECC throws an error when it's read\n"); + printf("and ensure that the ECC interrupts on an error\n"); + printf("when the corrupted address is read\n\n"); - // Clear all ECC Errors - MXC_GCR->eccerr = 0xFFFFFFFF; - MXC_GCR->eccnded = 0xFFFFFFFF; + // Clear all ECC Errors -- write-1-to-clear + MXC_GCR->eccerr = MXC_GCR->eccerr; + MXC_GCR->eccnded = MXC_GCR->eccnded; - // Enable SysRAM ECC and interrupts - MXC_MCR->eccen |= 1; - MXC_GCR->eccirqen |= 0x3F; + // Enable interrupts for ECC errors + MXC_GCR->eccirqen |= + MXC_F_GCR_ECCIRQEN_SYSRAM0ECCEN | + MXC_F_GCR_ECCIRQEN_SYSRAM1ECCEN | + MXC_F_GCR_ECCIRQEN_SYSRAM2ECCEN | + MXC_F_GCR_ECCIRQEN_SYSRAM3ECCEN | + MXC_F_GCR_ECCIRQEN_SYSRAM4ECCEN | + MXC_F_GCR_ECCIRQEN_SYSRAM5ECCEN; NVIC_EnableIRQ(ECC_IRQn); + // Scan all of memory, which should not cause any errors to be detected + printf("Preliminary scan to ensure no pre-existing ECC errors\n"); + eccFlag = 0; + + for (i = MXC_SRAM_MEM_BASE; i < ramTop-sizeof(uint32_t); i+= sizeof(uint32_t)) { + cursor = (uint32_t *)i; + *cursor; + if (eccFlag) { + break; + } + } + printf("%d\n", ramTop); + if (eccFlag) { + printf("ECC Error: 0x%08x\n", eccErr); + printf("ECC Not Double Error: 0x%08x\n", eccDErr); + printf("ECC Error Address: 0x%08x\n", eccAddr); + printf("FAIL: Error found in preliminary memory scan\n"); + test_fail++; + } else { + printf("PASS: No errors\n"); + test_pass++; + } + + // Initialize data badData = 0xDEADBEEF; - printf("--------\nData before Corruption: 0x%08x\n", badData); + + printf("\nData before Corruption: 0x%08x\n", badData); printf("Address of data: 0x%08x\n", &badData); - // Disable IRQ and Corrupt Data - MXC_MCR->eccen &= ~1; + // Disable ECC so data can be corrupted + MXC_MCR->eccen &= ~MXC_F_MCR_ECCEN_SYSRAM0ECCEN; badData = 0xDEADBEEE; - MXC_MCR->eccen |= 1; + MXC_MCR->eccen |= MXC_F_MCR_ECCEN_SYSRAM0ECCEN; - printf("--------\nData after 1bit error: 0x%08x\n", badData); + printf("\nData after single-bit error: 0x%08x\n", badData); printf("ECC Error: 0x%08x\n", eccErr); printf("ECC Not Double Error: 0x%08x\n", eccDErr); printf("ECC Error Address: 0x%08x\n", eccAddr); - if(eccFlag) { - printf("An ECC Error was found!\n"); - eccFlag = 0; + if (eccFlag) { + printf("PASS: An ECC Error was found\n"); + eccFlag = 0; + test_pass++; + } else { + printf("FAIL: Error not detected!\n"); + eccFlag = 0; + test_fail++; } - - MXC_MCR->eccen &= ~1; + + // Disable ECC so data can be corrupted + MXC_MCR->eccen &= ~MXC_F_MCR_ECCEN_SYSRAM0ECCEN; badData = 0xDEADBEEC; - MXC_MCR->eccen |= 1; + MXC_MCR->eccen |= MXC_F_MCR_ECCEN_SYSRAM0ECCEN; - printf("--------\nData after 2 bit error: 0x%08x\n", badData); + printf("\nData after double-bit error: 0x%08x\n", badData); printf("ECC Error: 0x%08x\n", eccErr); printf("ECC Not Double Error: 0x%08x\n", eccDErr); printf("ECC Error Address: 0x%08x\n", eccAddr); - if(eccFlag) { - printf("An ECC Error was found!\n"); - eccFlag = 0; + if (eccFlag) { + printf("PASS: An ECC Error was found\n"); + eccFlag = 0; + test_pass++; + } else { + printf("FAIL: Error not detected!\n"); + eccFlag = 0; + test_fail++; } + printf("\n# Passed: %u, # Failed: %u, Test %s\n", test_pass, test_fail, test_fail ? "FAIL!" : "Ok"); printf("Example Complete\n"); + while(1); } diff --git a/lib/sdk/Applications/EvKitExamples/LP/main.c b/lib/sdk/Applications/EvKitExamples/LP/main.c index 80a0e23b82b53f550716f81577a435d1ec6cf2e0..a92a90979140d839ba48d5da310f538889d0565c 100644 --- a/lib/sdk/Applications/EvKitExamples/LP/main.c +++ b/lib/sdk/Applications/EvKitExamples/LP/main.c @@ -49,8 +49,8 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2018-10-15 21:49:29 +0000 (Mon, 15 Oct 2018) $ - * $Revision: 38520 $ + * $Date: 2019-04-26 14:44:33 -0500 (Fri, 26 Apr 2019) $ + * $Revision: 42977 $ * **************************************************************************** */ @@ -210,7 +210,7 @@ void backup(void) { SIMO_setVregO_B(850); SIMO_setVregO_C(850); - LP_EnterBackupMode(); + LP_EnterBackupMode(NULL); } void turnOffUnused(void) { diff --git a/lib/sdk/Applications/EvKitExamples/RPU/.cproject b/lib/sdk/Applications/EvKitExamples/RPU/.cproject new file mode 100644 index 0000000000000000000000000000000000000000..c9e3171991c57e629041fa8eca9c6f4b3fce2df9 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/.cproject @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> + <storageModule moduleId="org.eclipse.cdt.core.settings"> + <cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <externalSettings/> + <extensions> + <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" name="Debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug"> + <folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962." name="/" resourcePath=""> + <toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.548125692" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1448195934" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.989348626" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.573934961" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.1195068176" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.1035348629" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.31679983" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.max" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1676901946" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1729767352" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="GNU Tools for ARM Embedded Processors" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1708484008" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.178519983" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m3" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.956545422" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1580514969" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1246670973" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1674926322" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.2051566192" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.408066731" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.1900584936" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.1096852527" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.937347953" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1468247042" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.1529750846" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.667765305" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/> + <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.786533016" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/> + <builder arguments="ECLIPSE=1" buildPath="${workspace_loc:/RPU}" command="make" id="ilg.gnuarmeclipse.managedbuild.cross.builder.592880777" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1648672385" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1969112665" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.507854261" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1576427906" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1576427906" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath"> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/CMSIS/Device/Maxim/MAX32665/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/MAX32665PeriphDriver/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/Boards/EvKit_V1/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/Boards/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Firmware/MAX32665/Libraries/CMSIS/Include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/arm-none-eabi/include""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/arm-none-eabi/include/sys""/> + <listOptionValue builtIn="false" value=""${MAXIM_PATH}/Toolchain/lib/gcc/arm-none-eabi/6.3.1/include""/> + </option> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.68945223" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.794996645" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.675776866" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.185399645" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/> + <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.246156916" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input"> + <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> + <additionalInput kind="additionalinput" paths="$(LIBS)"/> + </inputType> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.391142733" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.2099090970" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.399743328" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.822983655" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash"/> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1050446219" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.335976671" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.964898349" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.972868647" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.890608562" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.1669392057" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/> + </tool> + <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.403251962" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize"> + <option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1919947275" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="RPU.ilg.gnuarmeclipse.managedbuild.cross.target.elf.737306620" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + <scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1576427906;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.68945223"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + </scannerConfigBuildInfo> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="refreshScope" versionNumber="2"> + <configuration configurationName="Debug"> + <resource resourceType="PROJECT" workspacePath="/RPU"/> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +</cproject> diff --git a/lib/sdk/Applications/EvKitExamples/RPU/.project b/lib/sdk/Applications/EvKitExamples/RPU/.project new file mode 100644 index 0000000000000000000000000000000000000000..b7c7a13eaa126b9b31ccf258028d9461a7c3676a --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/.project @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>RPU</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> + <triggers>full,incremental,</triggers> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> +</projectDescription> diff --git a/lib/sdk/Applications/EvKitExamples/RPU/.settings/language.settings.xml b/lib/sdk/Applications/EvKitExamples/RPU/.settings/language.settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5a1647610f97197abe406e8ef1bb9e62065f5a1 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/.settings/language.settings.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<project> + <configuration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962" name="Debug"> + <extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> + <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> + <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> + <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> + </extension> + </configuration> +</project> diff --git a/lib/sdk/Applications/EvKitExamples/RPU/Makefile b/lib/sdk/Applications/EvKitExamples/RPU/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..1227e6c4db6fee4b6abf158e504ae33fdbacb8b4 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/Makefile @@ -0,0 +1,118 @@ +################################################################################ + # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + # + # Permission is hereby granted, free of charge, to any person obtaining a + # copy of this software and associated documentation files (the "Software"), + # to deal in the Software without restriction, including without limitation + # the rights to use, copy, modify, merge, publish, distribute, sublicense, + # and/or sell copies of the Software, and to permit persons to whom the + # Software is furnished to do so, subject to the following conditions: + # + # The above copyright notice and this permission notice shall be included + # in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + # OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + # OTHER DEALINGS IN THE SOFTWARE. + # + # Except as contained in this notice, the name of Maxim Integrated + # Products, Inc. shall not be used except as stated in the Maxim Integrated + # Products, Inc. Branding Policy. + # + # The mere transfer of this software does not imply any licenses + # of trade secrets, proprietary technology, copyrights, patents, + # trademarks, maskwork rights, or any other form of intellectual + # property whatsoever. Maxim Integrated Products, Inc. retains all + # ownership rights. + # + # $Date: 2018-02-19 11:21:05 -0600 (Mon, 19 Feb 2018) $ + # $Revision: 33510 $ + # + ############################################################################### + +# This is the name of the build output file +ifeq "$(PROJECT)" "" +PROJECT=max32665 +endif + +# Specify the target processor +ifeq "$(TARGET)" "" +TARGET=MAX32665 +endif + +# Create Target name variables +TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) +TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) + +# Select 'GCC' or 'IAR' compiler +COMPILER=GCC + +# Specify the board used +ifeq "$(BOARD)" "" +BOARD=EvKit_V1 +endif + +# This is the path to the CMSIS root directory +ifeq "$(MAXIM_PATH)" "" +LIBS_DIR=../../../Libraries +else +LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) +endif +CMSIS_ROOT=$(LIBS_DIR)/CMSIS + +# Source files for this test (add path to VPATH below) +SRCS = main.c + +# Where to find source files for this test +VPATH=. + +# Where to find header files for this test +IPATH = . + +# Enable assertion checking for development +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE + +# Specify the target revision to override default +# "A2" in ASCII +# TARGET_REV=0x4132 +DUAL_CORE=1 + +# Use this variables to specify and alternate tool path +#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin + +# Use these variables to add project specific tool options +#PROJ_CFLAGS+=--specs=nano.specs +#PROJ_LDFLAGS+=--specs=nano.specs + +# Point this variable to a startup file to override the default file +#STARTUPFILE=start.S + +MXC_OPTIMIZE=-O1 + +# Point this variable to a linker file to override the default file +# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld +# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC)_emulator_dualcpu.ld + +################################################################################ +# Include external library makefiles here + +# Include the BSP +BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) +include $(BOARD_DIR)/board.mk + +# Include the peripheral driver +PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver +include $(PERIPH_DRIVER_DIR)/periphdriver.mk + +################################################################################ +# Include the rules for building for this target. All other makefiles should be +# included before this one. +include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk + +# The rule to clean out all the build products. +distclean: clean + $(MAKE) -C ${PERIPH_DRIVER_DIR} clean diff --git a/lib/sdk/Applications/EvKitExamples/RPU/RPU.launch b/lib/sdk/Applications/EvKitExamples/RPU/RPU.launch new file mode 100644 index 0000000000000000000000000000000000000000..c7456e468b8778ea6dbfa993f924892b78c7a066 --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/RPU.launch @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.openocd.launchConfigurationType"> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doContinue" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/> +<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.firstResetType" value="init"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="openocd"/> +<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerOther" value="-s ${env_var:TOOLCHAIN_PATH}/share/openocd/scripts -f interface/cmsis-dap.cfg -f target/MAX32665.cfg"/> +<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherRunCommands" value=""/> +<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.secondResetType" value="halt"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM OpenOCD"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> +<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> +<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> +<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> +<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/MAX32665.elf"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RPU"/> +<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1674944962"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/RPU"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> +</listAttribute> +<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/> +<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> +</launchConfiguration> diff --git a/lib/sdk/Applications/EvKitExamples/RPU/main.c b/lib/sdk/Applications/EvKitExamples/RPU/main.c new file mode 100644 index 0000000000000000000000000000000000000000..54f60cbea90247ef633f61c14ce1438d30efd2ba --- /dev/null +++ b/lib/sdk/Applications/EvKitExamples/RPU/main.c @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2018-06-15 10:53:46 -0500 (Fri, 15 Jun 2018) $ + * $Revision: 35592 $ + * + ******************************************************************************/ + +/** + * @file main.c + * @brief Resource Protection Unit Example + * @details This example uses the resource protection unit to block DMA from reading the + * key out of the crypto module during an operation. The attempt to read will result + * in a hardfault which ends the example + */ + +/***** Includes *****/ +#include <stdio.h> +#include <stdint.h> +#include "mxc_config.h" +#include "rpu.h" +#include "led.h" +#include "tmr_utils.h" +#include "mxc_delay.h" +#include "core1.h" + +/***** Definitions *****/ + +/***** Globals *****/ +#if defined ( __GNUC__) + extern uint8_t __load_start_cpu1; +#endif +/***** Functions *****/ +void HardFault_Handler(void) +{ + printf("\n\nHard Fault reached\n"); + printf("Press reset to run the example again\n"); + printf("Example Complete\n"); + while(1); +} + +int Core1_Main(void) +{ + int err; + // The RPU defaults to all access enabled + // We need to disallow everything we don't want to access + // the RPU_Allow function can only be used to selectively + // allow masters that have already been disallowed + err = RPU_Disallow(RPU_TMR3, (~RPU_SYS1_ALLOW) & 0x1FF); // Acquire exclusive access to TMR3 + + if(err == E_BAD_STATE) { + LED_On(0); + while(1); + } else if(err == E_BAD_PARAM) { + while(1); + } + + LED_On(1); + + while(1); +} + + +// ***************************************************************************** +int main(void) +{ + printf("********* Resource Protection Unit Example **********\n"); + printf("This example uses the resource protection unit to prevent\n"); + printf("code running in Core 0 from accessing the timer in use by Core 1\n"); + + LED_On(1); + TMR_Delay(MXC_TMR0, MSEC(500), NULL); + LED_Off(1); + + Core1_Start(); + mxc_delay(1000); + + // Try to read TMR3's config register + uint32_t invalidaddr = MXC_TMR2->cn; + printf("TMR3 Control Register: 0x%08x\n", invalidaddr); + + printf("Did not fault\n"); + while(1); +} diff --git a/lib/sdk/Applications/EvKitExamples/SDHC_FAT/Makefile b/lib/sdk/Applications/EvKitExamples/SDHC_FAT/Makefile index 5b1ba7b1d52e485fbb42641096786a62ea87a617..4f14fd230644859d67e6fe5bb7557dd6629df66e 100644 --- a/lib/sdk/Applications/EvKitExamples/SDHC_FAT/Makefile +++ b/lib/sdk/Applications/EvKitExamples/SDHC_FAT/Makefile @@ -1,124 +1,125 @@ -################################################################################ - # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. - # - # Permission is hereby granted, free of charge, to any person obtaining a - # copy of this software and associated documentation files (the "Software"), - # to deal in the Software without restriction, including without limitation - # the rights to use, copy, modify, merge, publish, distribute, sublicense, - # and/or sell copies of the Software, and to permit persons to whom the - # Software is furnished to do so, subject to the following conditions: - # - # The above copyright notice and this permission notice shall be included - # in all copies or substantial portions of the Software. - # - # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - # IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES - # OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - # OTHER DEALINGS IN THE SOFTWARE. - # - # Except as contained in this notice, the name of Maxim Integrated - # Products, Inc. shall not be used except as stated in the Maxim Integrated - # Products, Inc. Branding Policy. - # - # The mere transfer of this software does not imply any licenses - # of trade secrets, proprietary technology, copyrights, patents, - # trademarks, maskwork rights, or any other form of intellectual - # property whatsoever. Maxim Integrated Products, Inc. retains all - # ownership rights. - # - # $Date: 2018-08-10 14:36:39 +0000 (Fri, 10 Aug 2018) $ - # $Revision: 36825 $ - # - ############################################################################### - -# This is the name of the build output file -ifeq "$(PROJECT)" "" -PROJECT=max32665 -endif - -# Specify the target processor -ifeq "$(TARGET)" "" -TARGET=MAX32665 -endif - -# Create Target name variables -TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) -TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) - -# Select 'GCC' or 'IAR' compiler -COMPILER=GCC - -# Specify the board used -ifeq "$(BOARD)" "" -BOARD=EvKit_V1 -endif - -# This is the path to the CMSIS root directory -ifeq "$(MAXIM_PATH)" "" -LIBS_DIR=../../../Libraries -else -LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -endif -CMSIS_ROOT=$(LIBS_DIR)/CMSIS - -# Source files for this test (add path to VPATH below) -SRCS = main.c - -# Where to find source files for this test -VPATH=. - -# Where to find header files for this test -IPATH = . - -# Enable assertion checking for development -PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE - -# Specify the target revision to override default -# "A2" in ASCII -# TARGET_REV=0x4132 - -# Use this variables to specify and alternate tool path -#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin - -# Use these variables to add project specific tool options -#PROJ_CFLAGS+=--specs=nano.specs -#PROJ_LDFLAGS+=--specs=nano.specs - -# Point this variable to a startup file to override the default file -#STARTUPFILE=start.S - -MXC_OPTIMIZE=-O1 - -# Point this variable to a linker file to override the default file -# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld - -################################################################################ -# Include external library makefiles here - -# Include the BSP -BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) -include $(BOARD_DIR)/board.mk - -# Include the peripheral driver -PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver -include $(PERIPH_DRIVER_DIR)/periphdriver.mk - -#include the FAT32 libraries -SDHC_DRIVER_DIR=$(LIBS_DIR)/SDHC -FAT32_DRIVER_DIR=$(SDHC_DRIVER_DIR)/ff13 -include $(FAT32_DRIVER_DIR)/fat32.mk - -#include the SDHC libraries -include $(SDHC_DRIVER_DIR)/sdhc.mk - -################################################################################ -# Include the rules for building for this target. All other makefiles should be -# included before this one. -include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk - -# The rule to clean out all the build products. -distclean: clean - $(MAKE) -C ${PERIPH_DRIVER_DIR} clean +################################################################################ + # Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + # + # Permission is hereby granted, free of charge, to any person obtaining a + # copy of this software and associated documentation files (the "Software"), + # to deal in the Software without restriction, including without limitation + # the rights to use, copy, modify, merge, publish, distribute, sublicense, + # and/or sell copies of the Software, and to permit persons to whom the + # Software is furnished to do so, subject to the following conditions: + # + # The above copyright notice and this permission notice shall be included + # in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + # OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + # OTHER DEALINGS IN THE SOFTWARE. + # + # Except as contained in this notice, the name of Maxim Integrated + # Products, Inc. shall not be used except as stated in the Maxim Integrated + # Products, Inc. Branding Policy. + # + # The mere transfer of this software does not imply any licenses + # of trade secrets, proprietary technology, copyrights, patents, + # trademarks, maskwork rights, or any other form of intellectual + # property whatsoever. Maxim Integrated Products, Inc. retains all + # ownership rights. + # + # $Date: 2019-05-30 14:18:04 -0500 (Thu, 30 May 2019) $ + # $Revision: 43593 $ + # + ############################################################################### + +# This is the name of the build output file +ifeq "$(PROJECT)" "" +PROJECT=max32665 +endif + +# Specify the target processor +ifeq "$(TARGET)" "" +TARGET=MAX32665 +endif + +# Create Target name variables +TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) +TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) + +# Select 'GCC' or 'IAR' compiler +COMPILER=GCC + +# Specify the board used +ifeq "$(BOARD)" "" +BOARD=EvKit_V1 +endif + +# This is the path to the CMSIS root directory +ifeq "$(MAXIM_PATH)" "" +LIBS_DIR=../../../Libraries +else +LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) +endif +CMSIS_ROOT=$(LIBS_DIR)/CMSIS + +# Source files for this test (add path to VPATH below) +SRCS = main.c + +# Where to find source files for this test +VPATH=. + +# Where to find header files for this test +IPATH = . + +# Enable assertion checking for development +PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE + +# Specify the target revision to override default +# "A2" in ASCII +# TARGET_REV=0x4132 + +# Use this variables to specify and alternate tool path +#TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin + +# Use these variables to add project specific tool options +#PROJ_CFLAGS+=--specs=nano.specs +#PROJ_LDFLAGS+=--specs=nano.specs + +# Point this variable to a startup file to override the default file +#STARTUPFILE=start.S + +# Set MXC_OPTIMIZE to override the default optimization level +#MXC_OPTIMIZE_CFLAGS=-Og + +# Point this variable to a linker file to override the default file +# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld + +################################################################################ +# Include external library makefiles here + +# Include the BSP +BOARD_DIR=$(LIBS_DIR)/Boards/$(BOARD) +include $(BOARD_DIR)/board.mk + +# Include the peripheral driver +PERIPH_DRIVER_DIR=$(LIBS_DIR)/$(TARGET_UC)PeriphDriver +include $(PERIPH_DRIVER_DIR)/periphdriver.mk + +#include the FAT32 libraries +SDHC_DRIVER_DIR=$(LIBS_DIR)/SDHC +FAT32_DRIVER_DIR=$(SDHC_DRIVER_DIR)/ff13 +include $(FAT32_DRIVER_DIR)/fat32.mk + +#include the SDHC libraries +include $(SDHC_DRIVER_DIR)/sdhc.mk + +################################################################################ +# Include the rules for building for this target. All other makefiles should be +# included before this one. +include $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/$(COMPILER)/$(TARGET_LC).mk + +# The rule to clean out all the build products. +distclean: clean + $(MAKE) -C ${PERIPH_DRIVER_DIR} clean diff --git a/lib/sdk/Applications/EvKitExamples/SDHC_FAT/main.c b/lib/sdk/Applications/EvKitExamples/SDHC_FAT/main.c index 358568d6d7b9ebee87f28b20dfd808c170a087ad..4d6838affdef25c889abc021d4cdf04de3455fe1 100644 --- a/lib/sdk/Applications/EvKitExamples/SDHC_FAT/main.c +++ b/lib/sdk/Applications/EvKitExamples/SDHC_FAT/main.c @@ -29,8 +29,8 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-02-28 19:54:56 +0000 (Thu, 28 Feb 2019) $ - * $Revision: 41324 $ + * $Date: 2019-05-30 14:18:04 -0500 (Thu, 30 May 2019) $ + * $Revision: 43593 $ * ******************************************************************************/ @@ -64,6 +64,8 @@ #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) +#define MAXLEN 256 + /***** Globals *****/ FATFS *fs; //FFat Filesystem Object FATFS fs_obj; @@ -71,7 +73,7 @@ FRESULT err; //FFat Result (Struct) FILINFO fno; //FFat File Information Object DIR dir; //FFat Directory Object - TCHAR message[256], directory[256], cwd[256], filename[256], volume_label[24], volume = '0'; + TCHAR message[MAXLEN], directory[MAXLEN], cwd[MAXLEN], filename[MAXLEN], volume_label[24], volume = '0'; TCHAR *FF_ERRORS[20]; DWORD clusters_free = 0, sectors_free = 0, sectors_total = 0, volume_sn = 0; UINT bytes_written = 0, bytes_read = 0, mounted = 0; @@ -82,6 +84,14 @@ /***** FUNCTIONS *****/ +void generateMessage(unsigned length) +{ + for(int i = 0 ; i < length; i++) { + /*Generate some random data to put in file*/ + message[i] = charset[rand() % (sizeof(charset)-1)]; + } +} + int mount() { fs = &fs_obj; if((err = f_mount(fs, "", 1)) != FR_OK) { //Mount the default drive to fs now @@ -192,10 +202,12 @@ int ls() { } int createFile() { + + unsigned int length = 128; + if(!mounted) { mount(); } - int length = 128; printf("Enter the name of the text file: \n"); scanf("%255s", filename); @@ -209,11 +221,8 @@ int createFile() { } printf("File opened!\n"); - for(int i = 0 ; i < length; i++) { - /*Generate some random data to put in file*/ - message[i] = charset[rand() % (sizeof(charset)-1)]; - } - + generateMessage(length); + if((err = f_write(&file, &message, length, &bytes_written)) != FR_OK){ printf("Error writing file: %s\n", FF_ERRORS[err]); f_mount(NULL, "", 0); return err; @@ -228,11 +237,13 @@ int createFile() { return err; } -int appendFile() { +int appendFile() +{ + unsigned int length = 0; + if(!mounted) { mount(); } - int length = 0; printf("Type name of file to append: \n"); scanf("%255s", filename); @@ -249,10 +260,8 @@ int appendFile() { } printf("File opened!\n"); - for(int i = 0 ; i < length; i++) { - message[i] = charset[rand()%(sizeof(charset)-1)]; - } - + generateMessage(length); + if((err = f_write(&file, &message, length, &bytes_written)) != FR_OK){ printf("Error writing file: %s\n", FF_ERRORS[err]); return err; @@ -342,7 +351,10 @@ int delete() { } -int example() { //cr: call other funcs from here +int example() +{ + unsigned int length = 256; + if((err = formatSDHC()) != FR_OK) { printf("Error Formatting SD Card: %s\n", FF_ERRORS[err]); return err; @@ -380,7 +392,9 @@ int example() { //cr: call other funcs from here } printf("File opened!\n"); - if((err = f_write(&file, &message, sizeof(message), &bytes_written)) != FR_OK){ + generateMessage(length); + + if((err = f_write(&file, &message, length, &bytes_written)) != FR_OK){ printf("Error writing file: %s\n", FF_ERRORS[err]); f_mount(NULL, "", 0); return err; diff --git a/lib/sdk/Applications/EvKitExamples/SDHC_Raw/Makefile b/lib/sdk/Applications/EvKitExamples/SDHC_Raw/Makefile index 2844d754982ad5904a74f4a9927da387bacbb34c..faa6ddebbb013c784f9117a197ce38974475c2d7 100644 --- a/lib/sdk/Applications/EvKitExamples/SDHC_Raw/Makefile +++ b/lib/sdk/Applications/EvKitExamples/SDHC_Raw/Makefile @@ -29,8 +29,8 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # - # $Date: 2019-03-29 18:02:50 +0000 (Fri, 29 Mar 2019) $ - # $Revision: 42007 $ + # $Date: 2019-05-30 14:18:39 -0500 (Thu, 30 May 2019) $ + # $Revision: 43594 $ # ############################################################################### @@ -57,11 +57,11 @@ BOARD=EvKit_V1 endif # This is the path to the CMSIS root directory -#ifeq "$(MAXIM_PATH)" "" +ifeq "$(MAXIM_PATH)" "" LIBS_DIR=../../../Libraries -#else +else LIBS_DIR=/$(subst \,/,$(subst :,,$(MAXIM_PATH))/Firmware/$(TARGET_UC)/Libraries) -#endif +endif CMSIS_ROOT=$(LIBS_DIR)/CMSIS # Source files for this test (add path to VPATH below) @@ -78,7 +78,7 @@ PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE # Specify the target revision to override default # "A2" in ASCII -# TARGET_REV=0x4132 +#TARGET_REV=0x4132 # Use this variables to specify and alternate tool path #TOOL_DIR=/opt/gcc-arm-none-eabi-4_8-2013q4/bin @@ -90,10 +90,11 @@ PROJ_CFLAGS+=-DMXC_ASSERT_ENABLE # Point this variable to a startup file to override the default file #STARTUPFILE=start.S -MXC_OPTIMIZE=-O1 +# Set MXC_OPTIMIZE to override the default optimization level +#MXC_OPTIMIZE_CFLAGS=-Og # Point this variable to a linker file to override the default file -# LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld +#LINKERFILE=$(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC/$(TARGET_LC).ld ################################################################################ # Include external library makefiles here diff --git a/lib/sdk/Applications/EvKitExamples/USB_MassStorage/descriptors.h b/lib/sdk/Applications/EvKitExamples/USB_MassStorage/descriptors.h index c61b25a551eca30502bb7a5b4b0dcc7930422523..27a52ffc40950c19085d3b0169a25476bfef843a 100644 --- a/lib/sdk/Applications/EvKitExamples/USB_MassStorage/descriptors.h +++ b/lib/sdk/Applications/EvKitExamples/USB_MassStorage/descriptors.h @@ -45,8 +45,8 @@ usb_device_descriptor_t __attribute__((aligned(4))) device_descriptor = { 0x12, /* bLength = 18 */ 0x01, /* bDescriptorType = Device */ - 0x0110, /* bcdUSB USB spec rev (BCD) */ - 0x00, /* bDeviceClass = mass storage (0) */ + 0x0200, /* bcdUSB USB spec rev (BCD) */ + 0x00, /* bDeviceClass = Unspecified */ 0x00, /* bDeviceSubClass */ 0x00, /* bDeviceProtocol */ 0x40, /* bMaxPacketSize0 is 64 bytes */ @@ -59,6 +59,19 @@ usb_device_descriptor_t __attribute__((aligned(4))) device_descriptor = { 0x01 /* bNumConfigurations */ }; +/* Device qualifier needed for high-speed operation */ +usb_device_qualifier_descriptor_t __attribute__((aligned(4))) device_qualifier_descriptor = { + 0x0A, /* bLength = 10 */ + 0x06, /* bDescriptorType = Device Qualifier */ + 0x0200, /* bcdUSB USB spec rev (BCD) */ + 0x00, /* bDeviceClass = Unspecified */ + 0x00, /* bDeviceSubClass */ + 0x00, /* bDeviceProtocol */ + 0x40, /* bMaxPacketSize0 is 64 bytes */ + 0x01, /* bNumConfigurations */ + 0x00 /* Reserved, must be 0 */ +}; + __attribute__((aligned(4))) struct __attribute__((packed)) { usb_configuration_descriptor_t config_descriptor; @@ -75,7 +88,7 @@ struct __attribute__((packed)) { 0x01, /* bConfigValue */ 0x00, /* iConfiguration */ 0xC0, /* bmAttributes (self-powered, no remote wakeup) */ - 0x01, /* MaxPower is 2ma (units are 2ma/bit) */ + 0x32, /* MaxPower is 100ma (units are 2ma/bit) */ }, { /* First Interface Descriptor For MSC Interface */ 0x09, /* bLength = 9 */ @@ -106,6 +119,53 @@ struct __attribute__((packed)) { } }; +__attribute__((aligned(4))) +struct __attribute__((packed)) { + usb_configuration_descriptor_t config_descriptor; + usb_interface_descriptor_t msc_interface_descriptor; + usb_endpoint_descriptor_t endpoint_descriptor_1; + usb_endpoint_descriptor_t endpoint_descriptor_2; +} config_descriptor_hs = +{ + { + 0x09, /* bLength = 9 */ + 0x02, /* bDescriptorType = Config (2) */ + 0x0020, /* wTotalLength(L/H) */ + 0x01, /* bNumInterfaces */ + 0x01, /* bConfigValue */ + 0x00, /* iConfiguration */ + 0xC0, /* bmAttributes (self-powered, no remote wakeup) */ + 0x32, /* MaxPower is 100ma (units are 2ma/bit) */ + }, + { /* First Interface Descriptor For MSC Interface */ + 0x09, /* bLength = 9 */ + 0x04, /* bDescriptorType = Interface (4) */ + 0x00, /* bInterfaceNumber */ + 0x00, /* bAlternateSetting */ + 0x02, /* bNumEndpoints (one for INm one for OUT) */ + 0x08, /* bInterfaceClass = Mass Storage (8) */ + 0x06, /* bInterfaceSubClass = SCSI Transparent Command Set */ + 0x50, /* bInterfaceProtocol = Bulk-Only Transport */ + 0x00, /* iInterface */ + }, + { /* OUT Endpoint 1 (Descriptor #1) */ + 0x07, /* bLength */ + 0x05, /* bDescriptorType (Endpoint) */ + 0x01, /* bEndpointAddress (EP1-OUT) */ + 0x02, /* bmAttributes (bulk) */ + 0x0200, /* wMaxPacketSize */ + 0x01, /* bInterval */ + }, + { /* IN Endpoint 2 (Descriptor #2) */ + 0x07, /* bLength */ + 0x05, /* bDescriptorType (Endpoint) */ + 0x82, /* bEndpointAddress (EP2-IN) */ + 0x02, /* bmAttributes (bulk) */ + 0x0200, /* wMaxPacketSize */ + 0x01 /* bInterval */ + } +}; + __attribute__((aligned(4))) uint8_t lang_id_desc[] = { 0x04, /* bLength */ diff --git a/lib/sdk/Applications/EvKitExamples/USB_MassStorage/main.c b/lib/sdk/Applications/EvKitExamples/USB_MassStorage/main.c index 0c3250fe1e87c678db7662e95b1c280a6f9c0895..06b8b8d4def5dfb47e244d7120ecee7b896dd9b5 100644 --- a/lib/sdk/Applications/EvKitExamples/USB_MassStorage/main.c +++ b/lib/sdk/Applications/EvKitExamples/USB_MassStorage/main.c @@ -83,8 +83,8 @@ static void usb_app_wakeup(void); /***** File Scope Variables *****/ -/* This EP assignment must match the Configuration Descriptor */ -static const msc_cfg_t msc_cfg = { +/* Defaults, which will be changed by the configuration code */ +static msc_cfg_t msc_cfg = { 1, /* EP OUT */ MXC_USBHS_MAX_PACKET, /* OUT max packet size */ 2, /* EP IN */ @@ -143,7 +143,7 @@ int main(void) remote_wake_en = 0; /* Start out in full speed */ - usb_opts.enable_hs = 0; + usb_opts.enable_hs = 1; usb_opts.delay_us = delay_us; /* Function which will be used for delays */ usb_opts.init_callback = usb_startup_cb; usb_opts.shutdown_callback = usb_shutdown_cb; @@ -163,6 +163,11 @@ int main(void) /* Register enumeration data */ enum_register_descriptor(ENUM_DESC_DEVICE, (uint8_t*)&device_descriptor, 0); enum_register_descriptor(ENUM_DESC_CONFIG, (uint8_t*)&config_descriptor, 0); + if (usb_opts.enable_hs) { + /* Two additional descriptors needed for high-speed operation */ + enum_register_descriptor(ENUM_DESC_OTHER_SPEED, (uint8_t*)&config_descriptor_hs, 0); + enum_register_descriptor(ENUM_DESC_QUAL, (uint8_t*)&device_qualifier_descriptor, 0); + } enum_register_descriptor(ENUM_DESC_STRING, lang_id_desc, 0); enum_register_descriptor(ENUM_DESC_STRING, mfg_id_desc, 1); enum_register_descriptor(ENUM_DESC_STRING, prod_id_desc, 2); @@ -209,6 +214,9 @@ int main(void) } else if (MXC_GETBIT(&event_flags, MAXUSB_EVENT_BRST)) { MXC_CLRBIT(&event_flags, MAXUSB_EVENT_BRST); printf("Bus Reset\n"); + } else if (MXC_GETBIT(&event_flags, MAXUSB_EVENT_BRSTDN)) { + MXC_CLRBIT(&event_flags, MAXUSB_EVENT_BRSTDN); + printf("Bus Reset Done: %s speed\n", (usb_get_status() & MAXUSB_STATUS_HIGH_SPEED) ? "High" : "Full"); } else if (MXC_GETBIT(&event_flags, MAXUSB_EVENT_SUSP)) { MXC_CLRBIT(&event_flags, MAXUSB_EVENT_SUSP); printf("Suspended\n"); @@ -233,6 +241,17 @@ static int setconfig_callback(usb_setup_pkt *sud, void *cbdata) if (sud->wValue == config_descriptor.config_descriptor.bConfigurationValue) { configured = 1; MXC_SETBIT(&event_flags, EVENT_ENUM_COMP); + if (usb_get_status() & MAXUSB_STATUS_HIGH_SPEED) { + msc_cfg.out_ep = config_descriptor_hs.endpoint_descriptor_1.bEndpointAddress & 0x7; + msc_cfg.out_maxpacket = config_descriptor_hs.endpoint_descriptor_1.wMaxPacketSize; + msc_cfg.in_ep = config_descriptor_hs.endpoint_descriptor_2.bEndpointAddress & 0x7; + msc_cfg.in_maxpacket = config_descriptor_hs.endpoint_descriptor_2.wMaxPacketSize; + } else { + msc_cfg.out_ep = config_descriptor.endpoint_descriptor_1.bEndpointAddress & 0x7; + msc_cfg.out_maxpacket = config_descriptor.endpoint_descriptor_1.wMaxPacketSize; + msc_cfg.in_ep = config_descriptor.endpoint_descriptor_2.bEndpointAddress & 0x7; + msc_cfg.in_maxpacket = config_descriptor.endpoint_descriptor_2.wMaxPacketSize; + } return msc_configure(&msc_cfg); /* Configure the device class */ } else if (sud->wValue == 0) { configured = 0; @@ -245,10 +264,10 @@ static int setconfig_callback(usb_setup_pkt *sud, void *cbdata) /******************************************************************************/ static int setfeature_callback(usb_setup_pkt *sud, void *cbdata) { - if(sud->wValue == FEAT_REMOTE_WAKE) { + if (sud->wValue == FEAT_REMOTE_WAKE) { remote_wake_en = 1; } else { - // Unknown callback + /* Unknown callback */ return -1; } @@ -258,10 +277,10 @@ static int setfeature_callback(usb_setup_pkt *sud, void *cbdata) /******************************************************************************/ static int clrfeature_callback(usb_setup_pkt *sud, void *cbdata) { - if(sud->wValue == FEAT_REMOTE_WAKE) { + if (sud->wValue == FEAT_REMOTE_WAKE) { remote_wake_en = 0; } else { - // Unknown callback + /* Unknown callback */ return -1; } @@ -302,6 +321,8 @@ static int event_callback(maxusb_event_t evt, void *data) case MAXUSB_EVENT_VBUS: usb_event_clear(MAXUSB_EVENT_BRST); usb_event_enable(MAXUSB_EVENT_BRST, event_callback, NULL); + usb_event_clear(MAXUSB_EVENT_BRSTDN); + usb_event_enable(MAXUSB_EVENT_BRSTDN, event_callback, NULL); usb_event_clear(MAXUSB_EVENT_SUSP); usb_event_enable(MAXUSB_EVENT_SUSP, event_callback, NULL); usb_connect(); @@ -314,6 +335,15 @@ static int event_callback(maxusb_event_t evt, void *data) configured = 0; suspended = 0; break; + case MAXUSB_EVENT_BRSTDN: + if (usb_get_status() & MAXUSB_STATUS_HIGH_SPEED) { + enum_register_descriptor(ENUM_DESC_CONFIG, (uint8_t*)&config_descriptor_hs, 0); + enum_register_descriptor(ENUM_DESC_OTHER_SPEED, (uint8_t*)&config_descriptor, 0); + } else { + enum_register_descriptor(ENUM_DESC_CONFIG, (uint8_t*)&config_descriptor, 0); + enum_register_descriptor(ENUM_DESC_OTHER_SPEED, (uint8_t*)&config_descriptor_hs, 0); + } + break; case MAXUSB_EVENT_SUSP: usb_app_sleep(); break; diff --git a/lib/sdk/Libraries/BTLE/btle.mk b/lib/sdk/Libraries/BTLE/btle.mk new file mode 100644 index 0000000000000000000000000000000000000000..366af614b67afb0d5aa514a211525f8b6dc3de18 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/btle.mk @@ -0,0 +1,212 @@ +################################################################################ +# Copyright (C) 2014 Maxim Integrated Products, Inc., All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +# OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of Maxim Integrated +# Products, Inc. shall not be used except as stated in the Maxim Integrated +# Products, Inc. Branding Policy. +# +# The mere transfer of this software does not imply any licenses +# of trade secrets, proprietary technology, copyrights, patents, +# trademarks, maskwork rights, or any other form of intellectual +# property whatsoever. Maxim Integrated Products, Inc. retains all +# ownership rights. +# +# $Id: btle.mk 44576 2019-07-11 21:30:22Z kevin.gillespie $ +# +################################################################################ + +################################################################################ +# This file can be included in a project makefile to build the library for the +# project. +################################################################################ + +ifeq "$(TARGET)" "" +$(error TARGET must be specified") +endif +TARGET_UC:=$(shell echo $(TARGET) | tr a-z A-Z) +TARGET_LC:=$(shell echo $(TARGET) | tr A-Z a-z) + +CORDIO_DIR := $(abspath $(CORDIO_DIR)) +CORDIO_PATH = ${CORDIO_DIR} + +# WSF (RTOS) +CORDIO_PATH += ${CORDIO_DIR}/wsf +CORDIO_PATH += ${CORDIO_DIR}/wsf/include +CORDIO_PATH += ${CORDIO_DIR}/wsf/include/util +CORDIO_PATH += ${CORDIO_DIR}/wsf/sources +CORDIO_PATH += ${CORDIO_DIR}/wsf/sources/util +CORDIO_PATH += ${CORDIO_DIR}/wsf/sources/port +CORDIO_PATH += ${CORDIO_DIR}/wsf/sources/port/baremetal + +# Stack (Host and Application Profile) +CORDIO_PATH += ${CORDIO_DIR}/stack +CORDIO_PATH += ${CORDIO_DIR}/stack/platform +CORDIO_PATH += ${CORDIO_DIR}/stack/platform/${TARGET_LC} +CORDIO_PATH += ${CORDIO_DIR}/stack/platform/include +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/include +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/include/app +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/apps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/apps/app +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/apps/app/common +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/anpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/bas +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/blpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/blps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/cpp +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/cscp +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/dis +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/fmpl +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/gap +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/gatt +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/glpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/glps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/hid +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/hrpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/hrps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/htpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/htps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/include +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/paspc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/plxpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/plxps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/rscp +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/scpps +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/sensor +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/tipc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/udsc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/uribeacon +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/wdxc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/wdxs +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/wpc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/profiles/wspc +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/sources/services +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-profiles/build +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/include +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/sec +# CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/sec/pal +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/sec/common +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/hci +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/hci/dual_chip +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/hci/common +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/att +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/l2c +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/hci +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/smp +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/dm +CORDIO_PATH += ${CORDIO_DIR}/stack/ble-host/sources/stack/cfg + +# Link Layer +CORDIO_PATH += ${CORDIO_DIR}/link_layer +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/${TARGET_LC} +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/include +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/sources +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/sources/chci +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/sources/bb +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/sources/bb/ble +CORDIO_PATH += ${CORDIO_DIR}/link_layer/platform/common/sources/ll +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/include +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/include/common +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/include/ble +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/common +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/common/bb +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/common/sch +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/lhci +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/init +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/bb +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/sch +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/include +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/ll +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/lmgr +CORDIO_PATH += ${CORDIO_DIR}/link_layer/controller/sources/ble/lctr +CORDIO_PATH += ${CORDIO_DIR}/link_layer/thirdparty +CORDIO_PATH += ${CORDIO_DIR}/link_layer/thirdparty/uecc + +# Physical Layer +CORDIO_PATH += ${CORDIO_DIR}/phy +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/shared +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble/pan2g5 +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble/pan2g5/include +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble/pan2g5/afe +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble/pan2g5/afe/${TARGET_LC} +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/prot/ble/pan2g5/afe/${TARGET_LC}/include +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/control +CORDIO_PATH += ${CORDIO_DIR}/phy/dbb/control/pan +CORDIO_PATH += ${CORDIO_DIR}/phy/bb +CORDIO_PATH += ${CORDIO_DIR}/phy/debug +CORDIO_PATH += ${CORDIO_DIR}/phy/include +CORDIO_PATH += ${CORDIO_DIR}/phy/llc +CORDIO_PATH += ${CORDIO_DIR}/phy/llc/shared +CORDIO_PATH += ${CORDIO_DIR}/phy/llc/ble + +# Add to source directory list +VPATH += ${CORDIO_PATH} + +# Add to include directory list +IPATH += ${CORDIO_PATH} + +# Add sources +ifneq "$(CORDIO_PATH_FILTER)" "" +BTLE_SRCS := $(notdir $(filter $(CORDIO_PATH_FILTER), $(foreach dir, $(CORDIO_PATH), $(wildcard $(dir)/*.c)))) +else +BTLE_SRCS := $(notdir $(foreach dir, $(CORDIO_PATH), $(wildcard $(dir)/*.c))) +endif + +FILTERED_SRCS := +ifeq ($(ENABLE_LL_TESTER),) +FILTERED_SRCS+=lctr_main_tester.c +else +PROJ_CFLAGS+=-DLL_ENABLE_TESTER=TRUE +endif + +ifeq ($(ENABLE_SDMA),) +FILTERED_SRCS+=hci_drv_sdma.c +else +PROJ_CFLAGS+=-DENABLE_SDMA=TRUE +PROJ_AFLAGS +=-D__SDMA_SIZE=0x40000 +FILTERED_SRCS+=hci_drv.c +endif + +SRCS+=$(filter-out $(FILTERED_SRCS),$(BTLE_SRCS)) + +# Add object files. +LIBS += $(notdir $(wildcard $(CORDIO_DIR)/cordio-phy.a)) + +# Add definitions +PROJ_CFLAGS+=-DLHCI_ENABLE_VS=TRUE +PROJ_CFLAGS+=-DBB_CLK_RATE_HZ=1600000 +PROJ_CFLAGS+=-DLCTR_CONN_NO_TIFS_REASSEMBLY=1 +PROJ_CFLAGS+=-DBB_ENABLE_INLINE_ENC_TX=1 +PROJ_CFLAGS+=-DBB_ENABLE_INLINE_DEC_RX=1 +PROJ_CFLAGS+=-DFORCE_PMU_WAKEUP=1 diff --git a/lib/sdk/Libraries/BTLE/cordio-phy.a b/lib/sdk/Libraries/BTLE/cordio-phy.a new file mode 100644 index 0000000000000000000000000000000000000000..177273f66c6cf5addcadef8e209e05a03e10f116 Binary files /dev/null and b/lib/sdk/Libraries/BTLE/cordio-phy.a differ diff --git a/lib/sdk/NDALibraries/BTLE/documentation/App_Framework_API.pdf b/lib/sdk/Libraries/BTLE/documentation/App_Framework_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/App_Framework_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/App_Framework_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Attribute_Protocol_API.pdf b/lib/sdk/Libraries/BTLE/documentation/Attribute_Protocol_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Attribute_Protocol_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/Attribute_Protocol_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/BLE_Host_Subsystem_Qual_Certificate.pdf b/lib/sdk/Libraries/BTLE/documentation/BLE_Host_Subsystem_Qual_Certificate.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/BLE_Host_Subsystem_Qual_Certificate.pdf rename to lib/sdk/Libraries/BTLE/documentation/BLE_Host_Subsystem_Qual_Certificate.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/BLE_Profile_Subsystem_Qual_Certificate.pdf b/lib/sdk/Libraries/BTLE/documentation/BLE_Profile_Subsystem_Qual_Certificate.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/BLE_Profile_Subsystem_Qual_Certificate.pdf rename to lib/sdk/Libraries/BTLE/documentation/BLE_Profile_Subsystem_Qual_Certificate.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Device_Manager_API.pdf b/lib/sdk/Libraries/BTLE/documentation/Device_Manager_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Device_Manager_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/Device_Manager_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/HCI_API.pdf b/lib/sdk/Libraries/BTLE/documentation/HCI_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/HCI_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/HCI_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/L2CAP_API.pdf b/lib/sdk/Libraries/BTLE/documentation/L2CAP_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/L2CAP_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/L2CAP_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Profile_and_Service_API.pdf b/lib/sdk/Libraries/BTLE/documentation/Profile_and_Service_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Profile_and_Service_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/Profile_and_Service_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Sample_App_Users_Guide.pdf b/lib/sdk/Libraries/BTLE/documentation/Sample_App_Users_Guide.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Sample_App_Users_Guide.pdf rename to lib/sdk/Libraries/BTLE/documentation/Sample_App_Users_Guide.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Stack_Porting_Guide.pdf b/lib/sdk/Libraries/BTLE/documentation/Stack_Porting_Guide.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Stack_Porting_Guide.pdf rename to lib/sdk/Libraries/BTLE/documentation/Stack_Porting_Guide.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Stack_Profiles_Developers_Guide.pdf b/lib/sdk/Libraries/BTLE/documentation/Stack_Profiles_Developers_Guide.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Stack_Profiles_Developers_Guide.pdf rename to lib/sdk/Libraries/BTLE/documentation/Stack_Profiles_Developers_Guide.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Stack_System_Architecture.pdf b/lib/sdk/Libraries/BTLE/documentation/Stack_System_Architecture.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Stack_System_Architecture.pdf rename to lib/sdk/Libraries/BTLE/documentation/Stack_System_Architecture.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/Wireless_Software_Foundation_API.pdf b/lib/sdk/Libraries/BTLE/documentation/Wireless_Software_Foundation_API.pdf similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/Wireless_Software_Foundation_API.pdf rename to lib/sdk/Libraries/BTLE/documentation/Wireless_Software_Foundation_API.pdf diff --git a/lib/sdk/NDALibraries/BTLE/documentation/cordio_profile_readme.md b/lib/sdk/Libraries/BTLE/documentation/cordio_profile_readme.md similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/cordio_profile_readme.md rename to lib/sdk/Libraries/BTLE/documentation/cordio_profile_readme.md diff --git a/lib/sdk/NDALibraries/BTLE/documentation/cordio_stack_readme.md b/lib/sdk/Libraries/BTLE/documentation/cordio_stack_readme.md similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/cordio_stack_readme.md rename to lib/sdk/Libraries/BTLE/documentation/cordio_stack_readme.md diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/1__abstract_8md_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/1__abstract_8md_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/1__abstract_8md_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/1__abstract_8md_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/Arm_Cordio.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/Arm_Cordio.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/Arm_Cordio.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/Arm_Cordio.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/DoxygenStyleSheet.css b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/DoxygenStyleSheet.css similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/DoxygenStyleSheet.css rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/DoxygenStyleSheet.css diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/annotated.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/anpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__cfg_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__db_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__hw_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__param_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__terminal_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/app__ui_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowdown.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowdown.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowdown.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowdown.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowright.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowright.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowright.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/arrowright.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__handler_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/att__uuid_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bas__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bc_s.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bc_s.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bc_s.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bc_s.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bda_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bdwn.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bdwn.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bdwn.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bdwn.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/blps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/bstream_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/calc128_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cfg__stack_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/classes.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/classes.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/classes.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/classes.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/closed.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/closed.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/closed.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/closed.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cpp__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/crc32_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/cscp__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_appframework.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_appframework.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_appframework.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_appframework.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_att.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_att.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_att.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_att.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_attc_discovery.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_attc_discovery.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_attc_discovery.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_attc_discovery.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_cccd.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_cccd.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_cccd.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_cccd.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_database.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_database.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_database.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_atts_database.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gap.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gap.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gap.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gap.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_battsvcattr.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_battsvcattr.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_battsvcattr.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_battsvcattr.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_svcdatastruct.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_svcdatastruct.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_svcdatastruct.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gatt_svcdatastruct.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gattprofiles.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gattprofiles.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gattprofiles.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_gattprofiles.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci_topo.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci_topo.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci_topo.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_hci_topo.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2cap.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2cap.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2cap.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2cap.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2capss.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2capss.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2capss.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_l2capss.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_profiles_af.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_profiles_af.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_profiles_af.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_profiles_af.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_smp.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_smp.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_smp.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_smp.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_stack.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_stack.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_stack.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/diagram_stack.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000000_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000000_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000000_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000000_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000002.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000002.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000002.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000002.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000043.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000043.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000043.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000043.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000001_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000006_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000007_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000006.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000006.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000006.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000006.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000008_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000006.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000006.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000006.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000006.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000042.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000042.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000042.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000042.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000009_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000010_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000010_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000010_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000010_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000011_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000012_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000012_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000012_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000012_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000013_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000016_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000016_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000016_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000016_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000017_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000017_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000017_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000017_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000018_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000018_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000018_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000018_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000019_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000019_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000019_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000019_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000020_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000020_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000020_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000020_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000021_000006.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000021_000006.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000021_000006.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000021_000006.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000023_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000023_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000023_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000023_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000024_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000025_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000025_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000025_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000025_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000026_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000028_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000028_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000028_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000028_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000029_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000029_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000029_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000029_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000030_000006.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000030_000006.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000030_000006.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000030_000006.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000032_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000032_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000032_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000032_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000033_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000033_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000033_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000033_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000034_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000034_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000034_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000034_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000035_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000035_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000035_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000035_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000042.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000042.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000042.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000042.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000036_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000027.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000027.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000027.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000038_000027.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000039_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000039_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000039_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000039_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000040_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000040_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000040_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000040_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000041_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000000.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000000.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000000.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000000.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000009.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000009.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000009.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000009.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000027.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000027.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000027.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000027.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000046.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000046.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000046.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_000042_000046.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_01fd9461b2b9cb822fcd1cc455958049_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_0650746a0f39978eb6a359493bea921f_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_083dd6bb20cdc21d6377a2c8f404db01.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_083dd6bb20cdc21d6377a2c8f404db01.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_083dd6bb20cdc21d6377a2c8f404db01.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_083dd6bb20cdc21d6377a2c8f404db01.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_14240524c92faaaceebe060377e88921.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_14240524c92faaaceebe060377e88921.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_14240524c92faaaceebe060377e88921.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_14240524c92faaaceebe060377e88921.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1968977382820ccc9307df87bd9a655a_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_1d2c147e5b33cac31c32dee8eba74f92_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2193f026831cdcfbe5f7630d525d29a2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2193f026831cdcfbe5f7630d525d29a2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2193f026831cdcfbe5f7630d525d29a2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2193f026831cdcfbe5f7630d525d29a2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2448ffd17b33850a59249216ac62359d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2448ffd17b33850a59249216ac62359d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2448ffd17b33850a59249216ac62359d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2448ffd17b33850a59249216ac62359d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_24e52f82d660f93e0745d24e71239de7_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_267301a7818b265e178dd1678b5be7da_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_27545987a30c1ce2d7af2bd86c78ac21_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_28e746fa2b2d847c24c15cb9cf47061c_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_2e1d5ae6e89575640b5c11b2b0dd7828_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_35094516b35a914485489400265ef606_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_39966f1b23fb9119d0e2e84328c29c92_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3af3f687dce0018c3eca5f89eed04794_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3b413abaffb582733343166118210417_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3e32500b9eb36cf42c63d7a0700b5f48.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3e32500b9eb36cf42c63d7a0700b5f48.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3e32500b9eb36cf42c63d7a0700b5f48.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_3e32500b9eb36cf42c63d7a0700b5f48.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4b2efa8dde6080c56d9829d057fd39df.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4b2efa8dde6080c56d9829d057fd39df.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4b2efa8dde6080c56d9829d057fd39df.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4b2efa8dde6080c56d9829d057fd39df.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_4f486d1e72826ae9c58bf305b51ae16e_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_5cf26327824e451e1022868dc841ad11_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_64d72f811608cc5536d7defd83dd8929_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_6a5ce93f472888e0793f2844156cb0e2_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7108d5013b197beb2004eacb657ed2e6_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_72413f27bc6a06dcd8eb07a15b445fac.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_72413f27bc6a06dcd8eb07a15b445fac.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_72413f27bc6a06dcd8eb07a15b445fac.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_72413f27bc6a06dcd8eb07a15b445fac.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7474d848c2a75fd8baba724a49ab5497_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7491aafc6772ac0317b005e79579b936.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7491aafc6772ac0317b005e79579b936.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7491aafc6772ac0317b005e79579b936.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7491aafc6772ac0317b005e79579b936.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_777b5b972e7bb8c05bd1df2cd2c64fa8_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_792ecca4f12bd5a21f99abff978ab3e7_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7975def220458f17c7281fab566ce246_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_7bfed3e367d92941728cc185aee9127b_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_84e488d8a84e65c3c9b677a5dd7a953b_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_8d20de1f413d615a571d8da343a68b55_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_91857b504f82a56ca001dd341fe65f25_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9c6c1d5b688df0f8e1edfb086967f595_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9cd61716eb232fce02341fdda60380b1_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_9ee610406381032583c9b2ea366d83ef_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_a946ce966c8139b039e16cc0d63039c1_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_aec2dea080396ad70937fe545ac403b0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_aec2dea080396ad70937fe545ac403b0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_aec2dea080396ad70937fe545ac403b0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_aec2dea080396ad70937fe545ac403b0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_afde2436970dac88923b1f77403d2006_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_b396dc28dbe644a9444597cdccdfe82e_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_bd209c9d3074d3795b66a9dd59ecf791_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_c5a52a81292cf9a5167198f4f346d6d9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_c5a52a81292cf9a5167198f4f346d6d9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_c5a52a81292cf9a5167198f4f346d6d9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_c5a52a81292cf9a5167198f4f346d6d9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_cc534d0ae49bf8e5d6f4ee87a58ea916_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_d80f2d3e4e836961689c466eb7625f53_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_dcada09bf3de69beabc0521b91c30550.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_dcada09bf3de69beabc0521b91c30550.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_dcada09bf3de69beabc0521b91c30550.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_dcada09bf3de69beabc0521b91c30550.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e4413fdd10501f0f4b65f615de72d05f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e4413fdd10501f0f4b65f615de72d05f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e4413fdd10501f0f4b65f615de72d05f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e4413fdd10501f0f4b65f615de72d05f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e5afad07a6e294c18dad619513d97382.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e5afad07a6e294c18dad619513d97382.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e5afad07a6e294c18dad619513d97382.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e5afad07a6e294c18dad619513d97382.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_e8bf73041848d8a97ff9b0f24e24824e_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dir_ebd89e2215d9fe75dd049fd7977024ba_dep.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dis__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dm__handler_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doc.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doc.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doc.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doc.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_1.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_1.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_1.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_1.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_2.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_2.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_2.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_2.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_3.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_3.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_3.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_3.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_4.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_4.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_4.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_4.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_5.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_5.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_5.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_5.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_6.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_6.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_6.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dot_inline_dotgraph_6.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.css b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.css similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.css rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.css diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/doxygen.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dynsections.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dynsections.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dynsections.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/dynsections.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/files.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/files.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/files.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/files.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/fmpl__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderclosed.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderclosed.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderclosed.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderclosed.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderopen.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderopen.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderopen.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/folderopen.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_dup.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_dup.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_dup.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_dup.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_k.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_k.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_k.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_k.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_m.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_m.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_m.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_m.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_n.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_n.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_n.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_n.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_o.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_o.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_o.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_o.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_q.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_q.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_q.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_q.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_v.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_v.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_v.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_v.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_k.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_k.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_k.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_k.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_m.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_m.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_m.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_m.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_n.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_n.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_n.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_n.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_o.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_o.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_o.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_o.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_q.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_q.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_q.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_q.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_v.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_v.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_v.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_v.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_y.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_y.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_y.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_vars_y.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_y.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_y.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_y.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/functions_y.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gap__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gatt__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_g.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_g.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_g.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_g.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_n.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_n.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_n.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_n.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_defs_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_g.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_g.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_g.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_g.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_eval_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_g.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_g.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_g.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_g.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_func_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_g.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_g.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_g.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_g.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_l.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_l.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_l.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_l.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_n.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_n.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_n.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_n.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_type.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_type.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_type.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_type.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_u.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_u.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_u.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_u.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_vars.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_vars.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_vars.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_vars.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_w.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_w.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_w.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/globals_w.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/glps__main_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/graph_legend.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_l_e_r_t___n_o_t_i_f_i_c_a_t_i_o_n___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___d_b___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___h_w___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___p_a_r_a_m___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_p_p___f_r_a_m_e_w_o_r_k___u_i___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___a_r_m___l_t_d___p_r_o_p_r_i_e_t_a_r_y___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_a_t_t_e_r_y___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___p_r_o_f_i_l_e_s.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_e___s_t_a_c_k.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___b_l_o_o_d___p_r_e_s_s_u_r_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___p_o_w_e_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___c_y_c_l_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_e_v_i_c_e___i_n_f_o_r_m_a_t_i_o_n___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___connections.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___connections.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___connections.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___connections.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___synchronization.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___synchronization.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___synchronization.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___d_m___synchronization.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___f_i_n_d___m_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_p___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___a_n_d___g_a_p___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_a_t_t___p_r_o_f_i_l_e_s.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_l_u_c_o_s_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___g_y_r_o_s_c_o_p_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_l_t_h___t_h_e_r_m_o_m_e_t_e_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_e_a_r_t___r_a_t_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___h_u_m_a_n___i_n_t_e_r_f_a_c_e___d_e_v_i_c_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___i_n_t_e_r_n_e_t___p_r_o_f_i_l_e___s_u_p_p_o_r_t___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_h_o_n_e___a_l_e_r_t___s_t_a_t_u_s___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_r_o_x_i_m_i_t_y___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_e_t_e_r___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___p_u_l_s_e___o_x_i_m_i_t_e_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___r_u_n_n_i_n_g___s_p_e_e_d___a_n_d___c_a_d_e_n_c_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_c_a_n___p_a_r_a_m_e_t_e_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_f_i_g_u_r_a_t_i_o_n.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_e_r_v_i_c_e___c_o_n_s_t_a_n_t_s.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___i_n_t___b_e_h_a_v_i_o_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___i_n_t___b_e_h_a_v_i_o_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___i_n_t___b_e_h_a_v_i_o_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___i_n_t___b_e_h_a_v_i_o_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___r_s_p___b_e_h_a_v_i_o_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___r_s_p___b_e_h_a_v_i_o_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___r_s_p___b_e_h_a_v_i_o_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___l_e_g___r_s_p___b_e_h_a_v_i_o_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___i_n_t___b_e_h_a_v_i_o_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___i_n_t___b_e_h_a_v_i_o_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___i_n_t___b_e_h_a_v_i_o_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___i_n_t___b_e_h_a_v_i_o_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___r_s_p___b_e_h_a_v_i_o_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___r_s_p___b_e_h_a_v_i_o_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___r_s_p___b_e_h_a_v_i_o_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_m_p___s_c___r_s_p___b_e_h_a_v_i_o_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_c___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___a_t_t_s___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___b_e_h_a_v_i_o_r.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___d_m___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___e_v_e_n_t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_c_l___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___c_m_d___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___e_v_t___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___i_n_i_t___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___h_c_i___o_p_t___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___i_n_i_t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___l2_c_a_p___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_e_c_u_r_i_t_y___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___s_t_a_c_k___s_m_p___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_n_s_o_r___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_e_m_p_e_r_a_t_u_r_e___s_e_r_v_i_c_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e-_r_e_l_a_t_e_d___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___t_i_m_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_b_e_a_c_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_r_i_c_f_g___c_o_n_f_i_g_u_r_a_t_i_o_n___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___u_s_e_r___d_a_t_a___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_e_i_g_h_t___s_c_a_l_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___p_r_o_f_i_l_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_i_r_e_l_e_s_s___d_a_t_a___e_x_c_h_a_n_g_e___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_p___s_e_r_v_i_c_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___a_s_s_e_r_t___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___b_u_f___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___c_s___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___e_f_s___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_a_t_h___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___m_s_g___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___o_s___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___q_u_e_u_e___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_i_m_e_r___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_r_a_c_e___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___t_y_p_e_s.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/group___w_s_f___u_t_i_l___a_p_i.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/gyro__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__cmd_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__core_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__drv_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__evt_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__handler_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hci__tr_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hid__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/hrps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/htps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/index.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/index.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/index.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/index.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/jquery.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/jquery.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/jquery.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/jquery.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/l2c__handler_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/mainpage_8md_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/mainpage_8md_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/mainpage_8md_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/mainpage_8md_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_1_abstract.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_1_abstract.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_1_abstract.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_1_abstract.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_mainpage.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_mainpage.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_mainpage.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/md_doc_ble-host_mainpage.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/modules.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_f.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_f.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_f.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_f.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_g.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_g.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_g.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_g.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_h.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_h.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_h.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/nav_h.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.css b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.css similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.css rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.css diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtree.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreedata.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreedata.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreedata.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreedata.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex10.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex10.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex10.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex10.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex11.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex11.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex11.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex11.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex12.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex12.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex12.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex12.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex13.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex13.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex13.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex13.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex14.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex14.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex14.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex14.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex15.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex15.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex15.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex15.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex16.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex16.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex16.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex16.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex17.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex17.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex17.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex17.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex18.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex18.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex18.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex18.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex19.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex19.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex19.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex19.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/navtreeindex9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/open.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/open.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/open.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/open.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_discconfig.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_discconfig.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_discconfig.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_discconfig.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_prepexecwrite.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_prepexecwrite.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_prepexecwrite.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_client_prepexecwrite.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_server.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_server.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_server.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_att_server.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_advscan.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_advscan.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_advscan.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_advscan.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_connopenclose.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_connopenclose.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_connopenclose.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_connopenclose.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_ecc.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_ecc.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_ecc.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_ecc.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_encrypt.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_encrypt.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_encrypt.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_encrypt.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_oob.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_oob.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_oob.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_oob.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_pair.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_pair.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_pair.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_pair.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_privacy.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_privacy.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_privacy.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_dm_privacy.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_acl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_acl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_acl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_acl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_cmdevt.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_cmdevt.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_cmdevt.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_cmdevt.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_reset.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_reset.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_reset.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_hci_reset.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_connparamupdate.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_connparamupdate.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_connparamupdate.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_connparamupdate.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_datapath.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_datapath.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_datapath.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_datapath.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_init.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_init.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_init.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/operation_l2cap_init.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/pages.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/pages.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/pages.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/pages.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/paspc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/plxps__main_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/printComponentTabs.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/printComponentTabs.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/printComponentTabs.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/printComponentTabs.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/print_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/resize.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/resize.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/resize.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/resize.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/rscp__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/scpps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_10.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_11.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_12.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_13.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_14.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_15.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_16.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/all_f.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/classes_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/close.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/close.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/close.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/close.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/enumvalues_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/files_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/functions_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/groups_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/mag_sel.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/mag_sel.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/mag_sel.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/mag_sel.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/nomatches.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/nomatches.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/nomatches.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/nomatches.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/pages_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.css b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.css similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.css rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.css diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_l.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_l.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_l.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_l.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_m.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_m.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_m.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_m.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_r.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_r.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_r.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/search_r.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/searchdata.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/searchdata.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/searchdata.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/searchdata.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/typedefs_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_0.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_1.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_10.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_11.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_12.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_13.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_14.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_15.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_2.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_3.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_4.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_5.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_6.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_7.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_8.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_9.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_a.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_b.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_c.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_d.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_e.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/search/variables_f.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sec__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/smp__handler_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/splitbar.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/splitbar.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/splitbar.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/splitbar.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_diag__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/struct_wsf_buf_pool_stat__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_adv_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_bpm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_date_time__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_dev_info__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_disc_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_adv_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ext_master_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_hrm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_master_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_cm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_plx_scm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_req_act_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_sec_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_slave_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_tm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_cback__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_led__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_ui_sound__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_update_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structapp_wsm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatt_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structattc_disc_char__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_attr__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_ccc_set__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structatts_group__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structbas_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structblps_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_new_addr_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_adv_set_start_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_start_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_per_adv_set_stop_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_auth_req_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_cnf_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_csrk__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_encrypt_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_irk__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_key_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_keypress_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_lesc_oob_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_ltk__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_oob_calc_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_cmpl_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_pair_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structdm_sec_slave_ind_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglpc_filter__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glm__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_glmc__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structglps_rec__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_auth_payload_to_expired_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_conn_spec__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_core_conn__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_disconnect_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_change_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_enc_key_refresh_cmpl__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_evt_stats__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_enable_param__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_adv_param__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_param__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_init_scan_param__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_ext_scan_param__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_hw_error_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_add_dev_to_res_list_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_report_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_adv_set_term_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ch_sel_algo_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_clear_res_list_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_conn_update_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_create_conn_cancel_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_data_len_change_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_encrypt_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ext_adv_report_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_gen_dh_key_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_neg_repl_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_ltk_req_repl_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_p256_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_report_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_est_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_per_adv_sync_lost_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_phy_update_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rand_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_def_data_len_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_local_res_addr_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_max_data_len_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_peer_res_addr_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_phy_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_read_remote_feat_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_neg_rep_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_rep_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_conn_param_req_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_rem_dev_from_res_list_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_req_rcvd_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_scan_timeout_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_addr_res_enable_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_data_len_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_set_def_phy_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_le_write_def_data_len_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_chan_map_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_local_ver_info__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_remote_ver_info_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_rssi_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_read_tx_pwr_lvl_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_cmd_status_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_vendor_spec_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhci_write_auth_payload_to_cmd_cmpl_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_config__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhid_report_id_map__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhrps_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structhtps_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_connect_ind__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_cnf__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_data_ind__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_disconnect_ind__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structl2c_coc_reg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structplxps_rec__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_key__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_msg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_ecc_shared_sec__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsec_msg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_cfg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_auth_rsp__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_keypress__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_pair__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structsmp_dm_security_req__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structterminal_command__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxc_conn_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_au_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwdxs_dc_cb__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_diag_alloc_fail__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_buf_pool_desc__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_control__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_file_info__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_efs_media__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_esf_attributes__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_msg_hdr__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_queue__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/structwsf_timer__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__alert_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__batt_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__bps_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cfg_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ch_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__core_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cps_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__cscs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__dis_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gls_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__gyro_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hid_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hrs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__hts_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__ipss_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__plxs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__px_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__rscs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__scpss_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__temp_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__time_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__uricfg_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wdxs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wp_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svc__wss_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svgpan.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svgpan.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svgpan.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/svgpan.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_off.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_off.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_off.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_off.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_on.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_on.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_on.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/sync_on.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_a.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_a.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_a.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_a.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_b.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_b.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_b.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_b.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_h.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_h.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_h.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_h.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_s.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_s.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_s.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_s.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_topnav.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_topnav.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_topnav.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tab_topnav.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tabs.css b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tabs.css similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tabs.css rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tabs.css diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/temp__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/terminal_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/tipc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/udsc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uniondm_sec_key__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionhci_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionl2c_coc_evt__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionsmp_dm_msg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.js b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.js similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.js rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t.js diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/unionwdxs_msg__t__coll__graph.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/uricfg__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdx__defs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxc__main_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__main_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wdxs__stream_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wpc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__assert_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__buf_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__cs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__efs_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__math_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__msg_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__os_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__queue_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__timer_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__trace_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h__dep__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsf__types_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wspc__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.map b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.map similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.map rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.map diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.md5 b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.md5 similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.md5 rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.md5 diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.png b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.png similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.png rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h__incl.png diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wsps__api_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h_source.html b/lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h_source.html similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h_source.html rename to lib/sdk/Libraries/BTLE/documentation/html/Cordio_Stack_Cordio_Profiles/wstr_8h_source.html diff --git a/lib/sdk/NDALibraries/BTLE/documentation/wsf_readme.md b/lib/sdk/Libraries/BTLE/documentation/wsf_readme.md similarity index 100% rename from lib/sdk/NDALibraries/BTLE/documentation/wsf_readme.md rename to lib/sdk/Libraries/BTLE/documentation/wsf_readme.md diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api.h new file mode 100644 index 0000000000000000000000000000000000000000..22b2c982111b7e0e1533853c1ec3365ca7345ae6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api.h @@ -0,0 +1,487 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_H +#define BB_BLE_API_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising packet statistics. */ +typedef struct +{ + uint32_t txAdv; /*!< Number of sent advertising packets. */ + uint32_t rxReq; /*!< Number of successfully received advertising requests. */ + uint32_t rxReqCrc; /*!< Number of received advertising requests with CRC errors. */ + uint32_t rxReqTimeout; /*!< Number of timed out received advertising requests (receive timeout). */ + uint32_t txRsp; /*!< Number of sent response packets. */ + uint32_t errAdv; /*!< Number of advertising transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBleAdvPktStats_t; + +/*! \brief Auxiliary advertising packet statistics. */ +typedef struct +{ + uint32_t txAdv; /*!< Number of sent advertising packets. */ + uint32_t rxReq; /*!< Number of successfully received advertising requests. */ + uint32_t rxReqCrc; /*!< Number of received advertising requests with CRC errors. */ + uint32_t rxReqTimeout; /*!< Number of timed out received advertising requests (receive timeout). */ + uint32_t txRsp; /*!< Number of sent response packets. */ + uint32_t txChain; /*!< Number of sent chain packets. */ + uint32_t errAdv; /*!< Number of advertising transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBleAuxAdvPktStats_t; + +/*! \brief Scan packet statistics. */ +typedef struct +{ + uint32_t rxAdv; /*!< Number of successfully received advertising packets. */ + uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */ + uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */ + uint32_t txReq; /*!< Number of sent advertising requests. */ + uint32_t rxRsp; /*!< Number of successfully received advertising response packets. */ + uint32_t rxRspCrc; /*!< Number of received advertising response packets with CRC errors. */ + uint32_t rxRspTimeout; /*!< Number of timed out advertising response packets (receive timeout). */ + uint32_t errScan; /*!< Number of scan transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBleScanPktStats_t; + +/*! \brief Scan packet statistics. */ +typedef struct +{ + uint32_t rxAdv; /*!< Number of successfully received advertising packets. */ + uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */ + uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */ + uint32_t txReq; /*!< Number of sent advertising requests. */ + uint32_t rxRsp; /*!< Number of successfully received advertising response packets. */ + uint32_t rxRspCrc; /*!< Number of received advertising response packets with CRC errors. */ + uint32_t rxRspTimeout; /*!< Number of timed out advertising response packets (receive timeout). */ + uint32_t rxChain; /*!< Number of successfully received chain packets. */ + uint32_t rxChainCrc; /*!< Number of received chain packets with CRC errors. */ + uint32_t rxChainTimeout; /*!< Number of timed out chain packets (receive timeout). */ + uint32_t errScan; /*!< Number of scan transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBleAuxScanPktStats_t; + +/*! \brief Periodic scan packet statistics. */ +typedef struct +{ + uint32_t rxAdv; /*!< Number of successfully received advertising packets. */ + uint32_t rxAdvCrc; /*!< Number of received advertising packets with CRC errors. */ + uint32_t rxAdvTimeout; /*!< Number of timed out advertising packets (receive timeout). */ + uint32_t rxChain; /*!< Number of successfully received chain packets. */ + uint32_t rxChainCrc; /*!< Number of received chain packets with CRC errors. */ + uint32_t rxChainTimeout; /*!< Number of timed out chain packets (receive timeout). */ + uint32_t errScan; /*!< Number of scan transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBlePerScanPktStats_t; + +/*! \brief Data packet statistics. */ +typedef struct +{ + uint32_t rxData; /*!< Number of successfully received data packets. */ + uint32_t rxDataCrc; /*!< Number of received data packets with CRC errors. */ + uint32_t rxDataTimeout; /*!< Number of timed out data packets (receive timeout). */ + uint32_t txData; /*!< Number of sent data packets. */ + uint32_t errData; /*!< Number of data transaction errors. */ + uint16_t rxSetupUsec; /*!< Rx packet setup watermark in microseconds. */ + uint16_t txSetupUsec; /*!< Tx packet setup watermark in microseconds. */ + uint16_t rxIsrUsec; /*!< Rx ISR processing watermark in microseconds. */ + uint16_t txIsrUsec; /*!< Tx ISR processing watermark in microseconds. */ +} BbBleDataPktStats_t; + +/*! \brief PDU filtering statistics. */ +typedef struct +{ + uint16_t failPduTypeFilt; /*!< Number of PDUs failing PDU type filter. */ + uint16_t passPduTypeFilt; /*!< Number of PDUs passing PDU type filter. */ + uint16_t failWlFilt; /*!< Number of PDUs failing whitelist filter. */ + uint16_t passWlFilt; /*!< Number of PDUs passing whitelist filter. */ + uint16_t failPeerAddrMatch; /*!< Number of PDUS failing peer address match. */ + uint16_t passPeerAddrMatch; /*!< Number of PDUs passing peer address match. */ + uint16_t failLocalAddrMatch; /*!< Number of PDUS failing local address match. */ + uint16_t passLocalAddrMatch; /*!< Number of PDUs passing local address match. */ + uint16_t failPeerRpaVerify; /*!< Number of peer RPAs failing verification. */ + uint16_t passPeerRpaVerify; /*!< Number of peer RPAs passing verification. */ + uint16_t failLocalRpaVerify; /*!< Number of local RPAs failing verification. */ + uint16_t passLocalRpaVerify; /*!< Number of local RPAs passing verification. */ + uint16_t failPeerPrivAddrReq; /*!< Number of peer addresses failing requirement to be RPAs. */ + uint16_t failLocalPrivAddrReq; /*!< Number of local addresses failing requirement to be RPAs. */ + uint16_t failPeerAddrResReq; /*!< Number of PDUs failing required peer address resolution. */ + uint16_t passPeerAddrResOpt; /*!< Number of PDUs passing optional peer address resolution. */ + uint16_t passLocalAddrResOpt; /*!< Number of PDUs passing optional local address resolution. */ + uint16_t peerResAddrPend; /*!< Number of peer address resolutions pended. */ + uint16_t localResAddrPend; /*!< Number of local address resolutions pended. */ +} BbBlePduFiltStats_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the BLE BB. + * + * \return None. + * + * Initialize baseband resources. + */ +/*************************************************************************************************/ +void BbBleInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for scanning master operations. + * + * \return None. + * + * Update the operation table with scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBleScanMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for auxiliary scanning master operations. + * + * \return None. + * + * Update the operation table with auxiliary scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBleAuxScanMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for periodic scanning master operations. + * + * \return None. + * + * Update the operation table with periodic scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBlePerScanMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for connectable master operations. + * + * \return None. + * + * Update the operation table with connectable master operations routines. + */ +/*************************************************************************************************/ +void BbBleConnMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for advertising slave operations. + * + * \return None. + * + * Update the operation table with advertising slave operations routines. + */ +/*************************************************************************************************/ +void BbBleAdvSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for auxiliary advertising slave operations. + * + * \return None. + * + * Update the operation table with auxiliary advertising slave operations routines. + */ +/*************************************************************************************************/ +void BbBleAuxAdvSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for connectable slave operations. + * + * \return None. + * + * Update the operation table with connectable slave operations routines. + */ +/*************************************************************************************************/ +void BbBleConnSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize for test operations. + * + * \return None. + * + * Update the operation table with test operations routines. + */ +/*************************************************************************************************/ +void BbBleTestInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize white list. + * + * \param numEntries Number of white list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the white list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitWhiteList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Initialize resolving list. + * + * \param numEntries Number of resolving list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the resolving list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitResolvingList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Initialize periodic list. + * + * \param numEntries Number of periodic list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the periodic list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitPeriodicList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Get transmit RF path compensation. + * + * \return Transmit RF path compensation (in 1-dBm units). + */ +/*************************************************************************************************/ +int8_t BbBleRfGetTxRfPathComp(void); + +/*************************************************************************************************/ +/*! + * \brief Get receive RF path compensation. + * + * \return Transmit RF path compensation (in 1-dBm units). + */ +/*************************************************************************************************/ +int8_t BbBleRfGetRxRfPathComp(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize RF path compensation. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleInitRfPathComp(void); + +/*************************************************************************************************/ +/*! + * \brief Get advertising packet statistics. + * + * \param pStats Advertising statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAdvStats(BbBleAdvPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get scan packet statistics. + * + * \param pStats Scan statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetScanStats(BbBleScanPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get auxiliary advertising packet statistics. + * + * \param pStats Auxiliary advertising statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAuxAdvStats(BbBleAuxAdvPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get auxiliary scan packet statistics. + * + * \param pStats Auxiliary scan statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAuxScanStats(BbBleAuxScanPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get periodic scan packet statistics. + * + * \param pStats Periodic scan statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetPerScanStats(BbBlePerScanPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get connection packet statistics. + * + * \param pStats Connection data statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetConnStats(BbBleDataPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get test mode packet statistics. + * + * \param pStats Test data statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetTestStats(BbBleDataPktStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get PDU filter statistics. + * + * \param pStats PDU filter statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetPduFiltStats(BbBlePduFiltStats_t *pStats); + +/*************************************************************************************************/ +/*! + * \brief Get supported transmit power. + * + * \param pMinTxPwr Return buffer for minimum transmit power (expressed in 1dBm units). + * \param pMaxTxPwr Return buffer for maximum transmit power (expressed in 1dBm units). + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleRfGetSupTxPower(int8_t *pMinTxPwr, int8_t *pMaxTxPwr); + +/*************************************************************************************************/ +/*! + * \brief Read RF path compensation. + * + * \param pTxPathComp Return buffer for RF transmit path compensation value (expressed in 0.1dBm units). + * \param pRxPathComp Return buffer for RF receive path compensation value (expressed in 0.1dBm units). + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleRfReadRfPathComp(int16_t *pTxPathComp, int16_t *pRxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Set RF path compensation. + * + * \param txPathComp RF transmit path compensation value (expressed in 0.1dBm units). + * \param rxPathComp RF receive path compensation value (expressed in 0.1dBm units). + * + * \return TRUE if successful, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBleRfWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Get the actual Tx power at the antenna (expressed in 1dBm units). + * + * \param txPwr Tx power provided by the host (expressed in 1dBm units). + * \param compFlag Flag to apply Tx path compensation or not. + * + * \return Actual Tx power at the antenna (expressed in 1dBm units). + * + * Tx path compensation is only used for extended ADV header. + * Compensation is not considered when filling in HCI events. + */ +/*************************************************************************************************/ +int8_t BbBleRfGetActualTxPower(int8_t txPwr, bool_t compFlag); + +/*! \} */ /* BB_API_BLE */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_op.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_op.h new file mode 100644 index 0000000000000000000000000000000000000000..12dff6a81c1d78b349f5cf5514f00bdaa5c009db --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_op.h @@ -0,0 +1,353 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_OP_H +#define BB_BLE_API_OP_H + +#include "bb_api.h" +#include "bb_ble_drv.h" +#include "bb_ble_api_pdufilt.h" +#include "ll_defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Convert BLE protocol ticks to BB ticks. */ +#define BB_BLE_TO_BB_TICKS(n) BB_US_TO_BB_TICKS((n) * LL_BLE_US_PER_TICK) + +/*! \brief Increment statistics counter. */ +#define BB_INC_STAT(s) s++ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Operation types. */ +enum +{ + BB_BLE_OP_TEST_TX, /*!< Continuous Tx test mode. */ + BB_BLE_OP_TEST_RX, /*!< Continuous Rx test mode. */ + BB_BLE_OP_MST_ADV_EVENT, /*!< Master advertising event. */ + BB_BLE_OP_SLV_ADV_EVENT, /*!< Slave advertising event. */ + BB_BLE_OP_MST_CONN_EVENT, /*!< Master connection event. */ + BB_BLE_OP_SLV_CONN_EVENT, /*!< Slave connection event. */ + BB_BLE_OP_MST_AUX_ADV_EVENT, /*!< Master auxiliary advertising event. */ + BB_BLE_OP_SLV_AUX_ADV_EVENT, /*!< Slave auxiliary advertising event. */ + BB_BLE_OP_SLV_PER_ADV_EVENT, /*!< Slave periodic advertising event. */ + BB_BLE_OP_MST_PER_SCAN_EVENT, /*!< Master periodic scanning event. */ + BB_BLE_OP_NUM /*!< Total number of operations. */ +}; + +/*! \brief Maximum request PDU length (MAX(LL_SCAN_REQ_PDU_LEN, LL_CONN_IND_PDU_LEN)). */ +#define BB_REQ_PDU_MAX_LEN (LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Pre-execute callback signature. */ +typedef void (*BbBlePreExec_t)(BbOpDesc_t *pBod); + +/*! \brief Execute callback signature. */ +typedef void (*BbBleExec_t)(BbOpDesc_t *pBod); + +/*! \brief Cancel callback signature. */ +typedef void (*BbBleCancel_t)(BbOpDesc_t *pBod); + +/*! \brief Advertising PDU transmit setup call signature. */ +typedef void (*BbBleTxAdvSetup_t)(BbOpDesc_t *pBod, uint32_t advTxTime); + +/*! \brief Chain indication PDU transmit setup call signature. */ +typedef uint32_t (*BbBleTxAuxSetup_t)(BbOpDesc_t *pBod, bool_t isChainInd); + +/*! \brief Returns TRUE if an scan request/response required. */ +typedef bool_t (*BbBleAdvComp_t)(BbOpDesc_t *pBod, const uint8_t *pBuf); + +/*! \brief Rx completion post processing call signature. */ +typedef void (*BbBleAdvPost_t)(BbOpDesc_t *pBod, const uint8_t *pBuf); + +/*! \brief Chain indication PDU received call signature. */ +typedef uint32_t (*BbBleRxChain_t)(BbOpDesc_t *pBod, const uint8_t *pBuf); + +/*! \brief Chain indication PDU received post call signature. */ +typedef bool_t (*BbBleRxChainPost_t)(BbOpDesc_t *pBod, const uint8_t *pBuf); + +/*! \brief Data transmit completion callback signature. */ +typedef void (*BbBleTxDataComp_t)(BbOpDesc_t *pBod, uint8_t status); + +/*! \brief Data receive completion callback signature. */ +typedef void (*BbBleRxDataComp_t)(BbOpDesc_t *pBod, uint8_t *pBuf, uint8_t status); + +/*! \brief Test completion callback signature. */ +typedef bool_t (*BbBleTestComp_t)(BbOpDesc_t *pBod, uint8_t status); + +/*! \brief Periodic PDU Rx complete call signature. */ +typedef uint32_t (*BbBlePerComp_t)(BbOpDesc_t *pBod, const uint8_t *pBuf, uint8_t status); + +/*! \brief Periodic PDU Rx complete post call signature. */ +typedef bool_t (*BbBlePerPostComp_t)(BbOpDesc_t *pBod, const uint8_t *pBuf); + +/*! + * \brief Master advertising event operation data (\ref BB_BLE_OP_MST_ADV_EVENT). + * + * \note BB assumes maximum adversing and scan response payload is 39 bytes. + */ +typedef struct +{ + uint8_t *pRxAdvBuf; /*!< Advertising buffer. */ + uint8_t *pTxReqBuf; /*!< Scan request buffer. */ + uint8_t *pRxRspBuf; /*!< Scan response buffer. */ + + BbBlePreExec_t preExecCback; /*!< Pre-execute callback. */ + BbBleAdvComp_t rxAdvCback; /*!< Advertising completion callback. */ + BbBleAdvPost_t rxAdvPostCback; /*!< Advertising completion post processing callback. */ + BbBleAdvComp_t txReqCback; /*!< Scan request completion callback. */ + BbBleAdvComp_t rxRspCback; /*!< Scan response completion callback. */ + + uint8_t txReqLen; /*!< Scan request buffer length. */ + + uint8_t scanChMap; /*!< Scan channel map. */ + + /* Return parameters. */ + int8_t advRssi; /*!< RSSI of advertisement. */ + uint8_t advRxPhyOptions; /*!< Rx PHY options. */ + uint32_t advCrc; /*!< CRC of advertisement. */ + uint32_t advStartTs; /*!< Start of advertising packet timestamp. */ + uint32_t elapsedUsec; /*!< Elapsed time of a single scan window in microseconds. */ + + /* Filter results. */ + bbBlePduFiltResults_t filtResults; /*!< Results from PDU filtering. */ +} BbBleMstAdvEvent_t; + +/*! + * \brief Slave advertising event operation data (\ref BB_BLE_OP_SLV_ADV_EVENT). + * + * \note BB assumes maximum scan request payload is 39 bytes. + */ +typedef struct +{ + uint8_t *pTxAdvBuf; /*!< Advertising buffer. */ + uint8_t *pRxReqBuf; /*!< Scan request buffer (must be size of BB_REQ_PDU_MAX_LEN). */ + uint8_t *pTxRspBuf; /*!< Scan response buffer. */ + + BbBleTxAdvSetup_t txAdvSetupCback; /*!< Adv PDU transmit setup callback. */ + BbBleAdvComp_t rxReqCback; /*!< Scan/Connect request receive completion callback. */ + BbBleAdvPost_t rxReqPostCback; /*!< Scan/Connect request receive post processing callback. */ + + uint8_t txAdvLen; /*!< Advertising buffer length. */ + uint8_t txRspLen; /*!< Scan response buffer length. */ + + uint8_t advChMap; /*!< Advertising channel map. */ + + /* Return parameters. */ + uint32_t reqStartTs; /*!< Start of request packet timestamp. */ + + /* Filter results. */ + bbBlePduFiltResults_t filtResults; /*!< Results from PDU filtering. */ +} BbBleSlvAdvEvent_t; + +/*! \brief Master auxiliary advertising event operation data (\ref BB_BLE_OP_MST_AUX_ADV_EVENT). */ +typedef struct +{ + uint8_t *pTxAuxReqBuf; /*!< Scan request buffer. */ + + BbBleAdvComp_t rxAuxAdvCback; /*!< Advertising completion callback. */ + BbBleAdvComp_t rxAuxRspCback; /*!< Scan response completion callback. */ + BbBleRxChain_t rxAuxChainCback; /*!< Chain completion callback. */ + BbBleRxChainPost_t rxAuxChainPostCback;/*!< Chain completion post callback. */ + + uint8_t txAuxReqLen; /*!< Scan request buffer length. */ + + uint32_t rxSyncDelayUsec; /*!< Receive timeout in microseconds. */ + bool_t isInit; /*!< TRUE if the event is for an initiation. */ + + /* Return parameters. */ + int8_t auxAdvRssi; /*!< RSSI of advertisement. */ + uint8_t auxRxPhyOptions; /*!< Rx PHY options. */ + uint32_t auxAdvCrc; /*!< CRC of advertisement. */ + uint32_t auxStartTs; /*!< Start of auxiliary advertising packet timestamp. */ + + /* Filter results. */ + bbBlePduFiltResults_t filtResults; /*!< Results from PDU filtering. */ +} BbBleMstAuxAdvEvent_t; + +/*! \brief Master periodic scanning event operation data (\ref BB_BLE_OP_MST_PER_SCAN_EVENT). */ +typedef struct +{ + BbBlePerComp_t rxPerAdvCback; /*!< Periodic scanning completion callback. */ + BbBlePerPostComp_t rxPerAdvPostCback; /*!< Periodic scanning completion post callback. */ + uint32_t rxSyncDelayUsec; /*!< Receive timeout in microseconds. */ + + /* Return parameters. */ + uint8_t rxStatus; /*!< RX status. */ + int8_t perAdvRssi; /*!< RSSI of advertisement. */ + uint8_t perRxPhyOptions; /*!< Rx PHY options. */ + uint32_t perAdvCrc; /*!< CRC of advertisement. */ + uint32_t perStartTs; /*!< Start of periodic advertising packet timestamp. */ + bool_t perIsFirstTs; /*!< True if it is the first timestamp for a serial of periodic packets. */ + +} BbBleMstPerScanEvent_t; + +/*! \brief Slave auxiliary advertising event operation data (\ref BB_BLE_OP_SLV_AUX_ADV_EVENT). */ +typedef struct +{ + /* TODO BbBleSlvAuxAdvEvent_t hide buffer descriptors in BB layer. */ + BbBleDrvTxBufDesc_t txAuxAdvPdu[2]; /*!< Advertising PDU descriptor. */ + uint8_t *pRxAuxReqBuf; /*!< Auxiliary request buffer (must be size of BB_REQ_PDU_MAX_LEN). */ + BbBleDrvTxBufDesc_t txAuxRspPdu[2]; /*!< Response PDU descriptor. */ + BbBleDrvTxBufDesc_t txAuxChainPdu[2]; /*!< Auxiliary chain PDU descriptor. */ + + BbBleAdvComp_t rxAuxReqCback; /*!< Auxiliary request receive completion callback. */ + BbBleAdvPost_t rxAuxReqPostCback; /*!< Auxiliary scan/connect request receive post processing callback. */ + BbBleTxAuxSetup_t txAuxSetupCback; /*!< Auxiliary chain indication setup callback. */ + + uint8_t auxAdvCh; /*!< Advertising channel map. */ + + /* Return parameters. */ + uint8_t auxRxPhyOptions; /*!< Rx PHY options. */ + uint32_t auxReqStartTs; /*!< Start of request packet timestamp. */ + + /* Filter results. */ + bbBlePduFiltResults_t filtResults; /*!< Results from PDU filtering. */ +} BbBleSlvAuxAdvEvent_t; + +/*! \brief Connection event operation data (\ref BB_BLE_OP_MST_CONN_EVENT). */ +typedef struct +{ + BbBleExec_t execCback; /*!< Execute callback. */ + BbBleCancel_t cancelCback; /*!< Cancel callback. */ + BbBleTxDataComp_t txDataCback; /*!< Transmit completion callback. */ + BbBleRxDataComp_t rxDataCback; /*!< Receive completion callback. */ + + /* Return parameters. */ + int8_t rssi; /*!< RSSI of the last received packet. */ + uint8_t rxPhyOptions; /*!< Rx PHY options. */ +} BbBleMstConnEvent_t; + +/*! \brief Connection event operation data (\ref BB_BLE_OP_SLV_CONN_EVENT). */ +typedef struct +{ + uint32_t rxSyncDelayUsec; /*!< Receive timeout in microseconds. */ + BbBleExec_t execCback; /*!< Execute callback. */ + BbBleCancel_t cancelCback; /*!< Cancel callback. */ + BbBleTxDataComp_t txDataCback; /*!< Transmit completion callback. */ + BbBleRxDataComp_t rxDataCback; /*!< Receive completion callback. */ + + /* Return parameters. */ + uint32_t startTs; /*!< Start timestamp of the first received packet. */ + int8_t rssi; /*!< RSSI of the last received packet. */ + uint8_t rxPhyOptions; /*!< Rx PHY options. */ +} BbBleSlvConnEvent_t; + +/*! \brief Continuous transmit operation data (\ref BB_BLE_OP_TEST_TX). */ +typedef struct +{ + BbBleTestComp_t testCback; /*!< Test callback. */ + + uint8_t *pTxBuf; /*!< Transmit data buffer. */ + uint16_t txLen; /*!< Transmit data buffer length. */ + uint16_t pktInterUsec; /*!< Transmit packet interval. */ +} BbBleTestTx_t; + +/*! \brief Continuous receive operation data (\ref BB_BLE_OP_TEST_RX). */ +typedef struct +{ + uint32_t rxSyncDelayUsec; /*!< Synchronization delay in microseconds. */ + BbBleTestComp_t testCback; /*!< Test callback. */ + + uint8_t *pRxBuf; /*!< Receive data buffer. */ + uint16_t rxLen; /*!< Receive data buffer length. */ +} BbBleTestRx_t; + +/*! \brief Bluetooth Low Energy protocol specific operation parameters. */ +typedef struct BbBleData_tag +{ + BbBleDrvChan_t chan; /*!< Channelization parameters. */ + bbBlePduFiltParams_t pduFilt; /*!< PDU filter parameters. */ + + union + { + BbBleMstAdvEvent_t mstAdv; /*!< Master advertising event data. */ + BbBleSlvAdvEvent_t slvAdv; /*!< Slave advertising event data. */ + BbBleMstAuxAdvEvent_t mstAuxAdv; /*!< Master auxiliary advertising event data. */ + BbBleSlvAuxAdvEvent_t slvAuxAdv; /*!< Slave auxiliary advertising event data. */ + BbBleSlvAuxAdvEvent_t slvPerAdv; /*!< Slave periodic advertising event data. */ + BbBleMstConnEvent_t mstConn; /*!< Master connection event data. */ + BbBleMstPerScanEvent_t mstPerScan; /*!< Master periodic scanning event data. */ + BbBleSlvConnEvent_t slvConn; /*!< Slave connection event data. */ + BbBleTestTx_t testTx; /*!< Transmit test data. */ + BbBleTestRx_t testRx; /*!< Receive test data. */ + } op; /*!< Operation specific data. */ +} BbBleData_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Transmit data PDU at next transmit slot. + * + * \param descs Array of transmit buffer descriptor. + * \param cnt Number of descriptors. + * + * \return None. + * + * \note This function is expected to be called during the call context of + * \ref BbBleSlvConnEvent_t::rxDataCback callback routine. + */ +/*************************************************************************************************/ +void BbBleTxData(BbBleDrvTxBufDesc_t descs[], uint8_t cnt); + +/*************************************************************************************************/ +/*! + * \brief Set receive data buffer for next receive slot. + * + * \param pBuf Receive data buffer. + * \param len Maximum length of data buffer. + * + * \return None. + * + * \note This function is expected to be called during the call context of + * \ref BbBleSlvConnEvent_t::rxDataCback callback routine. + * + * \note BB must always call the BbSlvConnEvent_t::rxDataCback callback routine of the + * currently executing BOD with the given buffer. + */ +/*************************************************************************************************/ +void BbBleRxData(uint8_t *pBuf, uint16_t len); + +/*! \} */ /* BB_API_BLE */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_OP_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_pdufilt.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_pdufilt.h new file mode 100644 index 0000000000000000000000000000000000000000..f5c339edf5ca61ec7c46fca0be8113738d7bfb97 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_pdufilt.h @@ -0,0 +1,169 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband PDU filtering interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_PDUFILT_H +#define BB_BLE_API_PDUFILT_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE_PDU_FILT + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Check whether a flag is set. */ +#define BB_BLE_PDU_FILT_FLAG_IS_SET(pFilt, flag) (((pFilt)->flags & BB_BLE_PDU_FILT_FLAG_##flag) != 0) + +/*! \brief Check whether a flag is clear. */ +#define BB_BLE_PDU_FILT_SET_FLAG(pFilt, flag) (pFilt)->flags |= BB_BLE_PDU_FILT_FLAG_##flag; + +/*! \brief PDU filtering flags. */ +enum +{ + /* Common flags. */ + BB_BLE_PDU_FILT_FLAG_LOCAL_ADDR_MATCH_ENA = (1 << 0), /*!< Local address should be matched. */ + BB_BLE_PDU_FILT_FLAG_LOCAL_ADDR_MATCH_RAND = (1 << 1), /*!< Local address to match is a random address. */ + BB_BLE_PDU_FILT_FLAG_PEER_ADDR_MATCH_ENA = (1 << 2), /*!< Peer address should be matched. */ + BB_BLE_PDU_FILT_FLAG_PEER_ADDR_MATCH_RAND = (1 << 3), /*!< Peer address to match is a random address. */ + + /* Privacy flags. */ + BB_BLE_PDU_FILT_FLAG_LOCAL_ADDR_RES_ENA = (1 << 4), /*!< Local address resolution is enabled. */ + BB_BLE_PDU_FILT_FLAG_LOCAL_ADDR_RES_OPT = (1 << 5), /*!< Local address resolution is optional. */ + BB_BLE_PDU_FILT_FLAG_PEER_ADDR_RES_ENA = (1 << 6) /*!< Peer address resolution is enabled. */ +}; + +/*! \brief Periodic PDU filtering parameters. */ +typedef struct +{ + uint8_t filterPolicy; /*!< Filter policy. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint64_t advAddr; /*!< Advertiser Address. */ +} bbBlePerPduFiltParams_t; + +/*! \brief PDU filtering parameters. */ +typedef struct +{ + uint16_t pduTypeFilt; /*!< Bit map of the PDUs the BB should allow. */ + uint16_t wlPduTypeFilt; /*!< Bit map of the PDUs the BB should pass through the whitelist. */ + uint32_t flags; /*!< Flags for PDU filtering. */ + uint64_t localAddrMatch; /*!< Local address to match. */ + uint64_t peerAddrMatch; /*!< Peer address to match. */ +} bbBlePduFiltParams_t; + +/*! \brief Extended PDU filtering parameters. */ +typedef struct +{ + uint64_t peerAddr; /*!< Peer address. */ + uint64_t localAddr; /*!< Local address. */ + uint8_t pduType; /*!< PDU type. */ + uint8_t extHdrFlags; /*!< Extended header flags. */ + bool_t peerAddrRand; /*!< TRUE if peer address is random, FALSE otherwise. */ + bool_t localAddrRand; /*!< TRUE if local address is random, FALSE otherwise. */ +} bbBlePduExtFiltParams_t; + +/*! \brief PDU filtering results. */ +typedef struct +{ + uint64_t peerAddr; /*!< Peer address. */ + uint64_t peerIdAddr; /*!< Peer ID address. */ + uint8_t pduType; /*!< PDU type. */ + uint8_t pduLen; /*!< PDU length. */ + bool_t peerAddrRand; /*!< TRUE if peer address is random. */ + bool_t peerIdAddrRand; /*!< TRUE if peer ID address is random. */ + bool_t peerMatch; /*!< TRUE if peer address was resolved or matched. */ + bool_t localMatch; /*!< TRUE if local address was resolved or matched. */ +} bbBlePduFiltResults_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Check if PDU is allowed, i.e., should not be ignored. + * + * \param pBuf PDU buffer. + * \param pFiltParams Filter parameters. + * \param forceRes TRUE if address resolution should be forced. + * \param pFiltResults Storage for filter results. + * + * \return TRUE if PDU is allowed, FALSE if PDU should be ignored. + */ +/*************************************************************************************************/ +bool_t BbBlePduFiltCheck(const uint8_t *pBuf, const bbBlePduFiltParams_t *pFiltParams, + bool_t forceRes, bbBlePduFiltResults_t *pFiltResults); + +/*************************************************************************************************/ +/*! + * \brief Check if PDU is allowed, i.e., should not be ignored. + * + * \param pExtFiltParams Extended filter parameters. + * \param pFiltParams Filter parameters. + * \param forceRes TRUE if address resolution should be forced. + * \param pFiltResults Storage for filter results. + * + * \return TRUE if PDU is allowed, FALSE if PDU should be ignored. + */ +/*************************************************************************************************/ +bool_t BbBleExtPduFiltCheck(const bbBlePduExtFiltParams_t *pExtFiltParams, + const bbBlePduFiltParams_t *pFiltParams, + bool_t forceRes, bbBlePduFiltResults_t *pFiltResults); + +/*************************************************************************************************/ +/*! + * \brief Get the peer ID address. + * + * \param pFiltResults Filter results. + * \param pPeerIdAddr Storage for peer ID address. + * \param pPeerIdAddrType Storage for peer ID address type; + * + * \return None. + */ +/*************************************************************************************************/ +void BbBlePduFiltResultsGetPeerIdAddr(const bbBlePduFiltResults_t *pFiltResults, uint64_t *pPeerIdAddr, uint8_t *pPeerIdAddrType); + +/*************************************************************************************************/ +/*! + * \brief Get the peer RPA. + * + * \param pFiltResults Filter results. + * \param pPeerRpa Storage for peer RPA or 0. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBlePduFiltResultsGetPeerRpa(const bbBlePduFiltResults_t *pFiltResults, uint64_t *pPeerRpa); + +/*! \} */ /* BB_API_BLE_PDU_FILT */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_PDUFILT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_periodiclist.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_periodiclist.h new file mode 100644 index 0000000000000000000000000000000000000000..2bf1fb20b37f0aef850f19a942fcfeb3672401f2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_periodiclist.h @@ -0,0 +1,120 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband periodiclist interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_PERIODICLIST_H +#define BB_BLE_API_PERIODICLIST_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE_WL + * \{ */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Check if address is periodic listed. + * + * \param addrType Address type. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * \return TRUE if white listed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListCheckAddr(uint8_t addrType, uint64_t addr, uint8_t SID); + +/*************************************************************************************************/ +/*! + * \brief Get periodic list size. + * + * \return Total number of periodic list entries. + * + * Read the periodic list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBlePeriodicListGetSize(void); + +/*************************************************************************************************/ +/*! + * \brief Clear all periodic list entries. + * + * \return None. + * + * Clear all periodic list entries stored in the BB. + * + * \note No resource synchronization is required to modify the periodic list resource as + * the LL modifies the periodic list only when advertising events are disabled. + */ +/*************************************************************************************************/ +void BbBlePeriodicListClear(void); + +/*************************************************************************************************/ +/*! + * \brief Add device to the periodic list. + * + * \param addrType Address type. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * \return TRUE if successful, FALSE if list full. + * + * Adds the given address to the periodic list stored in the BB. + * + * \note No resource synchronization is required to modify the periodic list resource as + * the LL modifies the periodic list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListAdd(uint8_t addrType, uint64_t addr, uint8_t SID); + +/*************************************************************************************************/ +/*! + * \brief Remove device from the periodic list. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Removes the given address from the periodic list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListRemove(bool_t randAddr, uint64_t addr, uint8_t SID); + +/*! \} */ /* BB_API_BLE_WL */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_WHITELIST_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_reslist.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_reslist.h new file mode 100644 index 0000000000000000000000000000000000000000..f8f426b57089dd773f6c98e6f74aea0b5ac8294c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_reslist.h @@ -0,0 +1,346 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband resolving list interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_RESLIST_H +#define BB_BLE_API_RESLIST_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE_RL + * \{ */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Resolvable address status. */ +enum +{ + BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST, /*!< Identity address is not in list. */ + BB_BLE_RESLIST_STATUS_ZERO_IRK, /*!< IRK is zero for address. */ + BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED, /*!< Resolvable address is unassigned. */ + BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED /*!< Resolvable address is assigned. */ +}; + +/*! \brief Privacy modes. */ +enum +{ + BB_BLE_RESLIST_PRIV_MODE_NETWORK = 0, /*!< Network privacy mode. */ + BB_BLE_RESLIST_PRIV_MODE_DEVICE = 1 /*!< Device privacy mode. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Address resolution needed callback signature. */ +typedef void (*bbBleResListAddrResNeeded_t)(uint64_t rpa, bool_t peer, uint8_t peerAddrType, uint64_t peerIdentityAddr); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Set address resolution needed callback. + * + * \param cback Callback. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleResListSetAddrResNeededCback(bbBleResListAddrResNeeded_t cback); + +/*************************************************************************************************/ +/*! + * \brief Get resolving list size. + * + * \return Total number of resolving list entries. + * + * Get the resolving list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBleResListGetSize(void); + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list. + * + * \return None. + * + * Clear all resolving list entries stored in the BB. + */ +/*************************************************************************************************/ +void BbBleResListClear(void); + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pPeerIrk Peer IRK. + * \param pLocalIrk Local IRK. + * + * \return TRUE if successful, FALSE if list full. + * + * Add device to resolving list. + */ +/*************************************************************************************************/ +bool_t BbBleResListAdd(uint8_t peerAddrType, uint64_t peerIdentityAddr, const uint8_t *pPeerIrk, + const uint8_t *pLocalIrk); + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Remove device from resolving list. + */ +/*************************************************************************************************/ +bool_t BbBleResListRemove(uint8_t peerAddrType, uint64_t peerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode of a device. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param privMode Privacy mode. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Set privacy mode of a device. + */ +/*************************************************************************************************/ +bool_t BbBleResListSetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t privMode); + +/*************************************************************************************************/ +/*! + * \brief Get privacy mode of a device. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pPrivMode Storage for privacy mode. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Get privacy mode of a device. + */ +/*************************************************************************************************/ +bool_t BbBleResListGetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t *pPrivMode); + +/*************************************************************************************************/ +/*! + * \brief Read peer resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Get the peer resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListReadPeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Read local resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Get the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListReadLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Update local resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for local resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Update the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListUpdateLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Generate peer resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address. + * + * \return TRUE if successful, FALSE if address not in list or peer IRK is zero. + * + * Generate a peer resolvable address for a peer. + */ +/*************************************************************************************************/ +bool_t BbBleResListGeneratePeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Check whether a peer address has been resolved. + * + * \param rpa Peer resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + * Check whether a peer address has been resolved. Because of timing constraints, addresses should + * not be resolved in this function; instead, the resolution callback should be invoked to schedule + * the operation later. + */ +/*************************************************************************************************/ +bool_t BbBleResListCheckResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Check whether a local address has been resolved. + * + * \param rpa Local resolvable private address + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + * Check whether a local address has been resolved. Because of timing constraints, addresses should + * not be resolved in this function; instead, the resolution callback should be invoked to schedule + * the operation later. + */ +/*************************************************************************************************/ +bool_t BbBleResListCheckResolveLocal(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Check whether a local address has been resolved. + * + * \param rpa Local resolvable private address + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + */ +/*************************************************************************************************/ +bool_t BbBleResListIsLocalResolved(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Resolve peer resolvable address. + * + * \param rpa Peer resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address could not be resolved. + * + * Resolve a peer resolvable address. + */ +/*************************************************************************************************/ +bool_t BbBleResListResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Resolve local resolvable address. + * + * \param rpa Local resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address could not be resolved. + * + * Resolve a local resolvable address. + */ +/*************************************************************************************************/ +bool_t BbBleResListResolveLocal(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Get status of peer address in resolving list. + * + * \param peerAddrRand TRUE if peer identity address is random. + * \param peerIdentityAddr Peer identity address. + * + * \return Peer address status. + * + * Get the peer resolvable private address status + */ +/*************************************************************************************************/ +uint8_t BbBleResListPeerStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Get status of local address in resolving list. + * + * \param peerAddrRand TRUE if peer identity address is random. + * \param peerIdentityAddr Peer identity address. + * + * \return Local address status. + * + * Get the peer resolvable private address status + */ +/*************************************************************************************************/ +uint8_t BbBleResListLocalStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Handle timeout of local resolvable addresses. + * + * \return None. + * + * A new local resolvable address will be generated for each entry in the resolving list. + */ +/*************************************************************************************************/ +void BbBleResListHandleTimeout(void); + +/*! \} */ /* BB_API_BLE_RL */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_RESLIST_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_whitelist.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_whitelist.h new file mode 100644 index 0000000000000000000000000000000000000000..11e8ab4083aa9fb2be6cb9b44412358693d3ee09 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/bb_ble_api_whitelist.h @@ -0,0 +1,143 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE baseband whitelist interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_API_WHITELIST_H +#define BB_BLE_API_WHITELIST_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup BB_API_BLE_WL + * \{ */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Check if address is white listed. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if white listed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListCheckAddr(bool_t randAddr, uint64_t addr); + +/*************************************************************************************************/ +/*! + * \brief Get white list size. + * + * \return Total number of white list entries. + * + * Read the white list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBleWhiteListGetSize(void); + +/*************************************************************************************************/ +/*! + * \brief Clear all white list entries. + * + * \return None. + * + * Clear all white list entries stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +void BbBleWhiteListClear(void); + +/*************************************************************************************************/ +/*! + * \brief Add device to the white list. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if successful, FALSE if list full. + * + * Adds the given address to the white list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListAdd(bool_t randAddr, uint64_t addr); + +/*************************************************************************************************/ +/*! + * \brief Remove device from the white list. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Removes the given address from the white list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListRemove(bool_t randAddr, uint64_t addr); + +/*************************************************************************************************/ +/*! + * \brief Add anonymous device to the white list. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleWhiteListAddAnonymous(void); + +/*************************************************************************************************/ +/*! + * \brief Remove anonymous device from the white list. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleWhiteListRemoveAnonymous(void); + +/*************************************************************************************************/ +/*! + * \brief Check if anonymous peer is allowed. + * + * \return TRUE if anonymous allowed, FALSE if disallowed. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListIsAnonymousAllowed(void); + +/*! \} */ /* BB_API_BLE_WL */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_API_WHITELIST_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/lhci_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/lhci_api.h similarity index 51% rename from lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/lhci_api.h rename to lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/lhci_api.h index 8fa85e5047cd9867efdbd6718b6b650f4da7ee16..d52967e6d6fe70c6eec1b77b9d883aa44a5339a0 100644 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/lhci_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/lhci_api.h @@ -1,22 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Link layer HCI subsystem API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ + * http://www.apache.org/licenses/LICENSE-2.0 * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer HCI subsystem API. */ /*************************************************************************************************/ @@ -25,7 +25,7 @@ #include "wsf_types.h" #include "wsf_os.h" -#include "cfg_mac.h" +#include "cfg_mac_ble.h" #ifdef __cplusplus extern "C" { @@ -42,27 +42,46 @@ typedef struct uint8_t len; /*!< Parameter length. */ } LhciHdr_t; +/*! \brief Command handler call signature. */ +typedef bool_t (*lhciCmdHandler_t)(LhciHdr_t *pHdr, uint8_t *pBuf); + /************************************************************************************************** Function Declarations **************************************************************************************************/ /* Initialization */ -void LhciAdvSlaveInit(void); void LhciScanMasterInit(void); -void LhciDataInit(void); +void LhciExtScanMasterInit(void); +void LhciAdvSlaveInit(void); +void LhciExtAdvSlaveInit(void); +void LhciEncMasterInit(void); +void LhciEncSlaveInit(void); +void LhciPrivAdvInit(void); +void LhciPrivConnInit(void); +void LhciConnInit(void); +void LhciConnMasterInit(void); +void LhciExtConnMasterInit(void); +void LhciScInit(void); +void LhciPhyInit(void); +void LhciChannelSelection2Init(void); +void LhciVsExtInit(lhciCmdHandler_t decodeCmd); void LhciHandlerInit(wsfHandlerId_t handlerId); void LhciHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); - -/* Data exchange */ -void LhciCmdRecv(uint8_t *pBuf); -void LhciAclRecv(uint8_t *pBuf); +#if (LL_ENABLE_TESTER) +void LhciTesterInit(void); +#endif /* Command processing */ -uint8_t LhciPackEvtHdr(uint8_t *pBuf, uint8_t evtCode, uint8_t paramLen); uint8_t LhciPackCmdStatusEvt(uint8_t *pBuf, uint8_t status, uint16_t opCode); uint8_t LhciPackCmdCompleteEvt(uint8_t *pBuf, uint16_t opCode); uint8_t LhciPackCmdCompleteEvtStatus(uint8_t *pBuf, uint8_t status); +uint8_t LhciPackVsEvt(uint8_t *pBuf, uint16_t vsEvtCode); void LhciSendEvent(uint8_t *pBuf); +bool_t LhciIsEventPending(void); +uint8_t LhciPackEvtHdr(uint8_t *pBuf, uint8_t evtCode, uint8_t paramLen); + +/* Event processing */ +void LhciVsEncodeTraceMsgEvtPkt(uint8_t *pBuf, uint8_t len); #ifdef __cplusplus }; diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_api.h new file mode 100644 index 0000000000000000000000000000000000000000..3b3e513952c111227b39acdb58bc9db223b7624f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_api.h @@ -0,0 +1,3047 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer interface file. + * + * Initialization conditional compilation are used to control LL initialization options. + * Define one or more of the following to enable roles and features. + * + * - INIT_BROADCASTER (default) + * - INIT_OBSERVER + * - INIT_PERIPHERAL + * - INIT_CENTRAL + * - INIT_ENCRYPTED + * + * \note Each feature may require additional \ref LlRtCfg_t requirements. + */ +/*************************************************************************************************/ + +#ifndef LL_API_H +#define LL_API_H + +#include "wsf_types.h" +#include "wsf_os.h" +#include "util/bda.h" +#include "cfg_mac_ble.h" +#include "ll_defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief The following status values are used in the LL API. */ +enum +{ + LL_SUCCESS = 0x00, + LL_ERROR_CODE_UNKNOWN_HCI_CMD = 0x01, + LL_ERROR_CODE_UNKNOWN_CONN_ID = 0x02, + LL_ERROR_CODE_HW_FAILURE = 0x03, + LL_ERROR_CODE_PAGE_TIMEOUT = 0x04, + LL_ERROR_CODE_AUTH_FAILURE = 0x05, + LL_ERROR_CODE_PIN_KEY_MISSING = 0x06, + LL_ERROR_CODE_MEM_CAP_EXCEEDED = 0x07, + LL_ERROR_CODE_CONN_TIMEOUT = 0x08, + LL_ERROR_CODE_CONN_LIMIT_EXCEEDED = 0x09, + LL_ERROR_CODE_SYNCH_CONN_LIMIT_EXCEEDED = 0x0A, + LL_ERROR_CODE_ACL_CONN_ALREADY_EXISTS = 0x0B, + LL_ERROR_CODE_CMD_DISALLOWED = 0x0C, + LL_ERROR_CODE_CONN_REJ_LIMITED_RESOURCES = 0x0D, + LL_ERROR_CODE_CONN_REJECTED_SECURITY_REASONS = 0x0E, + LL_ERROR_CODE_CONN_REJECTED_UNACCEPTABLE_BDADDR = 0x0F, + LL_ERROR_CODE_CONN_ACCEPT_TIMEOUT_EXCEEDED = 0x10, + LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE = 0x11, + LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS = 0x12, + LL_ERROR_CODE_REMOTE_USER_TERM_CONN = 0x13, + LL_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES = 0x14, + LL_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF = 0x15, + LL_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST = 0x16, + LL_ERROR_CODE_REPEATED_ATTEMPTS = 0x17, + LL_ERROR_CODE_PAIRING_NOT_ALLOWED = 0x18, + LL_ERROR_CODE_UNKNOWN_LMP_PDU = 0x19, + LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE = 0x1A, + LL_ERROR_CODE_SCO_OFFSET_REJ = 0x1B, + LL_ERROR_CODE_SCO_INTERVAL_REJ = 0x1C, + LL_ERROR_CODE_SCO_AIR_MODE_REJ = 0x1D, + LL_ERROR_CODE_INVALID_LMP_PARAMS = 0x1E, + LL_ERROR_CODE_UNSPECIFIED_ERROR = 0x1F, + LL_ERROR_CODE_UNSUPPORTED_LMP_PARAM_VAL = 0x20, + LL_ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED = 0x21, + LL_ERROR_CODE_LMP_LL_RESP_TIMEOUT = 0x22, + LL_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION = 0x23, + LL_ERROR_CODE_LMP_PDU_NOT_ALLOWED = 0x24, + LL_ERROR_CODE_ENCRYPT_MODE_NOT_ACCEPTABLE = 0x25, + LL_ERROR_CODE_LINK_KEY_CAN_NOT_BE_CHANGED = 0x26, + LL_ERROR_CODE_REQ_QOS_NOT_SUPPORTED = 0x27, + LL_ERROR_CODE_INSTANT_PASSED = 0x28, + LL_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29, + LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION = 0x2A, + LL_ERROR_CODE_RESERVED1 = 0x2B, + LL_ERROR_CODE_QOS_UNACCEPTABLE_PARAM = 0x2C, + LL_ERROR_CODE_QOS_REJ = 0x2D, + LL_ERROR_CODE_CHAN_ASSESSMENT_NOT_SUPPORTED = 0x2E, + LL_ERROR_CODE_INSUFFICIENT_SECURITY = 0x2F, + LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE = 0x30, + LL_ERROR_CODE_RESERVED2 = 0x31, + LL_ERROR_CODE_ROLE_SWITCH_PENDING = 0x32, + LL_ERROR_CODE_RESERVED3 = 0x33, + LL_ERROR_CODE_RESERVED_SLOT_VIOLATION = 0x34, + LL_ERROR_CODE_ROLE_SWITCH_FAILED = 0x35, + LL_ERROR_CODE_EXTENDED_INQUIRY_RESP_TOO_LARGE = 0x36, + LL_ERROR_CODE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = 0x37, + LL_ERROR_CODE_HOST_BUSY_PAIRING = 0x38, + LL_ERROR_CODE_CONN_REJ_NO_SUITABLE_CHAN_FOUND = 0x39, + LL_ERROR_CODE_CONTROLLER_BUSY = 0x3A, + LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL = 0x3B, + LL_ERROR_CODE_ADV_TIMEOUT = 0x3C, + LL_ERROR_CODE_CONN_TERM_MIC_FAILURE = 0x3D, + LL_ERROR_CODE_CONN_FAILED_TO_ESTABLISH = 0x3E, + LL_ERROR_CODE_MAC_CONN_FAILED = 0x3F, + LL_ERROR_CODE_COARSE_CLK_ADJ_REJ = 0x40, + LL_ERROR_CODE_TYPE0_SUBMAP_NOT_DEF = 0x41, + LL_ERROR_CODE_UNKNOWN_ADV_ID = 0x42, + LL_ERROR_CODE_LIMIT_REACHED = 0x43, + LL_ERROR_CODE_OP_CANCELLED_BY_HOST = 0x44 +}; + +/*! \addtogroup LL_API_INIT + * \{ */ + +/*! \brief LL runtime configuration parameters. */ +typedef struct +{ + /* Device */ + uint16_t compId; /*!< Company ID (default to ARM Ltd. ID). */ + uint16_t implRev; /*!< Implementation revision number. */ + uint8_t btVer; /*!< Core specification implementation level (LL_VER_BT_CORE_SPEC_4_2). */ + uint32_t _align32; /*!< Unused. Align next field to word boundary. */ + /* Advertiser */ + uint8_t maxAdvSets; /*!< Maximum number of advertising sets. */ + uint8_t maxAdvReports; /*!< Maximum number of pending legacy or extended advertising reports. */ + uint16_t maxExtAdvDataLen; /*!< Maximum extended advertising data size. */ + uint8_t defExtAdvDataFrag; /*!< Default extended advertising data fragmentation size. */ + uint32_t auxDelayUsec; /*!< Auxiliary Offset delay above T_MAFS in microseconds. */ + /* Scanner */ + uint8_t maxScanReqRcvdEvt; /*!< Maximum scan request received events. */ + uint16_t maxExtScanDataLen; /*!< Maximum extended scan data size. */ + /* Connection */ + uint8_t maxConn; /*!< Maximum number of connections. */ + uint8_t numTxBufs; /*!< Default number of transmit buffers. */ + uint8_t numRxBufs; /*!< Default number of receive buffers. */ + uint16_t maxAclLen; /*!< Maximum ACL buffer size. */ + int8_t defTxPwrLvl; /*!< Default Tx power level for connections. */ + uint8_t ceJitterUsec; /*!< Allowable CE jitter on a slave (account for master's sleep clock resolution). */ + /* DTM */ + uint16_t dtmRxSyncMs; /*!< DTM Rx synchronization window in milliseconds. */ + /* PHY */ + bool_t phy2mSup; /*!< 2M PHY supported. */ + bool_t phyCodedSup; /*!< Coded PHY supported. */ + bool_t stableModIdxTxSup; /*!< Tx stable modulation index supported. */ + bool_t stableModIdxRxSup; /*!< Rx stable modulation index supported. */ +} LlRtCfg_t; + +/*! \} */ /* LL_API_INIT */ + +/*! \addtogroup LL_API_DEVICE + * \{ */ + +/* The supported state bitmask indicates the LE states supported by the LL. */ +#define LL_SUP_STATE_NON_CONN_ADV (UINT64_C(1) << 0) /*!< Non-connectable Advertising State supported. */ +#define LL_SUP_STATE_SCAN_ADV (UINT64_C(1) << 1) /*!< Scannable Advertising State supported. */ +#define LL_SUP_STATE_CONN_ADV (UINT64_C(1) << 2) /*!< Connectable Advertising State supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV (UINT64_C(1) << 3) /*!< High Duty Cycle Directed Advertising State supported. */ +#define LL_SUP_STATE_PASS_SCAN (UINT64_C(1) << 4) /*!< Passive Scanning State supported. */ +#define LL_SUP_STATE_ACT_SCAN (UINT64_C(1) << 5) /*!< Active Scanning State supported. */ +#define LL_SUP_STATE_INIT (UINT64_C(1) << 6) /*!< Initiating State supported. Connection State in the Master Role supported is also supported. */ +#define LL_SUP_STATE_CONN_SLV (UINT64_C(1) << 7) /*!< Connection State in the Slave Role supported. */ +#define LL_SUP_STATE_NON_CONN_ADV_AND_PASS_SCAN (UINT64_C(1) << 8) /*!< Non-connectable Advertising State and Passive Scanning State combination supported. */ +#define LL_SUP_STATE_SCAN_ADV_AND_PASS_SCAN (UINT64_C(1) << 9) /*!< Scannable Advertising State and Passive Scanning State combination supported. */ +#define LL_SUP_STATE_CONN_ADV_AND_PASS_SCAN (UINT64_C(1) << 10) /*!< Connectable Advertising State and Passive Scanning State combination supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV_AND_PASS_SCAN (UINT64_C(1) << 11) /*!< Directed Advertising State and Passive Scanning State combination supported. */ +#define LL_SUP_STATE_NON_CONN_ADV_AND_ACT_SCAN (UINT64_C(1) << 12) /*!< Non-connectable Advertising State and Active Scanning State combination supported. */ +#define LL_SUP_STATE_SCAN_ADV_AND_ACT_SCAN (UINT64_C(1) << 13) /*!< Scannable Advertising State and Active Scanning State combination supported. */ +#define LL_SUP_STATE_CONN_ADV_AND_ACT_SCAN (UINT64_C(1) << 14) /*!< Connectable Advertising State and Active Scanning State combination supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV_ACT_SCAN (UINT64_C(1) << 15) /*!< Directed Advertising State and Active Scanning State combination supported. */ +#define LL_SUP_STATE_NON_CONN_ADV_AND_INIT (UINT64_C(1) << 16) /*!< Non-connectable Advertising State and Initiating State combination supported. */ +#define LL_SUP_STATE_SCAN_ADV_AND_INIT (UINT64_C(1) << 17) /*!< Scannable Advertising State and Initiating State combination supported */ +#define LL_SUP_STATE_NON_CONN_ADV_MST (UINT64_C(1) << 18) /*!< Non-connectable Advertising State and Master Role combination supported. */ +#define LL_SUP_STATE_SCAN_ADV_MST (UINT64_C(1) << 19) /*!< Scannable Advertising State and Master Role combination supported. */ +#define LL_SUP_STATE_NON_CONN_ADV_SLV (UINT64_C(1) << 20) /*!< Non-connectable Advertising State and Slave Role combination supported. */ +#define LL_SUP_STATE_SCAN_ADV_SLV (UINT64_C(1) << 21) /*!< Scannable Advertising State and Slave Role combination supported. */ +#define LL_SUP_STATE_PASS_SCAN_AND_INIT (UINT64_C(1) << 22) /*!< Passive Scanning State and Initiating State combination supported. */ +#define LL_SUP_STATE_ACT_SCAN_AND_INIT (UINT64_C(1) << 23) /*!< Active Scanning State and Initiating State combination supported. */ +#define LL_SUP_STATE_PASS_SCAN_MST (UINT64_C(1) << 24) /*!< Passive Scanning State and Master Role combination supported. */ +#define LL_SUP_STATE_ACT_SCAN_MST (UINT64_C(1) << 25) /*!< Active Scanning State and Master Role combination supported. */ +#define LL_SUP_STATE_PASS_SCAN_SLV (UINT64_C(1) << 26) /*!< Passive Scanning state and Slave Role combination supported. */ +#define LL_SUP_STATE_ACT_SCAN_SLV (UINT64_C(1) << 27) /*!< Active Scanning state and Slave Role combination supported. */ +#define LL_SUP_STATE_INIT_MST (UINT64_C(1) << 28) /*!< Initiating State and Master Role combination supported. Master Role and Master Role combination is also supported. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV (UINT64_C(1) << 29) /*!< Low Duty Cycle Directed Advertising State. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_PASS_SCAN (UINT64_C(1) << 30) /*!< Low Duty Cycle Directed Advertising and Passive Scanning State combination supported. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_ACT_SCAN (UINT64_C(1) << 31) /*!< Low Duty Cycle Directed Advertising and Active Scanning State combination supported. */ +#define LL_SUP_STATE_CONN_ADV_AND_INIT (UINT64_C(1) << 32) /*!< Connectable Advertising State and Initiating State combination supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV_AND_INIT (UINT64_C(1) << 33) /*!< High Duty Cycle Directed Advertising and Initiating combination supported. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_INIT (UINT64_C(1) << 34) /*!< Low Duty Cycle Directed Advertising and Initiating combination supported. */ +#define LL_SUP_STATE_CONN_ADV_MST (UINT64_C(1) << 35) /*!< Connectable Advertising State and Master Role combination supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV_MST (UINT64_C(1) << 36) /*!< High Duty Cycle Directed Advertising and Master Role combination supported. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV_MST (UINT64_C(1) << 37) /*!< Low Duty Cycle Directed Advertising and Master Role combination supported. */ +#define LL_SUP_STATE_CONN_ADV_SLV (UINT64_C(1) << 38) /*!< Connectable Advertising State and Slave Role combination supported. */ +#define LL_SUP_STATE_HI_DUTY_DIR_ADV_SLV (UINT64_C(1) << 39) /*!< High Duty Cycle Directed Advertising and Slave Role combination supported. */ +#define LL_SUP_STATE_LO_DUTY_DIR_ADV_SLV (UINT64_C(1) << 40) /*!< Low Duty Cycle Directed Advertising and Slave Role combination supported. */ +#define LL_SUP_STATE_INIT_SLV (UINT64_C(1) << 41) /*!< Initiating State and Slave Role combination. */ + +/*! \brief The features bitmask indicates the LE features supported by the LL. */ +enum +{ + /* --- Core Spec 4.0 --- */ + LL_FEAT_ENCRYPTION = (1 << 0), /*!< Encryption supported. */ + /* --- Core Spec 4.2 --- */ + LL_FEAT_CONN_PARAM_REQ_PROC = (1 << 1), /*!< Connection Parameters Request Procedure supported. */ + LL_FEAT_EXT_REJECT_IND = (1 << 2), /*!< Extended Reject Indication supported. */ + LL_FEAT_SLV_INIT_FEAT_EXCH = (1 << 3), /*!< Slave-Initiated Features Exchange supported. */ + LL_FEAT_LE_PING = (1 << 4), /*!< LE Ping supported. */ + LL_FEAT_DATA_LEN_EXT = (1 << 5), /*!< Data Length Extension supported. */ + LL_FEAT_PRIVACY = (1 << 6), /*!< LL Privacy supported. */ + LL_FEAT_EXT_SCAN_FILT_POLICY = (1 << 7), /*!< Extended Scan Filter Policy supported. */ + /* --- Core Spec 5.0 --- */ + LL_FEAT_LE_2M_PHY = (1 << 8), /*!< LE 2M PHY supported. */ + LL_FEAT_STABLE_MOD_IDX_TRANSMITTER = (1 << 9), /*!< Stable Modulation Index - Transmitter supported. */ + LL_FEAT_STABLE_MOD_IDX_RECEIVER = (1 << 10), /*!< Stable Modulation Index - Receiver supported. */ + LL_FEAT_LE_CODED_PHY = (1 << 11), /*!< LE Coded PHY supported. */ + LL_FEAT_LE_EXT_ADV = (1 << 12), /*!< LE Extended Advertising supported. */ + LL_FEAT_LE_PER_ADV = (1 << 13), /*!< LE Periodic Advertising supported. */ + LL_FEAT_CH_SEL_2 = (1 << 14), /*!< Channel Selection Algorithm #2 supported. */ + LL_FEAT_LE_POWER_CLASS_1 = (1 << 15), /*!< LE Power Class 1 supported. */ + LL_FEAT_MIN_NUM_USED_CHAN = (1 << 16), /*!< Minimum Number of Used Channels supported. */ + /* --- */ + LL_FEAT_ALL_MASK = 0x1FFFF /*!< All feature mask, need to be updated when new features are added. */ +}; + +/*! \brief This parameter identifies the device role. */ +enum +{ + LL_ROLE_MASTER = 0, /*!< Role is master. */ + LL_ROLE_SLAVE = 1 /*!< Role is slave. */ +}; + +/*! \brief Operational mode flags. */ +enum +{ + LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP = (1 << 0), /*!< Perform version exchange LLCP at connection establishment. */ + LL_OP_MODE_FLAG_SLV_REQ_IMMED_ACK = (1 << 1), /*!< MD bit set if data transmitted. */ + LL_OP_MODE_FLAG_BYPASS_CE_GUARD = (1 << 2), /*!< Bypass end of CE guard. */ + LL_OP_MODE_FLAG_MST_RETX_AFTER_RX_NACK = (1 << 3), /*!< Master retransmits after receiving NACK. */ + LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP = (1 << 4), /*!< Master ignores LL_CONNECTION_PARAM_RSP. */ + LL_OP_MODE_FLAG_MST_UNCOND_CP_RSP = (1 << 5), /*!< Master unconditionally accepts LL_CONNECTION_PARAM_RSP. */ + /*!< (LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP must be cleared). */ + LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP = (1 << 6), /*!< Perform data length update LLCP at connection establishment. */ + LL_OP_MODE_FLAG_REQ_SYM_PHY = (1 << 7), /*!< Require symmetric PHYs for connection. */ + LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP = (1 << 8), /*!< Perform feature exchange LLCP at connection establishment. */ + LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP = (1 << 9), /*!< Slave delays LLCP startup procedures. */ + /* diagnostics only */ + LL_OP_MODE_FLAG_ENA_ADV_DLY = (1 << 16), /*!< Enable advertising delay. */ + LL_OP_MODE_FLAG_ENA_SCAN_BACKOFF = (1 << 17), /*!< Enable scan backoff. */ + LL_OP_MODE_FLAG_ENA_WW = (1 << 18), /*!< Enable window widening. */ + LL_OP_MODE_FLAG_ENA_SLV_LATENCY = (1 << 19), /*!< Enable slave latency. */ + LL_OP_MODE_FLAG_ENA_LLCP_TIMER = (1 << 20) /*!< Enable LLCP timer. */ +}; + +/*! \} */ /* LL_API_DEVICE */ + +/*! \addtogroup LL_API_BROADCAST + * \{ */ + +/*! \brief The advertising type indicates the connectable and discoverable nature of the advertising packets transmitted by a device. */ +enum +{ + LL_ADV_CONN_UNDIRECT = 0, /*!< Connectable undirected advertising. Peer devices can scan and connect to this device. */ + LL_ADV_CONN_DIRECT_HIGH_DUTY = 1, /*!< Connectable directed advertising, high duty cycle. Only a specified peer device can connect to this device. */ + LL_ADV_SCAN_UNDIRECT = 2, /*!< Scannable undirected advertising. Peer devices can scan this device but cannot connect. */ + LL_ADV_NONCONN_UNDIRECT = 3, /*!< Non-connectable undirected advertising. Peer devices cannot scan or connect to this device. */ + LL_ADV_CONN_DIRECT_LOW_DUTY = 4 /*!< Connectable directed advertising, low duty cycle. Only a specified peer device can connect to this device. */ +}; + +/*! \brief The address type indicates whether an address is public or random. */ +enum +{ + LL_ADDR_PUBLIC = 0, /*!< Public address. */ + LL_ADDR_RANDOM = 1, /*!< Random address. */ + LL_ADDR_PUBLIC_IDENTITY = 2, /*!< Public identity address. */ + LL_ADDR_RANDOM_IDENTITY = 3, /*!< Random (static) identity address. */ + LL_ADDR_RANDOM_UNRESOLVABLE = 0xFE, /*!< Un-resolvable random address. */ + LL_ADDR_ANONYMOUS = 0xFF /*!< Anonymous advertiser. */ +}; + +#define LL_ADDR_RANDOM_BIT LL_ADDR_RANDOM /*!< Address type random or public bit. */ +#define LL_ADDR_IDENTITY_BIT LL_ADDR_PUBLIC_IDENTITY /*!< Address type identity bit. */ + +/*! \brief Advertising channel bit. */ +enum +{ + LL_ADV_CHAN_37_BIT = (1 << 0), /*!< Advertising channel 37. */ + LL_ADV_CHAN_38_BIT = (1 << 1), /*!< Advertising channel 38. */ + LL_ADV_CHAN_39_BIT = (1 << 2), /*!< Advertising channel 39. */ + LL_ADV_CHAN_ALL = 0x7 /*!< All advertising channels. */ +}; + +/*! \brief Advertising filter policy. */ +enum +{ + LL_ADV_FILTER_NONE = 0, /*!< Scan from any device. */ + LL_ADV_FILTER_SCAN_WL_BIT = 1, /*!< Scan from White List only. */ + LL_ADV_FILTER_CONN_WL_BIT = 2, /*!< Connect from While List only. */ + LL_ADV_FILTER_WL_ONLY = 3 /*!< Scan and connect from While List only. */ +}; + +/*! \brief Advertising event properties. */ +enum +{ + LL_ADV_EVT_PROP_CONN_ADV_BIT = (1 << 0), /*!< Connectable advertising. */ + LL_ADV_EVT_PROP_SCAN_ADV_BIT = (1 << 1), /*!< Scannable advertising. */ + LL_ADV_EVT_PROP_DIRECT_ADV_BIT = (1 << 2), /*!< Directed advertising. */ + LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT = (1 << 3), /*!< High Duty Cycle advertising. */ + LL_ADV_EVT_PROP_LEGACY_ADV_BIT = (1 << 4), /*!< Use legacy advertising PDUs. */ + LL_ADV_EVT_PROP_OMIT_AA_BIT = (1 << 5), /*!< Omit advertiser's address from all PDUs (anonymous advertising). */ + LL_ADV_EVT_PROP_TX_PWR_BIT = (1 << 6) /*!< Include TxPower in the advertising PDU. */ +}; + +#define LL_ADV_EVT_PROP_NON_CONN_NON_SCAN 0 /*!< Non-connectable and non-scannable advertising. */ + +/*! \brief Extended advertising parameters. */ +typedef struct +{ + uint16_t advEventProp; /*!< Advertising Event Properties. */ + uint32_t priAdvInterMin; /*!< Primary Advertising Interval Minimum. */ + uint32_t priAdvInterMax; /*!< Primary Advertising Interval Maximum. */ + uint8_t priAdvChanMap; /*!< Primary Advertising Channel Map. */ + uint8_t ownAddrType; /*!< Own Address Type. */ + uint8_t peerAddrType; /*!< Peer Address Type. */ + uint8_t *pPeerAddr; /*!< Peer Address. */ + uint8_t advFiltPolicy; /*!< Advertising Filter Policy. */ + int8_t advTxPwr; /*!< Advertising Tx Power. */ + uint8_t priAdvPhy; /*!< Primary Advertising PHY. */ + uint8_t secAdvMaxSkip; /*!< Secondary Advertising Maximum Skip. */ + uint8_t secAdvPhy; /*!< Secondary Advertising PHY. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t scanReqNotifEna; /*!< Scan Request Notification Enable. */ +} LlExtAdvParam_t; + +/*! \brief Extended advertising enable parameters. */ +typedef struct +{ + uint8_t handle; /*!< Advertising handle. */ + uint16_t duration; /*!< Duration. */ + uint8_t numEvents; /*!< Maximum number of extended advertising events. */ +} LlExtAdvEnableParam_t; + +/*! \brief Periodic advertising parameters. */ +typedef struct +{ + uint16_t perAdvInterMin; /*!< Periodic Advertising Interval Minimum. */ + uint16_t perAdvInterMax; /*!< Periodic Advertising Interval Maximum. */ + uint16_t perAdvProp; /*!< Periodic Advertising Properties. */ +} LlPerAdvParam_t; + +/*! \brief Advertising data operation. */ +enum +{ + LL_ADV_DATA_OP_FRAG_INTER = 0, /*!< Intermediate fragment. */ + LL_ADV_DATA_OP_FRAG_FIRST = 1, /*!< First fragment. */ + LL_ADV_DATA_OP_FRAG_LAST = 2, /*!< Last fragment. */ + LL_ADV_DATA_OP_COMP = 3, /*!< Complete extended advertising data. */ + LL_ADV_DATA_OP_UNCHANGED = 4 /*!< Unchanged data (just update the Advertising DID). */ +}; + +/*! \brief Advertising data fragment preference. */ +enum +{ + LL_ADV_DATA_FRAG_ALLOW = 0, /*!< Controller may fragment all Host advertising data. */ + LL_ADV_DATA_FRAG_DISALLOW = 1 /*!< Controller should not fragment nor minimize fragmentation of Host advertising data. */ +}; + +/*! \} */ /* LL_API_BROADCAST */ + +/*! \addtogroup LL_API_OBSERVER + * \{ */ + +/*! \brief Type of scan. */ +enum +{ + LL_SCAN_PASSIVE = 0, /*!< Passive scanning. */ + LL_SCAN_ACTIVE = 1 /*!< Active scanning. */ +}; + +/*! \brief Scan filter policy. */ +enum +{ + LL_SCAN_FILTER_NONE = 0, /*!< Accept all advertising packets. */ + LL_SCAN_FILTER_WL_BIT = 1, /*!< Accept from While List only. */ + LL_SCAN_FILTER_RES_INIT_BIT = 2, /*!< Accept directed advertisements with RPAs. */ + LL_SCAN_FILTER_WL_OR_RES_INIT = 3 /*!< Accept from White List or directed advertisements with RPAs. */ +}; + +/*! \brief Periodic scan filter policy. */ +enum +{ + LL_PER_SCAN_FILTER_NONE = 0, /*!< Use advSID, advAddrType and advAddr to filter. */ + LL_PER_SCAN_FILTER_PL_BIT = 1 /*!< Use the periodic advertiser list. */ +}; + +/*! \brief Scan parameters. */ +typedef struct +{ + uint16_t scanInterval; /*!< Scan interval. */ + uint16_t scanWindow; /*!< Scan window. */ + uint8_t scanType; /*!< Scan type. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t scanFiltPolicy; /*!< Scan filter policy. */ +} LlScanParam_t; + +/*! \brief Extended scan parameters. */ +typedef struct +{ + uint16_t scanInterval; /*!< Scan interval. */ + uint16_t scanWindow; /*!< Scan window. */ + uint8_t scanType; /*!< Scan type. */ +} LlExtScanParam_t; + +/*! \brief Scan filter modes for duplicate report. */ +enum +{ + LL_SCAN_FILTER_DUP_DISABLE = 0x00, /*!< Duplicate filtering disabled. */ + LL_SCAN_FILTER_DUP_ENABLE_ONCE = 0x01, /*!< Duplicate filtering enabled. */ + LL_SCAN_FILTER_DUP_ENABLE_PERIODIC = 0x02 /*!< Duplicate filtering enabled, reset for each scan period. */ +}; + +/*! \brief Advertising report event types. */ +enum +{ + LL_RPT_TYPE_ADV_IND = 0x00, /*!< Connectable undirected advertising (ADV_IND). */ + LL_RPT_TYPE_ADV_DIRECT_IND = 0x01, /*!< Connectable directed advertising (ADV_DIRECT_IND). */ + LL_RPT_TYPE_ADV_SCAN_IND = 0x02, /*!< Scannable undirected advertising (ADV_SCAN_IND). */ + LL_RPT_TYPE_ADV_NONCONN_IND = 0x03, /*!< Non connectable undirected advertising (ADV_NONCONN_IND). */ + LL_RPT_TYPE_SCAN_RSP = 0x04 /*!< Scan Response (SCAN_RSP). */ +}; + +/*! \brief Periodic advertising create sync command. */ +typedef struct +{ + uint8_t filterPolicy; /*!< Filter Policy. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint8_t *pAdvAddr; /*!< Advertiser Address. */ + uint16_t skip; /*!< Skip. */ + uint16_t syncTimeOut; /*!< Synchronization Timeout. */ +} LlPerAdvCreateSyncCmd_t; + +/*! \brief Device in periodic advertiser list */ +typedef struct +{ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint8_t *pAdvAddr; /*!< Advertiser Address. */ + uint8_t advSID; /*!< Advertising SID. */ +} LlDevicePerAdvList_t; + +/*! \} */ /* LL_API_OBSERVER */ + +/*! \addtogroup LL_API_CONN + * \{ */ + +/*! \brief Master clock accuracy. */ +enum +{ + LL_MCA_500_PPM = 0x00, /*!< 500 ppm */ + LL_MCA_250_PPM = 0x01, /*!< 250 ppm */ + LL_MCA_150_PPM = 0x02, /*!< 150 ppm */ + LL_MCA_100_PPM = 0x03, /*!< 100 ppm */ + LL_MCA_75_PPM = 0x04, /*!< 75 ppm */ + LL_MCA_50_PPM = 0x05, /*!< 50 ppm */ + LL_MCA_30_PPM = 0x06, /*!< 30 ppm */ + LL_MCA_20_PPM = 0x07 /*!< 20 ppm */ +}; + +/*! \brief PHYS specification. */ +enum +{ + LL_PHYS_NONE = 0, /*!< No selected PHY. */ + LL_PHYS_LE_1M_BIT = (1 << 0), /*!< LE 1M PHY. */ + LL_PHYS_LE_2M_BIT = (1 << 1), /*!< LE 2M PHY. */ + LL_PHYS_LE_CODED_BIT = (1 << 2) /*!< LE Coded PHY. */ +}; + +/*! \brief All PHYs preference. */ +enum +{ + LL_ALL_PHY_ALL_PREFERENCES = 0, /*!< All PHY preferences. */ + LL_ALL_PHY_TX_PREFERENCE_BIT = (1 << 0), /*!< Set if no Tx PHY preference. */ + LL_ALL_PHY_RX_PREFERENCE_BIT = (1 << 1) /*!< Set if no Rx PHY preference. */ +}; + +/*! \brief PHY options. */ +enum +{ + LL_PHY_OPTIONS_NONE = 0, /*!< No preferences. */ + LL_PHY_OPTIONS_S2_PREFERRED = 1, /*!< S=2 coding preferred when transmitting on LE Coded PHY. */ + LL_PHY_OPTIONS_S8_PREFERRED = 2 /*!< S=8 coding preferred when transmitting on LE Coded PHY. */ +}; + +/*! \brief PHY types. */ +enum +{ + LL_PHY_NONE = 0, /*!< PHY not selected. */ + LL_PHY_LE_1M = 1, /*!< LE 1M PHY. */ + LL_PHY_LE_2M = 2, /*!< LE 2M PHY. */ + LL_PHY_LE_CODED = 3 /*!< LE Coded PHY. */ +}; + +/*! \brief Privacy modes. */ +enum +{ + LL_PRIV_MODE_NETWORK = 0, /*!< Network privacy mode. */ + LL_PRIV_MODE_DEVICE = 1 /*!< Device privacy mode. */ +}; + +/*! \brief Initiating parameters (\a LlExtCreateConn()). */ +typedef struct +{ + uint16_t scanInterval; /*!< Scan interval. */ + uint16_t scanWindow; /*!< Scan window. */ + uint8_t filterPolicy; /*!< Scan filter policy. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t peerAddrType; /*!< Address type used for peer device. */ + const uint8_t *pPeerAddr; /*!< Address of peer device. */ +} LlInitParam_t; + +/*! \brief Initiating parameters (\a LlExtCreateConn()). */ +typedef struct +{ + uint8_t filterPolicy; /*!< Scan filter policy. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t peerAddrType; /*!< Address type used for peer device. */ + const uint8_t *pPeerAddr; /*!< Address of peer device. */ + uint8_t initPhys; /*!< Initiating PHYs. */ +} LlExtInitParam_t; + +/*! \brief Initiating scan parameters (\a LlExtCreateConn()). */ +typedef struct +{ + uint16_t scanInterval; /*!< Scan interval. */ + uint16_t scanWindow; /*!< Scan window. */ +} LlExtInitScanParam_t; + +/*! \brief Connection specification (\a LlCreateConn(), \a LlConnUpdate() and \a LlExtCreateConn()). */ +typedef struct +{ + uint16_t connIntervalMin; /*!< Minimum connection interval. */ + uint16_t connIntervalMax; /*!< Maximum connection interval. */ + uint16_t connLatency; /*!< Connection latency. */ + uint16_t supTimeout; /*!< Supervision timeout. */ + uint16_t minCeLen; /*!< Minimum CE length. */ + uint16_t maxCeLen; /*!< Maximum CE length. */ +} LlConnSpec_t; + +/*! \brief Channel selection algorithm methods. */ +enum +{ + LL_CH_SEL_1 = 0, /*!< Channel selection #1. */ + LL_CH_SEL_2 = 1 /*!< Channel selection #2. */ +}; + +/*! \brief Tx power level type. */ +enum +{ + LL_TX_PWR_LVL_TYPE_CURRENT = 0x00, /*!< Current transmit power level. */ + LL_TX_PWR_LVL_TYPE_MAX = 0x01 /*!< Maximum transmit power level. */ +}; + +/*! \} */ /* LL_API_CONN */ + +/*! \addtogroup LL_API_ENCRYPT + * \{ */ + +/*! \brief Nonce mode. */ +enum +{ + LL_NONCE_MODE_PKT_CNTR = 0x00, /*!< Packet counter nonce mode (default). */ + LL_NONCE_MODE_EVT_CNTR = 0x01 /*!< Connection event counter mode. */ +}; + +/*! \brief Encryption mode data structure used in LlGetEncMode() and LlSetEncMode(). */ +typedef struct +{ + bool_t enaAuth; /*!< Enable authentication. */ + bool_t nonceMode; /*!< Nonce mode. */ +} LlEncMode_t; + +/*! \} */ /* LL_API_ENCRYPT */ + +/*! \addtogroup LL_API_TEST + * \{ */ + +/*! \brief Test packet payload type. */ +enum +{ + LL_TEST_PKT_TYPE_PRBS9 = 0x00, /*!< Pseudo-Random bit sequence 9. */ + LL_TEST_PKT_TYPE_0F = 0x01, /*!< 00001111'b packet payload type. */ + LL_TEST_PKT_TYPE_55 = 0x02, /*!< 01010101'b packet payload type. */ + LL_TEST_PKT_TYPE_PRBS15 = 0x03, /*!< Pseudo-Random bit sequence 15. */ + LL_TEST_PKT_TYPE_FF = 0x04, /*!< 11111111'b packet payload type. */ + LL_TEST_PKT_TYPE_00 = 0x05, /*!< 00000000'b packet payload type. */ + LL_TEST_PKT_TYPE_F0 = 0x06, /*!< 11110000'b packet payload type. */ + LL_TEST_PKT_TYPE_AA = 0x07 /*!< 10101010'b packet payload type. */ +}; + +/*! \brief Test PHY type. */ +enum +{ + LL_TEST_PHY_LE_1M = 0x01, /*!< LE 1M PHY. */ + LL_TEST_PHY_LE_2M = 0x02, /*!< LE 2M PHY. */ + LL_TEST_PHY_LE_CODED = 0x03, /*!< LE Coded PHY (data coding unspecified). */ + LL_TEST_PHY_LE_CODED_S8 = 0x03, /*!< LE Coded PHY with S=8 data coding. */ + LL_TEST_PHY_LE_CODED_S2 = 0x04 /*!< LE Coded PHY with S=2 data coding. */ +}; + +/*! \brief Test modulation index. */ +enum +{ + LL_TEST_MOD_IDX_STANDARD = 0x00, /*!< Standard modulation index. */ + LL_TEST_MOD_IDX_STABLE = 0x01 /*!< Stable modulation index. */ +}; + +/*! \brief Test report data. */ +typedef struct +{ + uint16_t numTx; /*!< Total transmit packet count. */ + uint16_t numRxSuccess; /*!< Successfully received packet count. */ + uint16_t numRxCrcError; /*!< CRC failed packet count. */ + uint16_t numRxTimeout; /*!< Receive timeout count. */ +} LlTestReport_t; + +/*! \} */ /* LL_API_TEST */ + +/*! \addtogroup LL_API_EVENT + * \{ */ + +/*! \brief Link control callback interface events */ +enum +{ + LL_ERROR_IND, /*!< Unrecoverable LL or radio error occurred (vendor specific). */ + /* --- Core Spec 4.0 --- */ + LL_RESET_CNF, /*!< Reset complete. */ + LL_ADV_REPORT_IND, /*!< Advertising report. */ + LL_ADV_ENABLE_CNF, /*!< Advertising enable/disable complete. */ + LL_SCAN_ENABLE_CNF, /*!< Scan enable/disable complete. */ + LL_CONN_IND, /*!< Connection complete. */ + LL_DISCONNECT_IND, /*!< Disconnect complete. */ + LL_CONN_UPDATE_IND, /*!< Connection update complete. */ + LL_CREATE_CONN_CANCEL_CNF, /*!< Create connection cancel status. */ + LL_READ_REMOTE_VER_INFO_CNF, /*!< Read remote version information complete. */ + LL_READ_REMOTE_FEAT_CNF, /*!< Read remote features complete. */ + LL_ENC_CHANGE_IND, /*!< Encryption change. */ + LL_ENC_KEY_REFRESH_IND, /*!< Key refresh. */ + LL_LTK_REQ_IND, /*!< LTK request. */ + LL_LTK_REQ_NEG_REPLY_CNF, /*!< LTK request negative reply status. */ + LL_LTK_REQ_REPLY_CNF, /*!< LTK request reply status. */ + /* --- Core Spec 4.2 --- */ + LL_REM_CONN_PARAM_IND, /*!< Remote connection parameter change. */ + LL_AUTH_PAYLOAD_TIMEOUT_IND, /*!< Authentication payload timeout expired. */ + LL_DATA_LEN_CHANGE_IND, /*!< Data length changed. */ + LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND, /*!< Read local P-256 public key complete. */ + LL_GENERATE_DHKEY_CMPL_IND, /*!< Generate Diffie-Hellman key complete. */ + LL_SCAN_REPORT_IND, /*!< Legacy scan report (vendor specific). */ + /* --- Core Spec 5.0 --- */ + LL_PHY_UPDATE_IND, /*!< LE PHY update complete. */ + LL_EXT_ADV_REPORT_IND, /*!< Extended advertising report. */ + LL_EXT_SCAN_ENABLE_CNF, /*!< Extended scan enable/disable complete. */ + LL_SCAN_TIMEOUT_IND, /*!< Scan timeout. */ + LL_SCAN_REQ_RCVD_IND, /*!< Scan request received. */ + LL_EXT_ADV_ENABLE_CNF, /*!< Extended advertising enable/disable complete. */ + LL_ADV_SET_TERM_IND, /*!< Advertising set terminated complete. */ + LL_PER_ADV_ENABLE_CNF, /*!< Periodic advertising enable/disable complete. */ + LL_PER_ADV_SYNC_ESTD_IND, /*!< Periodic scanning synchronization established. */ + LL_PER_ADV_SYNC_LOST_IND, /*!< Periodic scanning synchronization lost. */ + LL_PER_ADV_REPORT_IND, /*!< Periodic scanning report. */ + LL_CH_SEL_ALGO_IND /*!< Channel selection algorithm. */ +}; + +/*! \brief Advertising report indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t *pData; /*!< Data buffer. */ + uint8_t len; /*!< Data buffer length. */ + int8_t rssi; /*!< RSSI. */ + uint8_t eventType; /*!< Event type. */ + uint8_t addrType; /*!< Address type. */ + bdAddr_t addr; /*!< Address. */ + /* --- direct fields --- */ + uint8_t directAddrType; /*!< Direct address type. */ + bdAddr_t directAddr; /*!< Direct address. */ +} LlAdvReportInd_t; + +/*! \brief Connect indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t role; /*!< Role of this device. */ + uint8_t addrType; /*!< Address type. */ + bdAddr_t peerAddr; /*!< Peer address. */ + uint16_t connInterval; /*!< Connection interval. */ + uint16_t connLatency; /*!< Connection latency. */ + uint16_t supTimeout; /*!< Supervision timeout. */ + uint8_t clockAccuracy; /*!< Clock accuracy. */ + /* --- enhanced fields --- */ + bdAddr_t localRpa; /*!< Local resolvable private address. */ + bdAddr_t peerRpa; /*!< Peer resolvable private address. */ +} LlConnInd_t; + +/*! \brief Disconnect indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t reason; /*!< Reason code. */ +} LlDisconnectInd_t; + +/*! \brief Connect update indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint16_t connInterval; /*!< Connection interval. */ + uint16_t connLatency; /*!< Connection latency. */ + uint16_t supTimeout; /*!< Supervision timeout. */ +} LlConnUpdateInd_t; + +/*! \brief Connection parameter change indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t handle; /*!< Connection handle. */ + uint16_t connIntervalMin;/*!< Minimum connection interval. */ + uint16_t connIntervalMax;/*!< Maximum connection interval. */ + uint16_t connLatency; /*!< Connection latency. */ + uint16_t supTimeout; /*!< Supervision timeout. */ +} LlRemConnParamInd_t; + +/*! \brief Create connection cancel confirm */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ +} LlCreateConnCancelCnf_t; + +/*! \brief Read remote version information confirm */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t version; /*!< Bluetooth specification version. */ + uint16_t mfrName; /*!< Manufacturer ID. */ + uint16_t subversion; /*!< Subversion. */ +} LlReadRemoteVerInfoCnf_t; + +#define LL_FEAT_LEN 8 /*!< Length of features byte array */ + +/*! \brief Read remote feature confirm */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t features[LL_FEAT_LEN]; /*!< Features. */ +} LlReadRemoteFeatCnf_t; + +/*! \brief Encryption change indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + bool_t enabled; /*!< Encryption enabled. */ +} LlEncChangeInd_t; + +/*! \brief Key refresh indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ +} LlEncKeyRefreshInd_t; + +/*! \brief LTK request indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t randNum[LL_RAND_LEN]; /*!< Random number. */ + uint16_t encDiversifier; /*!< Encryption diversifier. */ +} LlLtkReqInd_t; + +/*! \brief LTK request reply confirm */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ +} LlLtkReqReplyCnf_t; + +/*! \brief LTK request negative reply */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ +} LlLtkReqNegReplyCnf_t; + +/*! \brief Authentication payload timeout expired indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t handle; /*!< Connection handle. */ +} LlAuthPayloadTimeoutInd_t; + +/*! \brief Data length change */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t handle; /*!< Connection handle. */ + uint16_t maxTxLen; /*!< Maximum transmit length. */ + uint16_t maxTxTime; /*!< Maximum transmit time in microseconds. */ + uint16_t maxRxLen; /*!< Maximum receive length. */ + uint16_t maxRxTime; /*!< Maximum receive time in microseconds. */ +} LlDataLenChangeInd_t; + +/*! \brief Read local P-256 key pair complete */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint8_t pubKey_x[LL_ECC_KEY_LEN]; /*!< Public key x-coordinate. */ + uint8_t pubKey_y[LL_ECC_KEY_LEN]; /*!< Public key y-coordinate. */ +} LlReadLocalP256PubKeyInd_t; + +/*! \brief Generate Diffie-Hellman key complete */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint8_t dhKey[LL_ECC_KEY_LEN]; /*!< Diffie-Hellman key. */ +} LlGenerateDhKeyInd_t; + +/*! \brief PHY update complete. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t txPhy; /*!< Transceiver PHY. */ + uint8_t rxPhy; /*!< Receiver PHY. */ +} LlPhyUpdateInd_t; + +/*! \brief HW error */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t code; /*!< Code. */ +} LlHwErrorInd_t; + +/*! \brief Scan report */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t peerAddrType; /*!< Peer address type. */ + uint64_t peerAddr; /*!< Peer address. */ + uint64_t peerRpa; /*!< Peer RPA. */ +} LlScanReportInd_t; + +/*! \brief Extended advertising enable */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint8_t handle; /*!< Advertising handle. */ +} LlExtAdvEnableCnf_t; + +/*! \brief Periodic advertising enable */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint8_t handle; /*!< Advertising handle. */ +} LlPerAdvEnableCnf_t; + +/*! \brief Extended advertising report event types. */ +enum +{ + LL_RPT_EVT_CONN_ADV_BIT = (1 << 0), /*!< Connectable advertising event bit. */ + LL_RPT_EVT_SCAN_ADV_BIT = (1 << 1), /*!< Scannable advertising event bit. */ + LL_RPT_EVT_DIRECT_ADV_BIT = (1 << 2), /*!< Directed advertising event bit. */ + LL_RPT_EVT_SCAN_RSP_BIT = (1 << 3), /*!< Scan response event bit. */ + LL_RPT_EVT_LEGACY_ADV_BIT = (1 << 4) /*!< Legacy advertising PDU event bit. */ +}; + +/*! \brief Extended advertising report data status. */ +enum +{ + LL_RPT_DATA_CMPL = 0x00, /*!< Data complete. */ + LL_RPT_DATA_INC_MORE = 0x01, /*!< Data incomplete, more date to come. */ + LL_RPT_DATA_INC_TRUNC = 0x02 /*!< Data incomplete, data truncated, no more date to come. */ +}; + +/*! \brief Special SID values. */ +enum +{ + LL_SID_NO_ADI = 0xFF /*!< No ADI field in the PDU. */ +}; + +/*! \brief Extended advertising report */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t eventType; /*!< Event type. */ + uint8_t addrType; /*!< Address type. */ + bdAddr_t addr; /*!< Address. */ + uint8_t priPhy; /*!< Primary PHY. */ + uint8_t secPhy; /*!< Secondary PHY. */ + uint8_t advSID; /*!< Advertising SID. */ + int8_t txPwr; /*!< Tx Power. */ + int8_t rssi; /*!< RSSI. */ + int16_t perAdvInter; /*!< Periodic advertising interval. */ + uint8_t directAddrType; /*!< Direct address type. */ + bdAddr_t directAddr; /*!< Direct address. */ + uint16_t len; /*!< Data buffer length. */ + const uint8_t *pData; /*!< Data buffer. */ +} LlExtAdvReportInd_t; + +/*! \brief Extended scan enable confirm */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ +} LlExtScanEnableCnf_t; + +/*! \brief Advertising set terminated */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint8_t advHandle; /*!< Advertising handle. */ + uint16_t connHandle; /*!< Connection handle. */ + uint8_t numCmplAdvEvt; /*!< Number of completed advertising events. */ +} LlAdvSetTermInd_t; + +/*! \brief Scan request received */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t handle; /*!< Advertising handle. */ + uint8_t scanAddrType; /*!< Scanner address type. */ + bdAddr_t scanAddr; /*!< Scanner address. */ +} LlScanReqRcvdInd_t; + +/*! \brief Used channel selection indication */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t handle; /*!< Connection handle. */ + uint8_t usedChSel; /*!< Used channel selection. */ +} LlChSelInd_t; + +/*! \brief LE periodic advertising synchronization established */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint8_t status; /*!< Status. */ + uint16_t syncHandle; /*!< Sync handle. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t addrType; /*!< Advertiser address type. */ + bdAddr_t addr; /*!< Advertiser address. */ + uint8_t advPhy; /*!< Advertiser PHY. */ + uint16_t perAdvInterval; /*!< Periodic advertising interval. */ + uint8_t advClkAccuracy; /*!< Advertiser clock accuracy. */ +} LlPerAdvSyncEstdCnf_t; + +/*! \brief LE periodic advertising report */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t syncHandle; /*!< Sync handle. */ + int8_t txPwr; /*!< Tx Power. */ + int8_t rssi; /*!< RSSI. */ + uint8_t unused; /*!< Future use. */ + uint8_t dataStatus; /*!< Data status. */ + uint16_t len; /*!< Data buffer length. */ + const uint8_t *pData; /*!< Data buffer. */ +} LlPerAdvReportInd_t; + +/*! \brief LE periodic advertising sync lost */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + uint16_t syncHandle; /*!< Sync handle. */ +} LlPerAdvSyncLostInd_t; + +/*! \brief Union of all event types */ +typedef union +{ + wsfMsgHdr_t hdr; /*!< Event header. */ + LlHwErrorInd_t hwErrorInd; /*!< Unrecoverable LL or radio error occurred. */ + /* --- Core Spec 4.0 --- */ + LlAdvReportInd_t advReportInd; /*!< LE advertising report. */ + LlConnInd_t connInd; /*!< LE connection complete. */ + LlDisconnectInd_t disconnectInd; /*!< LE disconnect complete. */ + LlConnUpdateInd_t connUpdateInd; /*!< LE connection update complete. */ + LlCreateConnCancelCnf_t createConnCancelCnf; /*!< LE create connection cancel status. */ + LlReadRemoteVerInfoCnf_t readRemoteVerInfoCnf; /*!< Read remote version information complete. */ + LlReadRemoteFeatCnf_t readRemoteFeatCnf; /*!< LE read remote features complete. */ + LlEncChangeInd_t encChangeInd; /*!< Encryption change. */ + LlEncKeyRefreshInd_t keyRefreshInd; /*!< Key refresh. */ + LlLtkReqInd_t ltkReqInd; /*!< LE LTK request. */ + LlLtkReqNegReplyCnf_t ltkReqNegReplyCnf; /*!< LTK request negative reply status. */ + LlLtkReqReplyCnf_t ltkReqReplyCnf; /*!< LTK request reply status. */ + /* --- Core Spec 4.2 --- */ + LlRemConnParamInd_t remConnParamInd; /*!< LE remote connection parameter request. */ + LlAuthPayloadTimeoutInd_t authPayloadTimeoutInd; /*!< Authentication payload timeout. */ + LlDataLenChangeInd_t dataLenChangeInd; /*!< Data length changed. */ + LlReadLocalP256PubKeyInd_t readLocalP256PubKeyInd; /*!< Read local P-256 public key complete. */ + LlGenerateDhKeyInd_t generateDhKeyInd; /*!< Generate Diffie-Hellman key complete. */ + LlScanReportInd_t scanReportInd; /*!< Scan report. */ + /* --- Core Spec 5.0 --- */ + LlPhyUpdateInd_t phyUpdateInd; /*!< PHY update complete. */ + LlExtAdvReportInd_t extAdvReportInd; /*!< LE extended advertising report. */ + LlExtScanEnableCnf_t extScanEnableCnf; /*!< LE extended scan enable completed. */ + LlScanReqRcvdInd_t scanReqRcvdInd; /*!< LE scan request received. */ + LlExtAdvEnableCnf_t extAdvEnableCnf; /*!< LE extended advertising enable complete. */ + LlAdvSetTermInd_t advSetTermInd; /*!< LE advertising set terminated. */ + LlChSelInd_t usedChSelInd; /*!< Used channel selection. */ + LlPerAdvEnableCnf_t perAdvEnableCnf; /*!< LE periodic advertising enable complete. */ + LlPerAdvSyncEstdCnf_t perAdvSyncEstdCnf; /*!< LE periodic advertising sync established. */ + LlPerAdvReportInd_t perAdvReportInd; /*!< LE periodic advertising report. */ + LlPerAdvSyncLostInd_t perAdvSyncLostInd; /*!< LE periodic advertising sync lost. */ + +} LlEvt_t; + +/*! \brief Event callback */ +typedef bool_t (*llEvtCback_t)(LlEvt_t *pEvent); + +/*! \brief ACL callback */ +typedef void (*llAclCback_t)(uint16_t handle, uint8_t numBufs); + +/*! \} */ /* LL_API_EVENT */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*! \addtogroup LL_API_INIT + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Get default runtime configuration values. + * + * \param pCfg Pointer to runtime configuration parameters. + * + * \return None. + * + * This function returns default value for the LL subsystem's runtime configurations. + */ +/*************************************************************************************************/ +void LlGetDefaultRunTimeCfg(LlRtCfg_t *pCfg); + +/*************************************************************************************************/ +/*! + * \brief Initialize runtime configuration. + * + * \param pCfg Pointer to runtime configuration parameters (data must be static). + * + * \return None. + * + * This function initializes the LL subsystem's runtime configuration. + * + * \note This routine must be called only once before any other initialization routines. + */ +/*************************************************************************************************/ +void LlInitRunTimeCfg(const LlRtCfg_t *pCfg); + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for connections. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for connections. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitConnMem(uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for extended advertising. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for extended advertising. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitExtAdvMem(uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for extended scanning. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for extended scanning. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitExtScanMem(uint8_t *pFreeMem, uint32_t freeMemSize); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an advertising slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising slave. + */ +/*************************************************************************************************/ +void LlAdvSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation for extended advertising slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an extended advertising slave. + */ +/*************************************************************************************************/ +void LlExtAdvSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a connectable slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and connectable slave. + */ +/*************************************************************************************************/ +void LlConnSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a encryptable connectable slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and encryptable + * connectable slave. + */ +/*************************************************************************************************/ +void LlEncConnSlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a scanning master. + * + * \return None. + * + * This function initializes the LL subsystem for use as a scanning master. + */ +/*************************************************************************************************/ +void LlScanMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation for extended scanning master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an extended scanning master. + */ +/*************************************************************************************************/ +void LlExtScanMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an initiating master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an initiating master. + */ +/*************************************************************************************************/ +void LlInitMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an extended initiating master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an initiating master. + */ +/*************************************************************************************************/ +void LlExtInitMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a connectable master. + * + * \return None. + * + * This function initializes the LL subsystem for use as a scanning and initiating master. + */ +/*************************************************************************************************/ +void LlConnMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a encryptable connectable slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and encryptable + * connectable slave. + */ +/*************************************************************************************************/ +void LlEncConnMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation with privacy. + * + * \return None. + * + * This function initializes the LL subsystem for use with privacy. + */ +/*************************************************************************************************/ +void LlPrivInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for secure connections. + * + * \return None. + * + * This function initializes the LL subsystem for secure connections. + */ +/*************************************************************************************************/ +void LlScInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for PHY features (slave). + * + * \return None. + * + * This function initializes the LL subsystem for slave PHY features. + */ +/*************************************************************************************************/ +void LlPhySlaveInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for PHY features (master). + * + * \return None. + * + * This function initializes the LL subsystem for master PHY features. + */ +/*************************************************************************************************/ +void LlPhyMasterInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for secure connections. + * + * \return None. + * + * This function initializes the LL subsystem for secure connections. + */ +/*************************************************************************************************/ +void LlChannelSelection2Init(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for test modes. + * + * \return None. + * + * This function initializes the LL subsystem for test modes. + */ +/*************************************************************************************************/ +void LlTestInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem with task handler. + * + * \param handlerId WSF handler ID. + * + * \return None. + * + * This function initializes the LL subsystem. It is called once upon system initialization. + * It must be called before any other function in the LL API is called. + */ +/*************************************************************************************************/ +void LlHandlerInit(wsfHandlerId_t handlerId); + +/*************************************************************************************************/ +/*! + * \brief LL message dispatch handler. + * + * \param event WSF event. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void LlHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); + +/*************************************************************************************************/ +/*! + * \brief Reset LL subsystem. + * + * \return None. + * + * Reset the LL subsystem. All active connections are closed and all radio procedures such as + * scanning or advertising are terminated. + */ +/*************************************************************************************************/ +void LlReset(void); + +/*************************************************************************************************/ +/*! + * \brief Register LL event handler. + * + * \param evtCback Client callback function. + * + * \return None. + * + * This function is called by a client to register for LL events. + */ +/*************************************************************************************************/ +void LlEvtRegister(llEvtCback_t evtCback); + +/*************************************************************************************************/ +/*! + * \brief Register ACL handler. + * + * \param sendCompCback Client ACL send complete callback function. + * \param recvPendCback Client ACL receive pending callback function. + * + * \return None. + * + * This function is called by a client to register for ACL data. + */ +/*************************************************************************************************/ +void LlAclRegister(llAclCback_t sendCompCback, llAclCback_t recvPendCback); + +/*! \} */ /* LL_API_INIT */ + +/*! \addtogroup LL_API_DEVICE + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Set Bluetooth device address + * + * \param pAddr Bluetooth device address. + * + * \return None. + * + * Set the BD address to be used by LL. + */ +/*************************************************************************************************/ +void LlSetBdAddr(const uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Get Bluetooth device address + * + * \param pAddr Bluetooth device address. + * + * \return None. + * + * Get the BD address currently used by LL or all zeros if address is not set. + */ +/*************************************************************************************************/ +void LlGetBdAddr(uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Set random device address. + * + * \param pAddr Random Bluetooth device address. + * + * \return Status. + * + * Set the random address to be used by LL. + */ +/*************************************************************************************************/ +uint8_t LlSetRandAddr(const uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Get random device address. + * + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Get the random address currently used by LL or all zeros if address is not set. + */ +/*************************************************************************************************/ +uint8_t LlGetRandAddr(uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Get versions + * + * \param pCompId Company ID. + * \param pBtVer Bluetooth version. + * \param pImplRev Implementation revision. + * + * \return None. + */ +/*************************************************************************************************/ +void LlGetVersion(uint16_t *pCompId, uint8_t *pBtVer, uint16_t *pImplRev); + +/*************************************************************************************************/ +/*! + * \brief Get supported states. + * + * \param pStates Supported states bitmask. + * + * \return None. + * + * Return the states supported by the LL. + */ +/*************************************************************************************************/ +void LlGetSupStates(uint8_t *pStates); + +/*************************************************************************************************/ +/*! + * \brief Get features. + * + * \param pFeatures Supported features bitmask. + * + * \return None. + * + * Return the LE features supported by the LL. + */ +/*************************************************************************************************/ +void LlGetFeatures(uint8_t *pFeatures); + +/*************************************************************************************************/ +/*! + * \brief Set features. + * + * \param pFeatures Supported features bitmask. + * + * \return Status error code. + * + * \note This function must only be called when controller is not connected to another + * device. + * + * Set the LE features supported by the LL. + */ +/*************************************************************************************************/ +uint8_t LlSetFeatures(const uint8_t *pFeatures); + +/*************************************************************************************************/ +/*! + * \brief Get random number. + * + * \param pRandNum Buffer to store 8 bytes random data. + * + * \return Status error code. + * + * Request the LL to generate a random number. + */ +/*************************************************************************************************/ +uint8_t LlGetRandNum(uint8_t *pRandNum); + +/*************************************************************************************************/ +/*! + * \brief Get white list size. + * + * \return Total number of white list entries. + * + * Read the white list capacity supported by the LL. + */ +/*************************************************************************************************/ +uint8_t LlGetWhitelistSize(void); + +/*************************************************************************************************/ +/*! + * \brief Clear all white list entries. + * + * \return Status error code. + * + * Clear all white list entries stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlClearWhitelist(void); + +/*************************************************************************************************/ +/*! + * \brief Add device to the white list. + * + * \param addrType Address type. + * \param pAddr Bluetooth device address. + * + * \return Status error code. + * + * Adds the given address to the white list stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToWhitelist(uint8_t addrType, bdAddr_t pAddr); + +/*************************************************************************************************/ +/*! + * \brief Remove device from the white list. + * + * \param addrType Address type. + * \param pAddr Bluetooth device address. + * + * \return Status error code. + * + * Removes the given address from the white list stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromWhitelist(uint8_t addrType, bdAddr_t pAddr); + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * \param pPeerIrk Peer IRK. + * \param pLocalIrk Local IRK. + * + * \return Status error code. + * + * Add device to resolving list. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, const uint8_t *pPeerIrk, const uint8_t *pLocalIrk); + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * + * \return Status error code. + * + * Remove device from resolving list. + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr); + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list. + * + * \return Status error code. + * + * Clear resolving list. + */ +/*************************************************************************************************/ +uint8_t LlClearResolvingList(void); + +/*************************************************************************************************/ +/*! + * \brief Read resolving list size. + * + * \param pSize Storage for resolving list size. + * + * \return Status error code. + * + * Read number of address translation entries that can be stored in the resolving list. + */ +/*************************************************************************************************/ +uint8_t LlReadResolvingListSize(uint8_t *pSize); + +/*************************************************************************************************/ +/*! + * \brief Read peer resolvable address. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return Status error code. + * + * Get the peer resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +uint8_t LlReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Read local resolvable address. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return Status error code. + * + * Get the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +uint8_t LlReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pRpa); + +/*************************************************************************************************/ +/*! + * \brief Enable or disable address resolution. + * + * \param enable Set to TRUE to enable address resolution or FALSE to disable address + * resolution. + * + * \return Status error code. + * + * Enable or disable address resolution so that received local or peer resolvable private + * addresses are resolved. + */ +/*************************************************************************************************/ +uint8_t LlSetAddrResolutionEnable(uint8_t enable); + +/*************************************************************************************************/ +/*! + * \brief Set resolvable private address timeout. + * + * \param rpaTimeout Timeout measured in seconds. + * + * \return Status error code. + * + * Set the time period between automatic generation of new resolvable private addresses. + */ +/*************************************************************************************************/ +uint8_t LlSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout); + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * \param privMode Privacy mode. + * + * \return Status error code. + * + * Allow the host to specify the privacy mode to be used for a given entry on the resolving list. + */ +/*************************************************************************************************/ +uint8_t LlSetPrivacyMode(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, uint8_t privMode); + +/*************************************************************************************************/ +/*! + * \brief Generate a P-256 public/private key pair. + * + * \return Status error code. + * + * Generate a P-256 public/private key pair. If another ECC operation (P-256 key pair or Diffie- + * Hellman key generation) is ongoing, an error will be returned. + */ +/*************************************************************************************************/ +uint8_t LlGenerateP256KeyPair(void); + +/*************************************************************************************************/ +/*! + * \brief Generate a Diffie-Hellman key. + * + * \param pubKey_x Remote public key x-coordinate. + * \param pubKey_y Remote public key y-coordinate. + * + * \return Status error code. + * + * Generate a Diffie-Hellman key from a remote public key and the local private key. If another + * ECC operation (P-256 key pair or Diffie-Hellman key generation) is ongoing, an error will be + * returned. + */ +/*************************************************************************************************/ +uint8_t LlGenerateDhKey(const uint8_t pubKey_x[LL_ECC_KEY_LEN], const uint8_t pubKey_y[LL_ECC_KEY_LEN]); + +/*************************************************************************************************/ +/*! + * \brief Set P-256 private key for debug purposes. + * + * \param privKey Private key, or all zeros to clear set private key. + * + * \return Status error code. + * + * Set P-256 private key or clear set private key. The private key will be used for generate key + * pairs and Diffie-Hellman keys until cleared. + */ +/*************************************************************************************************/ +uint8_t LlSetP256PrivateKey(const uint8_t privKey[LL_ECC_KEY_LEN]); + +/*************************************************************************************************/ +/*! + * \brief Set channel class. + * + * \param pChanMap Channel map (0=bad, 1=usable). + * + * \return Status error code. + * + * Set the channel class. At least 2 bits must be set. + */ +/*************************************************************************************************/ +uint8_t LlSetChannelClass(const uint8_t *pChanMap); + +/*************************************************************************************************/ +/*! + * \brief Set operational mode flags. + * + * \param flags Flags. + * \param enable TRUE to set flags or FALSE to clear flags. + * + * \return Status error code. + * + * Set mode flags governing LL operations. + */ +/*************************************************************************************************/ +uint8_t LlSetOpFlags(uint32_t flags, bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Set the default Ext adv TX PHY options. + * + * \param phyOptions PHY options. + * + * \return None. + * + * Set the default TX PHY options for extended adv slave primary and secondary channel. + */ +/*************************************************************************************************/ +void LlSetDefaultExtAdvTxPhyOptions(const uint8_t phyOptions); + +/*! \} */ /* LL_API_DEVICE */ + +/*! \addtogroup LL_API_BROADCAST + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Set advertising transmit power. + * + * \param advTxPwr Advertising transmit power level. + * + * \return None. + * + * Set the advertising transmit power. + */ +/*************************************************************************************************/ +void LlSetAdvTxPower(int8_t advTxPwr); + +/*************************************************************************************************/ +/*! + * \brief Get advertising transmit power. + * + * \param pAdvTxPwr Advertising transmit power level. + * + * \return Status error code. + * + * Return the advertising transmit power. + */ +/*************************************************************************************************/ +uint8_t LlGetAdvTxPower(int8_t *pAdvTxPwr); + +/*************************************************************************************************/ +/*! + * \brief Set advertising parameter. + * + * \param advIntervalMin Minimum advertising interval. + * \param advIntervalMax Maximum advertising interval. + * \param advType Advertising type. + * \param ownAddrType Address type used by this device. + * \param peerAddrType Address type of peer device. Only used for directed advertising. + * \param pPeerAddr Address of peer device. Only used for directed advertising. + * \param advChanMap Advertising channel map. + * \param advFiltPolicy Advertising filter policy. + * + * \return Status error code. + * + * Set advertising parameters. + * + * \note This function must only be called when advertising is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvParam(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, + uint8_t ownAddrType, uint8_t peerAddrType, const uint8_t *pPeerAddr, + uint8_t advChanMap, uint8_t advFiltPolicy); + +/*************************************************************************************************/ +/*! + * \brief Set advertising data. + * + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set advertising data data. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvData(uint8_t len, const uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Set scan response data. + * + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return Status error code. + * + * Set scan response data. + */ +/*************************************************************************************************/ +uint8_t LlSetScanRespData(uint8_t len, const uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Advertising enable. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * + * \return None. + + * Enable or disable advertising. + */ +/*************************************************************************************************/ +void LlAdvEnable(uint8_t enable); + +/*************************************************************************************************/ +/*! + * \brief Set advertising set random device address. + * + * \param handle Advertising handle. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Set the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvSetRandAddr(uint8_t handle, const uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Get advertising set random device address. + * + * \param handle Advertising handle. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Get the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LlGetAdvSetRandAddr(uint8_t handle, uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising parameters. + * + * \param handle Advertising handle. + * \param pExtAdvParam Extended advertising parameters. + * + * \return Status error code. + * + * Set extended advertising parameters. + * + * \note This function must only be called when advertising for this set is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvParam(uint8_t handle, LlExtAdvParam_t *pExtAdvParam); + +/*************************************************************************************************/ +/*! + * \brief Get extended advertising TX power level. + * + * \param handle Advertising handle. + * \param pLevel Transmit power level. + * + * \return Status error code. + * + * Get the TX power of an advertising set. + */ +/*************************************************************************************************/ +uint8_t LlGetExtAdvTxPowerLevel(uint16_t handle, int8_t *pLevel); + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Set extended scan response data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return Status error code. + * + * Set extended scan response data. + */ +/*************************************************************************************************/ +uint8_t LlSetExtScanRespData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Extended advertising enable. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * \param numAdvSets Number of elements in enaParam[]. + * \param enaParam Enable parameter table. + * + * \return None. + * + * Enable or disable extended advertising. + */ +/*************************************************************************************************/ +void LlExtAdvEnable(uint8_t enable, uint8_t numAdvSets, LlExtAdvEnableParam_t enaParam[]); + +/*************************************************************************************************/ +/*! + * \brief Read maximum advertising data length. + * + * \param pLen Return buffer for Maximum data length. + * + * \return Status error code. + * + * Read maximum advertising data length. + */ +/*************************************************************************************************/ +uint8_t LlReadMaxAdvDataLen(uint16_t *pLen); + +/*************************************************************************************************/ +/*! + * \brief Read number of supported advertising sets. + * + * \param pNumSets Return buffer for number of advertising sets. + * + * \return Status error code. + * + * Read number of supported advertising sets. + */ +/*************************************************************************************************/ +uint8_t LlReadNumSupAdvSets(uint8_t *pNumSets); + +/*************************************************************************************************/ +/*! + * \brief Remove advertising set. + * + * \param handle Advertising handle. + * + * \return Status error code. + * + * Removes the an advertising set from the LL. + */ +/*************************************************************************************************/ +uint8_t LlRemoveAdvSet(uint8_t handle); + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets. + * + * \return Status error code. + * + * Remove all existing advertising sets from the LL. + */ +/*************************************************************************************************/ +uint8_t LlClearAdvSets(void); + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising parameters. + * + * \param handle Advertising handle. + * \param pPerAdvParam Periodic advertising parameters. + * + * \return Status error code. + * + * Set periodic advertising parameters. + * + * \note This function must only be called when advertising handle exists. + */ +/*************************************************************************************************/ +uint8_t LlSetPeriodicAdvParam(uint8_t handle, LlPerAdvParam_t *pPerAdvParam); + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set periodic advertising data. + */ +/*************************************************************************************************/ +uint8_t LlSetPeriodicAdvData(uint8_t handle, uint8_t op, uint8_t len, const uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising enable. + * + * \param enable TRUE to enable advertising, FALSE to disable advertising. + * \param handle Advertising handle. + * + * \return Status error code. + * + * Enable or disable periodic advertising. + */ +/*************************************************************************************************/ +void LlSetPeriodicAdvEnable(uint8_t enable, uint8_t handle); + +/*************************************************************************************************/ +/*! + * \brief Set auxiliary packet offset delay. + * + * \param handle Advertising handle. + * \param delayUsec Additional time in microseconds. "0" to disable. + * + * \return Status error code. + * + * Additional delay given to auxiliary packets specified by AuxPtr. Offset values are + * limited by the advertising interval. + */ +/*************************************************************************************************/ +uint8_t LlSetAuxOffsetDelay(uint8_t handle, uint32_t delayUsec); + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data fragmentation length. + * + * \param handle Advertising handle. + * \param fragLen Fragmentation length. + * + * \return Status error code. + * + * Fragmentation size for Advertising Data and Scan Response Data when selected by the host. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvDataFragLen(uint8_t handle, uint8_t fragLen); + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising transmit PHY options. + * + * \param handle Advertising handle. + * \param priPhyOpts Primary advertising channel PHY options. + * \param secPhyOpts Secondary advertising channel PHY options. + * + * \return Status error code. + * + * PHY options for extended advertising transmissions. New values are applied dynamically. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvTxPhyOptions(uint8_t handle, uint8_t priPhyOpts, uint8_t secPhyOpts); + +/*************************************************************************************************/ +/*! + * \brief Read supported transmit power. + * + * \param pMinTxPwr Return buffer for minimum transmit power. + * \param pMaxTxPwr Return buffer for maximum transmit power. + * + * \return None. + * + * Read the minimum and maximum transmit powers supported by the LL. + */ +/*************************************************************************************************/ +void LlReadSupTxPower(int8_t *pMinTxPwr, int8_t *pMaxTxPwr); + +/*************************************************************************************************/ +/*! + * \brief Read RF path compensation. + * + * \param pTxPathComp Return buffer for RF transmit path compensation value. + * \param pRxPathComp Return buffer for RF receive path compensation value. + * + * \return None. + * + * Read the RF Path Compensation Values parameter used in the Tx Power Level and RSSI calculation. + */ +/*************************************************************************************************/ +void LlReadRfPathComp(int16_t *pTxPathComp, int16_t *pRxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Write RF path compensation. + * + * \param txPathComp RF transmit path compensation value. + * \param rxPathComp RF receive path compensation value. + * + * \return Status error code. + * + * Indicate the RF path gain or loss between the RF transceiver and the antenna contributed by + * intermediate components. + */ +/*************************************************************************************************/ +uint8_t LlWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Scan report enable. + * + * \param enable Set to TRUE to enable scan reports, FALSE to disable scan reports. + * + * \return None. + * + * Enable or disable reports about the scanners from which an advertiser receives scan requests. + */ +/*************************************************************************************************/ +void LlScanReportEnable(uint8_t enable); + +/*! \} */ /* LL_API_BROADCAST */ + +/*! \addtogroup LL_API_OBSERVER + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Set scan channel map. + * + * \param chanMap Scan channel map. + * + * \return Status error code. + * + * Set scan channel map. + * + * \note This function must only be called when scanning is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetSetScanChanMap(uint8_t chanMap); + +/*************************************************************************************************/ +/*! + * \brief Set scan parameters. + * + * \param pParam Scan parameters. + * + * \return Status error code. + * + * Set scan parameters. + * + * \note This function must only be called when scanning is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetScanParam(const LlScanParam_t *pParam); + +/*************************************************************************************************/ +/*! + * \brief Scan enable. + * + * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. + * \param filterDup Set to TRUE to filter duplicates. + * + * \return None. + * + * Enable or disable scanning. This function is only used when operating in master role. + */ +/*************************************************************************************************/ +void LlScanEnable(uint8_t enable, uint8_t filterDup); + +/*************************************************************************************************/ +/*! + * \brief Set extended scanning parameters. + * + * \param ownAddrType Address type used by this device. + * \param scanFiltPolicy Scan filter policy. + * \param scanPhys Scanning PHYs bitmask. + * \param param Scanning parameter table indexed by PHY. + * + * \return Status error code. + * + * Set the extended scan parameters to be used on the primary advertising channel. + */ +/*************************************************************************************************/ +uint8_t LlSetExtScanParam(uint8_t ownAddrType, uint8_t scanFiltPolicy, uint8_t scanPhys, const LlExtScanParam_t param[]); + +/*************************************************************************************************/ +/*! + * \brief Extended scan enable. + * + * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. + * \param filterDup Set to TRUE to filter duplicates. + * \param duration Duration. + * \param period Period. + * + * \return None. + * + * Enable or disable extended scanning. + */ +/*************************************************************************************************/ +void LlExtScanEnable(uint8_t enable, uint8_t filterDup, uint16_t duration, uint16_t period); + +/*************************************************************************************************/ +/*! + * \brief Create synchronization of periodic advertising. + * + * \param pParam Create sync parameters. + * + * \return Status error code. + * + * Create synchronization of periodic advertising. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvCreateSync(const LlPerAdvCreateSyncCmd_t *pParam); + +/*************************************************************************************************/ +/*! + * \brief Cancel pending synchronization of periodic advertising. + * + * \return Status error code. + * + * Cancel pending synchronization of periodic advertising. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvCreateSyncCancel(void); + +/*************************************************************************************************/ +/*! + * \brief Stop synchronization of periodic advertising. + * + * \param syncHandle Sync handle. + * + * \return Status error code. + * + * Stop synchronization of periodic advertising. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvTerminateSync(uint16_t syncHandle); + +/*************************************************************************************************/ +/*! + * \brief Add device to periodic advertiser list. + * + * \param pParam Add to periodic list parameters. + * + * \return Status error code. + * + * Add device to periodic advertiser list. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToPeriodicAdvList(const LlDevicePerAdvList_t *pParam); + +/*************************************************************************************************/ +/*! + * \brief Remove device from periodic advertiser list command. + * + * \param pParam Remove from periodic list parameters. + * + * \return Status error code. + * + * + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromPeriodicAdvList(const LlDevicePerAdvList_t *pParam); + +/*************************************************************************************************/ +/*! + * \brief Clear all devices in periodic advertiser list command. + * + * \return Status error code. + * + * Clear all devices in periodic advertiser list command. + */ +/*************************************************************************************************/ +uint8_t LlClearPeriodicAdvList(void); + +/*************************************************************************************************/ +/*! + * \brief Read total number of devices in periodic advertiser list command. + * + * \param pListSize Return size value of periodic advertiser list + * + * \return Status error code. + * + * Read total number of devices in periodic advertiser list command. + */ +/*************************************************************************************************/ +uint8_t LlReadPeriodicAdvListSize(uint8_t *pListSize); + +/*! \} */ /* LL_API_OBSERVER */ + +/*! \addtogroup LL_API_CONN + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Disconnect a connection. + * + * \param handle Connection handle. + * \param reason Disconnect reason. + * + * \return Status error code. + * + * Disconnect a connection. + */ +/*************************************************************************************************/ +uint8_t LlDisconnect(uint16_t handle, uint8_t reason); + +/*************************************************************************************************/ +/*! + * \brief Set connection's operational mode flags. + * + * \param handle Connection handle. + * \param flags Flags. + * \param enable TRUE to set flags or FALSE to clear flags. + * + * \return Status error code. + * + * Set connection's operational mode flags governing LL operations. + */ +/*************************************************************************************************/ +uint8_t LlSetConnOpFlags(uint16_t handle, uint32_t flags, bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Read remote features. + * + * \param handle Connection handle. + * + * \return Status error code. + * + * Read the link layer features of the remote device. + */ +/*************************************************************************************************/ +uint8_t LlReadRemoteFeat(uint16_t handle); + +/*************************************************************************************************/ +/*! + * \brief Read remote version information. + * + * \param handle Connection handle. + * + * \return Status error code. + * + * Read the version information of the remote device. + */ +/*************************************************************************************************/ +uint8_t LlReadRemoteVerInfo(uint16_t handle); + +/*************************************************************************************************/ +/*! + * \brief Get RSSI of a connection. + * + * \param handle Connection handle. + * \param pRssi RSSI value. + * + * \return Status error code. + * + * Get the current RSSI of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetRssi(uint16_t handle, int8_t *pRssi); + +/*************************************************************************************************/ +/*! + * \brief Get connection's TX power level. + * + * \param handle Connection handle. + * \param type Power level type. + * \param pLevel Transmit power level. + * + * \return Status error code. + * + * Get the TX power of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetTxPowerLevel(uint16_t handle, uint8_t type, int8_t *pLevel); + +/*************************************************************************************************/ +/*! + * \brief Set connection's TX power level. + * + * \param handle Connection handle. + * \param level Transmit power level. + * + * \return Status error code. + * + * Set the TX power of a connection. + */ +/*************************************************************************************************/ +uint8_t LlSetTxPowerLevel(uint16_t handle, int8_t level); + +/*************************************************************************************************/ +/*! + * \brief Update connection parameters. + * + * \param handle Connection handle. + * \param pConnSpec New connection specification. + * + * \return Status error code. + * + * Update the connection parameters of a connection. + */ +/*************************************************************************************************/ +uint8_t LlConnUpdate(uint16_t handle, const LlConnSpec_t *pConnSpec); + +/*************************************************************************************************/ +/*! + * \brief Remote connection parameter request reply. + * + * \param handle Connection handle. + * \param pConnSpec New connection specification. + * + * \return Status error code. + * + * Reply to a connection parameter request. + */ +/*************************************************************************************************/ +uint8_t LlRemoteConnParamReqReply(uint16_t handle, const LlConnSpec_t *pConnSpec); + +/*************************************************************************************************/ +/*! + * \brief Remote connection parameter request negative reply. + * + * \param handle Connection handle. + * \param reason Reason code. + * + * \return None. + * + * Negative reply to a connection parameter request. + */ +/*************************************************************************************************/ +uint8_t LlRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason); + +/*************************************************************************************************/ +/*! + * \brief Set connection's channel map. + * + * \param handle Connection handle. + * \param pChanMap Channel map. + * + * \return Status error code. + * + * Set the channel map of a connection. + */ +/*************************************************************************************************/ +uint8_t LlSetChannelMap(uint16_t handle, const uint8_t *pChanMap); + +/*************************************************************************************************/ +/*! + * \brief Get connection's channel map. + * + * \param handle Connection handle. + * \param pChanMap Channel map. + * + * \return Status error code. + * + * Get the current channel map of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetChannelMap(uint16_t handle, uint8_t *pChanMap); + +/*************************************************************************************************/ +/*! + * \brief Set data length. + * + * \param handle Connection handle. + * \param txLen Maximum number of payload bytes for a Data PDU + * \param txTime Maximum microseconds for a Data PDU + * + * \return Status error code. + * + * Preferred maximum microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +uint8_t LlSetDataLen(uint16_t handle, uint16_t txLen, uint16_t txTime); + +/*************************************************************************************************/ +/*! + * \brief Read default data length. + * + * \param pMaxTxLen Maximum number of payload bytes for a Data PDU + * \param pMaxTxTime Maximum microseconds for a Data PDU + * + * \return None. + * + * Suggested length and microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +void LlReadDefaultDataLen(uint16_t *pMaxTxLen, uint16_t *pMaxTxTime); + +/*************************************************************************************************/ +/*! + * \brief Write default data length. + * + * \param maxTxLen Maximum number of payload bytes for a Data PDU + * \param maxTxTime Maximum microseconds for a Data PDU + * + * \return Status error code. + * + * Suggested length and microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +uint8_t LlWriteDefaultDataLen(uint16_t maxTxLen, uint16_t maxTxTime); + +/*************************************************************************************************/ +/*! + * \brief Read maximum data length. + * + * \param pMaxTxLen Maximum number of payload bytes for a Tx Data PDU + * \param pMaxTxTime Maximum microseconds for a Tx Data PDU + * \param pMaxRxLen Maximum number of payload bytes for a Rx Data PDU + * \param pMaxRxTime Maximum microseconds for a Rx Data PDU + * + * \return None. + * + * Read the Controller's maximum supported payload octets and packet duration times for + * transmission and reception. + */ +/*************************************************************************************************/ +void LlReadMaximumDataLen(uint16_t *pMaxTxLen, uint16_t *pMaxTxTime, uint16_t *pMaxRxLen, uint16_t *pMaxRxTime); + +/*************************************************************************************************/ +/*! + * \brief Read current transmitter PHY and receive PHY. + * + * \param handle Connection handle. + * \param pTxPhy Storage for transmitter PHY. + * \param pRxPhy Storage for receiver PHY. + * + * \return Status error code. + * + * Read current transmitter PHY and receive PHY. + */ +/*************************************************************************************************/ +uint8_t LlReadPhy(uint16_t handle, uint8_t *pTxPhy, uint8_t *pRxPhy); + +/*************************************************************************************************/ +/*! + * \brief Set default PHYs. + * + * \param allPhys All PHYs preferences. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * + * \return Status error code. + * + * Specify the preferred values for the transmitter PHY and receiver PHY to be used for all + * subsequent connections over the LE transport. + */ +/*************************************************************************************************/ +uint8_t LlSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys); + +/*************************************************************************************************/ +/*! + * \brief Set PHY for a connection. + * + * \param handle Connection handle. + * \param allPhys All PHYs preferences. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * \param phyOptions PHY options. + * + * \return Status error code. + * + * Set PHY preferences for a given connection. The controller might not be able to make the + * change (e.g., because the peer does not support the requested PHY) or may decide that the + * current PHY is preferable. + */ +/*************************************************************************************************/ +uint8_t LlSetPhy(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions); + +/*************************************************************************************************/ +/*! + * \brief Set local minimum number of used channels. + * + * \param phys Bitmask for the PHYs. + * \param pwrThres Power threshold. + * \param minUsedCh Minimum number of used channels. + * + * \return Status error code. + * + * Set local minimum number of used channels. + */ +/*************************************************************************************************/ +uint8_t LlSetLocalMinUsedChan(uint8_t phys, int8_t pwrThres, uint8_t minUsedCh); + +/*************************************************************************************************/ +/*! + * \brief Get peer minimum number of used channels. + * + * \param handle Connection handle. + * \param pPeerMinUsedChan Storage for the peer minimum number of used channels. + * + * \return Status error code. + * + * Get peer minimum number of used channels. + */ +/*************************************************************************************************/ +uint8_t LlGetPeerMinUsedChan(uint16_t handle, uint8_t *pPeerMinUsedChan); + +/*! \} */ /* LL_API_CONN */ + +/*! \addtogroup LL_API_CENTRAL + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Create connection. + * + * \param pInitParam Initiating parameters. + * \param pConnSpec Connection specification. + * + * \return Status error code. + * + * Create a connection to the specified peer address with the specified connection parameters. + * This function is only when operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlCreateConn(const LlInitParam_t *pInitParam, const LlConnSpec_t *pConnSpec); + +/*************************************************************************************************/ +/*! + * \brief Extended create connection. + * + * \param pInitParam Initiating parameters. + * \param scanParam Scan parameters table indexed by PHY. + * \param connSpec Connection specification table indexed by PHY. + * + * \return Status error code. + * + * Create a connection to the specified peer address with the specified connection parameters. + * This function is only when operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlExtCreateConn(const LlExtInitParam_t *pInitParam, const LlExtInitScanParam_t scanParam[], const LlConnSpec_t connSpec[]); + +/*************************************************************************************************/ +/*! + * \brief Cancel a create connection operation. + * + * \return None. + * + * Cancel a connection before it is established. This function is only used when operating + * in master role. + */ +/*************************************************************************************************/ +void LlCreateConnCancel(void); + +/*! \} */ /* LL_API_CENTRAL */ + +/*! \addtogroup LL_API_ENCRYPT + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Encrypt data. + * + * \param pKey Encryption key. + * \param pData 16 bytes of plain text data. + * + * \return Status error code. + * + * Request the LL to encryption a block of data in place. + */ +/*************************************************************************************************/ +uint8_t LlEncrypt(uint8_t *pKey, uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Start encryption. + * + * \param handle Connection handle. + * \param pRand Pointer to the random number. + * \param diversifier Diversifier value. + * \param pKey Pointer to the encryption key. + * + * \return Status error code. + * + * Start or restart link layer encryption on a connection. This function is only used when + * operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlStartEncryption(uint16_t handle, const uint8_t *pRand, uint16_t diversifier, const uint8_t *pKey); + +/*************************************************************************************************/ +/*! + * \brief Reply to a LTK request. + * + * \param handle Connection handle. + * \param pKey Pointer to new key. + * + * \return Status error code. + * + * Provide the requested LTK encryption key. This function is only used when operating in + * slave mode. + */ +/*************************************************************************************************/ +uint8_t LlLtkReqReply(uint16_t handle, const uint8_t *pKey); + +/*************************************************************************************************/ +/*! + * \brief Negative reply to a LTK request. + * + * \param handle Connection handle. + * + * \return Status error code. + * + * Requested LTK encryption key not available. This function is only used when operating in + * slave mode. + */ +/*************************************************************************************************/ +uint8_t LlLtkReqNegReply(uint16_t handle); + +/*************************************************************************************************/ +/*! + * \brief Read authenticated payload timeout value. + * + * \param handle Connection handle. + * \param pTimeout Pointer to timeout value. + * + * \return Status error code. + * + * Read authenticated payload timeout value for the given handle. + */ +/*************************************************************************************************/ +uint8_t LlReadAuthPayloadTimeout(uint16_t handle, uint16_t *pTimeout); + +/*************************************************************************************************/ +/*! + * \brief Write authenticated payload timeout value. + * + * \param handle Connection handle. + * \param timeout New timeout value. + * + * \return Status error code. + * + * Write new authenticated payload timeout value for the given handle. + */ +/*************************************************************************************************/ +uint8_t LlWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout); + +/*************************************************************************************************/ +/*! + * \brief Get encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode Storage for encryption mode. + * + * \return Status error code. + * + * Get the encryption mode used by a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetEncMode(uint16_t handle, LlEncMode_t *pMode); + +/*************************************************************************************************/ +/*! + * \brief Set encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode New encryption mode. + * + * \return Status error code. + * + * Set the encryption mode used by a connection. Must be called before encryption is started or + * when encryption is paused. + */ +/*************************************************************************************************/ +uint8_t LlSetEncMode(uint16_t handle, const LlEncMode_t *pMode); + +/*! \} */ /* LL_API_ENCRYPT */ + +/*! \addtogroup LL_API_DATA + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Get the maximum ACL buffers size. + * + * \return Maximum buffers size in bytes. + */ +/*************************************************************************************************/ +uint16_t LlGetAclMaxSize(void); + +/*************************************************************************************************/ +/*! + * \brief Get the number of buffers in the LL ACL transmit queue. + * + * \return Number of buffers. + */ +/*************************************************************************************************/ +uint8_t LlGetAclTxBufs(void); + +/*************************************************************************************************/ +/*! + * \brief Get the number of buffers in the LL ACL receive queue. + * + * \return Number of buffers. + */ +/*************************************************************************************************/ +uint8_t LlGetAclRxBufs(void); + +/*************************************************************************************************/ +/*! + * \brief Send an ACL data packet. + * + * \param pData Data buffer + * + * \return None. + * + * Send an ACL data packet. pData points to an ACL buffer formatted according to [1]; the host + * must set the connection handle, flags, and length fields in the buffer. + */ +/*************************************************************************************************/ +void LlSendAclData(uint8_t *pData); + +/*************************************************************************************************/ +/*! + * \brief Receive an ACL data packet + * + * \return Data buffer. + * + * Receive an ACL data packet. This function returns a pointer to an ACL buffer formatted + * according to [1]. The host must parse the header to determine the connection handle, flags, + * and length fields. If no ACL buffers are available this function returns NULL. + * + * The host must deallocate the buffer by calling WsfMsgFree() and call LlRecvBufCmpl() to + * update LL accounting. + */ +/*************************************************************************************************/ +uint8_t *LlRecvAclData(void); + +/*************************************************************************************************/ +/*! + * \brief Indicate that received ACL data buffer has been deallocated + * + * \param numBufs Number of completed packets. + * + * \return None. + * + * Indicate that received ACL data buffer has been deallocated. + */ +/*************************************************************************************************/ +void LlRecvAclDataComplete(uint8_t numBufs); + +/*! \} */ /* LL_API_DATA */ + +/*! \addtogroup LL_API_TEST + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Enter transmit test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param len Length of test data. + * \param pktType Test packet payload type. + * \param numPkt Auto terminate after number of packets, 0 for infinite. + * + * \return Status error code. + * + * Start the transmit test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlTxTest(uint8_t rfChan, uint8_t len, uint8_t pktType, uint16_t numPkt); + +/*************************************************************************************************/ +/*! + * \brief Enter receive test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param numPkt Auto terminate after number of successful packets, 0 for infinite. + * + * \return Status error code. + * + * Start the receive test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlRxTest(uint8_t rfChan, uint16_t numPkt); + +/*************************************************************************************************/ +/*! + * \brief Enter enhanced transmit test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param len Length of test data. + * \param pktType Test packet payload type. + * \param phy Transmitter PHY. + * \param numPkt Auto terminate after number of packets, 0 for infinite. + * + * \return Status error code. + * + * Start the transmit test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlEnhancedTxTest(uint8_t rfChan, uint8_t len, uint8_t pktType, uint8_t phy, uint16_t numPkt); + +/*************************************************************************************************/ +/*! + * \brief Enter enhanced receive test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param phy Receiver PHY. + * \param modIdx Modulation index. + * \param numPkt Auto terminate after number of successful packets, 0 for infinite. + * + * \return Status error code. + * + * Start the receive test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlEnhancedRxTest(uint8_t rfChan, uint8_t phy, uint8_t modIdx, uint16_t numPkt); + +/*************************************************************************************************/ +/*! + * \brief End test mode. + * + * \param pRpt Report return buffer. + * + * \return Status error code. + * + * End test mode and return the report. + */ +/*************************************************************************************************/ +uint8_t LlEndTest(LlTestReport_t *pRpt); + +/*************************************************************************************************/ +/*! + * \brief Set pattern of errors for Tx test mode. + * + * \param pattern Error pattern (1s = no error; 0s = CRC failure). + * + * \return Status error code. + * + * Set pattern of errors for Tx test mode. + * + * \note The error pattern must be set after the Tx test is started. + */ +/*************************************************************************************************/ +uint8_t LlSetTxTestErrorPattern(uint32_t pattern); + +/*! \} */ /* LL_API_TEST */ + +/*! \addtogroup LL_API_DIAG + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Get advertising set context size. + * + * \param pMaxAdvSets Buffer to return the maximum number of advertising sets. + * \param pAdvSetCtxSize Buffer to return the size in bytes of the advertising set context. + * + * Return the advertising set context sizes. + */ +/*************************************************************************************************/ +void LlGetAdvSetContextSize(uint8_t *pMaxAdvSets, uint16_t *pAdvSetCtxSize); + +/*************************************************************************************************/ +/*! + * \brief Get connection context size. + * + * \param pMaxConn Buffer to return the maximum number of connections. + * \param pConnCtxSize Buffer to return the size in bytes of the connection context. + * + * Return the connection context sizes. + */ +/*************************************************************************************************/ +void LlGetConnContextSize(uint8_t *pMaxConn, uint16_t *pConnCtxSize); + +/*************************************************************************************************/ +/*! + * \brief Get the LL handler watermark level. + * + * \return Watermark level in microseconds. + */ +/*************************************************************************************************/ +uint16_t LlStatsGetHandlerWatermarkUsec(void); + +/*! \} */ /* LL_API_DIAG */ + + +#ifdef __cplusplus +}; +#endif + +#endif /* LL_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_init_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_init_api.h new file mode 100644 index 0000000000000000000000000000000000000000..abf04fb06b7d64e1f64638c440e162a2ad9a2247 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_init_api.h @@ -0,0 +1,92 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL initialization implementation file. + */ +/*************************************************************************************************/ + +#ifndef LL_INIT_API_H +#define LL_INIT_API_H + +#include "wsf_types.h" +#include "bb_api.h" +#include "ll_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_INIT_API + * \{ + */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#ifndef INIT_BROADCASTER +/*! \brief Initialize broadcaster feature. */ +#define INIT_BROADCASTER +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Runtime configuration parameters. */ +typedef struct +{ + const BbRtCfg_t *pBbRtCfg; /*!< BB runtime configuration. */ + const uint8_t wlSizeCfg; /*!< Whitelist size configuration. */ + const uint8_t rlSizeCfg; /*!< Resolving list size configuration. */ + const uint8_t plSizeCfg; /*!< Periodic list size configuration. */ + const LlRtCfg_t *pLlRtCfg; /*!< LL runtime configuration. */ + uint8_t *pFreeMem; /*!< Pointer to free memory, returns adjusted location of free memory. */ + uint32_t freeMemAvail; /*!< Amount of free memory available, returns adjusted amount of free memory. */ +} LlInitRtCfg_t; + +/************************************************************************************************** + Functions Declarations +**************************************************************************************************/ + +/* System initializers. */ +uint32_t LlInitStdInit(LlInitRtCfg_t *pCfg); +uint32_t LlInitExtInit(LlInitRtCfg_t *pCfg); +uint32_t LlInitControllerInit(LlInitRtCfg_t *pCfg); +uint32_t LlInitControllerExtInit(LlInitRtCfg_t *pCfg); + +/* Intermediate initializers. */ +uint32_t LlInitSetBbRtCfg(const BbRtCfg_t *pBbRtCfg, const uint8_t wlSizeCfg, const uint8_t rlSizeCfg, + const uint8_t plSizeCfg, uint8_t *pFreeMem, uint32_t freeMemAvail); +uint32_t LlInitSetLlRtCfg(const LlRtCfg_t *pLlRtCfg, uint8_t *pFreeMem, uint32_t freeMemAvail); +void LlInitBbInit(void); +void LlInitBbAuxInit(void); +void LlInitSchInit(void); +void LlInitLlInit(bool_t initHandler); +void LlInitChciTrInit(void); +void LlInitLhciInit(void); +void LlMathSetSeed(const uint32_t *pSeed); + +/*! \} */ /* LL_INIT_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LL_INIT_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_tester_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_tester_api.h new file mode 100644 index 0000000000000000000000000000000000000000..3532bd44eceabed386d03e4f2f36c8b5b40fa4d4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/ll_tester_api.h @@ -0,0 +1,320 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer tester interface file. + */ +/*************************************************************************************************/ + +#ifndef LL_TESTER_API_H +#define LL_TESTER_API_H + +#include "wsf_types.h" +#include "ll_api.h" +#include "lctr_api.h" + +/* Access internal definitions. */ +#include "../../sources/ble/lctr/lctr_pdu_conn.h" + +/* Require compile time directive. */ +#if (LL_ENABLE_TESTER != TRUE) +#error "LL_ENABLE_TESTER compilation directive must be set to 1." +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Tester acknowledgement mode. */ +enum +{ + LL_TESTER_ACK_MODE_NORMAL = 0, /*!< Ack packets according to normal acknowledgement/flow control scheme. */ + LL_TESTER_ACK_MODE_NO_RX_ACK = 1, /*!< Do not acknowledge Rx packets. */ + LL_TESTER_ACK_MODE_IGNORE_TX_ACK = 2 /*!< Ignore acknowledgements of Tx packets. */ +}; + +#define LL_TESTER_TRIGGER_NONEMPTY 0xFE /*!< Trigger only on non-empty packets. */ +#define LL_TESTER_TRIGGER_ALWAYS 0xFF /*!< Always trigger. */ + +#define LL_TESTER_ADVB_MAX_LEN LL_ADVB_MAX_LEN + 4 /*!< Maximum allowed ADVB length. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Link layer tester control block */ +typedef struct +{ + /* Advertising channel override values. */ + /* Place here to 32-bit align. */ + uint8_t txAdvPdu[LL_TESTER_ADVB_MAX_LEN]; /*!< Advertising PDU override buffer. */ + uint32_t advAccessAddrRx; /*!< Advertising access address override (Rx). */ + uint32_t advAccessAddrTx; /*!< Advertising access address override (Tx). */ + /* Place here to 32-bit align. */ + uint8_t txScanReqPdu[LL_TESTER_ADVB_MAX_LEN]; /*!< Scan request PDU override buffer. */ + uint32_t advCrcInitRx; /*!< Advertising CRC value override (Rx). */ + uint32_t advCrcInitTx; /*!< Advertising CRC value override (Tx). */ + /* Place here to 32-bit align. */ + uint8_t txScanRspPdu[LL_TESTER_ADVB_MAX_LEN]; /*!< Scan response PDU override buffer. */ + bool_t txAdvPduLen; /*!< Advertising PDU override buffer length, 0 to disable. */ + bool_t txScanReqPduLen; /*!< Scan request PDU override buffer length, 0 to disable. */ + bool_t txScanRspPduLen; /*!< Scan response PDU override buffer length, 0 to disable. */ + + /* Extended advertising channel override values. */ + uint32_t auxAccessAddrRx; /*!< Auxiliary advertising access address override (Rx). */ + uint32_t auxAccessAddrTx; /*!< Auxiliary advertising access address override (Tx). */ + uint32_t auxCrcInitRx; /*!< Advertising CRC value override (Rx). */ + uint32_t auxCrcInitTx; /*!< Advertising CRC value override (Tx). */ + struct + { + uint8_t pduMatch; /*!< PDU type to override. */ + uint8_t len; /*!< Length of override buffer. */ + uint8_t buf[LL_CONN_IND_PDU_LEN]; + /*!< Override request buffer. */ + } auxReq; /*!< Auxiliary request buffer override parameters. */ + struct + { + uint16_t pduMatchMask; /*!< Enable override bitmask of PDU types. */ + uint8_t modifyMask; /*!< Enable extended header field override bitmask. */ + uint64_t AdvA; /*!< AdvA override value. */ + uint64_t TargetA; /*!< TargetA override value. */ + uint8_t SuppInfo; /*!< SuppInfo override value. */ + uint16_t ADI; /*!< ADI override value. */ + int8_t TxPower; /*!< TxPower override value. */ + } extHdr; /*!< Extended header override values. */ + + /* Data channel override values. */ + uint32_t dataAccessAddrRx; /*!< Data channel access address override (Rx). */ + uint32_t dataAccessAddrTx; /*!< Data channel access address override (Tx). */ + uint32_t dataCrcInitRx; /*!< Data channel CRC value override (Rx). */ + uint32_t dataCrcInitTx; /*!< Data channel CRC value override (Tx). */ + + /* Connection parameter override values. */ + bool_t connIndEnabled; /*!< Connection indication override packet enabled. */ + lctrConnInd_t connInd; /*!< Connection indication override packet. */ + bool_t connUpdIndEnabled; /*!< Connection update indication override packet enabled. */ + lctrConnUpdInd_t connUpdInd; /*!< Connection update indication override packet. */ + bool_t connParamReqEnabled;/*!< Connection parameter request override packet enabled. */ + lctrConnParam_t connParamReq; /*!< Connection parameter request override packet. */ + + /* Data length override values. */ + bool_t dataLenReqEnabled; /*!< Local Data PDU parameters enabled. */ + lctrDataLen_t dataLenReq; /*!< Local Data PDU parameters. */ + + uint32_t connIntervalUs; /*!< Connection interval override. */ + uint16_t eventCounterOffset; /*!< Event counter offset value. */ + + uint32_t txLlcpFilter; /*!< Filter for LLCP Tx. */ + uint32_t rxLlcpFilter; /*!< Filter for LLCP Rx. */ + bool_t dataTriggerEnabled; /*!< Trigger is enabled. */ + uint8_t dataTriggerPdu; /*!< PDU on which to trigger data. */ + bool_t dataTriggerAfter; /*!< Data sent after PDU. */ + + /* Packet override values. */ + uint32_t pktMic; /*!< Packet MIC override XOR value. */ + uint8_t pktLlId; /*!< Packet LLID override XOR value. */ + + /* LLCP handling. */ + bool_t llcpForwardEnabled; /*!< LLCP packet to host enable. */ + bool_t llcpLlcpIntercept; /*!< LLCP intercept enable. */ + + /* Acknowledgement/flow control. */ + uint8_t ackMode; /*!< Acknowledgement mode. */ + uint8_t ackTrigger; /*!< Rx datum or condition on which to trigger special ack handling. */ +} llTesterCtrlBlock_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern llTesterCtrlBlock_t llTesterCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*! \addtogroup LL_TESTER_API_INIT + * \{ */ + +void LlTesterInit(void); + +/* \} */ + +/*! \addtogroup LL_TESTER_API_ADV_CHAN + * \{ */ + +/* Advertising channel override */ +void LlTesterSetAdvAccessAddr(uint32_t accessAddr, bool_t forRx); +void LlTesterSetAdvCrcInit(uint32_t crcInit, bool_t forRx); + +/* Advertising data exchange */ +uint8_t LlTesterSetTxAdvPdu(uint8_t *pBuf, uint8_t len); +uint8_t LlTesterSetTxScanReqPdu(uint8_t *pBuf, uint8_t len); +uint8_t LlTesterSetTxScanRspPdu(uint8_t *pBuf, uint8_t len); + +/* Extended advertising override */ +void LlTesterSetAuxAccessAddr(uint32_t accessAddr, bool_t forRx); +void LlTesterSetAuxCrcInit(uint32_t crcInit, bool_t forRx); +void LlTesterSetTxAuxReqPdu(uint8_t pduMatch, uint8_t *pBuf, uint8_t len); +void LlTesterSetExtAdvHdrFields(uint16_t pduMatchMask, uint8_t modifyMask, + uint8_t *pAdvA, uint8_t *pTargetA, uint8_t SuppInfo, uint16_t ADI, int8_t TxPower); + +/* \} */ + +/*! \addtogroup LL_TESTER_API_DATA_CHAN + * \{ */ + +/* Data channel override */ +void LlTesterSetDataAccessAddr(uint32_t accessAddr, bool_t forRx); +uint8_t LlTesterGetDataAccessAddr(uint16_t handle, uint32_t *pAccessAddr); +void LlTesterSetDataCrcInit(uint32_t crcInit, bool_t forRx); +uint8_t LlTesterGetDataCrcInit(uint16_t handle, uint32_t *pCrcInit); + +/* Data control override */ +void LlTesterSetConnInd(uint32_t accessAddr, uint32_t crcInit, uint8_t txWinSize, uint16_t txWinOffset, + uint16_t interval, uint16_t latency, uint16_t timeout, uint64_t chanMask, + uint8_t hopInc, uint8_t masterSca); +void LlTesterAdjConnInterval(uint32_t intervalUs); + +/* Data packet override */ +void LlTesterSetPktLlId(uint8_t id); +void LlTesterSetPktMic(uint32_t mic); + +/* Acknowledgement/flow control override */ +void LlTesterSetAckMode(uint8_t ackMode, uint8_t ackTrigger); + +/* Data exchange */ +uint8_t LlTesterTxDataPdu(uint16_t handle, uint8_t *pBuf, uint8_t len); + +/* \} */ + +/*! \addtogroup LL_TESTER_API_LLCP + * \{ */ + +void LlTesterForwardLlcpToHost(bool_t enable, bool_t intercept); +void LlTesterSetEventCounterOffset(uint16_t offset); +uint8_t LlTesterSendConnUpdInd(uint16_t handle, + uint8_t txWinSize, uint16_t txWinOffset, + uint16_t interval, uint16_t latency, uint16_t timeout); +uint8_t LlTesterSendConnParamReq(uint16_t handle, + uint16_t connIntervalMin, uint16_t connIntervalMax, + uint16_t connLatency, uint16_t supTimeout, uint8_t prefPeriod, + uint16_t refConnEvtCnt, uint16_t *pOffset); +uint8_t LlTesterSendDataLen(uint16_t handle, + uint16_t rxLen, uint16_t rxTime, + uint16_t txLen, uint16_t txTime); +uint8_t LlTesterSendPhyReq(uint16_t handle, uint8_t txPhys, uint8_t rxPhys); +uint8_t LlTesterSendPhyUpdateInd(uint16_t handle, uint8_t mToSPhy, uint8_t sToMPhy); +void LlTesterEnableRxFlowControl(bool_t enable); +void LlTesterSetTxLlcpFilter(uint32_t filter); +void LlTesterSetRxLlcpFilter(uint32_t filter); +void LlTesterSetDataTrigger(uint8_t pdu, bool_t enable, bool_t after); + +/* \} */ + +/*! \addtogroup LL_TESTER_API_BB + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Adjust Tx TIFS timing value. + * + * \param adjNs Adjustment value in nanoseconds. + * + * \return None. + * + * Adjust the TIFS timing of transmit by the given signed value of timer ticks. + * If adjustment value is out of range, maximum allowed value is used. + */ +/*************************************************************************************************/ +void BbTesterAdjTxTifsNs(int16_t adjNs); + +/*************************************************************************************************/ +/*! + * \brief Trigger channel modifications on matching Tx packet header. + * + * \param hdrMask Header mask. + * \param hdrValue Match value. + * + * \return None. + * + * Modify the transmit channel parameters of a packet only when the Tx packet header matches + * the given parameters. This applies to the modification parameter provided by the following + * routines: + * + * - \ref BbTesterSetInvalidCrcInit() + * - \ref BbTesterSetInvalidAccessAddress() + */ +/*************************************************************************************************/ +void BbTesterSetModifyTxPktTrigger(uint16_t hdrMask, uint16_t hdrValue); + +/*************************************************************************************************/ +/*! + * \brief Invalidate CRC initialization value. + * + * \param chanMask Invalidate channel mask. + * \param adjMask Number of adjustments (0 to disable). + * \param forRx TRUE for Rx, FALSE for Tx. + * + * \return None. + * + * Force the receiver to receive a packet with CRC error if the receive channel is in + * \b chanMask while stepping through the invalid pattern in \b invalidMask. + */ +/*************************************************************************************************/ +void BbTesterSetInvalidCrcInit(uint64_t chanMask, uint32_t adjMask, bool_t forRx); + +/*************************************************************************************************/ +/*! + * \brief Invalidate access address value. + * + * \param chanMask Invalidate channel mask. + * \param invalidMask Enable mask for invalidating access address (0 to disable). + * \param forRx TRUE for Rx, FALSE for Tx. + * + * \return None. + * + * Force the receiver to receive a miss a packet if the receive channel is in + * \b chanMask while stepping through the invalid pattern in \b invalidMask. + */ +/*************************************************************************************************/ +void BbTesterSetInvalidAccessAddress(uint64_t chanMask, uint32_t invalidMask, bool_t forRx); + +/*************************************************************************************************/ +/*! + * \brief Enable bypassing PDU filtering. + * + * \param enable If TRUE enable bypass PDU filtering, FALSE otherwise. + * + * \return None. + * + * Enable bypassing PDU filtering. + */ +/*************************************************************************************************/ +void BbTesterEnablePduFilterBypass(bool_t enable); + +/* \} */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LL_TESTER_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/sch_api_ble.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/sch_api_ble.h new file mode 100644 index 0000000000000000000000000000000000000000..9cd11b901c1427e90eb026cfd1a9d5bb73e69e53 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/ble/sch_api_ble.h @@ -0,0 +1,58 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer scheduler interface file. + */ +/*************************************************************************************************/ + +#ifndef SCH_API_BLE_H +#define SCH_API_BLE_H + +#include "wsf_types.h" +#include "bb_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Resource manager */ +void SchRmInit(void); +uint32_t SchRmPreferredPeriodUsec(void); +bool_t SchRmAdd(uint8_t handle, uint32_t minUsec, uint32_t maxUsec, uint32_t durUsec, uint32_t *pInterUsec); +bool_t SchRmStartUpdate(uint8_t handle, uint32_t minUsec, uint32_t maxUsec, uint32_t durUsec, uint32_t *pInterUsec); +void SchRmCommitUpdate(uint8_t handle); +void SchRmRemove(uint8_t handle); +void SchRmSetReference(uint8_t handle); +uint32_t SchRmGetOffsetUsec(uint32_t rsvnOffs[], uint32_t maxOffsUsec, uint8_t handle); + +/* BLE time utilities */ +uint32_t SchBleCalcDataPktDurationUsec(uint8_t phy, uint16_t len); +uint32_t SchBleCalcAdvPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len); +uint32_t SchBleCalcAuxPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len); +void SchBleCalcAdvOpDuration(BbOpDesc_t *pBod); +bool_t SchBleGetNextMstConnDueTime(uint32_t *pDueTime); + +#ifdef __cplusplus +}; +#endif + +#endif /* SCH_API_BLE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/bb_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/bb_api.h new file mode 100644 index 0000000000000000000000000000000000000000..d3cbd908424411897a1f3f86ac89ec6d159c7428 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/bb_api.h @@ -0,0 +1,450 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband interface file. + * + * \addtogroup BB_API Baseband (BB) API + * \{ + * - Bluetooth low energy: advertising and connections + * - ZigBee/802.15.4 (TBD) + * - BAN/802.15.6 (TBD) + * + * \dot + * digraph + * { + * node [shape=record, width=1.0, height=0.5, fontname=Helvetica, fontsize=8]; + * + * ble [label="BLE\nlink layer", style=filled, fillcolor=lightgray]; + * zigbee [label="802.15.4\nMAC", style=filled, fillcolor=lightgray]; + * ban [label="802.15.6\nMAC", style=filled, fillcolor=lightgray]; + * sch [label="Multi-protocol\nscheduler", style=filled, fillcolor=lightgray]; + * bb_drv [label="{ BB porting layer | BB specific driver }"]; + * bb_hw [label="BB hardware", style=filled, fillcolor=dimgray]; + * + * ble -> sch; + * ble -> bb_drv; + * zigbee -> sch; + * zigbee -> bb_drv; + * ban -> sch; + * ban -> bb_drv; + * sch -> bb_drv; + * bb_drv -> bb_hw [style=dashed]; + * } + * \enddot + * + * \defgroup BB_API_INIT Initialization + * \defgroup BB_API_BOD Baseband Operation Descriptors (BOD) + * \defgroup BB_API_CTRL Control interface + * \defgroup BB_API_BLE Bluetooth LE Protocol + * + * \} + */ +/*************************************************************************************************/ + +#ifndef BB_API_H +#define BB_API_H + +#include "wsf_types.h" +#include "cfg_mac.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \addtogroup BB_API_BOD + * \{ */ + +/*! \brief Protocol types */ +enum +{ + BB_PROT_NONE, /*!< Non-protocol specific operation. */ + BB_PROT_BLE, /*!< Bluetooth Low Energy normal mode. */ + BB_PROT_BLE_DTM, /*!< Bluetooth Low Energy direct test mode. */ + BB_PROT_PRBS15, /*!< Enable the continuous PRBS15 transmit sequence. */ + BB_PROT_15P4, /*!< 802.15.4. */ + BB_PROT_NUM /*!< Number of protocols. */ +}; + +/*! \brief Status codes */ +enum +{ + BB_STATUS_SUCCESS, /*!< Operation successful. */ + BB_STATUS_FAILED, /*!< General failure. */ + BB_STATUS_CANCELED, /*!< Receive canceled. */ + BB_STATUS_RX_TIMEOUT, /*!< Receive packet timeout. */ + BB_STATUS_CRC_FAILED, /*!< Receive packet with CRC verification failed. */ + BB_STATUS_FRAME_FAILED, /*!< Receive packet with frame verification failed. */ + BB_STATUS_ACK_FAILED, /*!< ACK packet failure. */ + BB_STATUS_ACK_TIMEOUT, /*!< ACK packet timeout. */ + BB_STATUS_TX_CCA_FAILED, /*!< Transmit CCA failure. */ + BB_STATUS_TX_FAILED /*!< Transmit failure. */ +}; + +/*! \brief PHY types. */ +enum +{ + BB_PHY_BLE_1M = 1, /*!< Bluetooth Low Energy 1Mbps PHY. */ + BB_PHY_BLE_2M = 2, /*!< Bluetooth Low Energy 2Mbps PHY. */ + BB_PHY_BLE_CODED = 3, /*!< Bluetooth Low Energy Coded PHY (data coding unspecified). */ + BB_PHY_15P4 = 4 /*!< 802.15.4 PHY. */ +}; + +/*! \brief PHY options. */ +enum +{ + BB_PHY_OPTIONS_DEFAULT = 0, /*!< BB defined PHY Options behavior. */ + BB_PHY_OPTIONS_BLE_S2 = 1, /*!< Always use S=2 coding when transmitting on LE Coded PHY. */ + BB_PHY_OPTIONS_BLE_S8 = 2 /*!< Always use S=8 coding when transmitting on LE Coded PHY. */ +}; + +/*! \} */ /* BB_API_BOD */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Binary divide with 1,000,000 divisor (n[max]=0xFFFFFFFF). */ +#define BB_MATH_DIV_10E6(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(4295)) >> 32)) + +#if (BB_CLK_RATE_HZ == 1000000) +/*! \brief Return microseconds (no conversion required). */ +#define BB_US_TO_BB_TICKS(us) (us) +#elif (BB_CLK_RATE_HZ == 8000000) +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) ((uint32_t)((us) << 3)) +#elif (BB_CLK_RATE_HZ == 32768) +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) ((uint32_t)(((uint64_t)(us) * UINT64_C(549755)) >> 24)) /* calculated value may be one tick low */ +#else +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) BB_MATH_DIV_10E6((uint64_t)(us) * (uint64_t)(BB_CLK_RATE_HZ)) +#endif + +#if (BB_CLK_RATE_HZ == 1000000) +/*! \brief BB ticks to microseconds (no conversion required). */ +#define BB_TICKS_TO_US(n) (n) +#elif (BB_CLK_RATE_HZ == 8000000) +/*! \brief BB ticks to microseconds (8MHz). */ +#define BB_TICKS_TO_US(n) ((n) >> 3) +#elif (BB_CLK_RATE_HZ == 32768) +/*! \brief BB ticks to microseconds (32768 Hz). */ +#define BB_TICKS_TO_US(n) (uint32_t)(((uint64_t)(n) * 15625) >> 9) +#else +/*! \brief BB ticks to microseconds. */ +#define BB_TICKS_TO_US(n) (uint32_t)((uint64_t)(n) * 1000000 / BB_CLK_RATE_HZ) +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \addtogroup BB_API_INIT + * \{ */ + +/*! \brief Typical maximum duration to scan in a scan interval (BbRtCfg_t::maxScanPeriodMs). */ +#define BB_MAX_SCAN_PERIOD_MS 1000 + +/*! \brief Typical RF setup delay (BbRtCfg_t::rfSetupDelayUs). */ +#define BB_RF_SETUP_DELAY_US 150 + +/*! \brief Typical operation setup delay in microseconds (BbRtCfg_t::schSetupDelayUs). */ +#define BB_SCH_SETUP_DELAY_US 500 + + +/*! \brief BB runtime configuration parameters. */ +typedef struct +{ + /* Common */ + uint16_t clkPpm; /*!< Clock accuracy in PPM. */ + uint8_t rfSetupDelayUs; /*!< RF setup delay in microseconds. */ + + /* BLE */ + uint16_t maxScanPeriodMs; /*!< Maximum duration to scan in a scan interval. */ + + /* Scheduler */ + uint16_t schSetupDelayUs; /*!< Operation setup delay in microseconds. */ +} BbRtCfg_t; + +/*! \} */ /* BB_API_INIT */ + +/*! \addtogroup BB_API_BOD + * \{ */ + +/* Forward definition of BOD. */ +struct BbOpDesc_tag; + +/*! \brief BOD completion event callback signature. */ +typedef void (*BbBodCompCback_t)(void); + +/*! \brief BOD event callback signature. */ +typedef void (*BbBodCback_t)(struct BbOpDesc_tag *pBod); + +/*! \brief Protocol event callback signature. */ +typedef void (*BbProtCback_t)(void); + +/*! \brief BOD rescheduling policy (listed in priority order). */ +typedef enum +{ + BB_RESCH_FIXED_PREFERRED, /*!< BOD is fixed (rescheduling has limited recoverable consequences). */ + BB_RESCH_FIXED, /*!< BOD is fixed (rescheduling has recoverable consequences). */ + BB_RESCH_PERIODIC, /*!< BOD is periodic (rescheduling has consequences). */ + BB_RESCH_MOVEABLE_PREFERRED, /*!< BOD is movable (rescheduling has minor consequences). */ + BB_RESCH_MOVEABLE, /*!< BOD is movable (rescheduling has no consequences). */ + BB_RESCH_BACKGROUND /*!< BOD is single background task. */ +} BbReschPol_t; + +/*! \} */ /* BB_API_BOD */ + +/*! \addtogroup BB_API_BOD + * \{ */ + +/* Forward protocol data definitions. */ +struct BbBleData_tag; +struct Bb154Data_tag; + +/*! \brief Baseband operation descriptor (BOD). */ +typedef struct BbOpDesc_tag +{ + struct BbOpDesc_tag *pPrev; /*!< Previous BOD. */ + struct BbOpDesc_tag *pNext; /*!< Next BOD. */ + + uint32_t due; /*!< Absolute clock due time. */ + uint32_t minDurUsec; /*!< Minimum required duration in microseconds. */ + uint32_t maxDurUsec; /*!< Maximum required duration in microseconds. */ + uint16_t dueOffsetUsec; /*!< Due time offset in microseconds. */ + + uint8_t reschPolicy; /*!< Rescheduling policy. */ + + uint8_t protId; /*!< Protocol type. */ + + BbBodCback_t endCback; /*!< End of BOD callback (when BOD ends). */ + BbBodCback_t abortCback; /*!< Abort BOD callback (when BOD is removed before beginning). */ + + void *pCtx; /*!< Client defined context. */ + + union + { + struct BbBleData_tag *pBle; /*!< BLE operation data. */ + struct Bb154Data_tag *p154; /*!< 802.15.4 operation data. */ + } prot; /*!< Protocol specific data. */ +} BbOpDesc_t; + +/*! \} */ /* BB_API_BOD */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*! \addtogroup BB_API_INIT + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Initialize runtime configuration. + * + * \param pCfg Pointer to runtime configuration parameters (data must be static). + * + * \return None. + * + * This function initializes the BB subsystem's runtime configuration. + * + * \note This routine must be called only once before any other initialization routine. + */ +/*************************************************************************************************/ +void BbInitRunTimeCfg(const BbRtCfg_t *pCfg); + +/*************************************************************************************************/ +/*! + * \brief Initialize the BB. + * + * \return None. + * + * Initialize baseband resources. + */ +/*************************************************************************************************/ +void BbInit(void); + +/*************************************************************************************************/ +/*! + * \brief Register operation completion handler. + * + * \param eventCback Event callback. + * + * \return None. + * + * Register operation completion handler. + */ +/*************************************************************************************************/ +void BbRegister(BbBodCompCback_t eventCback); + +/*************************************************************************************************/ +/*! + * \brief Register protocol handlers. + * + * \param protId Protocol ID. + * \param execOpCback Execute operation callback. + * \param cancelOpCback Cancel operation callback. + * \param startProtCback Start protocol callback. + * \param stopProtCback Stop protocol callback. + * + * \return None. + */ +/*************************************************************************************************/ +void BbRegisterProt(uint8_t protId, BbBodCback_t execOpCback, BbBodCback_t cancelOpCback, + BbProtCback_t startProtCback, BbProtCback_t stopProtCback); + +/*! \} */ /* BB_API_INIT */ + +/*! \addtogroup BB_API_CTRL + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of given protocol. + * + * \param protId Protocol ID. + * + * \return None. + * + * Enable BB and start processing the list of BODs. This routine may be called several times, if + * a protocol layers has several simultaneously-enabled operations. However, \ref BbStop() must + * be called an equal number of time to disable the baseband. + */ +/*************************************************************************************************/ +void BbStart(uint8_t protId); + +/*************************************************************************************************/ +/*! + * \brief Stop BB processing of given protocol. + * + * \param protId Protocol ID. + * + * Disable BB processing of BODs. + * + * \note For any particular protocol, calls to \ref BbStart() and \ref BbStop() must be + * balanced to ensure that the hardware is disabled if and only if appropriate. + */ +/*************************************************************************************************/ +void BbStop(uint8_t protId); + +/*************************************************************************************************/ +/*! + * \brief Execute BOD. + * + * \param pBod Pointer to the BOD to execute. + * + * \return None. + * + * Execute the protocol specific BOD handler. + */ +/*************************************************************************************************/ +void BbExecuteBod(BbOpDesc_t *pBod); + +/*************************************************************************************************/ +/*! + * \brief Cancel current executing BOD. + * + * \return None. + */ +/*************************************************************************************************/ +void BbCancelBod(void); + +/*************************************************************************************************/ +/*! + * \brief Get the currently-executing BOD. + * + * \return Currently-executing BOD. + */ +/*************************************************************************************************/ +BbOpDesc_t *BbGetCurrentBod(void); + +/*************************************************************************************************/ +/*! + * \brief Cancel current executing BOD. + * + * \return None. + * + * \note This function is expected to be called during the execution context of the + * current executing BOD, typically in the related ISRs. + */ +/*************************************************************************************************/ +void BbSetBodTerminateFlag(void); + +/*************************************************************************************************/ +/*! + * \brief Get termination state of current executing BOD. + * + * \return TRUE if termination flag set, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbGetBodTerminateFlag(void); + +/*************************************************************************************************/ +/*! + * \brief Terminate a BOD immediately. + * + * \return None. + * + * \note This function is expected to be called during the execution context of the + * current executing BOD, typically in the related ISRs. + */ +/*************************************************************************************************/ +void BbTerminateBod(void); + +/*************************************************************************************************/ +/*! + * \brief Get BB clock accuracy. + * + * \return Clock accuracy in part per million. + * + * Returns the current BB clock accuracy. + */ +/*************************************************************************************************/ +uint16_t BbGetClockAccuracy(void); + +/*************************************************************************************************/ +/*! + * \brief Get scheduler setup delay. + * + * \return Scheduler setup delay in microseconds. + * + * Returns the scheduler setup delay. + */ +/*************************************************************************************************/ +uint16_t BbGetSchSetupDelayUs(void); + +/*************************************************************************************************/ +/*! + * \brief Returns the ID of the active protocol. + * + * \return Protocol operation in progress. + */ +/*************************************************************************************************/ +uint8_t BbGetActiveProtocol(void); + +/*! \} */ /* BB_API_CTRL */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac.h new file mode 100644 index 0000000000000000000000000000000000000000..11c8608dca8ab06d18083726d653bf144e525b6c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief MAC system configuration. + */ +/*************************************************************************************************/ + +#ifndef CFG_MAC_H +#define CFG_MAC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*** Baseband ***/ + +#ifndef BB_CLK_RATE_HZ +#define BB_CLK_RATE_HZ 1000000 /*!< BB clock rate in hertz. */ +#endif + +/*** Controller HCI ***/ + +#ifndef CHCI_BUF_TAILROOM +#define CHCI_BUF_TAILROOM 4 /*!< Extra byte allocation required for buffer (e.g., for MIC). */ +#endif + +#ifdef __cplusplus +}; +#endif + +#endif /* CFG_MAC_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac_ble.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac_ble.h new file mode 100644 index 0000000000000000000000000000000000000000..646c8cea38e6716dbb62186322bff76e635cfeee --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/cfg_mac_ble.h @@ -0,0 +1,108 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE MAC system configuration. + */ +/*************************************************************************************************/ + +#ifndef CFG_MAC_BLE_H +#define CFG_MAC_BLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*** LL ***/ + +#ifndef LL_API_PARAM_CHECK +#define LL_API_PARAM_CHECK 1 /*!< Check API parameters. */ +#endif + +#ifndef LL_MAX_CONN +#define LL_MAX_CONN 4 /*!< Absolute maximum number of connections (maximum is 32). */ +#endif + +#ifndef LL_NUM_ADV_FILT +#define LL_NUM_ADV_FILT 8 /*!< Table size for advertising filter. */ +#endif + +#ifndef LL_MAX_ADV_SETS +#define LL_MAX_ADV_SETS 6 /*!< Absolute maximum number of advertising sets. */ +#endif + +#ifndef LL_MAX_PER_SCAN +#define LL_MAX_PER_SCAN 6 /*!< Absolute maximum number of periodic scanners (maximum is 32). */ +#endif + +#ifndef LL_ENABLE_TESTER +#define LL_ENABLE_TESTER 0 /*!< Enable LL tester extensions. */ +#endif + +#ifndef LHCI_ENABLE_VS +#define LHCI_ENABLE_VS 1 /*!< Enable vendor specific command processing. */ +#endif + +/*** Scheduler ***/ + +#ifndef SCH_RM_MAX_RSVN +#define SCH_RM_MAX_RSVN (LL_MAX_CONN + LL_MAX_ADV_SETS) /*!< Maximum number of reservations (maximum is 32). */ +#endif + +/*** Baseband ***/ + +#ifndef BB_DATA_PLD_MAX_LEN +#define BB_DATA_PLD_MAX_LEN 251 /*!< Maximum data channel payload length (valid range 27 to 251, exclude MIC). */ +#endif + +#ifndef BB_ADV_PLD_MAX_LEN +#define BB_ADV_PLD_MAX_LEN 255 /*!< Maximum advertising channel payload length (valid range 95 to 255). */ +#endif + +#ifndef BB_FIXED_DATA_PKT_LEN +#define BB_FIXED_DATA_PKT_LEN 0 /*!< Fixed packet length required for BB data receive buffers (0 to disable). */ +#endif + +#ifndef BB_FIXED_ADVB_PKT_LEN +#define BB_FIXED_ADVB_PKT_LEN 0 /*!< Fixed packet length required for BB advertisement receive buffers (0 to disable). */ +#endif + +#ifndef BB_DATA_PDU_TAILROOM +#define BB_DATA_PDU_TAILROOM 4 /*!< Extra byte allocation required for BB operations (i.e. MIC). */ +#endif + +#ifndef BB_ENABLE_INLINE_ENC_TX +#define BB_ENABLE_INLINE_ENC_TX 0 /*!< Enable inline encryption mode. Not available for all projects. */ +#endif + +#ifndef BB_ENABLE_INLINE_DEC_RX +#define BB_ENABLE_INLINE_DEC_RX 0 /*!< Enable inline decryption mode. Not available for all projects. */ +#endif + +#ifndef BB_SYM_PHY_REQ +#define BB_SYM_PHY_REQ 0 /*!< Symmetric PHY required on connections. */ +#endif + +#ifdef __cplusplus +}; +#endif + +#endif /* CFG_MAC_BLE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/sch_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/sch_api.h new file mode 100644 index 0000000000000000000000000000000000000000..3c51357948fe47397587673eb1daac642cf89ac2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/include/common/sch_api.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Multi-protocol scheduler interface file. + */ +/*************************************************************************************************/ + +#ifndef SCH_API_H +#define SCH_API_H + +#include "wsf_types.h" +#include "wsf_os.h" +#include "bb_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Conflict action call signature. */ +typedef BbOpDesc_t*(*BbConflictAct_t)(BbOpDesc_t *pNewBod, BbOpDesc_t *pExistBod); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void SchInit(void); +void SchHandlerInit(wsfHandlerId_t handlerId); +void SchReset(void); +uint16_t SchStatsGetHandlerWatermarkUsec(void); + +/* Control */ +void SchHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); + +/* List maintenance */ +void SchInsertNextAvailable(BbOpDesc_t *pBod); +bool_t SchInsertAtDueTime(BbOpDesc_t *pBod, BbConflictAct_t conflictCback); +bool_t SchInsertEarlyAsPossible(BbOpDesc_t *pBod, uint32_t min, uint32_t max); +bool_t SchInsertLateAsPossible(BbOpDesc_t *pBod, uint32_t min, uint32_t max); +bool_t SchRemove(BbOpDesc_t *pBod); +void SchReload(BbOpDesc_t *pBod); +void SchRemoveBackground(void); +void SchInsertBackground(BbOpDesc_t *pBod); +void SchTerminateBackground(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* SCH_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..96c8580eded2f4f1637d52e45b49e332cca8807b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master.c @@ -0,0 +1,526 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Scanning master BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_drv.h" +#include "bb_ble_int.h" +#include "sch_api.h" +#include "wsf_math.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Guard time at the end of a scan window to the next BOD. Backoff one advertise data exchange. */ +#define BB_SCAN_GUARD_US (LL_ADV_PKT_MAX_USEC + LL_BLE_TIFS_US + \ + LL_SCAN_REQ_MAX_USEC + LL_BLE_TIFS_US + \ + LL_SCAN_RSP_MAX_USEC + \ + BbGetSchSetupDelayUs()) + +/*! \brief Event states for scan operations. */ +enum +{ + BB_EVT_STATE_RX_ADV_IND, + BB_EVT_STATE_TX_SCAN_OR_CONN_IND, + BB_EVT_STATE_RX_SCAN_RSP +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +BbBleScanPktStats_t bbScanStats; /*!< Scan packet statistics. */ + +extern const BbRtCfg_t *pBbRtCfg; + +/*************************************************************************************************/ +/*! + * \brief Calculate remaining scan duration. + * + * \param pBod Pointer to the BOD. + * \param pScan Pointer to the scan event operation data. + * \param refTime Reference time. + * \param setupUsec Setup delay required in microseconds. + * + * \return Scan duration in microseconds. + * + * This function is calculates the duration of the scan examining: + * - total elapsed scan time + * - neighboring BOD + * - maximum scan period + */ +/*************************************************************************************************/ +static uint32_t bbBleCalcScanDurationUsec(BbOpDesc_t *pBod, BbBleMstAdvEvent_t *pScan, uint32_t refTime, uint32_t setupUsec) +{ + const uint32_t totalGapUsec = BB_SCAN_GUARD_US + setupUsec; + uint32_t remTimeUsec; + + WSF_ASSERT(pBod->maxDurUsec > 0); + + if ((pScan->elapsedUsec + totalGapUsec) > pBod->maxDurUsec) + { + /* Scan window completed. */ + pScan->elapsedUsec = pBod->maxDurUsec; + return 0; + } + + remTimeUsec = pBod->maxDurUsec - pScan->elapsedUsec; + + if (pBod->pNext) + { + uint32_t timeToNextOpUsec = BB_TICKS_TO_US(pBod->pNext->due - refTime); + + /* Limit scanning to the edge of neighboring BOD. */ + remTimeUsec = WSF_MIN(remTimeUsec, timeToNextOpUsec); + + if (remTimeUsec < totalGapUsec) + { + pScan->elapsedUsec += remTimeUsec; + return 0; + } + } + + /* Reduce time such that advertising exchange can complete before end of the receive window. */ + remTimeUsec -= totalGapUsec; + + /* Limit scanning to the maximum scan period. */ + remTimeUsec = WSF_MIN(remTimeUsec, (pBbRtCfg->maxScanPeriodMs * 1000)); + + return remTimeUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Continue scan operation. + * + * \param pBod Pointer to the BOD to execute. + * \param pScan Pointer to the scan event operation data. + * + * \return TRUE if the BOD is completed, FALSE if operation continues. + * + * This function is called to continue scan operation. + */ +/*************************************************************************************************/ +static bool_t bbContScanOp(BbOpDesc_t *pBod, BbBleMstAdvEvent_t *pScan) +{ + uint32_t curTime, scanDurUsec; + + if (BbGetBodTerminateFlag()) + { + /* Client terminated. */ + return TRUE; + } + + curTime = BbDrvGetCurrentTime(); + pScan->elapsedUsec += BB_TICKS_TO_US(curTime - bbBleCb.lastScanStart); + bbBleCb.lastScanStart = curTime; + + if ((scanDurUsec = bbBleCalcScanDurationUsec(pBod, pScan, curTime, BbGetSchSetupDelayUs())) == 0) + { + return TRUE; + } + + bbBleCb.bbParam.due = bbBleCb.lastScanStart + BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs()); + bbBleCb.bbParam.dueOffsetUsec = 0; + bbBleCb.bbParam.rxTimeoutUsec = scanDurUsec; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = BB_EVT_STATE_RX_ADV_IND; + + if (pScan->pTxReqBuf) + { + bbBleSetIfs(); /* active scan or initiating */ + } + else + { + bbBleClrIfs(); /* passive scan */ + } + BbBleDrvRxData(pScan->pRxAdvBuf, BB_ADVB_MAX_LEN); + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Tx completion for scanning master operation. + * + * \param status Completion status. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstScanTxCompCback(uint8_t status) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleMstAdvEvent_t * const pScan = &pCur->prot.pBle->op.mstAdv; + + bool_t bodComplete = FALSE; + bool_t bodCont = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_TX_SCAN_OR_CONN_IND: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pScan->txReqCback); + WSF_ASSERT(pScan->pTxReqBuf); + + if (pScan->txReqCback(pCur, pScan->pTxReqBuf)) + { + WSF_ASSERT(pScan->pRxRspBuf); + + BB_ISR_MARK(bbScanStats.rxSetupUsec); + + bbBleClrIfs(); /* last operation in event */ + BbBleDrvRxTifsData(pScan->pRxRspBuf, BB_ADVB_MAX_LEN); + + /* Rx may fail; no more important statements in the !bodComplete code path */ + } + else + { + bodCont = TRUE; + } + + break; + } + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbScanStats.txReq); + break; + default: + BB_INC_STAT(bbScanStats.errScan); + break; + } + + break; + } + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + if (bodCont) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BbBleDrvCancelTifs(); + break; + default: + /* coverity[dead_error_begin] */ + break; + } + + bodComplete = bbContScanOp(pCur, pScan); + } + + if (bodComplete) + { + BbTerminateBod(); + } + + BB_ISR_MARK(bbScanStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for scanning master operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstScanRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + bool_t bodComplete = FALSE; + bool_t bodCont = FALSE; + bool_t pduAllow; + BbBleDrvTxBufDesc_t desc; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_RX_ADV_IND: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pScan->rxAdvCback); + WSF_ASSERT(pScan->pRxAdvBuf); + + pScan->advRssi = rssi; + pScan->advCrc = crc; + pScan->advStartTs = timestamp; + pScan->advRxPhyOptions = rxPhyOptions; + + pduAllow = BbBlePduFiltCheck(pScan->pRxAdvBuf, &pBle->pduFilt, FALSE, &pScan->filtResults); + + if (pduAllow && pScan->rxAdvCback(pCur, pScan->pRxAdvBuf)) + { + WSF_ASSERT(pScan->pTxReqBuf); + + BB_ISR_MARK(bbScanStats.txSetupUsec); + + desc.pBuf = pScan->pTxReqBuf; + desc.len = pScan->txReqLen; + + bbBleSetIfs(); + BbBleDrvTxTifsData(&desc, 1); + + /* Tx may fail; no more important statements in the !bodComplete code path */ + } + else + { + bodCont = TRUE; + } + + if (pduAllow && pScan->rxAdvPostCback) + { + pScan->rxAdvPostCback(pCur, pScan->pRxAdvBuf); + } + + break; + } + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbScanStats.rxAdv); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbScanStats.rxAdvTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbScanStats.rxAdvCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbScanStats.errScan); + break; + } + + break; + } + + case BB_EVT_STATE_RX_SCAN_RSP: + { + WSF_ASSERT(pScan->rxRspCback); + WSF_ASSERT(pScan->pRxRspBuf); + + switch (status) + { + case BB_STATUS_SUCCESS: + if (BbBlePduFiltCheck(pScan->pRxRspBuf, &pBle->pduFilt, FALSE, &pScan->filtResults)) + { + pScan->rxRspCback(pCur, pScan->pRxRspBuf); + } + bodCont = TRUE; + break; + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + pScan->rxRspCback(pCur, NULL); + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbScanStats.rxRsp); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbScanStats.rxRspTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbScanStats.rxRspCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbScanStats.errScan); + break; + } + + break; + } + + default: /* invalid state */ + WSF_ASSERT(FALSE); + break; + } + + if (bodCont) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + bodComplete = bbContScanOp(pCur, pScan); + } + + if (bodComplete) + { + BbTerminateBod(); + } + + BB_ISR_MARK(bbScanStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute scanning master BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbMstExecuteScanOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + uint32_t scanDurUsec; + BbBleMstAdvEvent_t * const pScan = &pBod->prot.pBle->op.mstAdv; + + if (pScan->preExecCback) + { + pScan->preExecCback(pBod); + } + + if ((scanDurUsec = bbBleCalcScanDurationUsec(pBod, pScan, pBod->due, 0)) == 0) + { + BbSetBodTerminateFlag(); + return; + } + + bbBleCb.lastScanStart = pBod->due; + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.txCback = bbMstScanTxCompCback; + bbBleCb.bbParam.rxCback = bbMstScanRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = scanDurUsec; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = 0; + + if (pScan->pTxReqBuf) + { + bbBleSetIfs(); /* active scan or initiating */ + } + else + { + bbBleClrIfs(); /* passive scan */ + } + BbBleDrvRxData(pScan->pRxAdvBuf, BB_ADVB_MAX_LEN); + + /* Rx may fail; no more important statements in the !bodComplete code path */ +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for scanning master operations. + * + * \return None. + * + * Update the operation table with scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBleScanMasterInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_MST_ADV_EVENT, bbMstExecuteScanOp, NULL); + + memset(&bbScanStats, 0, sizeof(bbScanStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising packet statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetScanStats(BbBleScanPktStats_t *pStats) +{ + *pStats = bbScanStats; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..06e1877a88a01d8edfd1c182a655cbf62279da7d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_master_ae.c @@ -0,0 +1,772 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Extended scanning master BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_int.h" +#include "sch_api.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Event states for scan operations. */ +enum +{ + BB_EVT_STATE_RX_ADV_IND, /*!< Receive Advertising indication. */ + BB_EVT_STATE_TX_SCAN_OR_CONN_REQ, /*!< Transmit scan or connection request. */ + BB_EVT_STATE_RX_SCAN_OR_CONN_RSP, /*!< Receive scan or connection response. */ + BB_EVT_STATE_RX_CHAIN_IND /*!< Receive chain indication. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Auxiliary scan packet statistics. */ +static BbBleAuxScanPktStats_t bbAuxScanStats; + +/*! \brief Periodic scan packet statistics. */ +static BbBlePerScanPktStats_t bbPerScanStats; + +/*! \brief Auxiliary advertising buffer. */ +static uint8_t bbAuxAdvBuf[LL_EXT_ADVB_MAX_LEN]; + +/*! \brief Periodic scanning buffer. */ +static uint8_t bbPerScanBuf[LL_EXT_ADVB_MAX_LEN]; + +/*************************************************************************************************/ +/*! + * \brief Tx completion for auxiliary scanning master operation. + * + * \param status Completion status. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstAuxScanTxCompCback(uint8_t status) +{ + bool_t bodComplete = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_TX_SCAN_OR_CONN_REQ: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + BB_ISR_MARK(bbAuxScanStats.rxSetupUsec); + + bbBleClrIfs(); /* Prepare for SCAN_OR_CONN_RSP */ + BbBleDrvRxTifsData(bbAuxAdvBuf, sizeof(bbAuxAdvBuf)); + + break; + } + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAuxScanStats.txReq); + break; + default: + BB_INC_STAT(bbAuxScanStats.errScan); + break; + } + + break; + } + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + if (bodComplete) + { + BbTerminateBod(); + } + + BB_ISR_MARK(bbAuxScanStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for auxiliary scanning master operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstAuxScanRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleMstAuxAdvEvent_t * const pAuxScan = &pBle->op.mstAuxAdv; + BbBleDrvTxBufDesc_t desc; + uint32_t auxOffsetUsec; + + bool_t bodComplete = FALSE; + bool_t bodCont = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState) + { + case BB_EVT_STATE_RX_ADV_IND: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pAuxScan->rxAuxAdvCback); + + pAuxScan->auxAdvRssi = rssi; + pAuxScan->auxAdvCrc = crc; + pAuxScan->auxStartTs = timestamp; + pAuxScan->auxRxPhyOptions = rxPhyOptions; + + if (pAuxScan->rxAuxAdvCback(pCur, bbAuxAdvBuf)) + { + if (pAuxScan->pTxAuxReqBuf) + { + /* Tx response PDU. */ + + bbBleCb.evtState = BB_EVT_STATE_TX_SCAN_OR_CONN_REQ; + + BB_ISR_MARK(bbAuxScanStats.txSetupUsec); + + desc.pBuf = pAuxScan->pTxAuxReqBuf; + desc.len = pAuxScan->txAuxReqLen; + + bbBleSetIfs(); + BbBleDrvTxTifsData(&desc, 1); + } + } + else if ((pAuxScan->rxAuxChainCback) && + ((auxOffsetUsec = pAuxScan->rxAuxChainCback(pCur, bbAuxAdvBuf)) > 0)) + { + /* Rx chain indication PDU. */ + + bbBleCb.evtState = BB_EVT_STATE_RX_CHAIN_IND; + + /* Cancel Tifs operation is needed for passive scan and non connectable/scannable adv with chain. */ + BbBleDrvCancelTifs(); + + BbBleDrvSetChannelParam(&pBle->chan); + bbBleCb.bbParam.due = timestamp + BB_US_TO_BB_TICKS(auxOffsetUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + BB_ISR_MARK(bbAuxScanStats.rxSetupUsec); + + bbBleClrIfs(); /* CHAIN_IND does not use TIFS. */ + BbBleDrvRxData(bbAuxAdvBuf, sizeof(bbAuxAdvBuf)); + + WSF_ASSERT(pAuxScan->rxAuxChainPostCback); + if (pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf) == FALSE) + { + bodCont = TRUE; + } + } + else + { + if (pAuxScan->rxAuxChainPostCback) + { + pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf); + } + bodCont = TRUE; + } + break; + } + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAuxScanStats.rxAdv); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbAuxScanStats.rxAdvTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbAuxScanStats.rxAdvCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbAuxScanStats.errScan); + break; + } + + break; + } + + case BB_EVT_STATE_RX_SCAN_OR_CONN_RSP: + { + bbBleCb.evtState = BB_EVT_STATE_RX_CHAIN_IND; + + WSF_ASSERT(pAuxScan->rxAuxRspCback); + + switch (status) + { + case BB_STATUS_SUCCESS: + pAuxScan->auxAdvRssi = rssi; + pAuxScan->auxAdvCrc = crc; + pAuxScan->auxStartTs = timestamp; + pAuxScan->auxRxPhyOptions = rxPhyOptions; + + pAuxScan->rxAuxRspCback(pCur, bbAuxAdvBuf); + if ((pAuxScan->rxAuxChainCback) && + ((auxOffsetUsec = pAuxScan->rxAuxChainCback(pCur, bbAuxAdvBuf)) > 0)) + { + BbBleDrvSetChannelParam(&pBle->chan); + bbBleCb.bbParam.due = timestamp + BB_US_TO_BB_TICKS(auxOffsetUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + BB_ISR_MARK(bbAuxScanStats.rxSetupUsec); + + bbBleClrIfs(); /* CHAIN_IND does not use TIFS. */ + BbBleDrvRxData(bbAuxAdvBuf, sizeof(bbAuxAdvBuf)); + + WSF_ASSERT(pAuxScan->rxAuxChainPostCback); + if (pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf) == FALSE) + { + bodCont = TRUE; + } + } + else + { + if (pAuxScan->rxAuxChainPostCback) + { + /* Only apply to scan response. */ + pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf); + } + bodCont = TRUE; + } + break; + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + pAuxScan->rxAuxRspCback(pCur, NULL); + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAuxScanStats.rxRsp); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbAuxScanStats.rxRspTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbAuxScanStats.rxRspCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbAuxScanStats.errScan); + break; + } + + break; + } + + case BB_EVT_STATE_RX_CHAIN_IND: + { + /* Same state. */ + /* bbBleCb.evtState = BB_EVT_STATE_RX_CHAIN_IND; */ + + WSF_ASSERT(pAuxScan->rxAuxChainCback); + + switch (status) + { + case BB_STATUS_SUCCESS: + { + uint32_t auxOffsetUsec; + if ((auxOffsetUsec = pAuxScan->rxAuxChainCback(pCur, bbAuxAdvBuf)) > 0) + { + BbBleDrvSetChannelParam(&pBle->chan); + bbBleCb.bbParam.due = timestamp + BB_US_TO_BB_TICKS(auxOffsetUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + BB_ISR_MARK(bbAuxScanStats.rxSetupUsec); + + bbBleClrIfs(); /* CHAIN_IND does not use TIFS. */ + BbBleDrvRxData(bbAuxAdvBuf, sizeof(bbAuxAdvBuf)); + + WSF_ASSERT(pAuxScan->rxAuxChainPostCback); + if (pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf) == FALSE) + { + bodCont = TRUE; + } + } + else + { + if (pAuxScan->rxAuxChainPostCback) + { + pAuxScan->rxAuxChainPostCback(pCur, bbAuxAdvBuf); + } + bodCont = TRUE; + } + break; + } + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + pAuxScan->rxAuxChainCback(pCur, NULL); + if (pAuxScan->rxAuxChainPostCback) + { + pAuxScan->rxAuxChainPostCback(pCur, NULL); + } + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + pAuxScan->rxAuxChainCback(pCur, NULL); + if (pAuxScan->rxAuxChainPostCback) + { + pAuxScan->rxAuxChainPostCback(pCur, NULL); + } + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAuxScanStats.rxChain); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbAuxScanStats.rxChainTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbAuxScanStats.rxChainCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbAuxScanStats.errScan); + break; + } + + break; + } + + default: /* invalid state */ + WSF_ASSERT(FALSE); + break; + } + + if (bodCont) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + bodComplete = TRUE; + } + + if (bodComplete) + { + BbTerminateBod(); + } + + BB_ISR_MARK(bbAuxScanStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute auxiliary scanning master BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbMstExecuteAuxScanOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleMstAuxAdvEvent_t * const pAuxScan = &pBod->prot.pBle->op.mstAuxAdv; + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.txCback = bbMstAuxScanTxCompCback; + bbBleCb.bbParam.rxCback = bbMstAuxScanRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = pAuxScan->rxSyncDelayUsec; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = 0; + + if (pAuxScan->pTxAuxReqBuf) + { + bbBleSetIfs(); /* active scan or initiating */ + } + else + { + bbBleClrIfs(); /* passive scan */ + } + BbBleDrvRxData(bbAuxAdvBuf, sizeof(bbAuxAdvBuf)); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for periodic scanning master operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstPerScanRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + uint32_t auxOffsetUsec; + + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleMstPerScanEvent_t * const pPerScan = &pBle->op.mstPerScan; + + bool_t bodComplete = FALSE; + bool_t bodCont = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState) + { + case BB_EVT_STATE_RX_ADV_IND: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pPerScan->rxPerAdvCback); + WSF_ASSERT(pPerScan->rxPerAdvPostCback); + + bbBleCb.evtState = BB_EVT_STATE_RX_CHAIN_IND; + pPerScan->perAdvRssi = rssi; + pPerScan->perAdvCrc = crc; + pPerScan->perStartTs = timestamp; + pPerScan->perIsFirstTs = TRUE; + pPerScan->perRxPhyOptions = rxPhyOptions; + + if ((auxOffsetUsec = pPerScan->rxPerAdvCback(pCur, bbPerScanBuf, status)) > 0) + { + BbBleDrvSetChannelParam(&pBle->chan); + bbBleCb.bbParam.due = timestamp + BB_US_TO_BB_TICKS(auxOffsetUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + BB_ISR_MARK(bbPerScanStats.rxSetupUsec); + + bbBleClrIfs(); /* SYNC_IND does not use TIFS. */ + BbBleDrvRxData(bbPerScanBuf, sizeof(bbPerScanBuf)); + + if (pPerScan->rxPerAdvPostCback(pCur, bbAuxAdvBuf) == FALSE) + { + bodCont = TRUE; + } + } + else + { + pPerScan->rxPerAdvPostCback(pCur, bbPerScanBuf); + bodCont = TRUE; + } + break; + } + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbPerScanStats.rxAdv); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbPerScanStats.rxAdvTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbPerScanStats.rxAdvCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbPerScanStats.errScan); + break; + } + + break; + } + + case BB_EVT_STATE_RX_CHAIN_IND: + { + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pPerScan->rxPerAdvCback); + WSF_ASSERT(pPerScan->rxPerAdvPostCback); + + pPerScan->perIsFirstTs = FALSE; + pPerScan->perAdvRssi = rssi; + pPerScan->perRxPhyOptions = rxPhyOptions; + + if ((auxOffsetUsec = pPerScan->rxPerAdvCback(pCur, bbPerScanBuf, status)) > 0) + { + /* Continue BOD with the CHAIN_IND and adjust the channel parameters. */ + BbBleDrvSetChannelParam(&pBle->chan); + bbBleCb.bbParam.due = timestamp + BB_US_TO_BB_TICKS(auxOffsetUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + BB_ISR_MARK(bbPerScanStats.rxSetupUsec); + + bbBleClrIfs(); /* SYNC_IND does not use TIFS. */ + BbBleDrvRxData(bbPerScanBuf, sizeof(bbPerScanBuf)); + + if (pPerScan->rxPerAdvPostCback(pCur, bbAuxAdvBuf) == FALSE) + { + bodCont = TRUE; + } + } + else + { + pPerScan->rxPerAdvPostCback(pCur, bbPerScanBuf); + bodCont = TRUE; + } + break; + } + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + pPerScan->rxPerAdvCback(pCur, NULL, status); + pPerScan->rxPerAdvPostCback(pCur, NULL); + bodCont = TRUE; + break; + + case BB_STATUS_FAILED: + default: + pPerScan->rxPerAdvCback(pCur, NULL, status); + pPerScan->rxPerAdvPostCback(pCur, NULL); + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbPerScanStats.rxChain); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbPerScanStats.rxChainTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbPerScanStats.rxChainCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbPerScanStats.errScan); + break; + } + + /* Same state. */ + /* bbBleCb.evtState = BB_EVT_STATE_RX_CHAIN_IND; */ + break; + } + + default: /* invalid state */ + WSF_ASSERT(FALSE); + break; + } + + if (bodCont) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + bodComplete = TRUE; + } + + if (bodComplete) + { + BbTerminateBod(); + } + + BB_ISR_MARK(bbPerScanStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute periodic scanning master BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbMstExecutePerScanOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleMstPerScanEvent_t * const pPerScan = &pBod->prot.pBle->op.mstPerScan; + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.rxCback = bbMstPerScanRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = pPerScan->rxSyncDelayUsec; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = 0; + + bbBleClrIfs(); /* passive scan */ + + BbBleDrvRxData(bbPerScanBuf, sizeof(bbPerScanBuf)); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for scanning master operations. + * + * \return None. + * + * Update the operation table with scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBleAuxScanMasterInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_MST_AUX_ADV_EVENT, bbMstExecuteAuxScanOp, NULL); + + memset(&bbAuxScanStats, 0, sizeof(bbAuxScanStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising packet statistics. + * + * \param pStats Auxiliary scan statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAuxScanStats(BbBleAuxScanPktStats_t *pStats) +{ + *pStats = bbAuxScanStats; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for periodic scanning master operations. + * + * \return None. + * + * Update the operation table with periodic scanning master operations routines. + */ +/*************************************************************************************************/ +void BbBlePerScanMasterInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_MST_PER_SCAN_EVENT, bbMstExecutePerScanOp, NULL); + + memset(&bbPerScanStats, 0, sizeof(bbPerScanStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get periodic scanning packet statistics. + * + * \param pStats periodic scan statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetPerScanStats(BbBlePerScanPktStats_t *pStats) +{ + *pStats = bbPerScanStats; +} + diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..7474edfe44b31641d47ad8fb72f0cc4137b3d8eb --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave.c @@ -0,0 +1,419 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Advertising slave BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_drv.h" +#include "bb_ble_int.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Event states for advertising operations. */ +enum +{ + BB_EVT_STATE_TX_ADV_IND, /*!< Transmit Advertising PDU. */ + BB_EVT_STATE_RX_SCAN_OR_CONN_IND, /*!< Receive scan or connection indication. */ + BB_EVT_STATE_TX_SCAN_RSP /*!< Transmit scan response. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +BbBleAdvPktStats_t bbAdvStats; /*!< Advertising packet statistics. */ +uint32_t bbIsrStartTime; /*!< ISR start time. */ + +/*************************************************************************************************/ +/*! + * \brief Setup an advertising operation. + * + * \param pBod Pointer to the BOD to execute. + * \param pAdv Pointer to the advertising data. + * \param status Receive status. + * \param firstOpInSet First operation flag. + * + * \return TRUE if the BOD is completed, FALSE if operation continues on the next channel. + * + * This function is called to setup the initial or subsequent advertising operation. Once all + * operations are execute in the given channel map, the BOD is considered completed. + */ +/*************************************************************************************************/ +static bool_t bbSetupAdvOp(BbOpDesc_t *pBod, BbBleSlvAdvEvent_t *pAdv, uint8_t status, bool_t firstOpInSet) +{ + BbBleData_t * const pBle = pBod->prot.pBle; + BbBleDrvTxBufDesc_t desc; + + if (BbGetBodTerminateFlag()) + { + /* Client terminated. */ + return TRUE; + } + + /* Compute next channel. */ + do + { + if (bbBleCb.advChIdx >= LL_NUM_CHAN_ADV) + { + /* BOD completed. */ + return TRUE; + } + + pBle->chan.chanIdx = LL_CHAN_ADV_MIN_IDX + bbBleCb.advChIdx; + + /* Selected channel in channel map; use this channel. */ + } while (!((1 << bbBleCb.advChIdx++) & pAdv->advChMap)); + + if (!firstOpInSet) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + } + + BbBleDrvSetChannelParam(&pBle->chan); + + if (firstOpInSet) + { + bbBleCb.bbParam.due = pBod->due; + } + else + { + if (pAdv->pRxReqBuf) + { + /* Schedule with relative framge gap. */ + bbBleCb.bbParam.due = BbDrvGetCurrentTime() + BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs()); + } + else + { + /* Schedule with absolute frame gap. */ + bbBleCb.bbParam.due += (BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, pBle->chan.initTxPhyOptions, pAdv->txAdvLen)) + + BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs())); + } + } + + bbBleCb.evtState = BB_EVT_STATE_TX_ADV_IND; + + if (pAdv->txAdvSetupCback) + { + pAdv->txAdvSetupCback(pBod, bbBleCb.bbParam.due); + } + + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + if (pAdv->pRxReqBuf) + { + bbBleSetIfs(); /* scannable or connectable advertising */ + } + else + { + bbBleClrIfs(); /* non-connectable advertising */ + } + desc.pBuf = pAdv->pTxAdvBuf; + desc.len = pAdv->txAdvLen; + + BbBleDrvTxData(&desc, 1); + + /* Tx may fail; no more important statements in the FALSE code path */ + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Tx completion for advertising slave operation. + * + * \param status Completion status. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvAdvTxCompCback(uint8_t status) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleSlvAdvEvent_t * const pAdv = &pCur->prot.pBle->op.slvAdv; + + bool_t bodComplete = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + if (status != BB_STATUS_SUCCESS) + { + BB_INC_STAT(bbAdvStats.errAdv); + bodComplete = TRUE; + goto Cleanup; + } + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_TX_ADV_IND: + if (pAdv->pRxReqBuf) + { + BB_ISR_MARK(bbAdvStats.rxSetupUsec); + + bbBleSetIfs(); /* set up for Tx SCAN_RSP */ + BbBleDrvRxTifsData(pAdv->pRxReqBuf, BB_REQ_PDU_MAX_LEN); /* reduce max length requirement */ + } + else + { + /* Operation completed. */ + bodComplete = bbSetupAdvOp(pCur, pAdv, status, FALSE); + } + + BB_INC_STAT(bbAdvStats.txAdv); + break; + + case BB_EVT_STATE_TX_SCAN_RSP: + /* Operation completed. */ + bodComplete = bbSetupAdvOp(pCur, pAdv, status, FALSE); + BB_INC_STAT(bbAdvStats.txRsp); + break; + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + /* Tx may fail; no more important statements in the !bodComplete code path */ + +Cleanup: + + if (bodComplete) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); + } + + BB_ISR_MARK(bbAdvStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for advertising slave operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvAdvRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + bool_t bodComplete = FALSE; + bool_t pduAllow; + BbBleDrvTxBufDesc_t desc; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_RX_SCAN_OR_CONN_IND: + switch (status) + { + case BB_STATUS_SUCCESS: + { + WSF_ASSERT(pAdv->rxReqCback); + WSF_ASSERT(pAdv->pRxReqBuf); + + pAdv->reqStartTs = timestamp; + + pduAllow = BbBlePduFiltCheck(pAdv->pRxReqBuf, &pBle->pduFilt, FALSE, &pAdv->filtResults); + if (pduAllow && pAdv->rxReqCback(pCur, pAdv->pRxReqBuf)) + { + BB_ISR_MARK(bbAdvStats.txSetupUsec); + + bbBleClrIfs(); /* last operation in event */ + desc.pBuf = pAdv->pTxRspBuf; + desc.len = pAdv->txRspLen; + BbBleDrvTxTifsData(&desc, 1); + } + else + { + /* Operation completed. */ + bodComplete = bbSetupAdvOp(pCur, pAdv, status, FALSE); + } + + if (pduAllow && pAdv->rxReqPostCback) + { + pAdv->rxReqPostCback(pCur, pAdv->pRxReqBuf); + } + + break; + } + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + case BB_STATUS_FAILED: + default: + /* Operation completed. */ + bodComplete = bbSetupAdvOp(pCur, pAdv, status, FALSE); + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAdvStats.rxReq); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbAdvStats.rxReqTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbAdvStats.rxReqCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbAdvStats.errAdv); + break; + } + + break; + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + /* Tx may fail; no more important statements in the !bodComplete code path */ + + if (bodComplete) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); + } + + BB_ISR_MARK(bbAdvStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute advertising slave BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecuteAdvOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleSlvAdvEvent_t * const pAdv = &pBod->prot.pBle->op.slvAdv; + + bbBleCb.bbParam.txCback = bbSlvAdvTxCompCback; + bbBleCb.bbParam.rxCback = bbSlvAdvRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = 2 * LL_MAX_TIFS_DEVIATION; + bbBleCb.bbParam.dueOffsetUsec = 0; + + bbBleCb.advChIdx = 0; + bbBleCb.evtState = 0; + + if (bbSetupAdvOp(pBod, pAdv, BB_STATUS_SUCCESS, TRUE)) + { + BbSetBodTerminateFlag(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cancel advertising slave BOD. + * + * \param pBod Pointer to the BOD to cancel. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvCancelAdvOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleDrvCancelData(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for advertising slave operations. + * + * \return None. + * + * Update the operation table with advertising slave operations routines. + */ +/*************************************************************************************************/ +void BbBleAdvSlaveInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_SLV_ADV_EVENT, bbSlvExecuteAdvOp, bbSlvCancelAdvOp); + + memset(&bbAdvStats, 0, sizeof(bbAdvStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising packet statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAdvStats(BbBleAdvPktStats_t *pStats) +{ + *pStats = bbAdvStats; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..f2d9135e0bb5c40be2ff9bf3b931cbb2449c6bf7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_adv_slave_ae.c @@ -0,0 +1,430 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Extended advertising slave BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_int.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Event states for advertising operations. */ +enum +{ + BB_EVT_STATE_TX_ADV_IND, /*!< Transmit Advertising indication. */ + BB_EVT_STATE_RX_SCAN_OR_CONN_REQ, /*!< Receive scan or connection request. */ + BB_EVT_STATE_TX_SCAN_RSP, /*!< Transmit scan response. */ + BB_EVT_STATE_TX_CHAIN_IND /*!< Transmit chain indication. */ +}; + + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +BbBleAuxAdvPktStats_t bbAuxAdvStats;/*!< Auxiliary advertising packet statistics. */ + +/*************************************************************************************************/ +/*! + * \brief Setup Tx CHAIN_IND. + * + * \param pCur Current BOD. + * \param pAuxAdv Auxiliary advertising context. + * + * \return TRUE if operation completed; FALSE if it continues. + */ +/*************************************************************************************************/ +static bool_t bbSlvAdvSetupTxAuxChainInd(BbOpDesc_t *pCur, BbBleSlvAuxAdvEvent_t *pAuxAdv) +{ + uint32_t auxOffsUsec; + + if (pAuxAdv->txAuxSetupCback == NULL) + { + /* Operation completed. */ + return TRUE; + } + + auxOffsUsec = pAuxAdv->txAuxSetupCback(pCur, TRUE); + if (auxOffsUsec == 0) + { + /* Operation completed. */ + return TRUE; + } + + /* Set updated auxiliary channel. */ + BbBleDrvSetChannelParam(&pCur->prot.pBle->chan); + + /* Offset may be up to 1 unit earlier than actual transmission. */ + bbBleCb.bbParam.due += BB_US_TO_BB_TICKS(auxOffsUsec); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + BB_ISR_MARK(bbAuxAdvStats.rxSetupUsec); + bbBleClrIfs(); /* CHAIN_IND does not use TIFS. */ + BbBleDrvTxData(pAuxAdv->txAuxChainPdu, 2); + + /* Operation continues. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Tx completion for auxiliary advertising slave operation. + * + * \param status Completion status. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvAuxAdvTxCompCback(uint8_t status) +{ + + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pCur->prot.pBle->op.slvAuxAdv; + BbBleData_t * const pBle = pCur->prot.pBle; + bool_t bodComplete = FALSE; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + + if (status != BB_STATUS_SUCCESS) + { + BB_INC_STAT(bbAuxAdvStats.errAdv); + bodComplete = TRUE; + goto Cleanup; + } + + switch (bbBleCb.evtState) + { + case BB_EVT_STATE_TX_ADV_IND: + if (!pAuxAdv->pRxAuxReqBuf) + { + /* Non-connectable and non-scannable operation. */ + bbBleCb.evtState = BB_EVT_STATE_TX_CHAIN_IND; + bodComplete = bbSlvAdvSetupTxAuxChainInd(pCur, pAuxAdv); + } + else + { + /* Scannable or connectable operation. */ + bbBleCb.evtState = BB_EVT_STATE_RX_SCAN_OR_CONN_REQ; + BB_ISR_MARK(bbAuxAdvStats.rxSetupUsec); + bbBleSetIfs(); /* set up for Tx SCAN_RSP */ + BbBleDrvRxTifsData(pAuxAdv->pRxAuxReqBuf, BB_REQ_PDU_MAX_LEN); /* reduce max length requirement */ + } + BB_INC_STAT(bbAuxAdvStats.txAdv); + break; + + case BB_EVT_STATE_TX_SCAN_RSP: + bbBleCb.evtState = BB_EVT_STATE_TX_CHAIN_IND; + bbBleCb.bbParam.due = pAuxAdv->auxReqStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pAuxAdv->auxRxPhyOptions, LL_ADV_HDR_LEN + LL_SCAN_REQ_PDU_LEN )) + + BB_US_TO_BB_TICKS(LL_BLE_TIFS_US); + bodComplete = bbSlvAdvSetupTxAuxChainInd(pCur, pAuxAdv); + BB_INC_STAT(bbAuxAdvStats.txRsp); + break; + + case BB_EVT_STATE_TX_CHAIN_IND: + /* bbBleCb.evtState = BB_EVT_STATE_TX_CHAIN_IND; */ /* Same state. */ + bodComplete = bbSlvAdvSetupTxAuxChainInd(pCur, pAuxAdv); + BB_INC_STAT(bbAuxAdvStats.txChain); + break; + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + /* Tx may fail; no more important statements in the !bodComplete code path */ + +Cleanup: + + if (bodComplete) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); + } + + BB_ISR_MARK(bbAuxAdvStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for auxiliary advertising slave operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvAuxAdvRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + bool_t bodComplete = FALSE; + + BB_ISR_START(); + WSF_ASSERT(BbGetCurrentBod()); + + switch (bbBleCb.evtState++) + { + case BB_EVT_STATE_RX_SCAN_OR_CONN_REQ: + switch (status) + { + case BB_STATUS_SUCCESS: + WSF_ASSERT(pAuxAdv->rxAuxReqCback); + WSF_ASSERT(pAuxAdv->pRxAuxReqBuf); + + pAuxAdv->auxReqStartTs = timestamp; + pAuxAdv->auxRxPhyOptions = rxPhyOptions; + + if (pAuxAdv->rxAuxReqCback(pCur, pAuxAdv->pRxAuxReqBuf)) + { + BB_ISR_MARK(bbAuxAdvStats.txSetupUsec); + + bbBleClrIfs(); /* last operation in event */ + BbBleDrvTxTifsData(pAuxAdv->txAuxRspPdu, 2); + + if (pAuxAdv->rxAuxReqPostCback) + { + pAuxAdv->rxAuxReqPostCback(pCur, pAuxAdv->pRxAuxReqBuf); + } + } + else + { + /* Operation completed. */ + bodComplete = TRUE; + } + break; + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_CRC_FAILED: + case BB_STATUS_FAILED: + default: + /* Operation completed. */ + bodComplete = TRUE; + break; + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbAuxAdvStats.rxReq); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbAuxAdvStats.rxReqTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbAuxAdvStats.rxReqCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbAuxAdvStats.errAdv); + break; + } + break; + + default: /* unexpected state */ + WSF_ASSERT(FALSE); + break; + } + + /* Tx may fail; no more important statements in the !bodComplete code path */ + + if (bodComplete) + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); + } + + BB_ISR_MARK(bbAuxAdvStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute auxiliary advertising slave BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecuteAuxAdvOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBod->prot.pBle->op.slvAuxAdv; + + bbBleCb.bbParam.txCback = bbSlvAuxAdvTxCompCback; + bbBleCb.bbParam.rxCback = bbSlvAuxAdvRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = 2 * LL_MAX_TIFS_DEVIATION; + bbBleCb.bbParam.dueOffsetUsec = 0; + + bbBleCb.advChIdx = 0; + bbBleCb.evtState = 0; + + if (BbGetBodTerminateFlag()) + { + /* Client terminated. */ + return; + } + + if (pAuxAdv->txAuxSetupCback) + { + /* AuxPtr offset return value not used for AUX_IND PDU. */ + pAuxAdv->txAuxSetupCback(pBod, FALSE); + } + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.due = pBod->due; + bbBleCb.evtState = BB_EVT_STATE_TX_ADV_IND; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + if (pAuxAdv->pRxAuxReqBuf) + { + /* Request expected (scannable or connectable operation). */ + bbBleSetIfs(); + } + else + { + /* CHAIN_IND (i.e. >=MAFS) expected or no request expected. */ + bbBleClrIfs(); + } + + BbBleDrvTxData(pAuxAdv->txAuxAdvPdu, 2); +} + +/*************************************************************************************************/ +/*! + * \brief Execute periodic advertising slave BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecutePerAdvOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBod->prot.pBle->op.slvPerAdv; + + bbBleCb.bbParam.txCback = bbSlvAuxAdvTxCompCback; + bbBleCb.bbParam.rxCback = bbSlvAuxAdvRxCompCback; + bbBleCb.bbParam.rxTimeoutUsec = 2 * LL_MAX_TIFS_DEVIATION; + bbBleCb.bbParam.dueOffsetUsec = 0; + + bbBleCb.advChIdx = 0; + bbBleCb.evtState = 0; + + if (BbGetBodTerminateFlag()) + { + /* Client terminated. */ + return; + } + + if (pAuxAdv->txAuxSetupCback) + { + /* AuxPtr offset return value not used for AUX_IND PDU. */ + pAuxAdv->txAuxSetupCback(pBod, FALSE); + } + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.due = pBod->due; + bbBleCb.evtState = BB_EVT_STATE_TX_ADV_IND; + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + if (pAuxAdv->pRxAuxReqBuf) + { + /* Request expected (scannable or connectable operation). */ + bbBleSetIfs(); + } + else + { + /* CHAIN_IND (i.e. >=MAFS) expected or no request expected. */ + bbBleClrIfs(); + } + + BbBleDrvTxData(pAuxAdv->txAuxAdvPdu, 2); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for advertising slave operations. + * + * \return None. + * + * Update the operation table with advertising slave operations routines. + */ +/*************************************************************************************************/ +void BbBleAuxAdvSlaveInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_SLV_AUX_ADV_EVENT, bbSlvExecuteAuxAdvOp, NULL); + bbBleRegisterOp(BB_BLE_OP_SLV_PER_ADV_EVENT, bbSlvExecutePerAdvOp, NULL); + memset(&bbAuxAdvStats, 0, sizeof(bbAuxAdvStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get auxiliary advertising packet statistics. + * + * \param pStats Auxiliary advertising statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetAuxAdvStats(BbBleAuxAdvPktStats_t *pStats) +{ + *pStats = bbAuxAdvStats; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..8c48b11a99211d975b3e95d4b13be749e121b5ac --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn.c @@ -0,0 +1,116 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Connectable BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_drv.h" +#include "bb_ble_int.h" + +#if BB_DATA_PLD_MAX_LEN < LL_MAX_DATA_LEN_MIN +#error "Unsupported BB_DATA_PLD_MAX_LEN value, must be greater than 27 bytes" +#endif + +#if BB_DATA_PLD_MAX_LEN > LL_MAX_DATA_LEN_ABS_MAX +#error "Unsupported BB_DATA_PLD_MAX_LEN value, must be less or equal to 251 bytes" +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +BbBleDataPktStats_t bbConnStats; /*!< Connection packet statistics. */ + +/*************************************************************************************************/ +/*! + * \brief Transmit data PDU at next transmit slot. + * + * \param descs Array of transmit buffer descriptor. + * \param cnt Number of descriptors. + * + * \return None. + * + * \note This function is expected to be called during the call context of + * \ref BbBleMstConnEvent_t::rxDataCback or \ref BbBleSlvConnEvent_t::rxDataCback + * callback routine. + */ +/*************************************************************************************************/ +void BbBleTxData(BbBleDrvTxBufDesc_t descs[], uint8_t cnt) +{ + if ((BbGetCurrentBod()->prot.pBle->chan.opType == BB_BLE_OP_MST_CONN_EVENT) && + (bbBleCb.evtState == 0)) + { + bbBleSetIfs(); /* master always Rx's after Tx */ + BbBleDrvTxData(descs, cnt); + } + else + { + BB_ISR_MARK(bbConnStats.txSetupUsec); + + /* TODO set only if master or if slave and Rx may follow in CE. */ + bbBleSetIfs(); + BbBleDrvTxTifsData(descs, cnt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set receive data buffer for next receive slot. + * + * \param pBuf Receive data buffer. + * \param len Maximum length of data buffer. + * + * \return None. + * + * \note This function is expected to be called during the call context of + * \ref BbBleMstConnEvent_t::rxDataCback or + * \ref BbBleSlvConnEvent_t::rxDataCback callback routine. + * + * \note BB must always call the \ref BbBleMstConnEvent_t::rxDataCback or + * \ref BbBleSlvConnEvent_t::rxDataCback callback routine of the + * currently executing BOD with the given buffer. + */ +/*************************************************************************************************/ +void BbBleRxData(uint8_t *pBuf, uint16_t len) +{ + WSF_ASSERT(!bbBleCb.pRxDataBuf); + + bbBleCb.pRxDataBuf = pBuf; + bbBleCb.rxDataLen = len; + + if ((BbGetCurrentBod()->prot.pBle->chan.opType == BB_BLE_OP_SLV_CONN_EVENT) && + (bbBleCb.evtState == 0)) + { + bbBleSetIfs(); /* slave always Tx's after Rx */ + BbBleDrvRxData(pBuf, len); + } +} + +/*************************************************************************************************/ +/*! + * \brief Get connection packet statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetConnStats(BbBleDataPktStats_t *pStats) +{ + *pStats = bbConnStats; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..9a17cb53143cc6beb6fc4d9fbec7b108d3f9a853 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_master.c @@ -0,0 +1,258 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Connectable master BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_drv.h" +#include "bb_ble_int.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern BbBleDataPktStats_t bbConnStats; /*!< Connection packet statistics. */ + +/*************************************************************************************************/ +/*! + * \brief Tx completion for connected master operation. + * + * \param status Transmission status + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstConnTxCompCback(uint8_t status) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleMstConnEvent_t * const pConn = &pCur->prot.pBle->op.mstConn; + uint8_t *pBuf; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + pConn->txDataCback(pCur, status); + + if (bbBleCb.pRxDataBuf && + (status == BB_STATUS_SUCCESS)) + { + BB_ISR_MARK(bbConnStats.rxSetupUsec); + + bbBleSetIfs(); /* TODO set only if Tx may follow in CE */ + BbBleDrvRxTifsData(bbBleCb.pRxDataBuf, bbBleCb.rxDataLen); + } + else + { + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BbBleDrvCancelTifs(); + break; + case BB_STATUS_FAILED: + default: + /* Free Rx data buffer before BOD end. */ + if (bbBleCb.pRxDataBuf != NULL) /* buffer should always exist, but still check */ + { + pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + pConn->rxDataCback(pCur, pBuf, BB_STATUS_CANCELED); + } + break; + } + + BbTerminateBod(); + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbConnStats.txData); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbConnStats.errData); + break; + } + + BB_ISR_MARK(bbConnStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for connected master operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbMstConnRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleMstConnEvent_t * const pConn = &pCur->prot.pBle->op.mstConn; + uint8_t *pBuf; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + // Only update on successful reception + if(status == BB_STATUS_SUCCESS) { + pConn->rssi = rssi; + pConn->rxPhyOptions = rxPhyOptions; + } + + if (bbBleCb.evtState == 0) + { + bbBleCb.evtState = 1; + } + + WSF_ASSERT(bbBleCb.pRxDataBuf); + pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + + /* Set Tx buffer or BOD cancel expected to be called during this routine. */ + pConn->rxDataCback(pCur, pBuf, status); + + if (BbGetBodTerminateFlag()) + { + WSF_ASSERT(!bbBleCb.pRxDataBuf); + + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); /* auto terminated on missed; just end */ + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbConnStats.rxData); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbConnStats.rxDataTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbConnStats.rxDataCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbConnStats.errData); + break; + } + + BB_ISR_MARK(bbConnStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute connectable master BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbMstExecuteConnOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleDrvSetChannelParam(&pBle->chan); + + WSF_ASSERT(pBle->op.mstConn.txDataCback); + WSF_ASSERT(pBle->op.mstConn.rxDataCback); + + bbBleCb.bbParam.txCback = bbMstConnTxCompCback; + bbBleCb.bbParam.rxCback = bbMstConnRxCompCback; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + bbBleCb.bbParam.rxTimeoutUsec = 2 * LL_MAX_TIFS_DEVIATION; + + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = 0; + + pBle->op.mstConn.execCback(pBod); +} + +/*************************************************************************************************/ +/*! + * \brief Cancel connectable master BOD. + * + * \param pBod Pointer to the BOD to cancel. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbMstCancelConnOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + WSF_ASSERT(pBod && pBle); + WSF_ASSERT(pBle->op.mstConn.rxDataCback); + + BbBleDrvCancelData(); + + if (bbBleCb.pRxDataBuf) + { + uint8_t *pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + + /* Buffer free expected to be called during this routine. */ + pBle->op.mstConn.rxDataCback(pBod, pBuf, BB_STATUS_CANCELED); + } + + pBle->op.mstConn.cancelCback(pBod); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for connectable master operations. + * + * \return None. + * + * Update the operation table with connectable master operations routines. + */ +/*************************************************************************************************/ +void BbBleConnMasterInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_MST_CONN_EVENT, bbMstExecuteConnOp, bbMstCancelConnOp); + + memset(&bbConnStats, 0, sizeof(bbConnStats)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..5e1e81058c2d7c94f7038e56582165f87fd10512 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_conn_slave.c @@ -0,0 +1,265 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Connectable slave BLE baseband porting implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_drv.h" +#include "bb_ble_int.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern BbBleDataPktStats_t bbConnStats; /*!< Connection packet statistics. */ + +/*************************************************************************************************/ +/*! + * \brief Tx completion for connected slave operation. + * + * \param status Transmission status + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvConnTxCompCback(uint8_t status) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleSlvConnEvent_t * const pConn = &pCur->prot.pBle->op.slvConn; + uint8_t *pBuf; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + pConn->txDataCback(pCur, status); + + if (status == BB_STATUS_SUCCESS) + { + if (bbBleCb.pRxDataBuf) + { + BB_ISR_MARK(bbConnStats.rxSetupUsec); + + bbBleSetIfs(); /* slave always Tx's after Rx */ + BbBleDrvRxTifsData(bbBleCb.pRxDataBuf, bbBleCb.rxDataLen); + } + else + { + /* Cancel TIFS timer if active. */ + BbBleDrvCancelTifs(); + + /* Tx completion is end of BOD. */ + BbTerminateBod(); + } + } + else + { + if (bbBleCb.pRxDataBuf != NULL) + { + pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + pConn->rxDataCback(pCur, pBuf, BB_STATUS_CANCELED); + } + + /* Tx failure is end of BOD. */ + BbTerminateBod(); + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbConnStats.txData); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbConnStats.errData); + break; + } + + BB_ISR_MARK(bbConnStats.txIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for connected slave operation. + * + * \param status Reception status. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Setup for next action in the operation or complete the operation. + */ +/*************************************************************************************************/ +static void bbSlvConnRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleSlvConnEvent_t * const pConn = &pCur->prot.pBle->op.slvConn; + uint8_t *pBuf; + + BB_ISR_START(); + + WSF_ASSERT(BbGetCurrentBod()); + + // Only update on successful reception + if(status == BB_STATUS_SUCCESS) { + pConn->rssi = rssi; + pConn->rxPhyOptions = rxPhyOptions; + } + + if (bbBleCb.evtState == 0) + { + bbBleCb.evtState = 1; + + pConn->startTs = timestamp; + + bbBleCb.bbParam.rxTimeoutUsec = 2 * LL_MAX_TIFS_DEVIATION; + } + + WSF_ASSERT(bbBleCb.pRxDataBuf); + + pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + + /* Set Tx buffer or BOD cancel expected to be called during this routine. */ + pConn->rxDataCback(pCur, pBuf, status); + + if (BbGetBodTerminateFlag()) + { + WSF_ASSERT(!bbBleCb.pRxDataBuf); + + /* Cancel TIFS timer if active. */ + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + BbBleDrvCancelTifs(); + break; + default: + break; + } + + BbTerminateBod(); + } + + /* Update statistics. */ + switch (status) + { + case BB_STATUS_SUCCESS: + BB_INC_STAT(bbConnStats.rxData); + break; + case BB_STATUS_RX_TIMEOUT: + BB_INC_STAT(bbConnStats.rxDataTimeout); + break; + case BB_STATUS_CRC_FAILED: + BB_INC_STAT(bbConnStats.rxDataCrc); + break; + case BB_STATUS_FAILED: + default: + BB_INC_STAT(bbConnStats.errData); + break; + } + + BB_ISR_MARK(bbConnStats.rxIsrUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Execute connectable slave BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecuteConnOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleSlvConnEvent_t * const pConn = &pBod->prot.pBle->op.slvConn; + + WSF_ASSERT(pConn->txDataCback); + WSF_ASSERT(pConn->rxDataCback); + + BbBleDrvSetChannelParam(&pBle->chan); + + bbBleCb.bbParam.txCback = bbSlvConnTxCompCback; + bbBleCb.bbParam.rxCback = bbSlvConnRxCompCback; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + bbBleCb.bbParam.rxTimeoutUsec = pConn->rxSyncDelayUsec; + + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleCb.evtState = 0; + + pBle->op.slvConn.execCback(pBod); +} + +/*************************************************************************************************/ +/*! + * \brief Cancel connectable slave BOD. + * + * \param pBod Pointer to the BOD to cancel. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvCancelConnOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + WSF_ASSERT(pBod && pBle); + WSF_ASSERT(pBle->op.slvConn.rxDataCback); + + BbBleDrvCancelData(); + + if (bbBleCb.pRxDataBuf) + { + uint8_t *pBuf = bbBleCb.pRxDataBuf; + bbBleCb.pRxDataBuf = NULL; + + /* Buffer free expected to be called during this routine. */ + pBle->op.slvConn.rxDataCback(pBod, pBuf, BB_STATUS_CANCELED); + } + + pBle->op.slvConn.cancelCback(pBod); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for connectable slave operations. + * + * \return None. + * + * Update the operation table with connectable slave operations routines. + */ +/*************************************************************************************************/ +void BbBleConnSlaveInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_SLV_CONN_EVENT, bbSlvExecuteConnOp, bbSlvCancelConnOp); + + memset(&bbConnStats, 0, sizeof(bbConnStats)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_int.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_int.h new file mode 100644 index 0000000000000000000000000000000000000000..5157125e0aa7fe764813008cda4fc5d9534bc824 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_int.h @@ -0,0 +1,126 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal BLE baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_INT_H +#define BB_BLE_INT_H + +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "bb_ble_drv.h" +#include "bb_drv.h" +#include "ll_defs.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "cfg_mac_ble.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum length of an advertising packet. */ +#define BB_ADVB_MAX_LEN WSF_MAX(BB_FIXED_ADVB_PKT_LEN, LL_ADVB_MAX_LEN) + +/*! \brief Mark the start of an ISR. */ +#define BB_ISR_START() bbIsrStartTime = BbDrvGetCurrentTime() + +/*! \brief Mark the ISR duration, recording the high watermark. */ +#define BB_ISR_MARK(x) x = WSF_MAX(x, BB_TICKS_TO_US(BbDrvGetCurrentTime() - bbIsrStartTime)) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Execution operation function. */ +typedef void (*bbBleExecOpFn_t)(BbOpDesc_t *pBod, BbBleData_t *pBle); + +/*! \brief BB control block. */ +typedef struct +{ + struct + { + bbBleExecOpFn_t execOpCback; /*!< Execute operation handler. */ + bbBleExecOpFn_t cancelOpCback; /*!< Cancel operation handler. */ + } opCbacks[BB_BLE_OP_NUM]; /*!< Operation handlers. */ + + uint8_t evtState; /*!< Action state of the currently operating BOD. */ + uint8_t advChIdx; /*!< Current advertising channel index. */ + uint32_t lastScanStart; /*!< Last scan start time. */ + + BbBleDrvDataParam_t bbParam; /*!< Baseband data parameters. */ + + uint16_t rxDataLen; /*!< Receive data buffer length. */ + uint8_t *pRxDataBuf; /*!< Current Rx data buffer. */ +} bbBleCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern bbBleCtrlBlk_t bbBleCb; + +/* ISR start time. */ +extern uint32_t bbIsrStartTime; + +/*************************************************************************************************/ +/*! + * \brief Register operation handlers. + * + * \param opType Operation type. + * \param execOpCback Execute operation callback. + * \param cancelOpCback Cancel operation callback. + * + * \return None. + */ +/*************************************************************************************************/ +void bbBleRegisterOp(uint8_t opType, bbBleExecOpFn_t execOpCback, bbBleExecOpFn_t cancelOpCback); + +#ifdef __cplusplus +}; +#endif + +/*************************************************************************************************/ +/*! + * \brief Clear IFS in operation. + * + * \return None. + * + * The BB may choose not to enable IFS after the next Tx or Rx. + */ +/*************************************************************************************************/ +void bbBleClrIfs(void); + +/*************************************************************************************************/ +/*! + * \brief Set IFS in operation. + * + * \return None. + * + * The BB must enable IFS after the next Tx or Rx. + */ +/*************************************************************************************************/ +void bbBleSetIfs(void); + +#endif /* BB_BLE_INT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_main.c new file mode 100644 index 0000000000000000000000000000000000000000..263f16e2c049d974844b6941db02092312f5c1a1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_main.c @@ -0,0 +1,213 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE baseband driver implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_ble_int.h" +#include "bb_ble_drv.h" +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +bbBleCtrlBlk_t bbBleCb; /*!< BB BLE control block. */ + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of BLE protocol. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleStartBle(void) +{ + BbBleDrvEnable(); + BbBleDrvEnableDataWhitening(TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of BLE protocol. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleStopBle(void) +{ + BbBleDrvDisable(); +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of BLE DTM protocol. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleStartBleDtm(void) +{ + BbBleDrvEnable(); + BbBleDrvEnableDataWhitening(FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of PRBS15 protocol. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleStartPrbs15(void) +{ + BbBleDrvEnable(); + BbBleDrvEnableDataWhitening(FALSE); + BbBleDrvEnablePrbs15(TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of PRBS15 protocol. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleStopPrbs15(void) +{ + BbBleDrvDisable(); + BbBleDrvEnablePrbs15(FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Execute operation. + * + * \param pBod Pointer to the BOD to execute. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleExecOp(BbOpDesc_t *pBod) +{ + BbBleData_t * const pBle = pBod->prot.pBle; + + WSF_ASSERT(pBle->chan.opType < BB_BLE_OP_NUM); + + if (bbBleCb.opCbacks[pBle->chan.opType].execOpCback) + { + bbBleCb.opCbacks[pBle->chan.opType].execOpCback(pBod, pBle); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cancel operation. + * + * \param pBod Pointer to the BOD to cancel. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbBleCancelOp(BbOpDesc_t *pBod) +{ + BbBleData_t * const pBle = pBod->prot.pBle; + + WSF_ASSERT(pBle->chan.opType < BB_BLE_OP_NUM); + + if (bbBleCb.opCbacks[pBle->chan.opType].cancelOpCback) + { + bbBleCb.opCbacks[pBle->chan.opType].cancelOpCback(pBod, pBle); + } +} +/*************************************************************************************************/ +/*! + * \brief Initialize the BLE BB. + * + * \return None. + * + * Initialize baseband resources. + */ +/*************************************************************************************************/ +void BbBleInit(void) +{ + BbBleDrvInit(); + BbRegisterProt(BB_PROT_BLE, bbBleExecOp, bbBleCancelOp, bbBleStartBle, bbBleStopBle); + BbRegisterProt(BB_PROT_BLE_DTM, bbBleExecOp, bbBleCancelOp, bbBleStartBleDtm, bbBleStopBle); + BbRegisterProt(BB_PROT_PRBS15, NULL, bbBleCancelOp, bbBleStartPrbs15, bbBleStopPrbs15); + + memset(&bbBleCb, 0, sizeof(bbBleCb)); +} + +/*************************************************************************************************/ +/*! + * \brief Register operation handlers. + * + * \param opType Operation type. + * \param execOpCback Execute operation callback. + * \param cancelOpCback Cancel operation callback. + * + * \return None. + */ +/*************************************************************************************************/ +void bbBleRegisterOp(uint8_t opType, bbBleExecOpFn_t execOpCback, bbBleExecOpFn_t cancelOpCback) +{ + bbBleCb.opCbacks[opType].execOpCback = execOpCback; + bbBleCb.opCbacks[opType].cancelOpCback = cancelOpCback; +} + + +/*************************************************************************************************/ +/*! + * \brief Clear IFS in operation. + * + * \return None. + * + * The BB may choose not to enable IFS after the next Tx or Rx. + */ +/*************************************************************************************************/ +void bbBleClrIfs(void) +{ + BbBleDrvOpParam_t opParams; + opParams.ifsSetup = FALSE; + opParams.ifsUsec = 0; + BbBleDrvSetOpParams(&opParams); +} + +/*************************************************************************************************/ +/*! + * \brief Set IFS in operation. + * + * \return None. + * + * The BB must enable IFS after the next Tx or Rx. + */ +/*************************************************************************************************/ +void bbBleSetIfs(void) +{ + BbBleDrvOpParam_t opParams; + opParams.ifsSetup = TRUE; + opParams.ifsUsec = LL_BLE_TIFS_US; + BbBleDrvSetOpParams(&opParams); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_test.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_test.c new file mode 100644 index 0000000000000000000000000000000000000000..91cc695b5fd606121d6d532c76af2525bc7d2aa6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/bb/bb_ble_test.c @@ -0,0 +1,284 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE baseband driver implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_ble_int.h" +#include "ll_math.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +BbBleDataPktStats_t bbTestStats; /*!< Test data packet statistics. */ +extern BbRtCfg_t *pBbRtCfg; + +/*************************************************************************************************/ +/*! + * \brief Tx completion for transmit test mode. + * + * \param status Completion status. + * + * \return None. + * + * Completion handler for the BLE transmit test operation. + */ +/*************************************************************************************************/ +static void bbTestTxCompCback(uint8_t status) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleTestTx_t * const pTx = &pBle->op.testTx; + bool_t bodComplete = FALSE; + BbBleDrvTxBufDesc_t desc; + + WSF_ASSERT(BbGetCurrentBod()); + + switch (status) + { + case BB_STATUS_SUCCESS: + bodComplete = !pTx->testCback(pCur, status); + break; + + case BB_STATUS_FAILED: + default: + (void)pTx->testCback(pCur, status); + bodComplete = TRUE; + break; + } + + if (bodComplete) + { + BbTerminateBod(); + } + else + { + const uint32_t pktInterUsec = pTx->pktInterUsec + bbBleCb.bbParam.dueOffsetUsec; + const uint32_t pktInter = BB_US_TO_BB_TICKS(pktInterUsec); + int16_t dueOffsetUsec = pktInterUsec - BB_TICKS_TO_US(pktInter); + + BbBleDrvCancelTifs(); + + bbBleCb.bbParam.due = bbBleCb.bbParam.due + pktInter; + bbBleCb.bbParam.dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + BbBleDrvSetChannelParam(&pBle->chan); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleClrIfs(); /* never setup for TIFS */ + desc.pBuf = pTx->pTxBuf; + desc.len = pTx->txLen; + BbBleDrvTxData(&desc, 1); + } + + switch (status) + { + case BB_STATUS_SUCCESS: + bbTestStats.txData++; + break; + case BB_STATUS_FAILED: + default: + bbTestStats.errData++; + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Rx completion for continuous receive test mode. + * + * \param status Completed receive buffer. + * \param rssi RSSI value. + * \param crc CRC value. + * \param timestamp Start of packet timestamp. + * \param rxPhyOptions Rx PHY options. + * + * \return None. + * + * Completion handler for the BLE receive test operation. + */ +/*************************************************************************************************/ +static void bbTestRxCompCback(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions) +{ + BbOpDesc_t * const pCur = BbGetCurrentBod(); + BbBleData_t * const pBle = pCur->prot.pBle; + BbBleTestRx_t * const pRx = &pBle->op.testRx; + bool_t bodComplete = FALSE; + uint32_t pktInterUsec, pktInter; + int16_t dueOffsetUsec; + + WSF_ASSERT(BbGetCurrentBod()); + + switch (status) + { + case BB_STATUS_SUCCESS: + case BB_STATUS_CRC_FAILED: + bodComplete = !pRx->testCback(pCur, status); + break; + + case BB_STATUS_RX_TIMEOUT: + case BB_STATUS_FAILED: + default: + (void)pRx->testCback(pCur, status); + bodComplete = TRUE; + break; + } + + if (bodComplete) + { + BbTerminateBod(); + } + else + { + BbBleDrvCancelTifs(); + + pktInterUsec = pBbRtCfg->rfSetupDelayUs; + pktInter = BB_US_TO_BB_TICKS(pktInterUsec); + dueOffsetUsec = pktInterUsec - BB_TICKS_TO_US(pktInter); + + bbBleCb.bbParam.due = BbDrvGetCurrentTime() + pktInter; + bbBleCb.bbParam.dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + bbBleCb.bbParam.rxTimeoutUsec = pRx->rxSyncDelayUsec; + BbBleDrvSetChannelParam(&pBle->chan); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleClrIfs(); /* never setup for TIFS */ + BbBleDrvRxData(pRx->pRxBuf, pRx->rxLen); + } + + switch (status) + { + case BB_STATUS_SUCCESS: + bbTestStats.rxData++; + break; + case BB_STATUS_RX_TIMEOUT: + bbTestStats.rxDataTimeout++; + break; + case BB_STATUS_CRC_FAILED: + bbTestStats.rxDataCrc++; + break; + case BB_STATUS_FAILED: + default: + bbTestStats.errData++; + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup test BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbTestCleanupOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleDrvCancelData(); + BbTerminateBod(); +} + +/*************************************************************************************************/ +/*! + * \brief Execute direct test mode transmit BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecuteTestTxOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleDrvTxBufDesc_t desc; + BbBleTestTx_t *pTx = &pBle->op.testTx; + + bbBleCb.bbParam.txCback = bbTestTxCompCback; + bbBleCb.bbParam.rxCback = bbTestRxCompCback; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + + BbBleDrvSetChannelParam(&pBle->chan); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleClrIfs(); /* never setup for TIFS */ + desc.pBuf = pTx->pTxBuf; + desc.len = pTx->txLen; + BbBleDrvTxData(&desc, 1); +} + +/*************************************************************************************************/ +/*! + * \brief Execute direct test mode receive BOD. + * + * \param pBod Pointer to the BOD to execute. + * \param pBle BLE operation parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbSlvExecuteTestRxOp(BbOpDesc_t *pBod, BbBleData_t *pBle) +{ + BbBleTestRx_t *pRx = &pBle->op.testRx; + + bbBleCb.bbParam.txCback = bbTestTxCompCback; + bbBleCb.bbParam.rxCback = bbTestRxCompCback; + bbBleCb.bbParam.due = pBod->due; + bbBleCb.bbParam.dueOffsetUsec = pBod->dueOffsetUsec; + bbBleCb.bbParam.rxTimeoutUsec = pRx->rxSyncDelayUsec; + + BbBleDrvSetChannelParam(&pBle->chan); + BbBleDrvSetDataParams(&bbBleCb.bbParam); + + bbBleClrIfs(); /* never setup for TIFS */ + BbBleDrvRxData(pRx->pRxBuf, pRx->rxLen); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize for direct test mode operations. + * + * \return None. + * + * Update the operation table with direct test mode operations routines. + */ +/*************************************************************************************************/ +void BbBleTestInit(void) +{ + bbBleRegisterOp(BB_BLE_OP_TEST_TX, bbSlvExecuteTestTxOp, bbTestCleanupOp); + bbBleRegisterOp(BB_BLE_OP_TEST_RX, bbSlvExecuteTestRxOp, bbTestCleanupOp); + + memset(&bbTestStats, 0, sizeof(bbTestStats)); +} + +/*************************************************************************************************/ +/*! + * \brief Get test mode packet statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetTestStats(BbBleDataPktStats_t *pStats) +{ + *pStats = bbTestStats; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api.h new file mode 100644 index 0000000000000000000000000000000000000000..5c9faa4da9d5e1e9bf288888cdaf8cbca8ac9bed --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api.h @@ -0,0 +1,167 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller common interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_H +#define LCTR_API_H + +#include "ll_api.h" +#include "ll_defs.h" +#include "bb_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Message dispatch handler types. */ +enum +{ + LCTR_DISP_CONN_IND, /*!< Advertising channel connection indication dispatch handler type. */ + LCTR_DISP_CONN, /*!< Connection message dispatch handler type. */ + LCTR_DISP_SCAN, /*!< Scan message dispatch handler type. */ + LCTR_DISP_INIT, /*!< Initiate message dispatch handler type. */ + LCTR_DISP_ADV, /*!< Advertising message dispatch handler type. */ + LCTR_DISP_TEST, /*!< Test message dispatch handler type. */ + LCTR_DISP_PRIV, /*!< Privacy message dispatch handler type. */ + LCTR_DISP_EXT_SCAN, /*!< Extended Scan message dispatch handler type. */ + LCTR_DISP_EXT_ADV, /*!< Extended Advertising message dispatch handler type. */ + LCTR_DISP_EXT_INIT, /*!< Extended Initiate message dispatch handler type. */ + LCTR_DISP_PER_ADV, /*!< Periodic Advertising message dispatch handler type. */ + LCTR_DISP_PER_CREATE_SYNC, /*!< Periodic Create Sync message dispatch handler type. */ + LCTR_DISP_PER_SCAN, /*!< Periodic Scanning message dispatch handler type. */ + LCTR_DISP_TOTAL, /*!< Total number of dispatch handlers. */ + /* Special IDs */ + LCTR_DISP_FIRST_SM = LCTR_DISP_CONN_IND+1, /*!< First state machine. */ + LCTR_DISP_LAST_SM = LCTR_DISP_TOTAL-1, /*!< Last state machine. */ + LCTR_DISP_BCST = 0xFF /*!< Broadcast message type. */ +}; + +/*! \brief Broadcast task messages. */ +enum +{ + LCTR_MSG_RESET /*!< Reset API message. */ +}; + +/*! \brief Task event mask bit positions. */ +enum +{ + LCTR_EVENT_RX_PENDING, /*!< Receive data PDU pending. */ + LCTR_EVENT_TX_PENDING, /*!< Transmit data PDU pending. */ + LCTR_EVENT_TX_COMPLETE, /*!< Transmit data PDU completed. */ + LCTR_EVENT_RX_ADVB, /*!< Receive AdvB PDU completed. */ + LCTR_EVENT_RX_DIRECT_ADVB, /*!< Receive direct AdvB PDU completed. */ + LCTR_EVENT_RX_SCAN_REQ, /*!< Receive scan request PDU completed. */ + LCTR_EVENT_SC_GENERATE_P256_KEY_PAIR, /*!< Generate P-256 public/private key pair. */ + LCTR_EVENT_SC_GENERATE_DHKEY, /*!< Generate Diffie-Hellman key. */ + LCTR_EVENT_TOTAL /*!< Total number of event handlers. */ +}; + +/*! \brief Waiting host reply bitmask. */ +enum +{ + LCTR_HOST_REPLY_CONN_PARAM_REQ = (1 << 0), /*!< Waiting for host to submit a connection parameter request reply. */ + LCTR_HOST_REPLY_LTK_REQ = (1 << 1) /*!< Waiting for host to submit a LTK request reply. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Common message structure passed to event handler. */ +typedef struct +{ + uint16_t handle; /*!< Handle. */ + uint8_t dispId; /*!< Dispatch ID. */ + uint8_t event; /*!< PDU ID. */ +} lctrMsgHdr_t; + +/*! \brief Connect request PDU. */ +typedef struct +{ + uint64_t initAddr; /*!< Scanner's address. */ + uint64_t advAddr; /*!< Advertiser's address. */ + + uint32_t accessAddr; /*!< Connection access address. */ + uint32_t crcInit; /*!< CRC initialization value. */ + uint64_t chanMask; /*!< Channel mask. */ + uint16_t interval; /*!< connInterval value. */ + uint16_t latency; /*!< connSlaveLatency value. */ + uint16_t timeout; /*!< connSupervisionTimeout value. */ + uint8_t txWinSize; /*!< transmitWindowSize value. */ + uint16_t txWinOffset; /*!< transmitWindowOffset value. */ + uint8_t hopInc; /*!< hopIncrement value. */ + uint8_t masterSca; /*!< Master sleep clock accuracy. */ +} lctrConnInd_t; + +/*! \brief Connection establish. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrConnInd_t connInd; /*!< Connection indication. */ + uint32_t connIndEndTs; /*!< Connection indication packet end timestamp. */ + uint8_t peerIdAddrType; /*!< Peer identity address type. */ + uint8_t usedChSel; /*!< Used channel selection. */ + uint8_t phy; /*!< PHY selection. */ + bool_t sendAdvSetTerm; /*!< Send Advertising Set Termination event. */ + uint8_t numExtAdvEvents; /*!< Number of completed extended advertising events. */ + bool_t isAuxConnReq; /*!< True if AUX_CON_REQ is received, False if CONN_IND is received. */ + uint64_t peerIdAddr; /*!< Peer identity address. */ + uint64_t peerRpa; /*!< Peer RPA. */ + uint64_t localRpa; /*!< Local RPA. */ +} lctrConnEstablish_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Runtime configuration. */ +extern const LlRtCfg_t *pLctrRtCfg; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +uint16_t LctrInitAdvSetMem(uint8_t *pFreeMem, uint32_t freeMemSize); +uint16_t LctrInitExtScanMem(uint8_t *pFreeMem, uint32_t freeMemSize); +uint16_t LctrInitConnMem(uint8_t *pFreeMem, uint32_t freeMemSize); +void LctrSetSupStates(void); + +/* Task */ +void LctrMsgDispatcher(lctrMsgHdr_t *pMsg); +void LctrEventHandler(uint8_t event); + +/*! \} */ /* LL_LCTR_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master.h new file mode 100644 index 0000000000000000000000000000000000000000..fa1c35290c6350f8e2ecbffc88450f10acd7f0b2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master.h @@ -0,0 +1,109 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_ADV_MASTER_H +#define LCTR_API_ADV_MASTER_H + +#include "lctr_api.h" +#include "lmgr_api_adv_master.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_ADV_MST + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master scan task messages for \a LCTR_DISP_SCAN dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_SCAN_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Scan events */ + LCTR_SCAN_MSG_DISCOVER_ENABLE, /*!< Scan enable API event. */ + LCTR_SCAN_MSG_DISCOVER_DISABLE, /*!< Scan disable API event. */ + LCTR_SCAN_MSG_TERMINATE, /*!< Scan BOD terminated event. */ + LCTR_SCAN_MSG_PARAM_UPD, /*!< Scan parameter update event. */ + LCTR_SCAN_MSG_TOTAL /*!< Total number of scan events. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Scan parameter message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lmgrScanParam_t param; /*!< Scan parameters. */ +} lctrScanParamMsg_t; + +/*! \brief Scan enable message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + bool_t filtDup; /*!< Filter out duplicate advertisers. */ +} lctrScanEnableMsg_t; + +/*! \brief Initiate message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LlConnSpec_t connSpec; /*!< Connection spec. */ + lmgrScanParam_t scanParam; /*!< Scan parameters. */ + uint64_t peerAddr; /*!< Peer address. */ + uint8_t peerAddrType; /*!< Peer address type. */ +} lctrInitiateMsg_t; + +/*! \brief Advertising report message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LlAdvReportInd_t rpt; /*!< Report data. */ + uint32_t hash; /*!< Event data hash. */ +} lctrAdvReportMsg_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrMstScanInit(void); +void LctrMstScanDefaults(void); + +/* Helpers */ +void lctrAdvReportsInc(void); +void lctrAdvReportsDec(void); + +/*! \} */ /* LL_LCTR_API_ADV_MST */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_ADV_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..7e0acba80dd45a4a2146dd26e33079ca79e4f6d8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_master_ae.h @@ -0,0 +1,171 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller extended scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_ADV_MASTER_AE_H +#define LCTR_API_ADV_MASTER_AE_H + +#include "lctr_api.h" +#include "lmgr_api_adv_master.h" +#include "wsf_assert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master scan and initiate task messages for \a LCTR_DISP_SCAN dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_EXT_SCAN_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Scan events */ + LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE, /*!< Scan enable API event. */ + LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE, /*!< Scan disable API event. */ + LCTR_EXT_SCAN_MSG_TERMINATE, /*!< Scan BOD terminated event. */ + LCTR_EXT_SCAN_MSG_TOTAL /*!< Total number of scan events. */ +}; + +/*! \brief Scanner create sync task messages for \a LCTR_DISP_PER_CREATE_SYNC dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_CREATE_SYNC_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Advertising events */ + LCTR_CREATE_SYNC_MSG_CREATE, /*!< Create sync create API event. */ + LCTR_CREATE_SYNC_MSG_CANCEL, /*!< Create sync cancel sync API event. */ + LCTR_CREATE_SYNC_MSG_DONE, /*!< Create sync done event. */ + LCTR_CREATE_SYNC_MSG_TERMINATE, /*!< Create sync scanning BOD terminate event. */ + LCTR_CREATE_SYNC_MSG_TOTAL /*!< Total number of Create sync events. */ + +}; + +/*! \brief Scanner periodic synchronous task messages for \a LCTR_DISP_PER_SCAN dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_PER_SCAN_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Advertising events */ + LCTR_PER_SCAN_MSG_SYNC_ESTD, /*!< Periodic scanning synchronous established event. */ + LCTR_PER_SCAN_MSG_TERMINATE, /*!< Periodic scanning terminate API event. */ + LCTR_PER_SCAN_MSG_TERMINATE_DONE, /*!< Periodic scanning terminate done event. */ + LCTR_PER_SCAN_SUP_TIMEOUT, /*!< Periodic synchronous supervision timeout event. */ + LCTR_PER_SCAN_MSG_TOTAL /*!< Total number of periodic scanning events. */ + +}; + +/*! \brief Scan PHYs. */ +enum +{ + LCTR_SCAN_PHY_1M, /*!< LE 1M PHY scanner. */ + LCTR_INIT_PHY_2M, /*!< LE 2M PHY initiator (not valid for scanning). */ + LCTR_SCAN_PHY_CODED, /*!< LE Coded PHY scanner. */ + LCTR_SCAN_PHY_TOTAL, /*!< Total number of scanning PHYs. */ + LCTR_SCAN_PHY_ALL = 0xFF /*!< All PHY scanners. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended scan enable message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t filtDup; /*!< Filter out duplicate advertisers. */ + uint32_t durMs; /*!< Duration in milliseconds. */ + uint32_t perMs; /*!< Period in milliseconds. */ +} lctrExtScanEnableMsg_t; + +/*! \brief Extended initiate message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t filterPolicy; /*!< Scan filter policy. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t peerAddrType; /*!< Address type used for peer device. */ + uint64_t peerAddr; /*!< Address of peer device. */ + uint8_t initPhys; /*!< Initiating PHYs. */ +} lctrExtInitiateMsg_t; + +/*! \brief Extended scan message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrExtScanEnableMsg_t enable; /*!< Extended scan enable message data. */ + lctrExtInitiateMsg_t init; /*!< Extended initiate message data. */ +} LctrExtScanMsg_t; + +/*! \brief Periodic create sync message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t filterPolicy; /*!< Filter Policy. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint64_t advAddr; /*!< Advertiser Address. */ + uint16_t skip; /*!< Skip. */ + uint16_t syncTimeOut; /*!< Synchronization Timeout. */ +} lctrPerCreateSyncMsg_t; + +/*! \brief Periodic Advertising message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrPerCreateSyncMsg_t createSync; /*!< Periodic create sync message data. */ +} LctrPerScanMsg_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Periodic scan message data. */ +extern LctrPerScanMsg_t *pLctrMstPerScanMsg; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrMstExtScanInit(void); +void LctrMstExtScanDefaults(void); +void LctrMstPerCreateSyncInit(void); +void LctrMstPerScanInit(void); + +/* Status */ +bool_t LctrMstExtScanValidateParam(void); + +/* Control */ +void LctrMstExtScanSetScanPhy(uint8_t scanPhy); +void LctrMstExtScanClearScanPhy(uint8_t scanPhy); +void LctrMstExtScanSetParam(uint8_t scanPhy, uint8_t ownAddrType, uint8_t scanFiltPolicy, const LlExtScanParam_t *pParam); +bool_t LctrMstPerIsSyncPending(void); +bool_t LctrMstPerIsSyncDisabled(void); +bool_t LctrMstPerIsSync(uint8_t advSID, uint8_t advAddrType, uint64_t advAddr); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_ADV_MASTER_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave.h new file mode 100644 index 0000000000000000000000000000000000000000..1c52b8367c64e62ca32792b3b00527adc9d0c0ee --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller advertising slave interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_ADV_SLAVE_H +#define LCTR_API_ADV_SLAVE_H + +#include "lctr_api.h" +#include "lmgr_api_adv_slave.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_ADV_SLV + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Slave advertising task messages for \a LCTR_DISP_ADV dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_ADV_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Advertising events */ + LCTR_ADV_MSG_START, /*!< Advertising start API event. */ + LCTR_ADV_MSG_STOP, /*!< Advertising stop API event. */ + LCTR_ADV_MSG_INT_START, /*!< Advertising start internal event. */ + LCTR_ADV_MSG_TERMINATE, /*!< Advertising BOD terminated event. */ + LCTR_ADV_MSG_PARAM_UPD, /*!< Advertising parameter update event. */ + LCTR_ADV_MSG_TOTAL /*!< Total number of advertising events. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising parameter message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lmgrAdvParam_t param; /*!< Advertising parameters. */ +} lctrAdvParamMsg_t; + +/*! \brief Link layer controller advertising message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrAdvParamMsg_t advParamUpd; /*!< Advertising parameter update. */ +} LctrAdvMsg_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrSlvAdvInit(void); +void LctrSlvAdvDefaults(void); + +/*! \} */ /* LL_LCTR_API_ADV_SLV */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_ADV_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..18005b27892c88e879d6aae05ba901d8b3a4d0cd --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_adv_slave_ae.h @@ -0,0 +1,131 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller extended advertising slave interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_ADV_SLAVE_AE_H +#define LCTR_API_ADV_SLAVE_AE_H + +#include "lctr_api.h" +#include "lmgr_api_adv_slave_ae.h" +#include "cfg_mac_ble.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Slave extended advertising task messages for \a LCTR_DISP_EXT_ADV dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_EXT_ADV_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Advertising events */ + LCTR_EXT_ADV_MSG_START, /*!< Extended advertising start API event. */ + LCTR_EXT_ADV_MSG_STOP, /*!< Extended advertising stop API event. */ + LCTR_EXT_ADV_MSG_INT_START, /*!< Extended advertising start internal event. */ // TODO not needed + LCTR_EXT_ADV_MSG_TERMINATE, /*!< Extended advertising BOD terminated event. */ + LCTR_EXT_ADV_MSG_TMR_DUR_EXP, /*!< Extended advertising duration timer expired event. */ + LCTR_EXT_ADV_MSG_TOTAL /*!< Total number of extended advertising events. */ +}; + +/*! \brief Slave periodic advertising task messages for \a LCTR_DISP_PER_ADV dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_PER_ADV_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Advertising events */ + LCTR_PER_ADV_MSG_START, /*!< Periodic advertising start API event. */ + LCTR_PER_ADV_MSG_STOP, /*!< Periodic advertising stop API event. */ + LCTR_PER_ADV_MSG_TERMINATE, /*!< Periodic advertising BOD terminated event. */ + LCTR_PER_ADV_MSG_TOTAL /*!< Total number of periodic advertising events. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended Advertising enable message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint32_t durMs; /*!< Duration in milliseconds. */ + uint8_t maxEvents; /*!< Maximum number of extended advertising events. */ +} LctrExtAdvEnableMsg_t; + +/*! \brief Periodic Advertising enable message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ +} LctrPerAdvEnableMsg_t; + +/*! \brief Extended Advertising message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LctrExtAdvEnableMsg_t enable; /*!< Enable message data. */ +} LctrExtAdvMsg_t; + +/*! \brief Periodic Advertising message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LctrPerAdvEnableMsg_t perEnable; /*!< Periodic enable message data. */ +} LctrPerAdvMsg_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrSlvExtAdvInit(void); +void LctrSlvExtAdvDefaults(void); +void LctrSlvPeriodicAdvInit(void); + +/* Status */ +uint8_t LctrIsExtAdvEnableParamValid(uint8_t enable, LlExtAdvEnableParam_t *pEnaParam); +uint8_t LctrIsExtAdvEnableReady(uint8_t handle); +bool_t LctrIsAdvHandleValid(uint8_t handle); +uint8_t LctrGetExtAdvTxPowerLevel(uint16_t handle, int8_t *pLevel); + +/* Control */ +uint8_t LctrGetAdvHandles(uint8_t pHandles[LL_MAX_ADV_SETS]); +uint8_t LctrSetExtAdvSetRandAddr(uint8_t handle, const uint8_t *pAddr); +uint8_t LctrGetExtAdvSetRandAddr(uint8_t handle, uint8_t *pAddr); +uint8_t LctrSetExtAdvParam(uint8_t handle, LlExtAdvParam_t *pExtAdvParam); +uint8_t LctrSetExtAdvData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); +uint8_t LctrSetExtScanRespData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); +uint8_t LctrRemoveAdvSet(uint8_t handle); +uint8_t LctrClearAdvSets(void); +uint8_t LctrSetAuxOffsetDelay(uint8_t handle, uint32_t delayUsec); +uint8_t LctrSetExtAdvDataFragLen(uint8_t handle, uint8_t fragLen); +uint8_t LctrSetExtAdvTxPhyOptions(uint8_t handle, uint8_t priPhyOpts, uint8_t secPhyOpts); +uint8_t LctrSetPeriodicAdvParam(uint8_t handle, LlPerAdvParam_t *pPerAdvParam); +void LctrSetPeriodicAdvEnable(uint8_t handle, bool_t enable); +uint8_t LctrSetPeriodicAdvData(uint8_t handle, uint8_t op, uint8_t len, const uint8_t *pData); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_ADV_SLAVE_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn.h new file mode 100644 index 0000000000000000000000000000000000000000..2805ccc1bbf6b81d449ebb4681a5ee86b7f9a5d9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn.h @@ -0,0 +1,286 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_CONN_H +#define LCTR_API_CONN_H + +#include "lctr_api.h" +#include "bb_ble_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_CONN + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Data channel PDU length (header + payload + MIC). */ +#define LCTR_DATA_PDU_LEN(len) ((len) + LL_DATA_HDR_LEN + BB_DATA_PDU_TAILROOM) + +/*! \brief Maximum data channel PDU length (header + payload + MIC). */ +#define LCTR_DATA_PDU_MAX_LEN LCTR_DATA_PDU_LEN(BB_DATA_PLD_MAX_LEN) + +/*! \brief Minimum data channel PDU length (header + payload + MIC). */ +#define LCTR_DATA_PDU_MIN_LEN LCTR_DATA_PDU_LEN(LL_MAX_DATA_LEN_MIN) + +/*! \brief Maximum value for maximum Data PDU length (spec limit is 251) */ +#define LCTR_MAX_DATA_LEN_MAX BB_DATA_PLD_MAX_LEN + +/*! \brief Connected task messages for \a LCTR_DISP_CONN dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_CONN_MSG_RESET = LCTR_MSG_RESET, + /* Receive remote PDU events */ + _LCTR_CONN_MSG_RX_EVENTS = 10, + LCTR_CONN_MSG_RX_CONNECT_IND, /*!< Connect indication received. */ + LCTR_CONN_MSG_RX_LLCP, /*!< LLCP message received. */ + LCTR_CONN_MSG_RX_LLCP_UNKNOWN, /*!< Unknown LLCP message received. */ + LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM, /*!< LLCP message with invalid parameter received. */ + /* Host/API events */ + _LCTR_CONN_MSG_API_EVENTS = 20, + LCTR_CONN_MSG_API_CONN_UPDATE, /*!< Connection update API event. */ + LCTR_CONN_MSG_API_CHAN_MAP_UPDATE, /*!< Channel map update API event. */ + LCTR_CONN_MSG_API_DISCONNECT, /*!< Disconnect API event. */ + LCTR_CONN_MSG_API_START_ENC, /*!< Start encryption API event. */ + LCTR_CONN_MSG_API_LTK_REPLY, /*!< LTK reply. */ + LCTR_CONN_MSG_API_LTK_NEG_REPLY, /*!< LTK negative reply. */ + LCTR_CONN_MSG_API_REMOTE_FEATURE, /*!< Read remote feature API event. */ + LCTR_CONN_MSG_API_REMOTE_VERSION, /*!< Read remote version API event. */ + LCTR_CONN_MSG_API_CONN_PARAM_REPLY, /*!< Remote connection parameter request reply API event. */ + LCTR_CONN_MSG_API_CONN_PARAM_NEG_REPLY,/*!< Remote connection parameter request negative reply API event. */ + LCTR_CONN_MSG_API_DATA_LEN_CHANGE, /*!< Data length change API event. */ + LCTR_CONN_MSG_API_PHY_UPDATE, /*!< PHY update API event. */ + LCTR_CONN_MSG_API_SET_MIN_USED_CHAN, /*!< Set minimum number of used channels API event. */ + /* Internal events */ + _LCTR_CONN_INT_EVENTS = 40, + LCTR_CONN_DATA_PENDING, /*!< New data pending. */ + LCTR_CONN_ARQ_Q_FLUSHED, /*!< ARQ queue transitioned to empty. */ + LCTR_CONN_MST_ESTABLISH, /*!< Establish connection (master only). */ + LCTR_CONN_SLV_INIT_STARTUP_LLCP, /*!< Slave initiates startup LLCP procedures(slave only). */ + _LCTR_CONN_LLCP_EVENTS = 50, + LCTR_CONN_LLCP_CONN_UPDATE, /*!< LL initiated connection update procedure. */ + LCTR_CONN_LLCP_VERSION_EXCH, /*!< LL initiated remote version exchange. */ + LCTR_CONN_LLCP_FEATURE_EXCH, /*!< LL initiated remote feature exchange. */ + LCTR_CONN_LLCP_LENGTH_EXCH, /*!< LL initiated data length exchange. */ + LCTR_CONN_LLCP_TERM, /*!< LL initiated termination. */ + LCTR_CONN_LLCP_PROC_CMPL, /*!< LLCP procedure completed. */ + LCTR_CONN_LLCP_START_PENDING, /*!< Start pending LLCP procedure. */ + LCTR_CONN_LLCP_SKIP_CONN_PARAM, /*!< Skip connection parameter exchange. */ + LCTR_CONN_LLCP_REJECT_CONN_UPD, /*!< Reject a connection update. */ + _LCTR_CONN_TERM_EVENTS = 60, + LCTR_CONN_TERM_SUP_TIMEOUT, /*!< Terminate connection due to supervision timeout. */ + LCTR_CONN_TERM_MIC_FAILED, /*!< Terminate connection due to MIC failure. */ + LCTR_CONN_TERM_INST_PASSED, /*!< Terminate connection due to instant passed. */ + LCTR_CONN_TERMINATED, /*!< Connection event terminated. */ + _LCTR_CONN_TMR_EVENTS = 70, + LCTR_CONN_TMR_LLCP_RSP_EXP, /*!< LLCP response timer expired. */ + LCTR_CONN_TMR_PING_PERIOD_EXP, /*!< LE Ping period timer expired. */ + LCTR_CONN_TMR_AUTH_PAYLOAD_EXP /*!< Authentication payload timer expired. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Connection update message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LlConnSpec_t connSpec; /*!< Updated connection specification. */ +} lctrConnUpdate_t; + +/*! \brief Channel map update message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint64_t chanMap; /*!< Channel map. */ +} lctrChanMapUpdate_t; + +/*! \brief Disconnect message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t reason; /*!< Disconnect reason. */ +} lctrDisconnect_t; + +/*! \brief Start encryption message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t rand[LL_RAND_LEN]; /*!< Random number. */ + uint16_t diversifier; /*!< Diversifier. */ + uint8_t key[LL_KEY_LEN]; /*!< Encryption key. */ +} lctrStartEnc_t; + +/*! \brief Remote connection parameter reply message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t key[LL_KEY_LEN]; /*!< Encryption key. */ +} lctrLtkReply_t; + +/*! \brief Remote connection parameter reply message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + LlConnSpec_t connSpec; /*!< Updated connection specification. */ +} lctrConnParamReply_t; + +/*! \brief Remote connection parameter negative reply message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t reason; /*!< Reason code. */ +} lctrConnParamNegReply_t; + +/*! \brief Data length change message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint16_t maxTxLen; /*!< Maximum transmit length. */ + uint16_t maxTxTime; /*!< Maximum transmit time. */ +} lctrDataLengthChange_t; + +/*! \brief PHY update message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t allPhys; /*!< All PHYs preferences. */ + uint8_t txPhys; /*!< Preferred transmitter PHYs. */ + uint8_t rxPhys; /*!< Preferred receiver PHYs. */ + uint16_t phyOptions; /*!< PHY options. */ +} lctrPhyUpdate_t; + +/*! \brief Set minimum number of used channels message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + uint8_t phys; /*!< Bitmask for the PHYs. */ + uint8_t minUsedChan; /*!< Minimum number of used channels. */ +} lctrSetMinUsedChan_t; + +/*! \brief Link layer controller message data. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrConnEstablish_t connEstablish; /*!< Connection establish message data. */ + lctrConnUpdate_t connUpd; /*!< Connection update message data. */ + lctrChanMapUpdate_t chanMapUpd; /*!< Channel map update message data. */ + lctrDisconnect_t disc; /*!< Disconnect message data. */ + lctrStartEnc_t startEnc; /*!< Start encryption message data. */ + lctrLtkReply_t ltkReply; /*!< LTK reply message data. */ + lctrConnParamReply_t connParamReply; /*!< Remote connection parameter reply message data. */ + lctrConnParamNegReply_t connParamNegReply;/*!< Remote connection parameter negative reply message data. */ + lctrDataLengthChange_t dataLenChange; /*!< Data length change message data. */ + lctrPhyUpdate_t phyUpd; /*!< PHY update message data. */ + lctrSetMinUsedChan_t setMinUsedChan; /*!< Set minimum number of used channels message data. */ +} lctrConnMsg_t; + +/*! \brief Initialize connection context. */ +typedef void (*LctrInitConnHdlr_t)(uint16_t connHandle); + +/*! \brief Set transmit flow control. */ +typedef void (*LctrTxFcHdlr_t)(uint16_t connHandle, uint8_t *pBuf); + +/*! \brief Transmit PDU complete. */ +typedef void (*LctrTxPduCompHdlr_t)(uint16_t connHandle); + +/*! \brief Transmit empty packet acknowledgment, returns TRUE if required. */ +typedef bool_t (*LctrTxAckHdlr_t)(uint16_t connHandle); + +/*! \brief Receive process flow control, returns TRUE if retransmission. */ +typedef bool_t (*LctrRxAckHdlr_t)(uint16_t connHandle); + +/*! \brief VS receive data handler. */ +typedef void (*LctrVsRecvHdlr_t)(uint16_t connHandle, uint8_t *pBuf); + +/*! \brief Connection event complete handler. */ +typedef void (*LctrCeCompHdlr_t)(uint16_t connHandle); + +/*! \brief Vendor specific PDU handlers. */ +typedef struct +{ + LctrInitConnHdlr_t connSetup; /*!< Setup connection context. */ + LctrInitConnHdlr_t connCleanup; /*!< Cleanup connection context. */ + LctrTxFcHdlr_t txPduFc; /*!< Set transmit PDU flow control. */ + LctrTxAckHdlr_t txPduAck; /*!< Tx PDU acknowledge required? */ + LctrRxAckHdlr_t rxPduAck; /*!< Process a receive PDU acknowledgment. */ + LctrVsRecvHdlr_t dataRecv; /*!< Receive data buffer handler. */ + LctrTxPduCompHdlr_t ceSetup; /*!< Setup connection event. */ + LctrCeCompHdlr_t ceCleanup; /*!< Cleanup connection event. */ +} LctrVsHandlers_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrSlvConnInit(void); +void LctrSlvConnEncInit(void); +void LctrMstConnInit(void); +void LctrMstConnEncInit(void); +void LctrVsConnInit(const LctrVsHandlers_t *pHdlrs); + +/* Helpers */ +uint8_t LctrValidateConnSpec(const LlConnSpec_t *pConnSpec); +bool_t LctrIsProcActPended(uint16_t handle, uint8_t event); + +/* Status */ +bool_t LctrIsConnHandleEnabled(uint16_t handle); +uint8_t LctrGetRole(uint16_t handle); +int8_t LctrGetRssi(uint16_t handle); +int8_t LctrGetTxPowerLevel(uint16_t handle); +uint64_t LctrGetChannelMap(uint16_t handle); +uint8_t LctrGetUsedFeatures(uint16_t handle); +uint8_t LctrGetTxPhy(uint16_t handle); +uint8_t LctrGetRxPhy(uint16_t handle); +void LctrGetPeerMinUsedChan(uint16_t handle, uint8_t *pPeerMinUsedChan); +bool_t LctrIsWaitingForReply(uint16_t handle, uint8_t reply); + + +/* Control */ +void LctrSetTxPowerLevel(uint16_t handle, int8_t level); +uint32_t LctrGetAuthPayloadTimeout(uint16_t handle); +bool_t LctrSetAuthPayloadTimeout(uint16_t handle, uint32_t timeoutMs); +void LctrGetEncMode(uint16_t handle, LlEncMode_t *pMode); +bool_t LctrSetEncMode(uint16_t handle, const LlEncMode_t *pMode); +void LctrSetConnOpFlags(uint16_t handle, uint32_t flags, bool_t enable); + +/* Data path */ +void LctrTxAcl(uint8_t *pAclBuf); +uint8_t *LctrRxAcl(void); +void LctrRxAclComplete(uint8_t numBufs); + +/*! \} */ /* LL_LCTR_API_CONN */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_CONN_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn_cs2.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn_cs2.h new file mode 100644 index 0000000000000000000000000000000000000000..86d965e0665d8065106aadd936f3c06cada73779 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_conn_cs2.h @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller channel selection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_CONN_CS_H +#define LCTR_API_CONN_CS_H + +#include "lctr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrChannelSelection2Init(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_CONN_CS_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master.h new file mode 100644 index 0000000000000000000000000000000000000000..8450e1d176db8d095d4661b9d0a5794f71b24cd1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master.h @@ -0,0 +1,72 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller initiating master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_INIT_MASTER_H +#define LCTR_API_INIT_MASTER_H + +#include "lctr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_INIT_MST + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master initiate task messages for \a LCTR_DISP_INIT dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_INIT_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Initiate events */ + LCTR_INIT_MSG_INITIATE, /*!< Initiate API event. */ + LCTR_INIT_MSG_INITIATE_CANCEL, /*!< Initiate cancel API event. */ + LCTR_INIT_MSG_TERMINATE, /*!< Scan BOD terminated event. */ + LCTR_INIT_MSG_TOTAL /*!< Total number of initiate events. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrMstInitInit(void); +void LctrMstInitDefaults(void); + +/*! \} */ /* LL_LCTR_API_INIT_MST */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_INIT_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..530893a2c5eed5a52358260d59ca537250b371cf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_init_master_ae.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller extended initiating master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_INIT_MASTER_AE_H +#define LCTR_API_INIT_MASTER_AE_H + +#include "lctr_api.h" +#include "wsf_assert.h" +#include "lctr_api_init_master.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_INIT_MST_AE + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master extended initiate task messages for \a LCTR_DISP_EXT_INIT dispatcher. */ +enum +{ + /* Broadcast events */ + LCTR_EXT_INIT_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */ + /* Initiate events */ + LCTR_EXT_INIT_MSG_INITIATE, /*!< Initiate API event. */ + LCTR_EXT_INIT_MSG_INITIATE_CANCEL, /*!< Initiate cancel API event. */ + LCTR_EXT_INIT_MSG_TERMINATE, /*!< Initiate scan BOD terminated event. */ + LCTR_EXT_INIT_MSG_TOTAL /*!< Total number of initiate events. */ +}; + +/*! \brief LCTR_EXT_INIT_MSG_INITIATE_CANCEL and LCTR_INIT_MSG_INITIATE_CANCEL shall be aligned. */ +WSF_CT_ASSERT(((int)LCTR_EXT_INIT_MSG_INITIATE_CANCEL == (int)LCTR_INIT_MSG_INITIATE_CANCEL)); + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrMstExtInitInit(void); +void LctrMstExtInitDefaults(void); + +/* Control */ +void LctrMstExtInitParam(uint8_t initPhy, const LlExtInitScanParam_t *pScanParam, const LlConnSpec_t *pConnSpec); +void LctrMstExtInitSetScanPhy(uint8_t scanPhy); +void LctrMstExtInitClearScanPhy(uint8_t scanPhy); + +/*! \} */ /* LL_LCTR_API_INIT_MST_AE */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_INIT_MASTER_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_phy.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_phy.h new file mode 100644 index 0000000000000000000000000000000000000000..6cb7f954cd023c9cbbe0b2cabc1f05491fb29b25 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_phy.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller PHY features interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_PHY_H +#define LCTR_API_PHY_H + +#include "lctr_api.h" +#include "lmgr_api_priv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrSlvPhyConnInit(void); +void LctrMstPhyConnInit(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_PHY_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_priv.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_priv.h new file mode 100644 index 0000000000000000000000000000000000000000..d726efebc1c28775b5f5cab53bc8123bafe20d26 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_priv.h @@ -0,0 +1,87 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller privacy interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_PRIV_H +#define LCTR_API_PRIV_H + +#include "lctr_api.h" +#include "lmgr_api_priv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_PRIV + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Slave advertising task messages for \a LCTR_DISP_ADV dispatcher. */ +enum +{ + /* Privacy events */ + LCTR_PRIV_MSG_RES_PRIV_ADDR_TIMEOUT, /*!< Resolvable private address timeout event. */ + LCTR_PRIV_MSG_ADDR_RES_NEEDED /*!< Address resolution needed. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Address resolution pending message. */ +typedef struct +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + bool_t peer; /*!< TRUE if RPA is a peer's RPA. */ + uint8_t peerAddrType; /*!< Peer identity address type. */ + uint64_t peerIdentityAddr; /*!< Peer identity address. */ + uint64_t rpa; /*!< Resolvable private address. */ +} lctrAddrResNeededMsg_t; + +/*! \brief Address resolution pending message. */ +typedef union +{ + lctrMsgHdr_t hdr; /*!< Message header. */ + lctrAddrResNeededMsg_t addrResNeeded; /*!< Address resolution needed. */ +} LctrPrivMsg_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrPrivInit(void); + +/* Control */ +void LctrPrivSetResPrivAddrTimeout(uint32_t timeout); + +/*! \} */ /* LL_LCTR_API_PRIV */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_PRIV_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_sc.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_sc.h new file mode 100644 index 0000000000000000000000000000000000000000..6885eea771d2712a7e550d8aaf96d74b8bfd6952 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lctr_api_sc.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller secure connections interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_API_SC_H +#define LCTR_API_SC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LCTR_API_SC + * \{ + */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LctrScInit(void); + +/* Execution. */ +uint8_t LctrGenerateP256KeyPair(void); +uint8_t LctrGenerateDhKey(const uint8_t *pPubKey, const uint8_t *pPrivKey); + +/*! \} */ /* LL_LCTR_API_SC */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_API_SC_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api.h new file mode 100644 index 0000000000000000000000000000000000000000..f37b37fe5912785e65150895faf6580b82a3804b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api.h @@ -0,0 +1,158 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager common interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_H +#define LMGR_API_H + +#include "ll_api.h" +#include "ll_defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API + * \{ + */ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master scan modes. */ +enum +{ + LMGR_SCAN_MODE_DISCOVER, /*!< Scan enabled state. */ + LMGR_SCAN_MODE_INITIATE /*!< Initiate enabled state. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising broadcast user data. */ +typedef struct +{ + uint8_t buf[LL_ADVBU_MAX_LEN]; /*!< ADVB-U buffer. */ + uint8_t len; /*!< ADVB-U buffer length. */ + bool_t modified; /*!< Content modified by host. */ +} lmgrAdvbUser_t; + +/*! \brief Link layer manager persistent control block (persists with resets). */ +typedef struct +{ + llEvtCback_t evtCback; /*!< Event callback. */ + llAclCback_t sendCompCback; /*!< ACL data send complete callback. */ + llAclCback_t recvPendCback; /*!< ACL data receive pending callback. */ + wsfHandlerId_t handlerId; /*!< System event handler ID. */ + uint16_t connCtxSize; /*!< Size of the connection context. */ + uint16_t advSetCtxSize; /*!< Size of the advertising set context. */ + uint16_t perScanCtxSize; /*!< Size of the periodic scanning context. */ + uint64_t featuresDefault; /*!< Default supported features. */ + + /* Device parameters */ + uint64_t bdAddr; /*!< Public device address. */ + uint64_t supStates; /*!< Supported states. */ +} lmgrPersistCtrlBlk_t; + +/*! \brief Link layer manager control block (cleared with resets). */ +typedef struct +{ + /* Status */ + uint8_t numConnEnabled; /*!< Number of active connection. */ + bool_t advEnabled; /*!< Legacy advertising is enabled. */ + uint8_t numExtAdvEnabled; /*!< Number of extended advertising is enabled. */ + uint8_t numScanEnabled; /*!< Number of scan is enabled. */ + uint8_t numInitEnabled; /*!< Number of initiate is enabled. */ + uint8_t scanMode; /*!< Discover or initiating scan mode. */ + uint8_t numWlFilterEnabled; /*!< Number of enabled whitelist filters. */ + uint8_t numPlFilterEnabled; /*!< Number of enabled periodic filters. */ + bool_t testEnabled; /*!< Test is enabled. */ + uint8_t resetDelayRefCnt; /*!< Reset delay reference counter. */ + uint8_t extAdvEnaDelayCnt; /*!< Extended advertising enable event delay reference count. */ + uint8_t advSetEnaStatus; /*!< Last advertising set enable error status. */ + uint8_t numExtScanPhys; /*!< Number of extended scanning PHYs enabled. */ + uint8_t extScanEnaDelayCnt; /*!< Extended scanning enable event delay reference count. */ + uint8_t extScanEnaStatus; /*!< Last extended scanning enable error status. */ + + /* Device parameters */ + bool_t bdAddrRndModAdv; /*!< Modified random address (advertising). */ + bool_t bdAddrRndModScan; /*!< Modified random address (scan). */ + bool_t bdAddrRndValid; /*!< Random device address valid. */ + uint32_t opModeFlags; /*!< Operational mode flags. */ + uint64_t bdAddrRnd; /*!< Random device address. */ + uint64_t features; /*!< Used local supported features. */ + + /* Operational parameters. */ + int8_t advTxPwr; /*!< Advertising Tx power. */ + bool_t addrResEna; /*!< Address resolution enabled. */ + bool_t useLegacyCmds; /*!< Use only legacy advertising, scan or initiate commands. */ + bool_t useExtCmds; /*!< Use only extended advertising, scan or initiate commands. */ + + /* Power Class 1. */ + int8_t powerThreshold[LL_MAX_PHYS]; /*!< Power threshold for each PHY. */ + uint8_t localMinUsedChan[LL_MAX_PHYS]; /*!< Local minimum number of used channels for each PHY. */ +} lmgrCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrPersistCtrlBlk_t lmgrPersistCb; +extern lmgrCtrlBlk_t lmgrCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Reset */ +void LmgrSetDefaults(void); +void LmgrIncResetRefCount(void); +void LmgrDecResetRefCount(void); + +/* Whitelist */ +void LmgrIncWhitelistRefCount(void); +void LmgrDecWhitelistRefCount(void); + +/* Periodic List */ +void LmgrIncPeriodiclistRefCount(void); +void LmgrDecPeriodiclistRefCount(void); + +/* Status */ +bool_t LmgrIsAddressTypeAvailable(uint8_t ownAddrType); +bool_t LmgrIsLegacyCommandAllowed(void); +bool_t LmgrIsExtCommandAllowed(void); + +/* Event Messages */ +void LmgrSendAdvEnableCnf(uint8_t status); +void LmgrSendScanEnableCnf(uint8_t status); +void LmgrSendAdvSetTermInd(uint8_t handle, uint8_t status, uint16_t connHandle, uint8_t numEvents); +bool_t LmgrSendEvent(LlEvt_t *pEvt); + +/*! \} */ /* LL_LMGR_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master.h new file mode 100644 index 0000000000000000000000000000000000000000..0dcd11045185c202903a219b06ee14a28271c7f9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager advertising master interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_ADV_MASTER_H +#define LMGR_API_ADV_MASTER_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API_ADV_MST + * \{ + */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Scan parameters. */ +typedef struct +{ + uint16_t scanInterval; /*!< Scan interval in BB ticks. */ + uint16_t scanWindow; /*!< Scan window duration in BB ticks. */ + uint8_t scanType; /*!< Advertising type. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t scanFiltPolicy; /*!< Scanning filter policy. */ +} lmgrScanParam_t; + +/*! \brief Master role device parameter definition. */ +typedef struct +{ + lmgrScanParam_t scanParam; /*!< Scan parameters. */ + uint64_t chanClass; /*!< Channel class. */ + uint8_t scanChanMap; /*!< Scan channel map. */ + uint8_t numAdvReport; /*!< Number of pending advertising reports. */ +} lmgrMstScanCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrMstScanCtrlBlk_t lmgrMstScanCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LmgrMstInit(void); + +/*! \} */ /* LL_LMGR_API_ADV_MST */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_ADV_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..ac507f3a7f070223d208d192a983b22273f43077 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_master_ae.h @@ -0,0 +1,63 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager advertising extension interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_ADV_MASTER_AE_H +#define LMGR_API_ADV_MASTER_AE_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Periodic advertising sync established event */ +typedef struct +{ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t addrType; /*!< Address type. */ + bdAddr_t addr; /*!< Address. */ + uint8_t advPhy; /*!< Advertising PHY. */ + uint16_t advInterval; /*!< Advertising interval. */ + uint8_t advClkAccuracy; /*!< Advertising clock accuracy. */ +} lmgrPerAdvSyncEstdInd_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Events */ +void LmgrSendExtScanEnableCnf(uint8_t status); +void LmgrSendScanTimeoutInd(void); +void LmgrSendExtAdvRptInd(LlExtAdvReportInd_t *pEvt); +void LmgrSendPerAdvRptInd(LlPerAdvReportInd_t *pEvt); +void LmgrSendSyncEstInd(uint8_t status, uint16_t handle, lmgrPerAdvSyncEstdInd_t *pEvt); +void LmgrSendSyncLostInd(uint16_t handle); + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_ADV_MASTER_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave.h new file mode 100644 index 0000000000000000000000000000000000000000..c38765cfa772d5f7849774162a8d49dd893d0e56 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager advertising slave interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_ADV_SLAVE_H +#define LMGR_API_ADV_SLAVE_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API_ADV_SLV + * \{ + */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising parameters. */ +typedef struct +{ + uint32_t advInterMin; /*!< Minimum advertising interval. */ + uint32_t advInterMax; /*!< Maximum advertising interval. */ + uint8_t advType; /*!< Advertising type. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t peerAddrType; /*!< Address type of peer device. Only used for directed advertising. */ + uint64_t peerAddr; /*!< Address of peer device. Only used for directed advertising. */ + uint8_t advChanMap; /*!< Advertising channel map. */ + uint8_t advFiltPolicy; /*!< Advertising filter policy. */ +} lmgrAdvParam_t; + +/*! \brief Slave role device parameter definition. */ +typedef struct +{ + uint32_t advTermCntDown; /*!< Advertising termination count down. */ + lmgrAdvParam_t advParam; /*!< Advertising parameters. */ + lmgrAdvbUser_t advData; /*!< Advertising host data buffer. */ + lmgrAdvbUser_t scanRspData; /*!< Scan response host data buffer. */ + uint8_t ownAddrType; /*!< Actual address type used by this device. */ + uint64_t localRpa; /*!< Local RPA used by this device. */ + bool_t scanReportEna; /*!< Scan report events enabled. */ + uint8_t defTxPhyOpts; /*!< Default Tx PHY options */ +} lmgrSlvAdvCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrSlvAdvCtrlBlk_t lmgrSlvAdvCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LmgrSlvInit(void); + +/*! \} */ /* LL_LMGR_API_ADV_SLV */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_ADV_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..537906bda43e6d5f37fc4a0098131518964937fe --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_adv_slave_ae.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager advertising extension interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_ADV_SLAVE_AE_H +#define LMGR_API_ADV_SLAVE_AE_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Events */ +void LmgrSendExtAdvEnableCnf(uint8_t handle, uint8_t status); +void LmgrSendScanReqReceivedInd(uint8_t handle, uint8_t scanAddrType, uint64_t scanAddr); +void LmgrSendAdvSetTermInd(uint8_t handle, uint8_t status, uint16_t connHandle, uint8_t numEvents); +void LmgrSendPeriodicAdvEnableCnf(uint8_t handle, uint8_t status); + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_ADV_SLAVE_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_conn.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_conn.h new file mode 100644 index 0000000000000000000000000000000000000000..a013a03e7f6417de05f8837aec4b093850bb3d13 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_conn.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_CONN_H +#define LMGR_API_CONN_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API_CONN + * \{ + */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Slave role device parameter definition. */ +typedef struct +{ + uint8_t availTxBuf; /*!< Available number of transmit buffers. */ + uint8_t availRxBuf; /*!< Available number of receive buffers. */ + + uint16_t maxTxLen; /*!< Default maximum number of Data PDU bytes. */ + uint16_t maxTxTime; /*!< Default maximum microseconds for a Data PDU. */ + + wsfQueue_t rxDataQ; /*!< Receive Data PDU (LE-U or LE-C) queue. */ + + uint32_t dataPendMsk; /*!< Bitmask of connection handles with new pending data. */ + + uint8_t allPhys; /*!< Default all PHYs. */ + uint8_t txPhys; /*!< Default transmitter PHYs. */ + uint8_t rxPhys; /*!< Default receiver PHYs. */ + +} lmgrConnCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrConnCtrlBlk_t lmgrConnCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LmgrConnInit(void); + +/*! \} */ /* LL_LMGR_API_CONN */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_CONN_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_priv.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_priv.h new file mode 100644 index 0000000000000000000000000000000000000000..d356b3e30aab4078b17f9a4b227f5bc489bf889f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_priv.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager privacy interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_PRIV_H +#define LMGR_API_PRIV_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API_PRIV + * \{ + */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Slave role device parameter definition. */ +typedef struct +{ + uint32_t resPrivAddrTimeout; /*!< Resolvable private address timeout. */ + uint8_t numPendingAddrRes; /*!< Number of pending address resolutions. */ +} lmgrPrivCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrPrivCtrlBlk_t lmgrPrivCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LmgrPrivInit(void); + +/*! \} */ /* LL_LMGR_API_PRIV */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_PRIV_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_sc.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_sc.h new file mode 100644 index 0000000000000000000000000000000000000000..9990e04356133fd480dcbbd96da6e6ac34cba230 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/include/lmgr_api_sc.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer manager secure connections interface file. + */ +/*************************************************************************************************/ + +#ifndef LMGR_API_SC_H +#define LMGR_API_SC_H + +#include "lmgr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LMGR_API_SC + * \{ + */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Secure connections parameter definition. */ +typedef struct +{ + uint8_t privKey[LL_ECC_KEY_LEN]; /*!< P-256 private key. */ + bool_t eccOpActive; /*!< An ECC generation operation is active. */ + bool_t privKeySet; /*!< P-256 private key set; do not generate new one. */ +} lmgrScCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lmgrScCtrlBlk_t lmgrScCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void LmgrScInit(void); + +/*! \} */ /* LL_LMGR_API_SC */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LMGR_API_SC_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init.c new file mode 100644 index 0000000000000000000000000000000000000000..04ccd6fefd80e4203b409b5610d1845362ea6ca3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init.c @@ -0,0 +1,233 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL initialization for SoC configuration. + */ +/*************************************************************************************************/ + +#include "ll_init_api.h" +#include "bb_ble_api.h" +#include "sch_api.h" + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize BB. + * + * \return None. + */ +/*************************************************************************************************/ +void LlInitBbInit(void) +{ + BbInit(); + + BbBleInit(); + + #ifdef INIT_CENTRAL + BbBleScanMasterInit(); + BbBleConnMasterInit(); + #else + #ifdef INIT_OBSERVER + BbBleScanMasterInit(); + #endif + #endif + + #ifdef INIT_PERIPHERAL + BbBleAdvSlaveInit(); + BbBleConnSlaveInit(); + #else + #ifdef INIT_BROADCASTER + BbBleAdvSlaveInit(); + #endif + #endif + + BbBleTestInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize scheduler. + * + * \return None. + */ +/*************************************************************************************************/ +void LlInitSchInit(void) +{ + wsfHandlerId_t handlerId = WsfOsSetNextHandler(SchHandler); + SchHandlerInit(handlerId); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL. + * + * \param initHandler Initialize WSF handler. + * + * \return None. + */ +/*************************************************************************************************/ +void LlInitLlInit(bool_t initHandler) +{ + if (initHandler) + { + wsfHandlerId_t handlerId = WsfOsSetNextHandler(LlHandler); + LlHandlerInit(handlerId); + } + /* else LlHandlerInit() is called by client */ + + #ifdef INIT_CENTRAL + LlScanMasterInit(); + LlInitMasterInit(); + #ifdef INIT_ENCRYPTED + LlEncConnMasterInit(); + #else + LlConnMasterInit(); + #endif + #else + #ifdef INIT_OBSERVER + LlScanMasterInit(); + #endif + #endif + + #ifdef INIT_PERIPHERAL + LlAdvSlaveInit(); + #ifdef INIT_ENCRYPTED + LlEncConnSlaveInit(); + #else + LlConnSlaveInit(); + #endif + #else + #ifdef INIT_BROADCASTER + LlAdvSlaveInit(); + #endif + #endif + + #ifdef INIT_ENCRYPTED + LlPrivInit(); + LlScInit(); + #endif +} + +/*************************************************************************************************/ +/*! + * \brief Set BB runtime configuration. + * + * \param pBbRtCfg BB runtime configuration (must be static). + * \param wlSizeCfg Whitelist size. + * \param rlSizeCfg Resolving list size. + * \param plSizeCfg Periodic list size. + * \param pFreeMem Free memory. + * \param freeMemAvail Amount of free memory in bytes. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint32_t LlInitSetBbRtCfg(const BbRtCfg_t *pBbRtCfg, const uint8_t wlSizeCfg, const uint8_t rlSizeCfg, + const uint8_t plSizeCfg, uint8_t *pFreeMem, uint32_t freeMemAvail) +{ + uint32_t memUsed; + uint32_t totalMemUsed = 0; + + BbInitRunTimeCfg(pBbRtCfg); + + memUsed = BbBleInitWhiteList(wlSizeCfg, pFreeMem, freeMemAvail); + pFreeMem += memUsed; + freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + memUsed = BbBleInitPeriodicList(plSizeCfg, pFreeMem, freeMemAvail); + pFreeMem += memUsed; + freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + #ifdef INIT_ENCRYPTED + memUsed = BbBleInitResolvingList(rlSizeCfg, pFreeMem, freeMemAvail); + /* pFreeMem += memUsed; */ + /* freeMemAvail -= memUsed; */ + totalMemUsed += memUsed; + #else + BbBleInitResolvingList(0, NULL, 0); + #endif + + return totalMemUsed; +} + +/*************************************************************************************************/ +/*! + * \brief Set LL runtime configuration. + * + * \param pLlRtCfg LL runtime configuration (must be static). + * \param pFreeMem Free memory. + * \param freeMemAvail Amount of free memory in bytes. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint32_t LlInitSetLlRtCfg(const LlRtCfg_t *pLlRtCfg, uint8_t *pFreeMem, uint32_t freeMemAvail) +{ + uint32_t totalMemUsed = 0; + #if defined (INIT_PERIPHERAL) || defined (INIT_CENTRAL) + uint32_t memUsed; + #endif + + LlInitRunTimeCfg(pLlRtCfg); + + #if defined (INIT_PERIPHERAL) || defined (INIT_CENTRAL) + memUsed = LlInitConnMem(pFreeMem, freeMemAvail); + /* pFreeMem += memUsed; */ + /* freeMemAvail -= memUsed; */ + totalMemUsed += memUsed; + #endif + + return totalMemUsed; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize standard configuration. + * + * \param pCfg Runtime configuration. + * + * \return Memory used. + */ +/*************************************************************************************************/ +uint32_t LlInitStdInit(LlInitRtCfg_t *pCfg) +{ + uint32_t memUsed; + uint32_t totalMemUsed = 0; + + memUsed = LlInitSetBbRtCfg(pCfg->pBbRtCfg, pCfg->wlSizeCfg, pCfg->rlSizeCfg, pCfg->plSizeCfg, + pCfg->pFreeMem, pCfg->freeMemAvail); + pCfg->pFreeMem += memUsed; + pCfg->freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + memUsed = LlInitSetLlRtCfg(pCfg->pLlRtCfg, pCfg->pFreeMem, pCfg->freeMemAvail); + pCfg->pFreeMem += memUsed; + pCfg->freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + LlInitBbInit(); + LlInitSchInit(); + LlInitLlInit(TRUE); + + return totalMemUsed; +} diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/fit/fit_api.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr.c similarity index 52% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/fit/fit_api.h rename to lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr.c index aade452df891b30a71d5d968294600a4bbb22da2..ac72de3c52615729f4cc9e159e9efb9e5c16baa2 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/fit/fit_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr.c @@ -1,10 +1,8 @@ /*************************************************************************************************/ /*! - * \file + * \brief LL initialization for controller configuration. * - * \brief Fitness sample application interface. - * - * Copyright (c) 2011-2018 Arm Ltd. All Rights Reserved. + * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. * ARM Ltd. confidential and proprietary. * * IMPORTANT. Your use of this file is governed by a Software License Agreement @@ -16,61 +14,95 @@ * to any use, copying or further distribution of this software. */ /*************************************************************************************************/ -#ifndef FIT_API_H -#define FIT_API_H - -#include "wsf_os.h" -#ifdef __cplusplus -extern "C" { -#endif +#include "ll_init_api.h" +#include "lhci_api.h" +#include "chci_api.h" /************************************************************************************************** - Macros + Functions **************************************************************************************************/ -#ifndef FIT_CONN_MAX -#define FIT_CONN_MAX 1 -#endif +/*! \brief Extended VS command decoder. */ +extern bool_t lhciVsExtDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ /*************************************************************************************************/ /*! - * \brief Start the application. + * \brief Initialize controller HCI transport. * * \return None. */ /*************************************************************************************************/ -void FitStart(void); +void LlInitChciTrInit(void) +{ + wsfHandlerId_t handlerId = WsfOsSetNextHandler(ChciTrHandler); + ChciTrHandlerInit(handlerId); +} /*************************************************************************************************/ /*! - * \brief Application handler init function called during system initialization. - * - * \param handlerID WSF handler ID for App. + * \brief Initialize LL HCI. * * \return None. */ /*************************************************************************************************/ -void FitHandlerInit(wsfHandlerId_t handlerId); +void LlInitLhciInit(void) +{ + wsfHandlerId_t handlerId; + + #ifdef INIT_CENTRAL + LhciScanMasterInit(); + #ifdef INIT_ENCRYPTED + LhciEncMasterInit(); + #endif + LhciConnMasterInit(); + #else + #ifdef INIT_OBSERVER + LhciScanMasterInit(); + #endif + #endif + #ifdef INIT_PERIPHERAL + LhciAdvSlaveInit(); + #ifdef INIT_ENCRYPTED + LhciEncSlaveInit(); + #endif + LhciConnInit(); + #else + #ifdef INIT_BROADCASTER + LhciAdvSlaveInit(); + #endif + #endif + + #ifdef INIT_ENCRYPTED + LhciPrivAdvInit(); + LhciPrivConnInit(); + LhciScInit(); + #endif + + handlerId = WsfOsSetNextHandler(LhciHandler); + LhciHandlerInit(handlerId); +} /*************************************************************************************************/ /*! - * \brief WSF event handler for the application. + * \brief Initialize standard controller configuration. * - * \param event WSF event mask. - * \param pMsg WSF message. + * \param pCfg Runtime configuration. * - * \return None. + * \return Memory used. */ /*************************************************************************************************/ -void FitHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); +uint32_t LlInitControllerInit(LlInitRtCfg_t *pCfg) +{ + uint32_t totalMemUsed; + + totalMemUsed = LlInitStdInit(pCfg); + + LlInitChciTrInit(); + LlInitLhciInit(); -#ifdef __cplusplus -}; -#endif + LhciVsExtInit(lhciVsExtDecodeCmdPkt); -#endif /* FIT_API_H */ + return totalMemUsed; +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_assert.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr_ext.c similarity index 56% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_assert.c rename to lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr_ext.c index e1960eafcadd31c1f6e4d683ffe0720a950a2454..a0b5bc1733bbb12f50e4d3cb202ac0b1ca6bd52b 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_assert.c +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ctr_ext.c @@ -1,10 +1,8 @@ /*************************************************************************************************/ /*! - * \file wsf_assert.c + * \brief LL initialization for extended controller configuration. * - * \brief Assert implementation. - * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. + * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. * ARM Ltd. confidential and proprietary. * * IMPORTANT. Your use of this file is governed by a Software License Agreement @@ -17,59 +15,65 @@ */ /*************************************************************************************************/ -#include "wsf_types.h" -#include "wsf_assert.h" -#include "wsf_trace.h" +#include "ll_init_api.h" +#include "lhci_api.h" +#include "chci_api.h" /************************************************************************************************** - Global Variables + Functions **************************************************************************************************/ -/*! \brief Assertion callback. */ -static void (*wsfAssertCback)(void) = NULL; +/*! \brief Extended VS command decoder. */ +extern bool_t lhciVsExtDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); /*************************************************************************************************/ /*! - * \def WsfAssert - * - * \brief Perform an assert action. - * - * \param pFile Name of file originating assert. - * \param line Line number of assert statement. + * \brief Initialize LL HCI extended features. * * \return None. */ /*************************************************************************************************/ -#if WSF_TOKEN_ENABLED == TRUE -void WsfAssert(uint16_t modId, uint16_t line) -#else -void WsfAssert(const char *pFile, uint16_t line) -#endif +void LlInitLhciExtInit(void) { -#if WSF_TOKEN_ENABLED == TRUE - WSF_TRACE_ERR2("Assertion detected on %s:%u", modId, line); -#else - WSF_TRACE_ERR2("Assertion detected on %s:%u", pFile, line); -#endif + LhciVsExtInit(lhciVsExtDecodeCmdPkt); + + #ifdef INIT_CENTRAL + LhciExtScanMasterInit(); + LhciExtConnMasterInit(); + #else + #ifdef INIT_OBSERVER + LhciExtScanMasterInit(); + #endif + #endif + + #ifdef INIT_BROADCASTER + LhciExtAdvSlaveInit(); + #endif - if (wsfAssertCback) - { - wsfAssertCback(); - } - else - { - while (TRUE); - } + #if defined(INIT_PERIPHERAL) || defined(INIT_CENTRAL) + LhciChannelSelection2Init(); + LhciPhyInit(); + #endif } /*************************************************************************************************/ /*! - * \brief Register assert handler. + * \brief Initialize extended controller configuration. * - * \param cback Callback called upon assert condition. + * \param pCfg Runtime configuration. + * + * \return Memory used. */ /*************************************************************************************************/ -void WsfAssertRegister(void (*cback)(void)) +uint32_t LlInitControllerExtInit(LlInitRtCfg_t *pCfg) { - wsfAssertCback = cback; + uint32_t totalMemUsed; + + totalMemUsed = LlInitExtInit(pCfg); + + LlInitChciTrInit(); + LlInitLhciInit(); + LlInitLhciExtInit(); + + return totalMemUsed; } diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ext.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ext.c new file mode 100644 index 0000000000000000000000000000000000000000..3a8dd7dab6b8d8635a91f00d30caa11e2b98091e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/init/init_ext.c @@ -0,0 +1,154 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL initialization for extended SoC configuration. + */ +/*************************************************************************************************/ + +#include "ll_init_api.h" +#include "bb_ble_api.h" + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize auxiliary BB operations. + * + * \return None. + */ +/*************************************************************************************************/ +void LlInitBbAuxInit(void) +{ + #ifdef INIT_OBSERVER + BbBleAuxScanMasterInit(); + BbBlePerScanMasterInit(); + #endif + + #ifdef INIT_BROADCASTER + BbBleAuxAdvSlaveInit(); + BbBleInitRfPathComp(); + #endif +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL extended features. + * + * \return None. + */ +/*************************************************************************************************/ +void LlInitLlExtInit(void) +{ + wsfHandlerId_t handlerId; + + #ifdef INIT_CENTRAL + LlExtScanMasterInit(); + LlExtInitMasterInit(); + LlPhyMasterInit(); + #else + #ifdef INIT_OBSERVER + LlExtScanMasterInit(); + #endif + #endif + + #ifdef INIT_PERIPHERAL + LlExtAdvSlaveInit(); + LlPhySlaveInit(); + #else + #ifdef INIT_BROADCASTER + LlExtAdvSlaveInit(); + #endif + #endif + + #if defined(INIT_PERIPHERAL) || defined(INIT_CENTRAL) + LlChannelSelection2Init(); + #endif + /* Initialize handler after feature bits are set. */ + handlerId = WsfOsSetNextHandler(LlHandler); + LlHandlerInit(handlerId); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended LL runtime configuration. + * + * \param pLlRtCfg LL runtime configuration (must be static). + * \param pFreeMem Free memory. + * \param freeMemAvail Amount of free memory in bytes. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint32_t LlInitSetExtLlRtCfg(const LlRtCfg_t *pLlRtCfg, uint8_t *pFreeMem, uint32_t freeMemAvail) +{ + uint32_t memUsed; + uint32_t totalMemUsed = 0; + + memUsed = LlInitSetLlRtCfg(pLlRtCfg, pFreeMem, freeMemAvail); + pFreeMem += memUsed; + freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + memUsed = LlInitExtScanMem(pFreeMem, freeMemAvail); + pFreeMem += memUsed; + freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + memUsed = LlInitExtAdvMem(pFreeMem, freeMemAvail); + /* pFreeMem += memUsed; */ + /* freeMemAvail -= memUsed; */ + totalMemUsed += memUsed; + + return totalMemUsed; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize extended configuration. + * + * \param pCfg Runtime configuration. + * + * \return Memory used. + */ +/*************************************************************************************************/ +uint32_t LlInitExtInit(LlInitRtCfg_t *pCfg) +{ + uint32_t memUsed; + uint32_t totalMemUsed = 0; + + memUsed = LlInitSetBbRtCfg(pCfg->pBbRtCfg, pCfg->wlSizeCfg, pCfg->rlSizeCfg, pCfg->plSizeCfg, + pCfg->pFreeMem, pCfg->freeMemAvail); + pCfg->pFreeMem += memUsed; + pCfg->freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + memUsed = LlInitSetExtLlRtCfg(pCfg->pLlRtCfg, pCfg->pFreeMem, pCfg->freeMemAvail); + pCfg->pFreeMem += memUsed; + pCfg->freeMemAvail -= memUsed; + totalMemUsed += memUsed; + + LlInitBbInit(); + LlInitBbAuxInit(); + LlInitSchInit(); + LlInitLlInit(FALSE); + LlInitLlExtInit(); + + return totalMemUsed; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..2d9f5f47eb396072278b83100ba3c5437992be31 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master.c @@ -0,0 +1,234 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scan action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master.h" +#include "sch_api.h" +#include "util/bstream.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> + +/*! \brief Assert table entries do not exceed addressable 32-bits in advFiltValidMask. */ +WSF_CT_ASSERT((LL_NUM_ADV_FILT <= 32)); + +/*************************************************************************************************/ +/*! + * \brief Common scan resource cleanup. + * + * \param pCtx Scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanCleanup(lctrMstScanCtx_t *pCtx) +{ + uint8_t *pBuf; + wsfHandlerId_t handlerId; + + LmgrDecResetRefCount(); + if (pCtx == &lctrMstScan) + { + lmgrCb.numScanEnabled = 0; + } + else + { + lmgrCb.numInitEnabled = 0; + } + switch (pCtx->scanParam.scanFiltPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrDecWhitelistRefCount(); + break; + default: + break; + } + lctrMstScanCleanupOp(pCtx); + + while ((pBuf = WsfMsgDeq(&pCtx->rxAdvbQ, &handlerId)) != NULL) + { + /* Drop pending AdvB PDUs. */ + WsfMsgFree(pBuf); + } + while ((pBuf = WsfMsgDeq(&pCtx->rxDirectAdvbQ, &handlerId)) != NULL) + { + /* Drop pending direct AdvB PDUs. */ + WsfMsgFree(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start scan discovery. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActDiscover(void) +{ + lctrScanEnableMsg_t *pMsg = (lctrScanEnableMsg_t *)pLctrMsg; + + lctrMstScan.scanParam = lmgrMstScanCb.scanParam; + + lctrAdvRptEnable(&lctrMstScan.data.disc.advFilt, pMsg->filtDup); + + BbStart(BB_PROT_BLE); + + LmgrIncResetRefCount(); + lmgrCb.numScanEnabled = 1; + switch (lctrMstScan.scanParam.scanFiltPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrIncWhitelistRefCount(); + break; + default: + break; + } + lctrMstDiscoverBuildOp(); + lmgrCb.scanMode = LMGR_SCAN_MODE_DISCOVER; + lctrMstScan.backoffCount = 1; + lctrMstScan.upperLimit = 1; + + LmgrSendScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active scan operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActShutdown(void) +{ + if (lmgrCb.numScanEnabled) + { + lctrMstScan.shutdown = TRUE; + SchRemove(&lctrMstScan.scanBod); + + /* Shutdown completes with events generated in BOD end callback. */ + } + else + { + /* TODO Can this occur if a reset or cancel is received after a initiate start fails? */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Send scan operation confirm. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActScanCnf(void) +{ + LmgrSendScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Send disallow scan host notification. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActDisallowScan(void) +{ + LmgrSendScanEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Operation self terminated (e.g. on connection indication). + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActSelfTerm(void) +{ + BbStop(BB_PROT_BLE); + lctrScanCleanup(&lctrMstScan); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host scan disable. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActScanTerm(void) +{ + BbStop(BB_PROT_BLE); + + lctrScanCleanup(&lctrMstScan); + LmgrSendScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host reset. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActResetTerm(void) +{ + BbStop(BB_PROT_BLE); + lctrScanCleanup(&lctrMstScan); +} + +/*************************************************************************************************/ +/*! + * \brief Update scan parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActUpdateScanParam(void) +{ + lctrScanParamMsg_t *pMsg = (lctrScanParamMsg_t *)pLctrMsg; + + lmgrMstScanCb.scanParam = pMsg->param; +} + +/*************************************************************************************************/ +/*! + * \brief Update scan filter. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanActUpdateScanFilt(void) +{ + lctrScanEnableMsg_t *pMsg = (lctrScanEnableMsg_t *)pLctrMsg; + if (lctrMstScan.data.disc.advFilt.enable != pMsg->filtDup) + { + lctrAdvRptEnable(&lctrMstScan.data.disc.advFilt, pMsg->filtDup); + } + + LmgrSendScanEnableCnf(LL_SUCCESS); +} + diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..ac80211c8c56521ed90c4cb8211dc88dd21799d7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_master_ae.c @@ -0,0 +1,459 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scan action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master_ae.h" +#include "lctr_int_adv_master.h" +#include "lctr_api_adv_master_ae.h" +#include "lmgr_api_adv_master_ae.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" + +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Setup periodic scanning context. + * + * \param pPerCreateSync Create sync control block. + * \param pMsg Create sync messgae. + * + * \return TRUE if successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static uint8_t lctrPerScanSetup(lctrPerCreateSyncCtrlBlk_t *pPerCreateSync, lctrPerCreateSyncMsg_t *pMsg) +{ + lctrPerScanCtx_t *pPerScanCtx; + + if ((pPerScanCtx = lctrAllocPerScanCtx()) == NULL) + { + return LL_ERROR_CODE_CONN_LIMIT_EXCEEDED; + } + + pPerCreateSync->pPerScanCtx = pPerScanCtx; + pPerScanCtx->filtParam.filterPolicy = pMsg->filterPolicy; + pPerScanCtx->filtParam.advSID = pMsg->advSID; + pPerScanCtx->filtParam.advAddrType = pMsg->advAddrType; + pPerScanCtx->filtParam.advAddr = pMsg->advAddr; + pPerScanCtx->skip = pMsg->skip; + pPerScanCtx->syncTimeOutMs = LCTR_PER_SYNC_TIMEOUT_TO_MS(pMsg->syncTimeOut); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Pack periodic advertising sync established report. + * + * \param pPerScanCtx Periodic scan context. + * \param pRpt Periodic advertising report. + * + * \return TRUE if pack report successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrPerAdvSyncEstRptPack(lctrPerScanCtx_t *pPerScanCtx, lmgrPerAdvSyncEstdInd_t *pRpt) +{ + memset(pRpt, 0, sizeof(lmgrPerAdvSyncEstdInd_t)); + + pRpt->advSID = pPerScanCtx->advSID; + Bda64ToBstream(pRpt->addr, pPerScanCtx->advAddr); + pRpt->addrType = pPerScanCtx->advAddrType; + pRpt->advPhy = pPerScanCtx->rxPhys; + pRpt->advInterval = LCTR_PER_INTER_TO_MS(BB_TICKS_TO_US(pPerScanCtx->perInter)); + pRpt->advClkAccuracy = pPerScanCtx->sca; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Common periodic scan resource cleanup. + * + * \param pPerScanCtx Periodic scan context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstPerScanCleanupOp(lctrPerScanCtx_t *pPerScanCtx) +{ + BbStop(BB_PROT_BLE); + + if (pPerScanCtx->filtParam.filterPolicy) + { + LmgrDecPeriodiclistRefCount(); + } + + LmgrDecResetRefCount(); + + pPerScanCtx->enabled = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Common scan resource cleanup. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtScanCleanupOp(lctrExtScanCtx_t *pExtScanCtx) +{ + BbBleMstAdvEvent_t *pScan; + BbStop(BB_PROT_BLE); + + switch (pExtScanCtx->scanParam.scanFiltPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrDecWhitelistRefCount(); + break; + default: + break; + } + + pScan = &pExtScanCtx->scanBleData.op.mstAdv; + if (pScan->pRxAdvBuf) + { + WsfMsgFree(pScan->pRxAdvBuf); + pScan->pRxAdvBuf = NULL; + } + if (pScan->pRxRspBuf) + { + WsfMsgFree(pScan->pRxRspBuf); + pScan->pRxRspBuf = NULL; + } + + WSF_ASSERT(lmgrCb.numScanEnabled > 0); + lmgrCb.numScanEnabled--; + LmgrDecResetRefCount(); +} + +/*************************************************************************************************/ +/*! + * \brief Start scan discovery. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActDiscover(lctrExtScanCtx_t *pExtScanCtx) +{ + uint8_t status; + + BbStart(BB_PROT_BLE); + + switch (pExtScanCtx->scanParam.scanFiltPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrIncWhitelistRefCount(); + break; + default: + break; + } + + /* Reset state. */ + pExtScanCtx->selfTerm = FALSE; + pExtScanCtx->shutdown = FALSE; + pExtScanCtx->auxOpPending = FALSE; + pExtScanCtx->bodTermCnt = 0; + pExtScanCtx->data.scan.advRptState = LCTR_RPT_STATE_IDLE; + + if (((status = lctrMstExtDiscoverBuildOp(pExtScanCtx)) != LL_SUCCESS) || + ((status = lctrMstAuxDiscoverBuildOp(pExtScanCtx)) != LL_SUCCESS)) + { + LmgrSendExtScanEnableCnf(status); + lctrSendExtScanMsg(pExtScanCtx, LCTR_EXT_SCAN_MSG_TERMINATE); + return; + } + + lmgrCb.numScanEnabled++; + LmgrIncResetRefCount(); + + pExtScanCtx->data.scan.backoffCount = 1; + pExtScanCtx->data.scan.upperLimit = 1; + + LmgrSendExtScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Update scan discovery. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActUpdateDiscover(lctrExtScanCtx_t *pExtScanCtx) +{ + LmgrSendExtScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active scan operation. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActShutdown(lctrExtScanCtx_t *pExtScanCtx) +{ + pExtScanCtx->shutdown = TRUE; + + if (!pExtScanCtx->auxOpPending) + { + SchRemove(&pExtScanCtx->scanBod); + } + else + { + SchRemove(&pExtScanCtx->auxScanBod); + } + + /* Shutdown completes with events generated in BOD end callback. */ +} + +/*************************************************************************************************/ +/*! + * \brief Send scan operation confirm. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActScanCnf(lctrExtScanCtx_t *pExtScanCtx) +{ + LmgrSendExtScanEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Send disallow scan host notification. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActDisallowScan(lctrExtScanCtx_t *pExtScanCtx) +{ + if (lctrMstExtScan.scanTermByHost) + { + LmgrSendExtScanEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); + } +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host scan disable. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActScanTerm(lctrExtScanCtx_t *pExtScanCtx) +{ + lctrMstExtScanCleanupOp(pExtScanCtx); + + if (lctrMstExtScan.scanTermByHost) + { + LmgrSendExtScanEnableCnf(LL_SUCCESS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after internal scan disable. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtScanActSelfTerm(lctrExtScanCtx_t *pExtScanCtx) +{ + lctrMstExtScanCleanupOp(pExtScanCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Create sync action function. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCreateSyncActCreate(void) +{ + lctrPerCreateSyncMsg_t *pMsg = (lctrPerCreateSyncMsg_t *)pLctrMstPerScanMsg; + + BbStart(BB_PROT_BLE); + + if (pMsg->filterPolicy) + { + LmgrIncPeriodiclistRefCount(); + } + + lctrPerCreateSync.filtParam.filterPolicy = pMsg->filterPolicy; + lctrPerCreateSync.filtParam.advAddr = pMsg->advAddr; + lctrPerCreateSync.filtParam.advAddrType = pMsg->advAddrType; + lctrPerCreateSync.filtParam.advSID = pMsg->advSID; + + lctrPerScanSetup(&lctrPerCreateSync, pMsg); + lctrMstPerScanBuildOp(lctrPerCreateSync.pPerScanCtx, pMsg); + + LmgrIncResetRefCount(); +} + +/*************************************************************************************************/ +/*! + * \brief Create sync done action function. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCreateSyncActDone(void) +{ + if (lctrPerCreateSync.createSyncPending == TRUE) + { + lctrPerCreateSync.createSyncPending = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Create sync cancel action function. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCreateSyncActCancel(void) +{ + if (lctrPerCreateSync.createSyncPending == TRUE) + { + lctrPerCreateSync.pPerScanCtx->cancelCreateSync = TRUE; + SchRemove(&lctrPerCreateSync.pPerScanCtx->bod); + } + + lctrSendCreateSyncMsg(LCTR_CREATE_SYNC_MSG_TERMINATE); +} + +/*************************************************************************************************/ +/*! + * \brief Create sync cancel action function. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCreateSyncActTerminate(void) +{ + lmgrPerAdvSyncEstdInd_t rpt; + + if (lctrPerCreateSync.pPerScanCtx->cancelCreateSync == TRUE) + { + lctrPerCreateSync.pPerScanCtx->cancelCreateSync = FALSE; + } + + lctrMstPerScanCleanupOp(lctrPerCreateSync.pPerScanCtx); + + memset(&rpt, 0, sizeof(lmgrPerAdvSyncEstdInd_t)); + LmgrSendSyncEstInd(LL_ERROR_CODE_OP_CANCELLED_BY_HOST, LCTR_GET_PER_SCAN_HANDLE(lctrPerCreateSync.pPerScanCtx), &rpt); +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning sync established action function. + * + * \param pPerScanCtx Periodic scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPerScanActSyncEstd(lctrPerScanCtx_t *pPerScanCtx) +{ + /* Pack and notify the host about sync established event. */ + lmgrPerAdvSyncEstdInd_t rpt; + + lctrPerAdvSyncEstRptPack(pPerScanCtx, &rpt); + LmgrSendSyncEstInd(LL_SUCCESS, LCTR_GET_PER_SCAN_HANDLE(pPerScanCtx), &rpt); +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning sync terminate action function. + * + * \param pPerScanCtx Periodic scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPerScanActSyncTerminate(lctrPerScanCtx_t *pPerScanCtx) +{ + pPerScanCtx->shutdown = TRUE; + + SchRemove(&pPerScanCtx->bod); + + /* Shutdown completes with events generated in BOD end callback. */ +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning sync terminate done action function. + * + * \param pPerScanCtx Periodic scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPerScanActSyncTerminateDone(lctrPerScanCtx_t *pPerScanCtx) +{ + lctrMstPerScanCleanupOp(pPerScanCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning sync terminate action function. + * + * \param pPerScanCtx Periodic scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPerScanActSyncTimeout(lctrPerScanCtx_t *pPerScanCtx) +{ + pPerScanCtx->shutdown = TRUE; + + SchRemove(&pPerScanCtx->bod); + + WsfTimerStop(&pPerScanCtx->tmrSupTimeout); + + LmgrSendSyncLostInd(LCTR_GET_PER_SCAN_HANDLE(pPerScanCtx)); + + /* Shutdown completes with events generated in BOD end callback. */ +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..e779cecc0b64da23c4e32e3f4a938554c5d19461 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave.c @@ -0,0 +1,302 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave.h" +#include "sch_api.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Notify host of direct connect timeout failure. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyHostDirectConnectTimeout(void) +{ + LlConnInd_t evt; + uint8_t *pBuf; + + evt.hdr.param = 0; + evt.hdr.event = LL_CONN_IND; + evt.hdr.status = LL_ERROR_CODE_ADV_TIMEOUT; + evt.status = LL_ERROR_CODE_ADV_TIMEOUT; + evt.handle = 0; + evt.role = LL_ROLE_SLAVE; + evt.addrType = lmgrSlvAdvCb.advParam.peerAddrType; + evt.connInterval = 0; + evt.connLatency = 0; + evt.supTimeout = 0; + evt.clockAccuracy = 0; + + pBuf = (uint8_t *)&evt.peerAddr; + BDA64_TO_BSTREAM(pBuf, lmgrSlvAdvCb.advParam.peerAddr); + + LL_TRACE_INFO0("### LlEvent ### LL_CONN_IND, status=LL_ERROR_CODE_ADV_TIMEOUT"); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Common advertise resource cleanup. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrAdvCleanup(void) +{ + LmgrDecResetRefCount(); + lmgrCb.advEnabled = FALSE; + if (lmgrSlvAdvCb.advParam.advFiltPolicy) + { + LmgrDecWhitelistRefCount(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActStart(void) +{ + BbStart(BB_PROT_BLE); + + LmgrIncResetRefCount(); + lmgrCb.advEnabled = TRUE; + if (lmgrSlvAdvCb.advParam.advFiltPolicy) + { + LmgrIncWhitelistRefCount(); + } + lctrSlvAdvBuildOp(); + + LmgrSendAdvEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Start advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActSelfStart(void) +{ + BbStart(BB_PROT_BLE); + + LmgrIncResetRefCount(); + lmgrCb.advEnabled = TRUE; + if (lmgrSlvAdvCb.advParam.advFiltPolicy) + { + LmgrIncWhitelistRefCount(); + } + lctrSlvAdvBuildOp(); +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active advertising operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActShutdown(void) +{ + if (lmgrCb.advEnabled) + { + lctrSlvAdv.shutdown = TRUE; + SchRemove(&lctrSlvAdv.advBod); + + /* Shutdown completes with events generated in BOD end callback. */ + } + else + { + /* TODO Can this occur if a disable or cancel is received after a advertising start fails? */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Send advertising operation confirm. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActAdvCnf(void) +{ + LmgrSendAdvEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Send advertising operation command disallowed. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActDisallowAdvCnf(void) +{ + LmgrSendAdvEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Operation self terminated (e.g. on connection indication). + * + * \return None. + * + * Slave self-termination is a result of the reception of a CONN_IND. + */ +/*************************************************************************************************/ +void lctrAdvActSelfTerm(void) +{ + if (lmgrCb.advEnabled) + { + if (lctrSlvAdv.connIndRcvd) + { + BbBleData_t * const pBle = &lctrSlvAdv.bleData; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + uint8_t *pBuf = pAdv->pRxReqBuf; + + if (pBuf) + { + bool_t restartAdv = FALSE; + + /* If peer address was not resolved, attempt to resolve it now. */ + if (!BbBlePduFiltCheck(pBuf, &pBle->pduFilt, TRUE, &pAdv->filtResults)) + { + /* Restart advertising if address resolution fails or PDU is still not allowed. */ + restartAdv = TRUE; + } + + if (restartAdv) + { + /* Reuse message. */ + lctrMsgHdr_t *pMsg = (lctrMsgHdr_t *)pBuf - 1; + pMsg->dispId = LCTR_DISP_ADV; + pMsg->event = LCTR_ADV_MSG_INT_START; + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + + BbStop(BB_PROT_BLE); + } + else + { + lctrConnEstablish_t *pMsg; + + if ((pMsg = (lctrConnEstablish_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->hdr.handle = 0; */ + pMsg->hdr.dispId = LCTR_DISP_CONN_IND; + /* pMsg->hdr.event = 0; */ + + lctrUnpackConnIndPdu(&pMsg->connInd, pBuf + LL_ADV_HDR_LEN); + pMsg->connIndEndTs = lctrSlvAdv.reqEndTs; + + BbBlePduFiltResultsGetPeerIdAddr(&pAdv->filtResults, &pMsg->peerIdAddr, &pMsg->peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pAdv->filtResults, &pMsg->peerRpa); + + pMsg->localRpa = lmgrSlvAdvCb.localRpa; + + pMsg->usedChSel = lctrSlvAdv.usedChSel; + pMsg->phy = LL_PHY_LE_1M; + pMsg->sendAdvSetTerm = FALSE; + pMsg->isAuxConnReq = FALSE; + /* pMsg->numExtAdvEvents = 0; */ /* Not used when sendAdvSetTerm = FALSE. */ + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + WsfMsgFree((lctrMsgHdr_t *)pBuf - 1); + } + } + } + else + { + lctrSlvAdvCleanupOp(); + + if (lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_DIRECT_HIGH_DUTY) + { + lctrNotifyHostDirectConnectTimeout(); + } + + BbStop(BB_PROT_BLE); + } + + lctrAdvCleanup(); + } + else + { + /* This occurs when an advertise enable fails. */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Terminated advertising after host advertising disable. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActAdvTerm(void) +{ + BbStop(BB_PROT_BLE); + + lctrAdvCleanup(); + lctrSlvAdvCleanupOp(); + + LmgrSendAdvEnableCnf(LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated advertising after host reset. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActResetTerm(void) +{ + BbStop(BB_PROT_BLE); + lctrAdvCleanup(); + lctrSlvAdvCleanupOp(); +} + +/*************************************************************************************************/ +/*! + * \brief Update advertising parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvActUpdateAdvParam(void) +{ + lctrAdvParamMsg_t *pMsg = (lctrAdvParamMsg_t *)pLctrMsg; + + lmgrSlvAdvCb.advParam = pMsg->param; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..b5754f7eb211b2ab726d734f4fcbf3560e82057a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c @@ -0,0 +1,563 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave extended advertising action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave_ae.h" +#include "lctr_int_adv_slave.h" +#include "lmgr_api_adv_slave_ae.h" +#include "bb_ble_api_reslist.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" + +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Common advertise resource cleanup. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExtAdvCleanup(lctrAdvSet_t *pAdvSet) +{ + BbBleSlvAdvEvent_t *pAdv; + lctrMsgHdr_t *pMsg; + + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pAdvSet->auxBleData.op.slvAuxAdv; + + if ((pMsg = (lctrMsgHdr_t *)pAuxAdv->pRxAuxReqBuf) != NULL) + { + /* Recover header. */ + WsfMsgFree(pMsg - 1); + pAuxAdv->pRxAuxReqBuf = NULL; + } + + pAdv = &pAdvSet->bleData.op.slvAdv; + if ((pMsg = (lctrMsgHdr_t *)pAdv->pRxReqBuf) != NULL) + { + /* Recover header. */ + WsfMsgFree(pMsg - 1); + pAdv->pRxReqBuf = NULL; + } + + if (pAdvSet->param.advFiltPolicy & LL_ADV_FILTER_SCAN_WL_BIT) + { + LmgrDecWhitelistRefCount(); + } + + WSF_ASSERT(lmgrCb.numExtAdvEnabled > 0); + lmgrCb.numExtAdvEnabled--; +} + +/*************************************************************************************************/ +/*! + * \brief Start extended advertising. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActStart(lctrAdvSet_t *pAdvSet) +{ + uint8_t status; + BbStart(BB_PROT_BLE); + + /* Reset state. */ + pAdvSet->maxEvents = pLctrSlvExtAdvMsg->enable.maxEvents; + pAdvSet->numEvents = 0; + pAdvSet->termReason = LL_SUCCESS; + pAdvSet->pExtAdvAuxPtr = NULL; + pAdvSet->connIndRcvd = FALSE; + pAdvSet->shutdown = FALSE; + pAdvSet->bodTermCnt = 0; + + if ((status = lctrSlvExtAdvBuildOp(pAdvSet, pLctrSlvExtAdvMsg->enable.durMs)) != LL_SUCCESS) + { + // TODO suppress terminate event on failed start + LmgrSendExtAdvEnableCnf(pAdvSet->handle, status); + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + return; + } + + lmgrCb.numExtAdvEnabled++; + + if (pAdvSet->param.advFiltPolicy) + { + LmgrIncWhitelistRefCount(); + } + + if (pLctrSlvExtAdvMsg->enable.durMs) + { + WsfTimerStartMs(&pAdvSet->tmrAdvDur, pLctrSlvExtAdvMsg->enable.durMs); + } + + LmgrSendExtAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Restart extended advertising. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActRestart(lctrAdvSet_t *pAdvSet) +{ + WsfTimerStop(&pAdvSet->tmrAdvDur); + + if (pLctrSlvExtAdvMsg->enable.durMs) + { + WsfTimerStartMs(&pAdvSet->tmrAdvDur, pLctrSlvExtAdvMsg->enable.durMs); + } + + pAdvSet->maxEvents = pLctrSlvExtAdvMsg->enable.maxEvents; + pAdvSet->numEvents = 0; + + LmgrSendExtAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active advertising operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActShutdown(lctrAdvSet_t *pAdvSet) +{ + WsfTimerStop(&pAdvSet->tmrAdvDur); + + pAdvSet->termReason = LL_SUCCESS; + pAdvSet->shutdown = TRUE; + + /* TODO: Attempt to remove BOD immediately to reduce shutdown time. */ + + /* Shutdown completes with events generated in BOD end callback. */ +} + +/*************************************************************************************************/ +/*! + * \brief Send advertising operation confirm. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActAdvCnf(lctrAdvSet_t *pAdvSet) +{ + LmgrSendExtAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Send advertising operation command disallowed. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActDisallowAdvCnf(lctrAdvSet_t *pAdvSet) +{ + LmgrSendExtAdvEnableCnf(pAdvSet->handle, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Operation self terminated (e.g. on connection request). + * + * \param pAdvSet Advertising set. + * + * \return None. + * + * Slave self-termination is a result of the expiration of the duration timer, numEvents reached, + * or reception of an AUX_CONN_REQ. + */ +/*************************************************************************************************/ +void lctrExtAdvActSelfTerm(lctrAdvSet_t *pAdvSet) +{ + if (!pAdvSet->connIndRcvd) + { + const uint8_t LEGACY_HIGH_DUTY = (LL_ADV_EVT_PROP_LEGACY_ADV_BIT | LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | + LL_ADV_EVT_PROP_DIRECT_ADV_BIT | LL_ADV_EVT_PROP_CONN_ADV_BIT); + WsfTimerStop(&pAdvSet->tmrAdvDur); + + lctrExtAdvCleanup(pAdvSet); + BbStop(BB_PROT_BLE); + + LmgrSendAdvSetTermInd(pAdvSet->handle, pAdvSet->termReason, 0, pAdvSet->numEvents); + + if ((pAdvSet->param.advEventProp & LEGACY_HIGH_DUTY) == LEGACY_HIGH_DUTY ) + { + /* Legacy connection complete event doesn't include peerRpa and localRpa. */ + lctrNotifyHostConnectInd(pAdvSet->handle, LL_ROLE_SLAVE, NULL, + pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, 0, 0, + LL_ERROR_CODE_ADV_TIMEOUT, 0); + } + } + else /* CONNECT_IND or CONNECT_REQ received */ + { + BbBleData_t * const pBle = &pAdvSet->bleData; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pAdvSet->auxBleData.op.slvAuxAdv; + + uint8_t *pBuf; + bool_t startConn = TRUE; + + if ((pBuf = pAdv->pRxReqBuf) != NULL) + { + /* Legacy advertising PDU. */ + + /* If peer address was not resolved, attempt to resolve it now. */ + if (!BbBlePduFiltCheck(pBuf, &pBle->pduFilt, TRUE, &pAdv->filtResults)) + { + startConn = FALSE; + } + } + else if ((pBuf = pAuxAdv->pRxAuxReqBuf) != NULL) + { + /* Extended advertising PDU. */ + lctrAdvbPduHdr_t hdr; + uint8_t *pTempBuf = pBuf; + lctrConnInd_t connInd; + bbBlePduExtFiltParams_t params; + + pTempBuf += lctrUnpackAdvbPduHdr(&hdr, pTempBuf); + lctrUnpackConnIndPdu(&connInd, pTempBuf); + + /* If peer address was not resolved, attempt to resolve it now. */ + + memset(¶ms, 0, sizeof(bbBlePduExtFiltParams_t)); + params.pduType = hdr.pduType; + params.extHdrFlags |= (LL_EXT_HDR_ADV_ADDR_BIT | LL_EXT_HDR_TGT_ADDR_BIT); /* ScanA and AdvA are mandatory. */ + params.peerAddr = connInd.initAddr; + params.peerAddrRand = hdr.txAddrRnd; + params.localAddr = connInd.advAddr; + params.localAddrRand = hdr.rxAddrRnd; + + if (!BbBleExtPduFiltCheck(¶ms, &pBle->pduFilt, TRUE, &pAuxAdv->filtResults)) + { + startConn = FALSE; + } + } + + if (startConn && pBuf) + { + lctrConnEstablish_t *pMsg; + + if ((pMsg = (lctrConnEstablish_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + lctrAdvbPduHdr_t hdr; + + pMsg->hdr.handle = pAdvSet->handle; + pMsg->hdr.dispId = LCTR_DISP_CONN_IND; + /* pMsg->hdr.event = 0; */ + + pBuf += lctrUnpackAdvbPduHdr(&hdr, pBuf); + lctrUnpackConnIndPdu(&pMsg->connInd, pBuf); + + if (pAdv->pRxReqBuf) + { + /* Legacy advertising. */ + BbBlePduFiltResultsGetPeerIdAddr(&pAdv->filtResults, &pMsg->peerIdAddr, &pMsg->peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pAdv->filtResults, &pMsg->peerRpa); + pMsg->phy = LL_PHY_LE_1M; + } + else + { + BbBlePduFiltResultsGetPeerIdAddr(&pAuxAdv->filtResults, &pMsg->peerIdAddr, &pMsg->peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pAuxAdv->filtResults, &pMsg->peerRpa); + pMsg->phy = pAdvSet->auxBleData.chan.rxPhy; /* Same PHY as received CONN_IND. */ + } + + pMsg->connIndEndTs = pAdvSet->connIndEndTs; + pMsg->localRpa = lmgrSlvAdvCb.localRpa; + + pMsg->usedChSel = pAdvSet->usedChSel; + + pMsg->sendAdvSetTerm = TRUE; + pMsg->numExtAdvEvents = pAdvSet->numEvents; + pMsg->isAuxConnReq = pAdvSet->isAuxConnReq; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + + lctrExtAdvCleanup(pAdvSet); + /* BbStop(BB_PROT_BLE); */ /* Remains enabled; connection starts immediately afterwards. */ + } + else + { + /* Restart advertising. */ + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_INT_START); + + /* Do not cleanup. Restarting will reuse resources. */ + /* lctrExtAdvCleanup(pAdvSet); */ + /* BbStop(BB_PROT_BLE); */ + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Terminated advertising after host advertising disable. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActAdvTerm(lctrAdvSet_t *pAdvSet) +{ + lctrExtAdvCleanup(pAdvSet); + BbStop(BB_PROT_BLE); + + LmgrSendExtAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup Advertising Set after host reset. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActReset(lctrAdvSet_t *pAdvSet) +{ + /* Although the AdvSet is freed here, some benign modifications to the context may occurs + * to complete the SM call path. */ + lctrFreeAdvSet(pAdvSet); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated advertising and cleanup Advertising Set after host reset. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActResetTerm(lctrAdvSet_t *pAdvSet) +{ + lctrExtAdvCleanup(pAdvSet); + BbStop(BB_PROT_BLE); + + /* Although the AdvSet is freed here, some benign modifications to the context may occurs + * to complete the SM call path. */ + lctrFreeAdvSet(pAdvSet); +} + +/*************************************************************************************************/ +/*! + * \brief Advertising set duration timer expired. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtAdvActDurationExpired(lctrAdvSet_t *pAdvSet) +{ + pAdvSet->termReason = LL_ERROR_CODE_ADV_TIMEOUT; + + /* Signal shutdown, event completion occurs in lctrExtAdvActSelfTerm(). */ + pAdvSet->shutdown = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Build channel remapping table. + * + * \param pChanParam Channel parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicBuildRemapTable(lctrChanParam_t *pChanParam) +{ + unsigned int chanIdx; + unsigned int numUsedChan = 0; + + for (chanIdx = 0; chanIdx < sizeof(pChanParam->chanRemapTbl); chanIdx++) + { + if (pChanParam->chanMask & (UINT64_C(1) << chanIdx)) + { + pChanParam->chanRemapTbl[numUsedChan++] = chanIdx; + } + } + + WSF_ASSERT(numUsedChan); /* must have at least one channel */ + + pChanParam->numUsedChan = numUsedChan; +} + +/*************************************************************************************************/ +/*! + * \brief Start periodic advertising. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActStart(lctrAdvSet_t *pAdvSet) +{ + uint8_t status; + + BbStart(BB_PROT_BLE); + + pAdvSet->perParam.shutdown = FALSE; + pAdvSet->perParam.perAccessAddr = lctrComputeAccessAddr(); + pAdvSet->perParam.perEventCounter = 0; + pAdvSet->perParam.perChanParam.chanMask = LL_CHAN_DATA_ALL; + lctrPeriodicBuildRemapTable(&pAdvSet->perParam.perChanParam); + pAdvSet->perParam.perChanParam.usedChSel = LL_CH_SEL_2; + pAdvSet->perParam.perChanParam.chIdentifier = (pAdvSet->perParam.perAccessAddr >> 16) ^ + (pAdvSet->perParam.perAccessAddr >> 0); + pAdvSet->perParam.perChIdx = lctrPeriodicSelectNextChannel(&pAdvSet->perParam.perChanParam, + pAdvSet->perParam.perEventCounter); + + if ((status = lctrSlvPeriodicAdvBuildOp(pAdvSet)) != LL_SUCCESS) + { + lctrSendPeriodicAdvSetMsg(pAdvSet, LCTR_PER_ADV_MSG_TERMINATE); + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, status); + return; + } + + pAdvSet->perParam.perAdvEnabled = TRUE; + + /* Need to set the flag to add aux BOD when extened adv is already started. */ + if (pAdvSet->state == LCTR_EXT_ADV_STATE_ENABLED && pAdvSet->auxBodUsed == FALSE) + { + pAdvSet->perParam.perAuxStart = TRUE; + } + + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Restart periodic advertising. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActUpdate(lctrAdvSet_t *pAdvSet) +{ + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); + // TODO cause random address to change +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising operation confirm. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActAdvCnf(lctrAdvSet_t *pAdvSet) +{ + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising operation command disallowed. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActDisallowAdvCnf(lctrAdvSet_t *pAdvSet) +{ + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active periodic advertising operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActShutdown(lctrAdvSet_t *pAdvSet) +{ + pAdvSet->perParam.shutdown = TRUE; + pAdvSet->perParam.perAdvEnabled = FALSE; + pAdvSet->perParam.perAuxStart = FALSE; + /* Shutdown completes with events generated in BOD end callback. */ +} + +/*************************************************************************************************/ +/*! + * \brief Terminated advertising after host periodic advertising disable. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActAdvTerm(lctrAdvSet_t *pAdvSet) +{ + BbStop(BB_PROT_BLE); + + SchRmRemove(LL_MAX_CONN + LCTR_GET_EXT_ADV_INDEX(pAdvSet)); + + LmgrSendPeriodicAdvEnableCnf(pAdvSet->handle, LL_SUCCESS); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated periodc advertising after host reset. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPeriodicAdvActResetTerm(lctrAdvSet_t *pAdvSet) +{ + BbStop(BB_PROT_BLE); + + SchRmRemove(LL_MAX_CONN + LCTR_GET_EXT_ADV_INDEX(pAdvSet)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..a4f4da2a9d22b0523f11e9bbc727853688ce4964 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn.c @@ -0,0 +1,1354 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller connection state machine action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_adv_slave.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "lmgr_api_conn.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_timer.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Use special token to indicate no notification is required. */ +#define LCTR_RESET_TERM_REASON 0xFF + +/*! \brief Valid feature bits applicable between controllers */ +#define LCTR_FEAT_PEER_MASK (LL_FEAT_ENCRYPTION | \ + LL_FEAT_CONN_PARAM_REQ_PROC | \ + LL_FEAT_EXT_REJECT_IND | \ + LL_FEAT_SLV_INIT_FEAT_EXCH | \ + LL_FEAT_DATA_LEN_EXT | \ + LL_FEAT_LE_2M_PHY | \ + LL_FEAT_STABLE_MOD_IDX_TRANSMITTER | \ + LL_FEAT_STABLE_MOD_IDX_RECEIVER | \ + LL_FEAT_LE_CODED_PHY | \ + LL_FEAT_CH_SEL_2 | \ + LL_FEAT_LE_POWER_CLASS_1) + +/*! \brief Used feature bitmask, i.e. FeatureSet[0]. */ +#define LCTR_USED_FEAT_SET_MASK 0xFF + +/*************************************************************************************************/ +/*! + * \brief Validate connection parameter range. + * + * \param pConnParam Connection Parameter. + * + * \return Status error code. + */ +/*************************************************************************************************/ +static bool_t lctrValidateConnParam(const lctrConnParam_t *pConnParam) +{ + if (pConnParam->connIntervalMin != pConnParam->connIntervalMax) + { + if ((pConnParam->prefPeriod == 0) || + (pConnParam->prefPeriod > pConnParam->connIntervalMax)) + { + return FALSE; + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connect indication. + * + * \param handle Connection handle. + * \param role Role. + * \param pConnInd Connection indication. + * \param peerIdAddrType Peer ID address type. + * \param peerIdAddr Peer ID address. + * \param peerRpa Peer RPA. + * \param localRpa Local RPA. + * \param status Status. + * \param usedChSel Used channel selection algorithm. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostConnectInd(uint16_t handle, uint8_t role, lctrConnInd_t *pConnInd, + uint8_t peerIdAddrType, uint64_t peerIdAddr, uint64_t peerRpa, + uint64_t localRpa, uint8_t status, uint8_t usedChSel) +{ + uint8_t *pBuf; + + LlConnInd_t connEvt; + connEvt.hdr.param = handle; + connEvt.hdr.event = LL_CONN_IND; + connEvt.hdr.status = status; + connEvt.status = status; + connEvt.handle = handle; + connEvt.role = role; + connEvt.addrType = peerIdAddrType; + + if (pConnInd) + { + connEvt.connInterval = pConnInd->interval; + connEvt.connLatency = pConnInd->latency; + connEvt.supTimeout = pConnInd->timeout; + connEvt.clockAccuracy = pConnInd->masterSca; + } + + pBuf = (uint8_t *)&connEvt.peerAddr; + BDA64_TO_BSTREAM(pBuf, peerIdAddr); + + pBuf = (uint8_t *)&connEvt.peerRpa; + BDA64_TO_BSTREAM(pBuf, peerRpa); + + pBuf = (uint8_t *)&connEvt.localRpa; + BDA64_TO_BSTREAM(pBuf, localRpa); + + LL_TRACE_INFO2("### LlEvent ### LL_CONN_IND, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&connEvt); + + if ((status == LL_SUCCESS) && + (lmgrCb.features & LL_FEAT_CH_SEL_2)) + { + LlChSelInd_t chSelEvt; + chSelEvt.hdr.param = handle; + chSelEvt.hdr.event = LL_CH_SEL_ALGO_IND; + chSelEvt.hdr.status = status; + chSelEvt.handle = handle; + chSelEvt.usedChSel = usedChSel; + + LL_TRACE_INFO3("### LlEvent ### LL_CH_SEL_ALGO_IND, handle=%u, status=%u, usedChSel=%u", handle, status, usedChSel); + + LmgrSendEvent((LlEvt_t *)&chSelEvt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store connection update connection specification. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnUpdateSpec(lctrConnCtx_t *pCtx) +{ + pCtx->connUpdSpec = pLctrConnMsg->connUpd.connSpec; +} + +/*************************************************************************************************/ +/*! + * \brief Store connect update parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnUpdate(lctrConnCtx_t *pCtx) +{ + /* Check for valid parameters. */ + if ((uint16_t)(lctrDataPdu.pld.connUpdInd.instant - pCtx->eventCounter) >= LCTR_MAX_INSTANT) + { + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_INST_PASSED); + } + + pCtx->connUpd = lctrDataPdu.pld.connUpdInd; +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connection update indication. + * + * \param pCtx Connection context. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostConnUpdateInd(lctrConnCtx_t *pCtx, uint8_t status) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlConnUpdateInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_CONN_UPDATE_IND; + evt.hdr.status = status; + evt.status = status; + evt.handle = handle; + + if (status == LL_SUCCESS) + { + evt.connInterval = pCtx->connUpd.interval; + evt.connLatency = pCtx->connUpd.latency; + evt.supTimeout = pCtx->connUpd.timeout; + } + + LL_TRACE_INFO2("### LlEvent ### LL_CONN_UPDATE_IND, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Store channel map parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreChanMapUpdate(lctrConnCtx_t *pCtx) +{ + pCtx->chanMapUpd.chanMask = pLctrConnMsg->chanMapUpd.chanMap; +} + +/*************************************************************************************************/ +/*! + * \brief Send channel map update indication PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendChanMapUpdateInd(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_CHAN_MAP_IND_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.eventCounterOffset) + { + pCtx->chanMapUpd.instant = pCtx->eventCounter + + llTesterCb.eventCounterOffset + 1; /* +1 for next CE */ + } + else +#endif + { + pCtx->chanMapUpd.instant = pCtx->eventCounter + + LL_MIN_INSTANT + 1 + /* +1 for next CE */ + pCtx->maxLatency; /* ensure slave will listen to this packet */ + } + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_CHANNEL_MAP_IND); + + UINT40_TO_BSTREAM(pBuf, pCtx->chanMapUpd.chanMask); + UINT16_TO_BSTREAM(pBuf, pCtx->chanMapUpd.instant); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store channel map parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreChanMap(lctrConnCtx_t *pCtx) +{ + pCtx->chanMapUpd = lctrDataPdu.pld.chanMapInd; + + /* Check for valid parameters. */ + if (((uint16_t)(pCtx->chanMapUpd.instant - pCtx->eventCounter) >= LCTR_MAX_INSTANT) || + (pCtx->chanMapUpd.chanMask == 0)) /* must have at least one channel */ + { + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_INST_PASSED); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send feature request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendFeatureReq(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_FEATURE_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + uint8_t opcode = (pCtx->role == LL_ROLE_MASTER) ? LL_PDU_FEATURE_REQ : LL_PDU_SLV_FEATURE_REQ; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, opcode); + UINT64_TO_BSTREAM(pBuf, (lmgrCb.features & LCTR_FEAT_PEER_MASK)); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send feature response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendFeatureRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + uint64_t featSet; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_FEATURE_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_FEATURE_RSP); + + featSet = (pCtx->usedFeatSet & LCTR_USED_FEAT_SET_MASK) | /* FeatureSet[0] used by master and slave */ + (lmgrCb.features & ~LCTR_USED_FEAT_SET_MASK); /* FeatureSet[1..7] used by sender */ + UINT64_TO_BSTREAM(pBuf, (featSet & LCTR_FEAT_PEER_MASK)); /* Only send valid features bits between controllers. */ + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store remote feature data. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreUsedFeatures(lctrConnCtx_t *pCtx) +{ + pCtx->usedFeatSet = lmgrCb.features & lctrDataPdu.pld.featReqRsp.featSet; + pCtx->featExchFlag = TRUE; + + /* Update stable modulation index. */ + pCtx->bleData.chan.peerTxStableModIdx = + (lctrDataPdu.pld.featReqRsp.featSet & LL_FEAT_STABLE_MOD_IDX_TRANSMITTER) ? TRUE : FALSE; + pCtx->bleData.chan.peerRxStableModIdx = + (lctrDataPdu.pld.featReqRsp.featSet & LL_FEAT_STABLE_MOD_IDX_RECEIVER) ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Send version indication PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendVersionInd(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + /* Maximum of one LL_VERSION_IND must be sent to peer. */ + if (pCtx->numSentVerInd == 0) + { + pCtx->numSentVerInd++; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_VERSION_IND_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_VERSION_IND); + UINT8_TO_BSTREAM(pBuf, pLctrRtCfg->btVer); + UINT16_TO_BSTREAM(pBuf, pLctrRtCfg->compId); + UINT16_TO_BSTREAM(pBuf, pLctrRtCfg->implRev); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } + } + else + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_LMP_PDU_NOT_ALLOWED, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store remote version data. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreRemoteVer(lctrConnCtx_t *pCtx) +{ + if (!pCtx->remoteVerValid) + { + pCtx->remoteVerValid = TRUE; + pCtx->remoteVer = lctrDataPdu.pld.verInd; + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of read remote version confirm. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostReadRemoteVerCnf(lctrConnCtx_t *pCtx) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlReadRemoteVerInfoCnf_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_READ_REMOTE_VER_INFO_CNF; + evt.hdr.status = LL_SUCCESS; + evt.status = LL_SUCCESS; + evt.handle = handle; + evt.version = pCtx->remoteVer.versNr; + evt.mfrName = pCtx->remoteVer.compId; + evt.subversion = pCtx->remoteVer.subVersNr; + + LL_TRACE_INFO1("### LlEvent ### LL_READ_REMOTE_VER_INFO_CNF, handle=%u, status=LL_SUCCESS", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send terminate indication PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendTerminateInd(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + uint8_t *pBuf; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_TERMINATE_IND_PDU_LEN)) != NULL) + { + pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_TERMINATE_IND); + UINT8_TO_BSTREAM(pBuf, pCtx->termReason); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of disconnect indication. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostDisconnectInd(lctrConnCtx_t *pCtx) +{ + if (pCtx->termReason < LCTR_RESET_TERM_REASON) + { + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlDisconnectInd_t evt; + evt.hdr.param = handle, + evt.hdr.event = LL_DISCONNECT_IND; + evt.hdr.status = LL_SUCCESS; + + evt.status = LL_SUCCESS; + evt.handle = handle; + evt.reason = pCtx->termReason; + + if (pCtx->llcpNotifyMask & (1 << LCTR_PROC_CMN_TERM)) + { + /* Host initiated termination. */ + evt.reason = LL_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST; + } + + LL_TRACE_INFO2("### LlEvent ### LL_DISCONNECT_IND, handle=%u, status=LL_SUCCESS, reason=%u", handle, pCtx->termReason); + + LmgrSendEvent((LlEvt_t *)&evt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store LLCP termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = lctrDataPdu.pld.termInd.errorCode; + + /* Ensure Ack for the received LL_TERMINATE_IND is Tx'ed. */ + pCtx->termAckReqd = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Store host initiated disconnect termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreDisconnectReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = pLctrConnMsg->disc.reason; +} + +/*************************************************************************************************/ +/*! + * \brief Store connection failed to establish termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnFailEstablishTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LL_ERROR_CODE_CONN_FAILED_TO_ESTABLISH; +} + +/*************************************************************************************************/ +/*! + * \brief Store LLCP timeout termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreLlcpTimeoutTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LL_ERROR_CODE_LMP_LL_RESP_TIMEOUT; +} + +/*************************************************************************************************/ +/*! + * \brief Store reset termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreResetTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LCTR_RESET_TERM_REASON; +} + +/*************************************************************************************************/ +/*! + * \brief Store invalid request termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreInstantPassedTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LL_ERROR_CODE_INSTANT_PASSED; +} + +/*************************************************************************************************/ +/*! + * \brief Store invalid request termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreMicFailedTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LL_ERROR_CODE_CONN_TERM_MIC_FAILURE; +} + +/*************************************************************************************************/ +/*! + * \brief Store connection parameter request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnParamReq(lctrConnCtx_t *pCtx) +{ + pCtx->connParam = lctrDataPdu.pld.connParamReqRsp; +} + +/*************************************************************************************************/ +/*! + * \brief Store connection parameter request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnParamRsp(lctrConnCtx_t *pCtx) +{ + LlConnSpec_t peerRsp; + peerRsp.connIntervalMin = lctrDataPdu.pld.connParamReqRsp.connIntervalMin; + peerRsp.connIntervalMax = lctrDataPdu.pld.connParamReqRsp.connIntervalMax; + peerRsp.connLatency = lctrDataPdu.pld.connParamReqRsp.connLatency; + peerRsp.supTimeout = lctrDataPdu.pld.connParamReqRsp.supTimeout; + peerRsp.minCeLen = 0; + peerRsp.maxCeLen = 0; + + if (!lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP) && + (LctrValidateConnSpec(&peerRsp) == LL_SUCCESS)) + { + /* Store slave's connection parameter response. */ + pCtx->connParam = lctrDataPdu.pld.connParamReqRsp; + + if (!lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_MST_UNCOND_CP_RSP)) + { + /* Ensure slave's response is within master's original connection update parameters. */ + if ((lctrDataPdu.pld.connParamReqRsp.connIntervalMin >= pCtx->connUpdSpec.connIntervalMin) && + (lctrDataPdu.pld.connParamReqRsp.connIntervalMin <= pCtx->connUpdSpec.connIntervalMax)) + { + pCtx->connUpdSpec.connIntervalMin = WSF_MAX(pCtx->connUpdSpec.connIntervalMin, + lctrDataPdu.pld.connParamReqRsp.connIntervalMin); + } + + if ((lctrDataPdu.pld.connParamReqRsp.connIntervalMax >= pCtx->connUpdSpec.connIntervalMin) && + (lctrDataPdu.pld.connParamReqRsp.connIntervalMax <= pCtx->connUpdSpec.connIntervalMax)) + { + pCtx->connUpdSpec.connIntervalMax = WSF_MIN(pCtx->connUpdSpec.connIntervalMax, + lctrDataPdu.pld.connParamReqRsp.connIntervalMax); + } + + pCtx->connUpdSpec.connLatency = WSF_MIN(pCtx->connUpdSpec.connLatency, + lctrDataPdu.pld.connParamReqRsp.connLatency); + pCtx->connUpdSpec.supTimeout = WSF_MAX(pCtx->connUpdSpec.supTimeout, + lctrDataPdu.pld.connParamReqRsp.supTimeout); + + /* pCtx->connUpdSpec.minCeLen = 0; */ /* ignored */ + /* pCtx->connUpdSpec.maxCeLen = 0; */ /* ignored */ + } + else + { + pCtx->connUpdSpec = peerRsp; + } + } + else + { + LL_TRACE_WARN1("Ignoring peer parameter received LL_CONNECTION_PARAM_RSP, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store connection parameter connection specification. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnParamSpec(lctrConnCtx_t *pCtx) +{ + pCtx->connUpdSpec = pLctrConnMsg->connParamReply.connSpec; +} + +/*************************************************************************************************/ +/*! + * \brief Send connection parameter request PDU to peer. + * + * \param pCtx Connection context. + * \param opcode Pdu Opcode. + * \param pConnSpec Connection specification. + * \param prefPeriod Preferred periodicity. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSendConnParamPdu(lctrConnCtx_t *pCtx, uint8_t opcode, LlConnSpec_t *pConnSpec, uint8_t prefPeriod) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_CONN_PARAM_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + unsigned int i; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM (pBuf, opcode); + + UINT16_TO_BSTREAM(pBuf, pConnSpec->connIntervalMin); + UINT16_TO_BSTREAM(pBuf, pConnSpec->connIntervalMax); + UINT16_TO_BSTREAM(pBuf, pConnSpec->connLatency); + UINT16_TO_BSTREAM(pBuf, pConnSpec->supTimeout); + + UINT8_TO_BSTREAM (pBuf, prefPeriod); + UINT16_TO_BSTREAM(pBuf, pCtx->eventCounter); + + for (i = 0; i < LCTR_OFFSET_COUNT; i++) + { + UINT16_TO_BSTREAM(pBuf, 0xFFFF); + } + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send connection parameter request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendConnParamReq(lctrConnCtx_t *pCtx) +{ +#if (LL_ENABLE_TESTER) + if (llTesterCb.connParamReqEnabled) + { + pCtx->connUpdSpec.connIntervalMin = llTesterCb.connParamReq.connIntervalMin; + pCtx->connUpdSpec.connIntervalMax = llTesterCb.connParamReq.connIntervalMax; + pCtx->connUpdSpec.connLatency = llTesterCb.connParamReq.connLatency; + pCtx->connUpdSpec.supTimeout = llTesterCb.connParamReq.supTimeout; + pCtx->connUpdSpec.minCeLen = 0; + pCtx->connUpdSpec.maxCeLen = 0; + llTesterCb.connParamReqEnabled = FALSE; + } +#endif + + lctrSendConnParamPdu(pCtx, LL_PDU_CONN_PARAM_REQ, &pCtx->connUpdSpec, LCTR_US_TO_CONN_IND(SchRmPreferredPeriodUsec())); +} + +/*************************************************************************************************/ +/*! + * \brief Send connection parameter response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendConnParamRsp(lctrConnCtx_t *pCtx) +{ + if ((pLctrRtCfg->maxConn > 1) && + (lmgrCb.numConnEnabled > 1)) + { + /* TODO resolve scheduling with multiple connections */ + WSF_ASSERT(0); + } + + lctrSendConnParamPdu(pCtx, LL_PDU_CONN_PARAM_RSP, &pLctrConnMsg->connParamReply.connSpec, 1); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of remote connection parameter change indication. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostConnParamInd(lctrConnCtx_t *pCtx) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + bool_t evtSent; + + LlConnSpec_t connSpec; + connSpec.connIntervalMin = pCtx->connParam.connIntervalMin; + connSpec.connIntervalMax = pCtx->connParam.connIntervalMax; + connSpec.connLatency = pCtx->connParam.connLatency; + connSpec.supTimeout = pCtx->connParam.supTimeout; + connSpec.minCeLen = 0; + connSpec.maxCeLen = 0; + + if (!lctrValidateConnParam(&pCtx->connParam) || + (LctrValidateConnSpec(&connSpec) != LL_SUCCESS)) + { + LlRemoteConnParamReqNegReply(handle, LL_ERROR_CODE_INVALID_LMP_PARAMS); + LL_TRACE_ERR1("Invalid connection parameters; reply with reason=INVALID_LMP_PARAMS, handle=%u", handle); + return; + } + + if ((pCtx->connParam.connIntervalMin != pCtx->connInterval) || // TODO compare to original conn min/max? + (pCtx->connParam.connIntervalMax != pCtx->connInterval) || + (pCtx->connParam.connLatency != pCtx->maxLatency) || + (LCTR_CONN_IND_TO_MS(pCtx->connParam.supTimeout) != pCtx->supTimeoutMs)) + { + LlRemConnParamInd_t evt; + + evt.hdr.param = handle; + evt.hdr.event = LL_REM_CONN_PARAM_IND; + evt.hdr.status = LL_SUCCESS; + + evt.handle = handle; + evt.connIntervalMin = pCtx->connParam.connIntervalMin; + evt.connIntervalMax = pCtx->connParam.connIntervalMax; + evt.connLatency = pCtx->connParam.connLatency; + evt.supTimeout = pCtx->connParam.supTimeout; + + LL_TRACE_INFO1("### LlEvent ### LL_REM_CONN_PARAM_IND, handle=%u, status=LL_SUCCESS", handle); + + evtSent = LmgrSendEvent((LlEvt_t *)&evt); + + if (!evtSent) + { + LlRemoteConnParamReqNegReply(handle, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE); + LL_TRACE_WARN1("Host event masked; reply with reason=UNSUPPORTED_REMOTE_FEATURE, handle=%u", handle); + } + return; + } + + /* If there is no change to the connection parameters, respond positively. */ + LlRemoteConnParamReqReply(handle, &connSpec); +} + +/*************************************************************************************************/ +/*! + * \brief Store local data length parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreLocalDataLength(lctrConnCtx_t *pCtx) +{ + /* Store local parameters */ + pCtx->localDataPdu.maxTxLen = pLctrConnMsg->dataLenChange.maxTxLen; + pCtx->localDataPdu.maxTxTime = pLctrConnMsg->dataLenChange.maxTxTime; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.dataLenReqEnabled) + { + pCtx->localDataPdu = llTesterCb.dataLenReq; + llTesterCb.dataLenReqEnabled = FALSE; + } +#endif + + /* Update connection event duration. */ + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); +} + +/*************************************************************************************************/ +/*! + * \brief Send data length request PDU to peer. + * + * \param pCtx Connection context. + * \param opcode PDU opcode. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSendDataLengthPdu(lctrConnCtx_t *pCtx, uint8_t opcode) +{ + uint8_t *pPdu; + uint16_t maxRxTime, maxTxTime; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_DATA_LEN_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM (pBuf, opcode); + + maxRxTime = pCtx->localDataPdu.maxRxTime; + maxTxTime = pCtx->localDataPdu.maxTxTime; + + /* If LL_FEAT_LE_CODED_PHY is not supported, maxRxTime and maxTxTime can not be more than 2120. */ + if (!(pCtx->usedFeatSet & LL_FEAT_LE_CODED_PHY)) + { + maxRxTime = WSF_MIN(pCtx->localDataPdu.maxRxTime, LL_MAX_DATA_TIME_ABS_MAX_1M); + maxTxTime = WSF_MIN(pCtx->localDataPdu.maxTxTime, LL_MAX_DATA_TIME_ABS_MAX_1M); + } + + UINT16_TO_BSTREAM(pBuf, pCtx->localDataPdu.maxRxLen); + UINT16_TO_BSTREAM(pBuf, maxRxTime); + UINT16_TO_BSTREAM(pBuf, pCtx->localDataPdu.maxTxLen); + UINT16_TO_BSTREAM(pBuf, maxTxTime); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send data length request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendDataLengthReq(lctrConnCtx_t *pCtx) +{ + lctrSendDataLengthPdu(pCtx, LL_PDU_LENGTH_REQ); +} + +/*************************************************************************************************/ +/*! + * \brief Send data length response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendDataLengthRsp(lctrConnCtx_t *pCtx) +{ + lctrSendDataLengthPdu(pCtx, LL_PDU_LENGTH_RSP); +} + +/*************************************************************************************************/ +/*! + * \brief Store remote data length parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreRemoteDataLength(lctrConnCtx_t *pCtx) +{ + lctrDataLen_t oldEffDataPdu; + + /* Check for valid parameters; allow parameters greater than known limits for compatibility. */ + if ((lctrDataPdu.pld.lenReq.maxTxLen < LL_MAX_DATA_LEN_MIN) || + (lctrDataPdu.pld.lenReq.maxRxLen < LL_MAX_DATA_LEN_MIN) || + (lctrDataPdu.pld.lenReq.maxTxTime < LL_MAX_DATA_TIME_MIN) || + (lctrDataPdu.pld.lenReq.maxRxTime < LL_MAX_DATA_TIME_MIN)) + { + LL_TRACE_WARN0("Received invalid parameters in LENGTH_PDU"); + return; + } + oldEffDataPdu = pCtx->effDataPdu; + + /* Compute effective values */ + pCtx->effDataPdu.maxTxLen = WSF_MIN(pCtx->localDataPdu.maxTxLen, lctrDataPdu.pld.lenReq.maxRxLen); + pCtx->effDataPdu.maxRxLen = WSF_MIN(pCtx->localDataPdu.maxRxLen, lctrDataPdu.pld.lenReq.maxTxLen); + pCtx->effDataPdu.maxTxTime = WSF_MIN(pCtx->localDataPdu.maxTxTime, lctrDataPdu.pld.lenReq.maxRxTime); + pCtx->effDataPdu.maxRxTime = WSF_MIN(pCtx->localDataPdu.maxRxTime, lctrDataPdu.pld.lenReq.maxTxTime); + if ((oldEffDataPdu.maxTxLen != pCtx->effDataPdu.maxTxLen) || + (oldEffDataPdu.maxRxLen != pCtx->effDataPdu.maxRxLen) || + (oldEffDataPdu.maxTxTime != pCtx->effDataPdu.maxTxTime) || + (oldEffDataPdu.maxRxTime != pCtx->effDataPdu.maxRxTime)) + { + lctrNotifyHostDataLengthInd(pCtx, LL_SUCCESS); + } + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); + + + LL_TRACE_INFO2("Effective data lengths maxTxLen=%u, maxRxLen=%u", pCtx->effDataPdu.maxTxLen, pCtx->effDataPdu.maxRxLen); + LL_TRACE_INFO2("Effective data times maxTxTime=%u, maxRxTime=%u", pCtx->effDataPdu.maxTxTime, pCtx->effDataPdu.maxRxTime); +} + +/*************************************************************************************************/ +/*! + * \brief Send set minimum number of used channels indication PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSendSetMinUsedChanPdu(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_MIN_USED_CHAN_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM (pBuf, LL_PDU_MIN_USED_CHAN_IND); + + UINT8_TO_BSTREAM(pBuf, pLctrConnMsg->setMinUsedChan.phys); + UINT8_TO_BSTREAM(pBuf, pLctrConnMsg->setMinUsedChan.minUsedChan); + + /*** Queue for transmit. ***/ + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send set minimum number of used channels indication PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendSetMinUsedChanInd(lctrConnCtx_t *pCtx) +{ + lctrSendSetMinUsedChanPdu(pCtx); + + /* The procedure completes after sending out the indication. */ + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CMN_SET_MIN_USED_CHAN); + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); +} + +/*************************************************************************************************/ +/*! + * \brief Store remote minimum number of used channels parameters. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreSetMinUsedChan(lctrConnCtx_t *pCtx) +{ + unsigned i; + + for (i = 0; i < LL_MAX_PHYS; i++) + { + /* Update the PHYs which are set. */ + if ((lctrDataPdu.pld.minUsedChanInd.phys & (1 << i)) == (1 << i)) + { + pCtx->peerMinUsedChan[i] = lctrDataPdu.pld.minUsedChanInd.minUsedChan; + } + } + + /* The procedure completes after receiving the indication. */ + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of data length change indication. + * + * \param pCtx Connection context. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostDataLengthInd(lctrConnCtx_t *pCtx, uint8_t status) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlDataLenChangeInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_DATA_LEN_CHANGE_IND; + evt.hdr.status = status; + evt.handle = handle; + + evt.maxTxLen = pCtx->effDataPdu.maxTxLen; + evt.maxTxTime = pCtx->effDataPdu.maxTxTime; + evt.maxRxLen = pCtx->effDataPdu.maxRxLen; + evt.maxRxTime = pCtx->effDataPdu.maxRxTime; + + LL_TRACE_INFO2("### LlEvent ### LL_DATA_LEN_CHANGE_IND, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send unknown response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendUnknownRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_UNKNOWN_RSP_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_UNKNOWN_RSP); + UINT8_TO_BSTREAM(pBuf, lctrDataPdu.opcode); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send reject indication PDU to peer in response to an unacceptable PDU. + * + * \param pCtx Connection context. + * \param reason Reason code. + * \param forceRejectExtInd TRUE to force using LL_REJECT_EXT_IND. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendRejectInd(lctrConnCtx_t *pCtx, uint8_t reason, bool_t forceRejectExtInd) +{ + uint8_t *pPdu; + bool_t rejectExtInd; + + rejectExtInd = forceRejectExtInd || + ((pCtx->usedFeatSet & LL_FEAT_EXT_REJECT_IND) && + pCtx->featExchFlag); /* only use extended if peer supports it */ + + if (rejectExtInd) + { + if ((pPdu = lctrTxCtrlPduAlloc(LL_REJECT_EXT_IND_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_REJECT_EXT_IND); + UINT8_TO_BSTREAM(pBuf, lctrDataPdu.opcode); + UINT8_TO_BSTREAM(pBuf, reason); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } + } + else + { + if ((pPdu = lctrTxCtrlPduAlloc(LL_REJECT_IND_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_REJECT_IND); + UINT8_TO_BSTREAM(pBuf, reason); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Start LLCP timer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStartLlcpTimer(lctrConnCtx_t *pCtx) +{ + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_LLCP_TIMER)) + { + if (pCtx->llcpNotifyMask & (1 << LCTR_PROC_CMN_TERM)) + { + WsfTimerStartMs(&pCtx->tmrProcRsp, pCtx->supTimeoutMs); + } + else + { + WsfTimerStartSec(&pCtx->tmrProcRsp, LL_T_PRT_SEC); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop LLCP timer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStopLlcpTimer(lctrConnCtx_t *pCtx) +{ + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_LLCP_TIMER)) + { + WsfTimerStop(&pCtx->tmrProcRsp); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start pending LLCP procedure. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStartPendingLlcp(lctrConnCtx_t *pCtx) +{ + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_START_PENDING); +} + +/*************************************************************************************************/ +/*! + * \brief Pause Tx data PDUs. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPauseTxData(lctrConnCtx_t *pCtx) +{ + pCtx->pauseTxData = TRUE; + LL_TRACE_INFO1(" >>> Data Path Tx Paused, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Unpause Tx data PDUs. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrUnpauseTxData(lctrConnCtx_t *pCtx) +{ + pCtx->pauseTxData = FALSE; + LL_TRACE_INFO1(" >>> Data Path Tx Unpaused/Resumed, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); + + /*** Queue any pending LE-U data for transmit. ***/ + + if (!WsfQueueEmpty(&pCtx->txLeuQ)) + { + wsfHandlerId_t connHandle; + uint8_t *pAclBuf; + uint16_t fragLen = lctrTxFragLen(pCtx); + + while ((pAclBuf = WsfMsgDeq(&pCtx->txLeuQ, &connHandle)) != NULL) + { + lctrAclHdr_t aclHdr; + + /*** Disassemble ACL packet. ***/ + + lctrUnpackAclHdr(&aclHdr, pAclBuf); + lctrTxDataPduQueue(pCtx, fragLen, &aclHdr, pAclBuf); + } + + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_TX_PENDING)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if Tx data pending. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCheckPauseComplete(lctrConnCtx_t *pCtx) +{ + if (WsfQueueEmpty(&pCtx->txArqQ)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_ARQ_Q_FLUSHED); + } +} + +/*************************************************************************************************/ +/*! + * \brief Pause Rx data PDUs. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPauseRxData(lctrConnCtx_t *pCtx) +{ + pCtx->pauseRxData = TRUE; + LL_TRACE_INFO1(" >>> Data Path Rx Paused, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Unpause Rx data PDUs. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrUnpauseRxData(lctrConnCtx_t *pCtx) +{ + pCtx->pauseRxData = FALSE; + LL_TRACE_INFO1(" >>> Data Path Rx Unpaused/Resumed, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..8677a75a828f46f92938f1b995de1ad268ddf0ad --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master.c @@ -0,0 +1,91 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn_master.h" +#include "lctr_pdu_adv.h" +#include "lctr_int_adv_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Send connection update request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendConnUpdateInd(lctrConnCtx_t *pCtx) +{ + uint32_t interMinUsec, interMaxUsec, durUsec, connIntervalUsec; + pCtx->connUpd.txWinSize = LL_MIN_TX_WIN_SIZE; + pCtx->connUpd.latency = pCtx->connUpdSpec.connLatency; + pCtx->connUpd.timeout = pCtx->connUpdSpec.supTimeout; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.connUpdIndEnabled) + { + pCtx->connUpd = llTesterCb.connUpdInd; + + llTesterCb.connUpdIndEnabled = FALSE; + pCtx->data.mst.sendConnUpdInd = TRUE; + + return; + } +#endif + + interMinUsec = LCTR_CONN_IND_US(pCtx->connUpdSpec.connIntervalMin); + interMaxUsec = LCTR_CONN_IND_US(pCtx->connUpdSpec.connIntervalMax); + durUsec = pCtx->localConnDurUsec; + + /* TODO: accommodate pCtx->connParam.prefPeriod. */ + if (!SchRmStartUpdate(LCTR_GET_CONN_HANDLE(pCtx), interMinUsec, interMaxUsec, durUsec, &connIntervalUsec)) + { + LL_TRACE_WARN1("Could not update connection, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_REJECT_CONN_UPD); + return; + } + + pCtx->connUpd.interval = LCTR_US_TO_CONN_IND(connIntervalUsec); + + /* Delay delivery until txWindowOffset can be computed. */ + pCtx->data.mst.sendConnUpdInd = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Reload an empty BOD with a data PDU. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstReloadDataPdu(lctrConnCtx_t *pCtx) +{ + /* Modify the next CE. Possible changes include empty CE or modification of MD. */ + SchReload(&pCtx->connBod); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..2b1ec0b50747dd032c45c548622a5dc2924d6685 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_conn_master_ae.c @@ -0,0 +1,229 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_init_master_ae.h" +#include "lctr_int_conn_master.h" +#include "lmgr_api_adv_master_ae.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Setup connection context and BOD. + * + * \param pExtInitCtx Extended initiate context. + * \param pConnSpec Connection spec. + * + * \return TRUE if successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static uint8_t lctrExtInitSetupConn(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec) +{ + lctrConnCtx_t *pCtx; + uint32_t connInterUsec; + uint32_t interMinUsec, interMaxUsec, durUsec; + + /* Allow only one connection between two devices. */ + if ((pCtx = lctrAllocConnCtx()) == NULL) + { + return LL_ERROR_CODE_CONN_LIMIT_EXCEEDED; + } + + interMinUsec = LCTR_CONN_IND_US(pConnSpec->connIntervalMin); + interMaxUsec = LCTR_CONN_IND_US(pConnSpec->connIntervalMax); + durUsec = pCtx->localConnDurUsec; + + if (!SchRmAdd(LCTR_GET_CONN_HANDLE(pCtx), interMinUsec, interMaxUsec, durUsec, &connInterUsec)) + { + lctrFreeConnCtx(pCtx); + return LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL; + } + + pExtInitCtx->data.init.connHandle = LCTR_GET_CONN_HANDLE(pCtx); + pExtInitCtx->data.init.connInterval = LCTR_US_TO_CONN_IND(connInterUsec); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Start initiate connection scan. + * + * \param pExtInitCtx Extended initiate context. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * \param filtPolicy Initiate filter policy. + * \param ownAddrType Own address type. + * + * \return Status code. + */ +/*************************************************************************************************/ +uint8_t lctrExtInitSetupInitiate(lctrExtScanCtx_t *pExtInitCtx, uint8_t peerAddrType, uint64_t peerAddr, + uint8_t filtPolicy, uint8_t ownAddrType) +{ + uint8_t status; + + if ((status = lctrExtInitSetupConn(pExtInitCtx, &pExtInitCtx->data.init.connSpec)) != LL_SUCCESS) + { + lctrScanNotifyHostInitiateError(status, peerAddrType, peerAddr); + lctrSendExtInitMsg(pExtInitCtx, LCTR_EXT_INIT_MSG_INITIATE_CANCEL); + return status; + } + + /* Reset state. */ + pExtInitCtx->selfTerm = FALSE; + pExtInitCtx->shutdown = FALSE; + pExtInitCtx->auxOpPending = FALSE; + pExtInitCtx->bodTermCnt = 0; + pExtInitCtx->data.init.filtPolicy = filtPolicy; + pExtInitCtx->data.init.ownAddrType = ownAddrType; + pExtInitCtx->data.init.connBodLoaded = FALSE; + + BbStart(BB_PROT_BLE); + + if (((status = lctrMstExtInitiateBuildOp(pExtInitCtx, + &pExtInitCtx->data.init.connSpec, + peerAddr, + peerAddrType)) != LL_SUCCESS) || + ((status = lctrMstAuxInitiateBuildOp(pExtInitCtx, + &pExtInitCtx->data.init.connSpec, + peerAddr, + peerAddrType)) != LL_SUCCESS)) + { + BbStop(BB_PROT_BLE); + lctrScanNotifyHostInitiateError(status, peerAddrType, peerAddr); + lctrSendExtInitMsg(pExtInitCtx, LCTR_EXT_INIT_MSG_INITIATE_CANCEL); + return status; + } + + switch (pExtInitCtx->data.init.filtPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrIncWhitelistRefCount(); + break; + default: + break; + } + + lmgrCb.numInitEnabled++; + LmgrIncResetRefCount(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Establish connection. + * + * \param pExtInitCtx Extended initiate context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtInitActConnect(lctrExtScanCtx_t *pExtInitCtx) +{ + lctrConnEstablish_t *pMsg; + lctrConnCtx_t *pCtx; + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + uint64_t peerRpa = 0; + + if ((pMsg = (lctrConnEstablish_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pCtx = LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle); + + pCtx->role = LL_ROLE_MASTER; + + pMsg->hdr.handle = LCTR_GET_CONN_HANDLE(pCtx); + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MST_ESTABLISH; + + pMsg->connInd = pExtInitCtx->data.init.connInd; + + if (pExtInitCtx->data.init.isLegacy == TRUE) + { + BbBleMstAdvEvent_t * const pScan = &pExtInitCtx->scanBleData.op.mstAdv; + BbBlePduFiltResultsGetPeerIdAddr(&pScan->filtResults, &peerIdAddr, &peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pScan->filtResults, &peerRpa); + } + else + { + BbBleMstAuxAdvEvent_t * const pAuxScan = &pExtInitCtx->auxBleData.op.mstAuxAdv; + BbBlePduFiltResultsGetPeerIdAddr(&pAuxScan->filtResults, &peerIdAddr, &peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pAuxScan->filtResults, &peerRpa); + } + + pMsg->peerIdAddrType = peerIdAddrType; + pMsg->peerIdAddr = peerIdAddr; + pMsg->peerRpa = peerRpa; + pMsg->localRpa = pExtInitCtx->data.init.localRpa; + + pMsg->usedChSel = pExtInitCtx->data.init.usedChSel; + pMsg->phy = pExtInitCtx->data.init.phy; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + /* Shutdown scanner. */ + lctrMstExtInitCleanupOp(pExtInitCtx); + lctrMstExtInit.estConnPhys = 1 << LCTR_GET_EXT_INIT_HANDLE(pExtInitCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Common initiate resource cleanup. + * + * \param pExtInitCtx Extended initiate context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtInitCleanupOp(lctrExtScanCtx_t *pExtInitCtx) +{ + BbBleMstAdvEvent_t *pScan; + + BbStop(BB_PROT_BLE); + + switch (pExtInitCtx->data.init.filtPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrDecWhitelistRefCount(); + break; + default: + break; + } + + pScan = &pExtInitCtx->scanBleData.op.mstAdv; + if (pScan->pRxAdvBuf) + { + WsfMsgFree(pScan->pRxAdvBuf); + pScan->pRxAdvBuf = NULL; + } + WSF_ASSERT(pScan->pRxRspBuf == NULL); + + WSF_ASSERT(lmgrCb.numInitEnabled > 0); + lmgrCb.numInitEnabled--; + LmgrDecResetRefCount(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc.c new file mode 100644 index 0000000000000000000000000000000000000000..5abc42dbe3d765fb6a07b5f7da70008c473b94ee --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc.c @@ -0,0 +1,533 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave encryption action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_enc_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Modify encryption mode. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrModifyEncMode(lctrConnCtx_t *pCtx) +{ + if (pCtx->pendEncMode) + { + /*** Apply new encryption mode. ***/ + + LL_TRACE_INFO3(" >>> Modifying encryption mode, handle=%u, enaAuth=%u, nonceMode=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->newEncMode.enaAuth, pCtx->newEncMode.nonceMode); + + pCtx->bleData.chan.enc.enaAuth = pCtx->newEncMode.enaAuth; + pCtx->bleData.chan.enc.nonceMode = pCtx->newEncMode.nonceMode; + + if (pCtx->newEncMode.nonceMode == LL_NONCE_MODE_EVT_CNTR) + { + pCtx->bleData.chan.enc.pEventCounter = &pCtx->eventCounter; + } + else + { + pCtx->bleData.chan.enc.pEventCounter = NULL; + } + } + + pCtx->pendEncMode = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Enable Tx data encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrEnableTxDataEnc(lctrConnCtx_t *pCtx) +{ + lctrModifyEncMode(pCtx); + + pCtx->bleData.chan.enc.enaEncrypt = TRUE; + LL_TRACE_INFO1(" >>> Tx/Encryption Enabled, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Enable Tx data encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDisableTxDataEnc(lctrConnCtx_t *pCtx) +{ + pCtx->bleData.chan.enc.enaEncrypt = FALSE; + LL_TRACE_INFO1(" >>> Tx/Encryption Disabled, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Enable Rx data encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrEnableRxDataEnc(lctrConnCtx_t *pCtx) +{ + lctrModifyEncMode(pCtx); + + pCtx->bleData.chan.enc.enaDecrypt = TRUE; + LL_TRACE_INFO1(" >>> Rx/Decryption Enabled, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Enable Rx data encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDisableRxDataEnc(lctrConnCtx_t *pCtx) +{ + pCtx->bleData.chan.enc.enaDecrypt = FALSE; + LL_TRACE_INFO1(" >>> Rx/Decryption Disabled, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); +} + +/*************************************************************************************************/ +/*! + * \brief Generate slave encryption vectors. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrGenerateSlvVectors(lctrConnCtx_t *pCtx) +{ + memcpy(pCtx->rand, lctrDataPdu.pld.encReq.rand, sizeof(pCtx->rand)); + pCtx->ediv = lctrDataPdu.pld.encReq.ediv; + + /* Store master part. */ + memcpy(pCtx->skd, lctrDataPdu.pld.encReq.skd_m + LCTR_SKD_M_OFFS, LL_SKD_LEN / 2); + memcpy(pCtx->iv, lctrDataPdu.pld.encReq.iv_m + LCTR_IV_M_OFFS, LL_IV_LEN / 2); + + /* Generate slave part of IV. */ + BbBleDrvRand(pCtx->iv + LCTR_IV_S_OFFS, LL_IV_LEN / 2); + + /* Generate slave part of SKD. */ + BbBleDrvRand(pCtx->skd + LCTR_SKD_S_OFFS, LL_SKD_LEN / 2); +} + +/*************************************************************************************************/ +/*! + * \brief Store LTK reply. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreLtkReply(lctrConnCtx_t *pCtx) +{ + memcpy(pCtx->ltk, pLctrConnMsg->ltkReply.key, sizeof(pCtx->ltk)); +} + +/*************************************************************************************************/ +/*! + * \brief Store LTK negative reply termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreLtkNegRepTerminateReason(lctrConnCtx_t *pCtx) +{ + pCtx->termReason = LL_ERROR_CODE_PIN_KEY_MISSING; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate session keys. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCalcSessionKey(lctrConnCtx_t *pCtx) +{ + uint8_t dir; + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + /* Use AES to transform LTK to session key using session key diversifier as seed. */ + LlMathAesEcb(pCtx->ltk, pEnc->sk, pCtx->skd); + + WSF_ASSERT(lctrInitCipherBlkHdlr); + memcpy(pEnc->iv, pCtx->iv, sizeof(pEnc->iv)); + dir = (pCtx->role == LL_ROLE_MASTER) ? 1 : 0; /* master = 1; slave = 0 */ + pEnc->dir = dir; + lctrInitCipherBlkHdlr(pEnc, LCTR_GET_CONN_HANDLE(pCtx), dir); +} + +/*************************************************************************************************/ +/*! + * \brief Send feature response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInvalidEncPduSeq(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN3("Out of sequence LLCP packet received, dropping connection, handle=%u, encState=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->encState, lctrDataPdu.opcode); + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_MIC_FAILED); +} + +/*************************************************************************************************/ +/*! + * \brief Send feature response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendEncRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_ENC_RSP_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_ENC_RSP); + + memcpy(pBuf, pCtx->skd + LCTR_SKD_S_OFFS, LL_SKD_LEN / 2); + pBuf += LL_SKD_LEN/2; + + memcpy(pBuf, pCtx->iv + LCTR_IV_S_OFFS, LL_IV_LEN / 2); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send start encryption request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendStartEncReq(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_START_ENC_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_START_ENC_REQ); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send start encryption response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendStartEncRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_START_ENC_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_START_ENC_RSP); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send pause encryption request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPauseEncReq(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PAUSE_ENC_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_PAUSE_ENC_REQ); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send pause encryption response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPauseEncRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PAUSE_ENC_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_PAUSE_ENC_RSP); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send ping request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPingReq(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PING_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_PING_REQ); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send ping response PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPingRsp(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PING_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_PING_RSP); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify slave host of connect indication. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrEncNotifyHostLtkReqInd(lctrConnCtx_t *pCtx) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlLtkReqInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_LTK_REQ_IND; + evt.hdr.status = LL_SUCCESS; + + evt.handle = handle; + evt.encDiversifier = pCtx->ediv; + + memcpy(evt.randNum, pCtx->rand, sizeof(evt.randNum)); + + LL_TRACE_INFO1("### LlEvent ### LL_LTK_REQ_IND, handle=%u, status=LL_SUCCESS", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of encryption change. + * + * \param pCtx Connection context. + * \param status Status code. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyEncChangeInd(lctrConnCtx_t *pCtx, uint8_t status) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + LlEncChangeInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_ENC_CHANGE_IND; + evt.hdr.status = status; + evt.status = status; + evt.handle = handle; + evt.enabled = pEnc->enaDecrypt; + + LL_TRACE_INFO3("### LlEvent ### LL_ENC_CHANGE_IND, handle=%u, status=%u, enabled=%u", handle, status, evt.enabled); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of key refreshed. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyEncKeyRefreshInd(lctrConnCtx_t *pCtx) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlEncKeyRefreshInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_ENC_KEY_REFRESH_IND; + evt.hdr.status = LL_SUCCESS; + + evt.status = LL_SUCCESS; + evt.handle = handle; + + LL_TRACE_INFO1("### LlEvent ### LL_ENC_KEY_REFRESH_IND, handle=%u, status=LL_SUCCESS", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of authentication payload timeout expired. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyAuthPayloadTimeout(lctrConnCtx_t *pCtx) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlAuthPayloadTimeoutInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_AUTH_PAYLOAD_TIMEOUT_IND; + evt.hdr.status = LL_SUCCESS; + + evt.handle = handle; + + LL_TRACE_INFO1("### LlEvent ### LL_AUTH_PAYLOAD_TIMEOUT_IND, handle=%u, status=LL_SUCCESS", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Restart authentication payload timeout timer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrRestartAuthPayloadTimer(lctrConnCtx_t *pCtx) +{ + WsfTimerStartMs(&pCtx->tmrAuthTimeout, pCtx->authTimeoutMs); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..c8c7578a41e754ad5d87b35fd2d313954849cabf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_enc_master.c @@ -0,0 +1,106 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master encryption action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_enc_master.h" +#include "lctr_int_enc_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Generate master encryption vectors. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrGenerateMstVectors(lctrConnCtx_t *pCtx) +{ + /* Store host parameters. */ + memcpy(pCtx->ltk, pLctrConnMsg->startEnc.key, sizeof(pCtx->ltk)); + memcpy(pCtx->rand, pLctrConnMsg->startEnc.rand, sizeof(pCtx->rand)); + pCtx->ediv = pLctrConnMsg->startEnc.diversifier; + + /* Generate master part of IV. */ + BbBleDrvRand(pCtx->iv + LCTR_IV_M_OFFS, LL_IV_LEN / 2); + + /* Generate master part of SKD. */ + BbBleDrvRand(pCtx->skd + LCTR_SKD_M_OFFS, LL_SKD_LEN / 2); +} + +/*************************************************************************************************/ +/*! + * \brief Generate master encryption vectors. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreSlvVectors(lctrConnCtx_t *pCtx) +{ + /* Store slave part. */ + memcpy(pCtx->skd + LCTR_SKD_S_OFFS, lctrDataPdu.pld.encRsp.skd_s, LL_SKD_LEN / 2); + memcpy(pCtx->iv + LCTR_IV_S_OFFS, lctrDataPdu.pld.encRsp.iv_s, LL_IV_LEN / 2); +} + +/*************************************************************************************************/ +/*! + * \brief Send encryption request PDU to peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendEncReq(lctrConnCtx_t *pCtx) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_ENC_REQ_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, LL_PDU_ENC_REQ); + + memcpy(pBuf, pCtx->rand, LL_RAND_LEN); + pBuf += LL_RAND_LEN; + + UINT16_TO_BSTREAM(pBuf, pCtx->ediv); + + memcpy(pBuf, pCtx->skd + LCTR_SKD_M_OFFS, LL_SKD_LEN / 2); + pBuf += LL_SKD_LEN / 2; + + memcpy(pBuf, pCtx->iv + LCTR_IV_M_OFFS, LL_IV_LEN / 2); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master.c new file mode 100644 index 0000000000000000000000000000000000000000..5c17ae0773bdc1f3115abb3a9ad69202f3ae0e9e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master.c @@ -0,0 +1,266 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_init_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Start initiate connection scan. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActInitiate(void) +{ + bool_t result = TRUE; + lctrConnCtx_t *pCtx; + uint32_t connInterUsec, interMinUsec, interMaxUsec, durUsec; + lctrInitiateMsg_t *pInitMsg = (lctrInitiateMsg_t *)pLctrMsg; + + do + { + if ((pCtx = lctrAllocConnCtx()) == NULL) + { + result = FALSE; + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_CONN_LIMIT_EXCEEDED, pInitMsg->peerAddrType, + pInitMsg->peerAddr); + break; + } + + interMinUsec = LCTR_CONN_IND_US(pInitMsg->connSpec.connIntervalMin); + interMaxUsec = LCTR_CONN_IND_US(pInitMsg->connSpec.connIntervalMax); + durUsec = pCtx->localConnDurUsec; + + if (!SchRmAdd(LCTR_GET_CONN_HANDLE(pCtx), interMinUsec, interMaxUsec, durUsec, &connInterUsec)) + { + lctrFreeConnCtx(pCtx); + result = FALSE; + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL, pInitMsg->peerAddrType, pInitMsg->peerAddr); + break; + } + } while (FALSE); + + if (!result) + { + lctrMsgHdr_t *pTermMsg; + + /* Send SM a terminate event. */ + if ((pTermMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pTermMsg))) != NULL) + { + pTermMsg->dispId = LCTR_DISP_INIT; + pTermMsg->event = LCTR_INIT_MSG_TERMINATE; + + WsfMsgSend(lmgrPersistCb.handlerId, pTermMsg); + } + + return; + } + + lctrMstInit.data.init.connHandle = LCTR_GET_CONN_HANDLE(pCtx); + lctrMstInit.data.init.connInterval = LCTR_US_TO_CONN_IND(connInterUsec); + lctrMstInit.data.init.connBodLoaded = FALSE; + lctrMstInit.scanParam = pInitMsg->scanParam; + + BbStart(BB_PROT_BLE); + + LmgrIncResetRefCount(); + lmgrCb.numInitEnabled = 1; + switch (lctrMstInit.scanParam.scanFiltPolicy) + { + case LL_SCAN_FILTER_WL_BIT: + case LL_SCAN_FILTER_WL_OR_RES_INIT: + LmgrIncWhitelistRefCount(); + break; + default: + break; + } + lctrMstInit.backoffCount = 1; + lctrMstInit.upperLimit = 1; + + lctrMstInitiateBuildOp(&pInitMsg->connSpec, pInitMsg->peerAddrType, pInitMsg->peerAddr); + lctrMstConnBuildOp(pCtx, &lctrMstInit.data.init.connInd); + + lctrMstInitiateOpCommit(); + + lmgrCb.scanMode = LMGR_SCAN_MODE_INITIATE; +} + +/*************************************************************************************************/ +/*! + * \brief Establish connection. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActConnect(void) +{ + if (lmgrCb.numInitEnabled) + { + BbBleData_t * const pBle = &lctrMstInit.bleData; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + lctrConnEstablish_t *pMsg; + lctrConnCtx_t *pCtx; + + if ((pMsg = (lctrConnEstablish_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pCtx = LCTR_GET_CONN_CTX(lctrMstInit.data.init.connHandle); + + pCtx->role = LL_ROLE_MASTER; + + pMsg->hdr.handle = LCTR_GET_CONN_HANDLE(pCtx); + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MST_ESTABLISH; + + pMsg->connInd = lctrMstInit.data.init.connInd; + /* Not used by master. */ + /* pMsg->connIndEndTs = 0; */ + + BbBlePduFiltResultsGetPeerIdAddr(&pScan->filtResults, &pMsg->peerIdAddr, &pMsg->peerIdAddrType); + BbBlePduFiltResultsGetPeerRpa(&pScan->filtResults, &pMsg->peerRpa); + + pMsg->localRpa = lctrMstInit.data.init.localRpa; + + pMsg->usedChSel = lctrMstInit.data.init.usedChSel; + pMsg->phy = LL_PHY_LE_1M; + /* Not used by master. */ + /* pMsg->sendAdvSetTerm = FALSE; */ + /* pMsg->numExtAdvEvents = 0; */ + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + /* Terminate scan. */ + BbStop(BB_PROT_BLE); + lctrScanCleanup(&lctrMstInit); + } + else + { + /* This occurs when an initiate start fails. */ + lctrInitActShutdown(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Shutdown active initiation operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActShutdown(void) +{ + if (lmgrCb.numInitEnabled) + { + SchRmRemove(lctrMstInit.data.init.connHandle); + lctrFreeConnCtx(LCTR_GET_CONN_CTX(lctrMstInit.data.init.connHandle)); + lctrMstInit.shutdown = TRUE; + SchRemove(&lctrMstInit.scanBod); + + /* Shutdown completes with events generated in BOD end callback. */ + } + else + { + /* TODO Can this occur if a reset or cancel is received after a initiate start fails? */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host initiate disable. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActScanTerm(void) +{ + BbBleData_t *pBle; + LlCreateConnCancelCnf_t evt; + + BbStop(BB_PROT_BLE); + + lctrScanCleanup(&lctrMstInit); + + evt.hdr.event = LL_CREATE_CONN_CANCEL_CNF; + evt.hdr.status = LL_SUCCESS; + evt.status = LL_SUCCESS; + + LL_TRACE_INFO0("### LlEvent ### LL_CREATE_CONN_CANCEL_CNF, status=LL_SUCCESS"); + + LmgrSendEvent((LlEvt_t *)&evt); + /* Send connection complete event after response to create connection cancel command. */ + pBle = &lctrMstInit.bleData; + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_UNKNOWN_CONN_ID, + BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, PEER_ADDR_MATCH_RAND), + pBle->pduFilt.peerAddrMatch); +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host reset. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActResetTerm(void) +{ + BbStop(BB_PROT_BLE); + lctrScanCleanup(&lctrMstInit); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host disallowing initiate. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActDisallowInitiate(void) +{ + lctrInitiateMsg_t *pInitMsg = (lctrInitiateMsg_t *)pLctrMsg; + + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_CMD_DISALLOWED, pInitMsg->peerAddrType, pInitMsg->peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host disallowing initiate cancel. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrInitActDisallowCancel(void) +{ + LlCreateConnCancelCnf_t evt; + evt.hdr.event = LL_CREATE_CONN_CANCEL_CNF; + evt.hdr.status = LL_ERROR_CODE_CMD_DISALLOWED; + evt.status = LL_ERROR_CODE_CMD_DISALLOWED; + + LL_TRACE_INFO0("### LlEvent ### LL_CREATE_CONN_CANCEL_CNF, status=LL_ERROR_CODE_CMD_DISALLOWED"); + + LmgrSendEvent((LlEvt_t *)&evt); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..2cdfb17a77ef7363ae7f5024b0d364fd9656c63a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_init_master_ae.c @@ -0,0 +1,119 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine action routines. + */ +/*************************************************************************************************/ +#include "lctr_int_init_master_ae.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Shutdown active initiation operation. + * + * \param pExtInitCtx Extended scan context of the initiator. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtInitActShutdown(lctrExtScanCtx_t *pExtInitCtx) +{ + pExtInitCtx->shutdown = TRUE; + + if (!pExtInitCtx->auxOpPending) + { + SchRemove(&pExtInitCtx->scanBod); + } + else + { + SchRemove(&pExtInitCtx->auxScanBod); + } + /* Shutdown completes with events generated in BOD end callback. */ +} + +/*************************************************************************************************/ +/*! + * \brief Terminated scan after host initiate disable. + * + * \param pExtInitCtx Extended scan context of the initiator. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtInitActScanTerm(lctrExtScanCtx_t *pExtInitCtx) +{ + lctrMstExtInitCleanupOp(pExtInitCtx); + + if (pExtInitCtx->state != LCTR_EXT_INIT_STATE_RESET) + { + LlCreateConnCancelCnf_t evt; + evt.hdr.event = LL_CREATE_CONN_CANCEL_CNF; + evt.hdr.status = LL_SUCCESS; + evt.status = LL_SUCCESS; + + LL_TRACE_INFO0("### LlEvent ### LL_EXT_CREATE_CONN_CANCEL_CNF, status=LL_SUCCESS"); + + LmgrSendEvent((LlEvt_t *)&evt); + /* Send connection complete event after response to create connection cancel command. */ + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_UNKNOWN_CONN_ID, + lctrMstExtInit.peerAddrType, + lctrMstExtInit.peerAddr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send disallow initiate host notification. + * + * \param pExtInitCtx Extended scan context of the initiator. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtInitActDisallowInitiate(lctrExtScanCtx_t *pExtInitCtx) +{ + lctrInitiateMsg_t *pInitMsg = (lctrInitiateMsg_t *)pLctrMsg; + + lctrScanNotifyHostInitiateError(LL_ERROR_CODE_CMD_DISALLOWED, pInitMsg->peerAddrType, pInitMsg->peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Send disallow create connection cancel host notification. + * + * \param pExtInitCtx Extended scan context of the initiator. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrExtInitActDisallowCancel(lctrExtScanCtx_t *pExtInitCtx) +{ + LlCreateConnCancelCnf_t evt; + evt.hdr.event = LL_CREATE_CONN_CANCEL_CNF; + evt.hdr.status = LL_ERROR_CODE_CMD_DISALLOWED; + + evt.status = LL_ERROR_CODE_CMD_DISALLOWED; + + LL_TRACE_INFO0("### LlEvent ### LL_EXT_CREATE_CONN_CANCEL_CNF, status=LL_ERROR_CODE_CMD_DISALLOWED"); + + LmgrSendEvent((LlEvt_t *)&evt); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..6db1711ab3e4e9fd0b547e626b5e92162e77681f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_act_phy.c @@ -0,0 +1,256 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller PHY features action routines. + */ +/*************************************************************************************************/ + +#include "lctr_int_slave_phy.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Store PHY update request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreHostPhyUpdate(lctrConnCtx_t *pCtx) +{ + pCtx->allPhys = pLctrConnMsg->phyUpd.allPhys; + pCtx->txPhys = pLctrConnMsg->phyUpd.txPhys; + pCtx->rxPhys = pLctrConnMsg->phyUpd.rxPhys; + + /* Update PHY options immediately. */ + pCtx->bleData.chan.tifsTxPhyOptions = pLctrConnMsg->phyUpd.phyOptions; +} + +/*************************************************************************************************/ +/*! + * \brief Store PHY update request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStorePeerPhyReq(lctrConnCtx_t *pCtx) +{ + pCtx->phyReq = lctrDataPdu.pld.phyReq; +} + +/*************************************************************************************************/ +/*! + * \brief Store PHY update indication. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStorePeerPhyUpdateInd(lctrConnCtx_t *pCtx) +{ + if ((lctrDataPdu.pld.phyUpdInd.masterToSlavePhy == 0) && + (lctrDataPdu.pld.phyUpdInd.slaveToMasterPhy == 0)) + { + /* No change. */ + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + return; + } + + /* Check for valid instant. */ + if ((uint16_t)(lctrDataPdu.pld.phyUpdInd.instant - pCtx->eventCounter) >= LCTR_MAX_INSTANT) + { + /* Consider connection lost. */ + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_INST_PASSED); + return; + } + + /* TODO check for valid PHYs. */ + + pCtx->phyUpd = lctrDataPdu.pld.phyUpdInd; +} + +/*************************************************************************************************/ +/*! + * \brief Send PHY PDU to peer. + * + * \param pCtx Connection context. + * \param opcode Opcode to send in PDU. + * \param txPhys Transmitter PHYs. + * \param rxPhys Receiver PHYs. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSendPhyPdu(lctrConnCtx_t *pCtx, uint8_t opcode, uint8_t txPhys, uint8_t rxPhys) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PHY_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM(pBuf, opcode); + + UINT8_TO_BSTREAM(pBuf, txPhys); + UINT8_TO_BSTREAM(pBuf, rxPhys); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send PHY request PDU to peer. + * + * \param pCtx Connection context. + * \param txPhys Transmitter PHYs. + * \param rxPhys Receiver PHYs. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPhyReqPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys) +{ + /*** Store PHY request ***/ + + pCtx->phyReq.txPhys = txPhys; + pCtx->phyReq.rxPhys = rxPhys; + + /*** Send PHY request ***/ + + lctrSendPhyPdu(pCtx, LL_PDU_PHY_REQ, txPhys, rxPhys); +} + +/*************************************************************************************************/ +/*! + * \brief Send PHY response PDU to peer. + * + * \param pCtx Connection context. + * \param txPhys Transmitter PHYs. + * \param rxPhys Receiver PHYs. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPhyRspPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys) +{ + lctrSendPhyPdu(pCtx, LL_PDU_PHY_RSP, txPhys, rxPhys); +} + +/*************************************************************************************************/ +/*! + * \brief Send PHY update indication PDU to peer. + * + * \param pCtx Connection context. + * \param txPhys Transmitter PHYS. + * \param rxPhys Receiver PHYS. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPhyUpdateIndPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys) +{ + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_PHY_UPD_IND_PDU_LEN)) != NULL) + { + uint8_t *pBuf = pPdu; + uint16_t ceOffset; + + /*** Store PHY update request ***/ + + pCtx->phyUpd.masterToSlavePhy = txPhys; + pCtx->phyUpd.slaveToMasterPhy = rxPhys; + +#if (LL_ENABLE_TESTER == TRUE) + if (llTesterCb.eventCounterOffset) + { + ceOffset = llTesterCb.eventCounterOffset + 1; /* +1 for next CE */ + } + else +#endif + { + ceOffset = LL_MIN_INSTANT + 1 + /* +1 for next CE */ + pCtx->maxLatency; /* ensure slave will listen this packet */ + } + + if (txPhys || rxPhys) + { + pCtx->phyUpd.instant = pCtx->eventCounter + ceOffset; + } + else + { + /* No change. */ + pCtx->phyUpd.instant = 0; + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + + /*** Assemble control PDU. ***/ + + UINT8_TO_BSTREAM (pBuf, LL_PDU_PHY_UPDATE_IND); + UINT8_TO_BSTREAM (pBuf, txPhys); + UINT8_TO_BSTREAM (pBuf, rxPhys); + UINT16_TO_BSTREAM(pBuf, pCtx->phyUpd.instant); + + /*** Queue for transmit. ***/ + + lctrTxCtrlPduQueue(pCtx, pPdu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of PHY update indication. + * + * \param pCtx Connection context. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostPhyUpdateInd(lctrConnCtx_t *pCtx, uint8_t status) +{ + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + LlPhyUpdateInd_t evt; + evt.hdr.param = handle; + evt.hdr.event = LL_PHY_UPDATE_IND; + evt.hdr.status = status; + evt.status = status; + evt.handle = handle; + + evt.txPhy = pCtx->bleData.chan.txPhy; + evt.rxPhy = pCtx->bleData.chan.rxPhy; + + LL_TRACE_INFO2("### LlEvent ### LL_PHY_UPDATE_IND, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int.h new file mode 100644 index 0000000000000000000000000000000000000000..d44ca5092af0c3d6a26575f98ffa00049d5ab6d0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int.h @@ -0,0 +1,187 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_H +#define LCTR_INT_H + +#include "lctr_api.h" +#include "ll_defs.h" +#include "lmgr_api.h" +#include "ll_math.h" + +#if (LL_ENABLE_TESTER) +#include "ll_tester_api.h" +#include "lctr_int_tester.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Minimum delay between connect indication and data channel in CONNECT_IND units. */ +#define LCTR_DATA_CHAN_DLY 1 /* 1.25 ms */ + +/*! \brief Minimum delay between auxiliary connect request and data channel using uncoded PHY in CONNECT_REQ units. */ +#define LCTR_DATA_CHAN_DLY_AUX_UNCODED 2 /* 2.5 ms */ + +/*! \brief Minimum delay between auxiliary connect request and data channel using coded PHY in CONNECT_REQ units. */ +#define LCTR_DATA_CHAN_DLY_AUX_CODED 3 /* 3.75 ms */ + +/*! \brief Convert connect indication ticks to scheduler ticks. */ +#define LCTR_CONN_IND_TICKS(x) ((x) * (1250 / LL_BLE_US_PER_TICK)) + +/*! \brief Convert connect indication ticks to milliseconds (no divide, rounds up). */ +#define LCTR_CONN_IND_MS(x) ((x) + ((x) >> 2) + (((x) & 3) ? 1 : 0)) + +/*! \brief Convert connect indication ticks to microseconds. */ +#define LCTR_CONN_IND_US(x) ((x) * 1250) + +/*! \brief Convert connect indication timeout ticks to milliseconds. */ +#define LCTR_CONN_IND_TO_MS(x) ((x) * 10) + +/*! \brief Convert microseconds to connection indication ticks. */ +#define LCTR_US_TO_CONN_IND(x) LL_MATH_DIV_1250(x) + +/*! \brief Convert BLE protocol ticks to microseconds. */ +#define LCTR_BLE_TO_US(x) ((x) * LL_BLE_US_PER_TICK) + +/*! \brief Convert periodic interval milliseconds to microseconds. */ +#define LCTR_PER_INTER_TO_US(x) ((x) * 1250) + +/*! \brief Convert periodic interval microseconds to milliseconds. */ +#define LCTR_PER_INTER_TO_MS(x) LL_MATH_DIV_1250(x) + +/*! \brief Convert periodic sync timeout unit to milliseconds. */ +#define LCTR_PER_SYNC_TIMEOUT_TO_MS(x) ((x) * 10) + +/*! \brief Fast termination supervision multiplier. */ +#define LCTR_FAST_TERM_CNT 6 + +/*! \brief Duration of a advertising packet in microseconds. */ +#define LCTR_ADV_PKT_1M_US(len) ((LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_ADV_HDR_LEN + len + LL_CRC_LEN) << 3) + +/*! \brief Duration of a connection indication packet in microseconds. */ +#define LCTR_CONN_IND_PKT_1M_US LCTR_ADV_PKT_1M_US(LL_CONN_IND_PDU_LEN) + +/*! \brief Extra area in ADVB buffer. */ +#define LCTR_ADVB_BUF_EXTRA_SIZE 6 + +/*! \brief Size for ADVB buffer allocation. */ +#define LCTR_ADVB_BUF_SIZE (WSF_MAX(BB_FIXED_ADVB_PKT_LEN, LL_ADVB_MAX_LEN) + LCTR_ADVB_BUF_EXTRA_SIZE) + +/*! \brief RSSI offset of extra data in ADVB buffer. */ +#define LCTR_ADVB_BUF_OFFSET_RSSI ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 0) + +/*! \brief RPA offset of extra data in ADVB buffer. */ +#define LCTR_ADVB_BUF_OFFSET_RX_RPA ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 1) + +/*! \brief CRC offset of extra data in ADVB buffer. */ +#define LCTR_ADVB_BUF_OFFSET_CRC ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 2) + +/*! \brief LCTR Maximum span of scheduler elements. */ +#define LCTR_SCH_MAX_SPAN 0x80000000 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Channel parameters. */ +typedef struct +{ + /* Channel parameters */ + uint8_t lastChanIdx; /*!< Current channel index. */ + uint8_t numUsedChan; /*!< Number of used channels. */ + uint64_t chanMask; /*!< Channel mask. */ + uint8_t chanRemapTbl[LL_CHAN_DATA_MAX_IDX + 1]; /*!< Channel remapping table. */ + + uint8_t usedChSel; /*!< Used channel selection. */ + uint16_t chIdentifier; /*!< Channel identifier. */ +} lctrChanParam_t; + +/*! \brief Call signature of a reset handler. */ +typedef void (*LctrResetHdlr_t)(void); + +/*! \brief Call signature of a message dispatch handler. */ +typedef void (*LctrMsgDisp_t)(lctrMsgHdr_t *pMsg); + +/*! \brief Call signature of a message dispatch handler. */ +typedef void (*LctrEvtHdlr_t)(void); + +/*! \brief Reservation manager callback signature. */ +typedef void (*LctrRmCback_t)(uint32_t rsvnOffs[], uint32_t refTime); + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern LctrResetHdlr_t lctrResetHdlrTbl[LCTR_DISP_TOTAL]; +extern LctrMsgDisp_t lctrMsgDispTbl[LCTR_DISP_TOTAL]; +extern LctrEvtHdlr_t lctrEventHdlrTbl[LCTR_EVENT_TOTAL]; +extern lctrMsgHdr_t *pLctrMsg; +extern LctrRmCback_t lctrGetConnOffsetsCback; +extern LctrRmCback_t lctrGetPerOffsetsCback; + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/* Helper routines. */ +uint32_t lctrComputeAccessAddr(void); +uint8_t lctrComputeHopInc(void); +uint8_t lctrPeriodicSelectNextChannel(lctrChanParam_t *pChanParam, uint16_t eventCounter); +void lctrPeriodicBuildRemapTable(lctrChanParam_t *pChanParam); +uint16_t lctrCalcTotalAccuracy(uint8_t mstScaIdx); +uint32_t lctrComputeCrcInit(void); + +/* Host events */ +void lctrNotifyHostHwErrInd(uint8_t code); +void lctrNotifyHostConnectInd(uint16_t handle, uint8_t role, lctrConnInd_t *pConnInd, + uint8_t peerIdAddrType, uint64_t peerIdAddr, uint64_t peerRpa, + uint64_t localRpa, uint8_t status, uint8_t usedChSel); + +/* State machine */ +void lctrMstScanExecuteSm(uint8_t event); +void lctrMstInitExecuteSm(uint8_t event); +void lctrSlvAdvExecuteSm(uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Get operational mode flag. + * + * \param flag Flag to check. + * + * \return TRUE if flag is set. + * + * Get mode flag governing LL operations. + */ +/*************************************************************************************************/ +bool_t lctrGetOpFlag(uint32_t flag); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master.h new file mode 100644 index 0000000000000000000000000000000000000000..d5f835398502bd6e65bc4053b34f9b0f0a611c33 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master.h @@ -0,0 +1,180 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ADV_MASTER_H +#define LCTR_INT_ADV_MASTER_H + +#include "lctr_int.h" +#include "lctr_api_adv_master.h" +#include "lctr_pdu_adv.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Minimum amount of time required for scanning, (minimum scanWindow size is 2.5ms). */ +#define LCTR_MIN_SCAN_USEC 0 + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master scan states. */ +enum +{ + LCTR_SCAN_STATE_DISABLED, /*!< Scan disabled state. */ + LCTR_SCAN_STATE_DISCOVER, /*!< Scan enabled state. */ + LCTR_SCAN_STATE_SHUTDOWN, /*!< Scan shutdown in progress. */ + LCTR_SCAN_STATE_RESET, /*!< Scan reset in progress. */ + LCTR_SCAN_STATE_TOTAL /*!< Total number of scan states. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising report filter. */ +typedef struct +{ + uint64_t filtTbl[LL_NUM_ADV_FILT]; + /*!< Advertising filter table. */ + bool_t enable; /*!< Enable advertising filtering. */ + bool_t addToFiltTbl; /*!< TRUE if duplicate is not found and is to be added to the table. */ + uint8_t headIdx; /*!< Head index of filter table. */ + uint32_t validMask; /*!< Mask for valid entries. */ +} lctrAdvRptFilt_t; + +/*! \brief Master scan state context. */ +typedef struct +{ + /* Scan buffer (placed here to 32-bit align) */ + uint8_t reqBuf[BB_REQ_PDU_MAX_LEN]; + /*!< Scan host data buffer. */ + uint8_t state; /*!< Scan state. */ + wsfQueue_t rxAdvbQ; /*!< Receive ADVB queue. */ + wsfQueue_t rxDirectAdvbQ; /*!< Receive direct ADVB queue. */ + + uint32_t scanWinStart; /*!< Scan window origin. */ + + lmgrScanParam_t scanParam; /*!< Scan parameters. */ + + union + { + /*! Discovery data. */ + struct + { + lctrAdvRptFilt_t advFilt; /*!< Advertising filter data. */ + uint64_t scanReqAdvAddr; /*!< Advertiser address in the scan request. */ + } disc; + + /*! Initiate data. */ + struct + { + lctrConnInd_t connInd; /*!< Connection indication. */ + uint64_t localRpa; /*!< Local RPA. */ + uint16_t connHandle; /*!< Connection handle. */ + uint16_t connInterval; /*!< Connection interval. */ + uint32_t firstCeDue; /*!< First CE due time. */ + bool_t connBodLoaded; /*!< Connection BOD loaded flag. */ + uint8_t usedChSel; /*!< Used channel selection. */ + } init; /*!< Initiation specific data. */ + } data; /*!< Scan specific data. */ + + /* BB/ISR context */ + bool_t selfTerm; /*!< Self-termination flag. */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + int8_t advRssi; /*!< Last received advertising or scan response RSSI. */ + BbOpDesc_t scanBod; /*!< Scan BOD. */ + BbBleData_t bleData; /*!< BLE BB operation data. */ + lctrAdvbPduHdr_t reqPduHdr; /*!< Request PDU header. */ + uint16_t upperLimit; /*!< Scan backoff upper limit. */ + uint8_t backoffCount; /*!< Scan backoff count. */ + uint8_t consRspSuccess; /*!< Number of consecutive scan response received. */ + uint8_t consRspFailure; /*!< Number of consecutive scan response failures. */ +} lctrMstScanCtx_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrMstScanCtx_t lctrMstScan; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Builder */ +void lctrMstDiscoverBuildOp(void); +void lctrMstScanCleanupOp(lctrMstScanCtx_t *pCtx); + +/* Event handlers. */ +void lctrMstRxAdvBPduHandler(void); +void lctrMstRxDirectAdvBPduHandler(void); + +/* ISR */ +void lctrMstDiscoverEndOp(BbOpDesc_t *pOp); +bool_t lctrMstDiscoverAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +void lctrMstDiscoverAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstScanReqTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstScanRspRxCompHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf); + +/* Action routines. */ +void lctrScanActDiscover(void); +void lctrScanActShutdown(void); +void lctrScanActScanCnf(void); +void lctrScanActDisallowScan(void); +void lctrScanActSelfTerm(void); +void lctrScanActScanTerm(void); +void lctrScanActResetTerm(void); +void lctrScanActUpdateScanParam(void); +void lctrScanActUpdateScanFilt(void); +void lctrInitActInitiate(void); +void lctrInitActConnect(void); +void lctrInitActShutdown(void); + +/* Helper routines. */ +void lctrScanCleanup(lctrMstScanCtx_t *pCtx); +void lctrScanNotifyHostInitiateError(uint8_t reason, uint8_t peerAddrType, uint64_t peerAddr); + +/* Channel. */ +uint8_t lctrScanChanSelectInit(uint8_t chanMap); +uint8_t lctrScanChanSelectNext(uint8_t chanIdx, uint8_t chanMap); + +/* Advertising report filtering. */ +void lctrAdvRptEnable(lctrAdvRptFilt_t *pAdvFilt, bool_t filtEna); +void lctrAdvRptGenerateLegacyHash(uint64_t *pHash, uint8_t addrType, uint64_t addr, uint8_t eventType); +void lctrAdvRptGenerateExtHash(uint64_t *pHash, uint8_t addrType, uint64_t addr, uint8_t eventType, + uint8_t sid, uint16_t did); +bool_t lctrAdvRptCheckDuplicate(lctrAdvRptFilt_t *pAdvFilt, uint64_t hash); +void lctrAdvRptAddEntry(lctrAdvRptFilt_t *pAdvFilt, uint64_t hash); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ADV_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..87b36df0d4974cbf0d7dd2d76cac832378984a5c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_master_ae.h @@ -0,0 +1,384 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller extended scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ADV_MASTER_AE_H +#define LCTR_INT_ADV_MASTER_AE_H + +#include "lctr_int.h" +#include "lctr_api_adv_master_ae.h" +#include "lctr_int_adv_master.h" +#include "lctr_pdu_adv_ae.h" +#include "bb_ble_api.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Resolve the extended scan handle from the context pointer. */ +#define LCTR_GET_EXT_SCAN_HANDLE(pCtx) (pCtx - lctrMstExtScanTbl) + +/*! \brief Resolve the periodic scanning handle from the context pointer. */ +#define LCTR_GET_PER_SCAN_HANDLE(pCtx) (pCtx - lctrMstPerScanTbl) + +/*! \brief Resolve the periodic scanning context from the handle. */ +#define LCTR_GET_PER_SCAN_CTX(h) &(lctrMstPerScanTbl[h]) + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master scan states. */ +enum +{ + LCTR_EXT_SCAN_STATE_DISABLED, /*!< Scan disabled state. */ + LCTR_EXT_SCAN_STATE_DISCOVER, /*!< Scan enabled state. */ + LCTR_EXT_SCAN_STATE_SHUTDOWN, /*!< Scan shutdown in progress. */ + LCTR_EXT_SCAN_STATE_RESET, /*!< Scan reset in progress. */ + LCTR_EXT_SCAN_STATE_TOTAL /*!< Total number of scan states. */ +}; + +/*! \brief Create sync states. */ +enum +{ + LCTR_CREATE_SYNC_STATE_DISABLED, /*!< Create sync disabled state. */ + LCTR_CREATE_SYNC_STATE_DISCOVER, /*!< Create sync enabled state. */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /*!< Create sync shutdown in process state. */ + LCTR_CREATE_SYNC_STATE_RESET, /*!< Create sync reset in progress. */ + LCTR_CREATE_SYNC_STATE_TOTAL /*!< Total number of Create sync states. */ +}; + +/*! \brief Periodic scanning states. */ +enum +{ + LCTR_PER_SCAN_STATE_DISABLE, /*!< Periodic scanning disabled state. */ + LCTR_PER_SCAN_STATE_SYNC_ESTD, /*!< Periodic scanning sync established state. */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE, /*!< Periodic scanning sync terminate in process state. */ + LCTR_PER_SCAN_STATE_RESET, /*!< Periodic scanning sync reset in progress. */ + LCTR_PER_SCAN_STATE_TOTAL /*!< Total number of Periodic scanning states. */ +}; + +/*! \brief Internal common (non-context, non-broadcast) events. */ +enum +{ + LCTR_EXT_SCAN_MSG_NON_SM = LCTR_EXT_SCAN_MSG_TOTAL, + LCTR_EXT_SCAN_MSG_TMR_DUR_EXP, /*!< Duration timer expired event. */ + LCTR_EXT_SCAN_MSG_TMR_PER_EXP /*!< Period timer expired event. */ +}; + +/*! \brief Extended advertising report assembly state. */ +enum +{ + LCTR_RPT_STATE_IDLE, /*!< No report assembly in progress. */ + LCTR_RPT_STATE_IN_PROGRESS, /*!< Report assembly in progress. */ + LCTR_RPT_STATE_COMP /*!< Report assembly completed. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended scanning context. */ +typedef struct +{ + /* Scan state. */ + uint8_t state; /*!< Scan state. */ + bool_t selfTerm; /*!< Self-termination flag. */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + uint32_t scanWinStart; /*!< Scan window origin. */ + LlScanParam_t scanParam; /*!< Scan parameters. */ + /* N.B. Scan parameters must persist after initiate. */ + union + { + struct + { + /* Report handling. */ + LlExtAdvReportInd_t advRpt; /*!< Advertising report. */ + uint8_t advRptState; /*!< Advertising report state. */ + + /* Backoff. */ + uint16_t upperLimit; /*!< Scan backoff upper limit. */ + uint8_t backoffCount; /*!< Scan backoff count. */ + uint8_t consRspSuccess; /*!< Number of consecutive scan response received. */ + uint8_t consRspFailure; /*!< Number of consecutive scan response failures. */ + uint64_t scanReqAdvAddr; /*!< Advertiser address in the scan request. */ + } scan; /*!< Extended scan data. */ + + struct + { + LlExtInitScanParam_t param; /*!< Extended initiating scan parameters. */ + LlConnSpec_t connSpec; /*!< Connection specification. */ + lctrConnInd_t connInd; /*!< Connection indication. */ + uint64_t localRpa; /*!< Local RPA. */ + uint16_t connHandle; /*!< Connection handle. */ + uint16_t connInterval; /*!< Connection interval. */ + uint32_t firstCeDue; /*!< First CE due time. */ + uint32_t scanWinStart; /*!< Scan window origin. */ + bool_t connBodLoaded; /*!< Connection BOD loaded flag. */ + bool_t isLegacy; /*!< TRUE if legacy advertising PDU is received. */ + uint8_t usedChSel; /*!< Used channel selection. */ + uint8_t filtPolicy; /*!< Initiate filter policy. */ + uint8_t ownAddrType; /*!< Own address type. */ + uint8_t phy; /*!< PHY selection. */ + } init; /*!< Extended initiate data. */ + } data; /*!< Extended scan or extended initiate data. */ + + /* Scan buffer (placed here to 32-bit align) */ + uint8_t reqBuf[BB_REQ_PDU_MAX_LEN]; + /*!< Scan host data buffer. */ + uint8_t auxRspBuf[LL_EXT_ADVB_MAX_LEN]; + /*!< Auxiliary response buffer. */ + uint8_t *pExtAdvData; /*!< Advertising data reassembly buffer. */ + + /* Packet state. */ + lctrExtAdvHdr_t extAdvHdr; /*!< Coalesced extended advertising header. */ + lctrAdvbPduHdr_t reqPduHdr; /*!< Request PDU header. */ + lctrAuxPtr_t priChAuxPtr; /*!< Primary channel AuxPtr. */ + lctrSyncInfo_t secSyncInfo; /*!< Secondary channel SyncInfo. */ + + /* BB/ISR. */ + bool_t auxOpPending; /*!< Auxiliary operation pending. */ + uint8_t bodTermCnt; /*!< Number of BOD terminated. */ + BbOpDesc_t scanBod; /*!< Scan BOD. */ + BbBleData_t scanBleData; /*!< BLE BB operation data. */ + BbOpDesc_t auxScanBod; /*!< Auxiliary scan BOD. */ + BbBleData_t auxBleData; /*!< Auxiliary BLE BB operation data. */ +} lctrExtScanCtx_t; + +/*! \brief Extended scanning control block. */ +typedef struct +{ + /* State. */ + uint8_t enaPhys; /*!< Enabled PHYs. */ + bool_t scanTermByHost; /*!< Host initiated scan disable. */ + uint32_t nextScanWinStart; /*!< Next scan window origin. */ + + /* Report */ + uint8_t termReason; /*!< Termination reason. */ + uint8_t filtDup; /*!< Advertising report filter mode. */ + lctrAdvRptFilt_t advFilt; /*!< Advertising filter data. */ + + /* Timers. */ + uint32_t scanDurMs; /*!< Scan duration in milliseconds. */ + uint32_t scanPerMs; /*!< Scan period in milliseconds. */ + wsfTimer_t tmrScanDur; /*!< Scan duration timer. */ + wsfTimer_t tmrScanPer; /*!< Scan period timer. */ +} lctrExtScanCtrlBlk_t; + + +/*! \brief Periodic advertising create sync parameters. */ +typedef struct +{ + uint8_t filterPolicy; /*!< Filter Policy. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint64_t advAddr; /*!< Advertiser Address. */ +} lctrPerParam_t; + +/*! \brief Periodic scanning context. */ +typedef struct +{ + bool_t enabled; /*!< Context enabled. */ + uint8_t state; /*!< Current state. */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + bool_t cancelCreateSync; /*!< Shut down due to create sync cancel. */ + bool_t firstPerAdvRcv; /*!< True if first periodic advertising packet is received. */ + + /* Report handling. */ + LlPerAdvReportInd_t advRpt; /*!< Periodic advertising report. */ + uint8_t advRptState; /*!< Periodic advertising report state. */ + uint8_t *pPerAdvData; /*!< Periodic data reassembly buffer. */ + + /* BB data */ + BbOpDesc_t bod; /*!< Periodic scanning BOD. */ + BbBleData_t bleData; /*!< BLE BB operation data. */ + + /* Peer periodic advertising parameters */ + uint16_t eventCounter; /*!< Connection event counter. */ + uint32_t perInter; /*!< Periodic scanning interval in BB ticks. */ + uint8_t sca; /*!< Sleep clock accuracy. */ + uint32_t skipInter; /*!< Skip interval in BB ticks. */ + uint32_t minDurUsec; /*!< Minimum required duration in microseconds. */ + uint32_t rxSyncDelayUsec; /*!< Receive timeout in microseconds. */ + uint32_t lastAnchorPoint; /*!< Last anchor point in BB tick. */ + uint16_t lastActiveEvent; /*!< Last active event counter. */ + + /* Local periodic scanning parameters */ + uint16_t skip; /*!< Skip. */ + uint16_t syncTimeOutMs; /*!< Synchronization Timeout in Milliseconds. */ + + /* Filtering parameters */ + bbBlePerPduFiltParams_t filtParam; /*!< Periodic scan filter parameters. */ + + /* RF parameters */ + int8_t rssi; /*!< RSSI. */ + + lctrChanParam_t chanParam; /*!< Channel parameters. */ + + /* Supervision */ + wsfTimer_t tmrSupTimeout; /*!< Supervision timer. */ + + /* Peer device info */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t advAddrType; /*!< Advertiser Address Type. */ + uint64_t advAddr; /*!< Advertiser Address. */ + + /* Packet state. */ + lctrExtAdvHdr_t extAdvHdr; /*!< Coalesced extended advertising header. */ + + /* PHY */ + uint8_t rxPhys; /*!< Default receiver PHYs. */ + +} lctrPerScanCtx_t; + +/*! \brief Master scan state context. */ +typedef struct +{ + uint8_t state; /*!< Periodic scan state. */ + bool_t createSyncPending; /*!< Create sync is pending. */ + bbBlePerPduFiltParams_t filtParam; /*!< Periodic scan filter parameters. */ + lctrPerScanCtx_t *pPerScanCtx; /*!< Current synchronous context. */ +} lctrPerCreateSyncCtrlBlk_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrExtScanCtx_t lctrMstExtScanTbl[LCTR_SCAN_PHY_TOTAL]; +extern lctrExtScanCtrlBlk_t lctrMstExtScan; +extern lctrPerCreateSyncCtrlBlk_t lctrPerCreateSync; +extern lctrPerScanCtx_t lctrMstPerScanTbl[LL_MAX_PER_SCAN]; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Builder */ +uint8_t lctrMstExtDiscoverBuildOp(lctrExtScanCtx_t *pExtScanCtx); +uint8_t lctrMstAuxDiscoverBuildOp(lctrExtScanCtx_t *pExtScanCtx); +void lctrMstAuxDiscoverOpCommit(lctrExtScanCtx_t *pExtScanCtx, lctrAuxPtr_t *pAuxPtr, uint32_t startTs, uint32_t endTs); +uint8_t lctrMstPerScanBuildOp(lctrPerScanCtx_t *pPerScanCtx, lctrPerCreateSyncMsg_t *pMsg); +void lctrMstPerScanOpCommit(lctrExtScanCtx_t *pExtScanCtx, lctrAuxPtr_t *pAuxPtr, lctrSyncInfo_t *pSyncInfo, uint32_t startTs, uint32_t endTs); + +/* ISR: Discovery packet handlers */ +bool_t lctrMstDiscoverRxExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +void lctrMstDiscoverRxExtAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstDiscoverRxAuxAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstDiscoverRxAuxScanRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf); +uint32_t lctrMstDiscoverRxAuxChainHandler(BbOpDesc_t *pOp, const uint8_t *pChainBuf); +bool_t lctrMstDiscoverRxAuxChainPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pChainBuf); +bool_t lctrMstDiscoverRxLegacyAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstDiscoverTxLegacyScanReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +bool_t lctrMstDiscoverRxLegacyScanRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf); +/* ISR: Discovery BOD handlers */ +void lctrMstExtDiscoverEndOp(BbOpDesc_t *pOp); +void lctrMstAuxDiscoverEndOp(BbOpDesc_t *pOp); +void lctrMstPerScanEndOp(BbOpDesc_t *pOp); +uint32_t lctrMstPerScanRxPerAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf, uint8_t status); +bool_t lctrMstPerScanRxPerAdvPktPostHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); + +/* Action routines. */ +void lctrExtScanActDiscover(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActShutdown(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActScanCnf(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActDisallowScan(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActScanTerm(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActSelfTerm(lctrExtScanCtx_t *pExtScanCtx); +void lctrExtScanActUpdateDiscover(lctrExtScanCtx_t *pExtScanCtx); +void lctrCreateSyncActCreate(void); +void lctrCreateSyncActCancel(void); +void lctrCreateSyncActTerminate(void); +void lctrCreateSyncActDone(void); +void lctrPerScanActSyncEstd(lctrPerScanCtx_t *pPerScanCtx); +void lctrPerScanActSyncTerminate(lctrPerScanCtx_t *pPerScanCtx); +void lctrPerScanActSyncTerminateDone(lctrPerScanCtx_t *pPerScanCtx); +void lctrPerScanActSyncTimeout(lctrPerScanCtx_t *pPerScanCtx); + +/* State machine */ +void lctrMstExtScanExecuteSm(lctrExtScanCtx_t *pExtScanCtx, uint8_t event); +void lctrMstCreateSyncExecuteSm(uint8_t event); +void lctrMstPerScanExecuteSm(lctrPerScanCtx_t *pPerScanCtx, uint8_t event); + +/* Helpers */ +lctrPerScanCtx_t *lctrAllocPerScanCtx(void); + +/* Messaging */ +void lctrSendExtScanMsg(lctrExtScanCtx_t *pExtScanCtx, uint8_t event); +void lctrSendCreateSyncMsg(uint8_t event); +void lctrSendPerScanMsg(lctrPerScanCtx_t *pCtx, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Convert PHY value to PHY value in extended advertising report. + * + * \param auxPtrPhy Auxiliary Pointer PHY field. + * + * \return LL PHY value. + */ +/*************************************************************************************************/ +uint8_t lctrConvertAuxPtrPhyToAdvRptPhy(uint8_t auxPtrPhy); + +/*************************************************************************************************/ +/*! + * \brief Convert AuxPtr PHY value to PHY value in extended advertising report. + * + * \param auxPtrPhy Auxiliary Pointer PHY field. + * + * \return BB PHY value. + */ +/*************************************************************************************************/ +uint8_t lctrConvertAuxPtrPhyToBbPhy(uint8_t auxPtrPhy); + +/*************************************************************************************************/ +/*! + * \brief Compute the connection interval window widening delay in microseconds. + * + * \param unsyncTimeUsec Unsynchronized time in microseconds. + * \param caPpm Total clock accuracy. + * + * \return Window widening delay in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrCalcAuxAdvWindowWideningUsec(uint32_t unsyncTimeUsec, uint32_t caPpm); + +/*************************************************************************************************/ +/*! + * \brief Compute auxiliary offset. + * + * \param pAuxPtr Auxiliary Pointer. + * \param pOffsetUsec Return auxiliary offset in microseconds. + * \param pSyncDelayUsec Return synchronization delay in microseconds. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstComputeAuxOffset(lctrAuxPtr_t *pAuxPtr, uint32_t *pOffsetUsec, uint32_t *pSyncDelayUsec); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ADV_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave.h new file mode 100644 index 0000000000000000000000000000000000000000..591b70d8aca70bd4d4b411ef565f81dce637a7f5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave.h @@ -0,0 +1,148 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller advertising slave interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ADV_SLAVE_H +#define LCTR_INT_ADV_SLAVE_H + +#include "lctr_int.h" +#include "lctr_api_adv_slave.h" +#include "lctr_pdu_adv.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Slave advertising states. */ +enum +{ + LCTR_ADV_STATE_DISABLED, /*!< Advertising disabled state. */ + LCTR_ADV_STATE_ENABLED, /*!< Advertising enabled state. */ + LCTR_ADV_STATE_SHUTDOWN, /*!< Advertising shutdown in progress. */ + LCTR_ADV_STATE_RESET, /*!< Advertising reset in progress. */ + LCTR_ADV_STATE_TOTAL /*!< Total number of advertising states. */ +}; + +/*! \brief Common extended advertising PDU types. */ + +enum +{ + LCTR_PDU_ADV_EXT_IND, + LCTR_PDU_AUX_ADV_IND, + LCTR_PDU_AUX_SCAN_RSP, + LCTR_PDU_AUX_SYNC_IND, + LCTR_PDU_AUX_CHAIN_IND, + LCTR_PDU_AUX_CONNECT_RSP +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Slave advertising state context. */ +typedef struct +{ + /* Adv buffer (placed here to 32-bit align) */ + uint8_t advBuf[LL_ADVB_MAX_LEN]; + /*!< Advertising host data buffer. */ + + uint8_t state; /*!< Advertising state. */ + + /* BB/ISR context */ + bool_t connIndRcvd; /*!< Connection indication received flag. */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + uint8_t usedChSel; /*!< Used channel selection. */ + BbOpDesc_t advBod; /*!< Advertising BOD. */ + BbBleData_t bleData; /*!< BLE BB operation data. */ + uint32_t reqEndTs; /*!< Last received request end of packet timestamp. */ + + /* Scan buffer (placed here to 32-bit align) */ + uint8_t scanRspBuf[LL_ADVB_MAX_LEN]; + /*!< Advertising host data buffer. */ + + wsfQueue_t rxScanReqQ; /*!< Received SCAN_REQ queue. */ +} lctrSlvAdvCtx_t; + +/*! \brief Scan request. */ +typedef struct +{ + uint8_t scanAddrType; /*!< Scanner address type. */ + uint64_t scanAddr; /*!< Scanner address. */ + uint8_t scanIdAddrType; /*!< Scanner ID address type. */ + uint64_t scanIdAddr; /*!< Scanner ID address. */ +} lctrSlvScanReport_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrSlvAdvCtx_t lctrSlvAdv; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Builder */ +void lctrSlvAdvBuildOp(void); +void lctrSlvAdvCleanupOp(void); + +/* Event handlers */ +void lctrSlvRxScanReq(void); + +/* Address selection */ +void lctrChooseAdvA(BbBleData_t * const pBle, lctrAdvbPduHdr_t *pPduHdr, + uint8_t ownAddrType, uint8_t peerAddrType, uint64_t peerAddr, + uint64_t *pAdvA); +void lctrChoosePeerAddr(BbBleData_t * const pBle, uint8_t ownAddrType, + uint8_t peerAddrType, uint64_t peerAddr, uint64_t *pPeerRpa); + +/* ISR */ +bool_t lctrSlvAdvHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +bool_t lctrScanReqHandler(BbOpDesc_t *pOp, uint8_t reqLen); +void lctrConnIndHandler(BbOpDesc_t *pOp, uint8_t reqLen, const uint8_t *pReqBuf); +void lctrSlvAdvPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +void lctrSlvAdvEndOp(BbOpDesc_t *pOp); + +/* Channel */ +uint32_t lctrCalcAdvDelay(void); + +/* Action routines */ +void lctrAdvActStart(void); +void lctrAdvActSelfStart(void); +void lctrAdvActShutdown(void); +void lctrAdvActAdvCnf(void); +void lctrAdvActDisallowAdvCnf(void); +void lctrAdvActSelfTerm(void); +void lctrAdvActAdvTerm(void); +void lctrAdvActResetTerm(void); +void lctrAdvActUpdateAdvParam(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ADV_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..4a4b59ac39b16b22556711bf3a35c7b00abbd090 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h @@ -0,0 +1,324 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller slave extended advertising interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ADV_SLAVE_AE_H +#define LCTR_INT_ADV_SLAVE_AE_H + +#include "lctr_int.h" +#include "lctr_api_adv_slave_ae.h" +#include "lmgr_api_adv_slave_ae.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "lctr_pdu_adv.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum value of the AuxPtr offset field. */ +#define LCTR_AUX_PTR_MAX_OFFSET 0x3FFF + +/*! \brief Number of shifted bytes for Used PHY field from the AUX Offset. */ +#define LCTR_AUX_OFFS_USED_PHY_SHIFT 13 + +/*! \brief Extended Advertising packet length. */ +#define LCTR_EXT_ADVB_LEN(ehLen, dLen) (LL_ADV_HDR_LEN + ehLen + dLen) + +/*! \brief Extended header common field length. */ +#define LCTR_EXT_HDR_CMN_LEN 1 + +/*! \brief Extended header flags field length. */ +#define LCTR_EXT_HDR_FLAG_LEN 1 + +/*! \brief Maximum size of a single complete advertising data buffer. */ +#define LCTR_COMP_EXT_ADV_DATA_MAX_LEN 251 /* TODO: cfg_mac_ble.h configuration */ + +/*! \brief Resolve the extended advertising index from the context pointer. */ +#define LCTR_GET_EXT_ADV_INDEX(pAdvSet) (pAdvSet - &pLctrAdvSetTbl[0]) + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Slave extended advertising states. */ +enum +{ + LCTR_EXT_ADV_STATE_DISABLED, /*!< Extended advertising disabled state. */ + LCTR_EXT_ADV_STATE_ENABLED, /*!< Extended advertising enabled state. */ + LCTR_EXT_ADV_STATE_SHUTDOWN, /*!< Extended advertising shutdown in progress. */ + LCTR_EXT_ADV_STATE_RESET, /*!< Extended advertising reset in progress. */ + LCTR_EXT_ADV_STATE_TOTAL /*!< Total number of extended advertising states. */ +}; + +/*! \brief Slave periodic advertising states. */ +enum +{ + LCTR_PER_ADV_STATE_DISABLED, /*!< Periodic advertising disabled state. */ + LCTR_PER_ADV_STATE_ENABLED, /*!< Periodic advertising enabled state. */ + LCTR_PER_ADV_STATE_SHUTDOWN, /*!< Periodic advertising shutdown in progress. */ + LCTR_PER_ADV_STATE_RESET, /*!< Periodic advertising reset in progress. */ + LCTR_PER_ADV_STATE_TOTAL /*!< Total number of Periodic advertising states. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended advertising parameters. */ +typedef struct +{ + uint16_t advEventProp; /*!< Advertising Event Properties. */ + uint32_t priAdvInterMin; /*!< Primary Advertising Interval Minimum. */ + uint32_t priAdvInterMax; /*!< Primary Advertising Interval Maximum. */ + uint32_t priAdvTermCntDown; /*!< Primary Advertising termination count down. */ + uint64_t peerAddr; /*!< Peer Address. */ + uint8_t priAdvChanMap; /*!< Primary Advertising Channel Map. */ + uint8_t ownAddrType; /*!< Own Address Type. */ + uint8_t peerAddrType; /*!< Peer Address Type. */ + uint8_t advFiltPolicy; /*!< Advertising Filter Policy. */ + int8_t advTxPwr; /*!< Advertising Tx Power. */ + uint8_t priAdvPhy; /*!< Primary Advertising PHY. */ + uint8_t secAdvMaxSkip; /*!< Secondary Advertising Maximum Skip. */ + uint8_t secAdvPhy; /*!< Secondary Advertising PHY. */ + uint8_t advSID; /*!< Advertising SID. */ + uint8_t scanReqNotifEna; /*!< Scan Request Notification Enable. */ +} lctrExtAdvParam_t; + +/*! \brief Periodic advertising parameters. */ +typedef struct +{ + uint8_t perState; /*!< Current periodic adv state. */ + bool_t perAdvEnabled; /*!< Periodic advertising enabled or not. */ + uint32_t perAccessAddr; /*!< Periodic advertising access address. */ + uint16_t perEventCounter; /*!< Periodic event counter. */ + bool_t perAuxStart; /*!< True if need to start aux BOD due to periodic adv. */ + + BbOpDesc_t perAdvBod; /*!< Periodic advertising BOD. */ + BbBleData_t perBleData; /*!< Periodic advertising BLE data. */ + uint32_t perOffsUsec; /*!< Offset in microseconds to the next periodic PDU. */ + uint8_t perChHopInc; /*!< Periodic channel hop increment value. */ + uint8_t perChIdx; /*!< Periodic LL Channel. */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + uint32_t perAdvInter; /*!< Periodic advertising interval in BB ticks. */ + + uint32_t advInterMin; /*!< Periodic Advertising Interval Minimum in BB ticks. */ + uint32_t advInterMax; /*!< Periodic Advertising Interval Maximum in BB ticks. */ + uint16_t advEventProp; /*!< Periodic Advertising Event Properties. */ + bool_t advParamReady; /*!< Periodic Advertising Parameter is ready or not. */ + + /* Channel parameters */ + lctrChanParam_t perChanParam; /*!< Periodic Advertising Channel parameter. */ +} lctrPerAdvParam_t; + +/*! \brief Advertising data buffer descriptor. */ +typedef struct +{ + uint16_t did; /*!< Advertising Data ID. */ + uint16_t len; /*!< Advertising data length. */ + uint8_t *pBuf; /*!< Advertising data buffer. */ + bool_t ready; /*!< Advertising data buffer complete. */ + uint16_t txOffs; /*!< Tx buffer offset. */ + uint8_t fragPref; /*!< Host fragmentation preference. */ + + union + { + struct + { + bool_t modified; /*!< Content modified by host. */ + uint8_t len; /*!< Advertising data buffer length. */ + uint16_t did; /*!< Advertising Data ID. */ + uint8_t buf[LCTR_COMP_EXT_ADV_DATA_MAX_LEN]; + /*!< Advertising data buffer. */ + uint8_t fragPref; /*!< Host fragmentation preference. */ + } ext; /*!< Extended advertising data buffer cache (temporary storage during active advertising). */ + + struct + { + bool_t modified; /*!< Content modified by host. */ + uint8_t len; /*!< Advertising data buffer length. */ + uint8_t buf[LL_ADVBU_MAX_LEN]; + /*!< Advertising data buffer. */ + } legacy; /*!< Legacy advertising data buffer. */ + } alt; /*!< Alternate data storage. */ +} lctrAdvDataBuf_t; + +/*! \brief Advertising set. */ +typedef struct +{ + bool_t enabled; /*!< Enable flag. */ + uint8_t handle; /*!< Advertising handle. */ + + uint8_t state; /*!< Current state. */ + + /* Host parameters */ + bool_t bdAddrRndMod; /*!< Modified random address. */ + bool_t bdAddrRndValid; /*!< Random device address valid. */ + uint64_t bdAddrRnd; /*!< Random device address. */ + uint64_t advA; /*!< Advertiser address. */ + uint64_t tgtA; /*!< Target address. */ + lctrExtAdvParam_t param; /*!< Extended advertising parameters. */ + uint32_t auxDelayUsec; /*!< Auxiliary advertising event delay. */ + uint8_t advDataFragLen; /*!< Advertising data fragmentation length. */ + + /* Periodic advertising parameters */ + lctrPerAdvParam_t perParam; /*!< Periodic advertising parameters. */ + + /* Enable parameters */ + wsfTimer_t tmrAdvDur; /*!< Advertising duration timer. */ + uint8_t maxEvents; /*!< Maximum number of AE. */ + + /* Advertising task context */ + uint8_t numEvents; /*!< Number of completed AE. */ + uint8_t termReason; /*!< Termination reason. */ + uint8_t extHdrFlags; /*!< Extended header flags. */ + uint8_t *pExtAdvAuxPtr; /*!< Extended advertising PDU buffer location of AuxPtr field. */ + uint8_t auxChHopInc; /*!< Auxiliary channel hop increment value. */ + uint32_t auxSkipInter; /*!< Total skip time in BB ticks. */ + + /* Buffers */ + uint8_t advHdrBuf[LCTR_EXT_ADVB_LEN(LL_EXT_ADV_HDR_MAX_LEN, 0)]; + /*!< Primary channel legacy advertising and extended advertising header buffer. */ + uint8_t scanRspHdrBuf[LL_ADVB_MAX_LEN]; + /*!< Primary channel legacy scan response buffer. */ + uint8_t auxAdvHdrBuf[LCTR_EXT_ADVB_LEN(LL_EXT_ADV_HDR_MAX_LEN, 0)]; + /*!< Auxiliary extended advertising header buffer. */ + uint8_t auxRspHdrBuf[LCTR_EXT_ADVB_LEN(LL_EXT_ADV_HDR_MAX_LEN, 0)]; + /*!< Auxiliary scan or connect response header buffer. */ + uint8_t perAdvHdrBuf[LCTR_EXT_ADVB_LEN(LL_EXT_ADV_HDR_MAX_LEN, 0)]; + /*!< Periodic advertising header buffer. */ + lctrAdvDataBuf_t advData; /*!< Advertising data buffer. */ + lctrAdvDataBuf_t scanRspData; /*!< Scan response data buffer. */ + lctrAdvDataBuf_t perAdvData; /*!< Periodic advertising data buffer. */ + + /* Connection context. */ + bool_t isAuxConnReq; /*!< True if AUX_CONN_REQ is received, False if CONN_IND is received. */ + uint32_t connIndEndTs; /*!< Connection indication end timestamp. */ + bool_t connIndRcvd; /*!< Connection request received flag. */ + uint8_t usedChSel; /*!< Used channel selection. */ + + /* BB/ISR context */ + bool_t shutdown; /*!< Client initiated shutdown flag. */ + uint8_t bodTermCnt; /*!< Number of BOD terminated. */ + BbOpDesc_t advBod; /*!< Advertising BOD. */ + BbBleData_t bleData; /*!< BLE data. */ + BbOpDesc_t auxAdvBod; /*!< Auxiliary advertising BOD. */ + BbBleData_t auxBleData; /*!< Auxiliary BLE data. */ + uint32_t auxOffsUsec; /*!< Offset in microseconds to the next auxiliary PDU. */ + uint8_t auxChIdx; /*!< AUX LL Channel. */ + bool_t auxBodUsed; /*!< Auxiliary BOD in use flag. */ + lctrAdvbPduHdr_t rspPduHdr; /*!< Response PDU header. */ +} lctrAdvSet_t; + +/*! \brief Slave extended advertising state context. */ +typedef struct +{ + wsfQueue_t rxScanReqQ; /*!< Received SCAN_REQ queue. */ +} lctrSlvExtAdvCtx_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrAdvSet_t *pLctrAdvSetTbl; +extern LctrExtAdvMsg_t *pLctrSlvExtAdvMsg; +extern lctrSlvExtAdvCtx_t lctrSlvExtAdv; +extern LctrPerAdvMsg_t *pLctrSlvPerAdvMsg; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Context */ +void lctrFreeAdvSet(lctrAdvSet_t *pAdvSet); + +/* Address selection */ +void lctrChooseSetAdvA(lctrAdvbPduHdr_t *pPduHdr, BbBleData_t * const pBle, lctrAdvSet_t *pAdvSet); +void lctrChooseSetPeerA(lctrAdvbPduHdr_t *pPduHdr, BbBleData_t * const pBle, lctrAdvSet_t *pAdvSet); + +/* Builder */ +uint8_t lctrSlvExtAdvBuildOp(lctrAdvSet_t *pAdvSet, uint32_t maxStartMs); +void lctrSlvAuxNonConnNonScanBuildOp(lctrAdvSet_t *pAdvSet); +void lctrSlvAuxScanBuildOp(lctrAdvSet_t *pAdvSet); +void lctrSlvAuxConnBuildOp(lctrAdvSet_t *pAdvSet); +void lctrSlvAuxRescheduleOp(lctrAdvSet_t *pAdvSet, BbOpDesc_t * const pOp); +uint8_t lctrSlvPeriodicAdvBuildOp(lctrAdvSet_t *pAdvSet); + +/* Channel */ +void lctrSelectNextAuxChannel(lctrAdvSet_t *pAdvSet); +void lctrSelectNextPerChannel(lctrAdvSet_t *pAdvSet); + +/* ISR: Packet handlers */ +void lctrSlvTxSetupExtAdvHandler(BbOpDesc_t *pOp, uint32_t txTime); +uint32_t lctrSlvTxSetupAuxAdvDataHandler(BbOpDesc_t *pOp, bool_t isChainInd); +uint32_t lctrSlvTxSetupAuxScanRspDataHandler(BbOpDesc_t *pOp, bool_t isChainInd); +bool_t lctrSlvRxAuxScanReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +void lctrSlvRxAuxScanReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +void lctrSlvRxLegacyScanReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +bool_t lctrSlvRxAuxConnReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +bool_t lctrSlvRxLegacyReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +void lctrSlvRxLegacyReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf); +uint32_t lctrSlvTxSetupPeriodicAdvDataHandler(BbOpDesc_t *pOp, bool_t isChainInd); + +/* ISR: BOD handlers */ +void lctrSlvExtAdvEndOp(BbOpDesc_t *pOp); +void lctrSlvAuxAdvEndOp(BbOpDesc_t *pOp); +void lctrSlvPeriodicAdvEndOp(BbOpDesc_t *pOp); + +/* Action routines */ +void lctrExtAdvActStart(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActRestart(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActShutdown(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActAdvCnf(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActDisallowAdvCnf(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActSelfTerm(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActAdvTerm(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActReset(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActResetTerm(lctrAdvSet_t *pAdvSet); +void lctrExtAdvActDurationExpired(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActStart(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActUpdate(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActDisallowAdvCnf(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActShutdown(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActResetTerm(lctrAdvSet_t *pAdvSet); +void lctrPeriodicAdvActAdvTerm(lctrAdvSet_t *pAdvSet); + +/* Reservation */ +void lctrGetPerAdvOffsets(uint32_t rsvnOffs[], uint32_t refTime); + +/* State machine */ +void lctrSlvExtAdvExecuteSm(lctrAdvSet_t *pAdvSet, uint8_t event); +void lctrSlvPeriodicAdvExecuteSm(lctrAdvSet_t *pAdvSet, uint8_t event); + +/* Messaging */ +void lctrSendAdvSetMsg(lctrAdvSet_t *pAdvSet, uint8_t event); +void lctrSendPeriodicAdvSetMsg(lctrAdvSet_t *pAdvSet, uint8_t event); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ADV_SLAVE_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn.h new file mode 100644 index 0000000000000000000000000000000000000000..d1b363ce849f68c3cfb0173de879b7f42c99e6bf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn.h @@ -0,0 +1,653 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_CONN_H +#define LCTR_INT_CONN_H + +#include "lctr_int.h" +#include "lctr_api_conn.h" +#include "lctr_pdu_conn.h" +#include "lctr_pdu_adv.h" +#include "lmgr_api_conn.h" +#include "ll_defs.h" +#include "sch_api.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "wsf_cs.h" +#include "wsf_msg.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#define LCTR_MAX_CONS_CRC 2 /*!< Maximum number of consecutive CRC failures. */ + +#ifndef LCTR_DATA_PDU_START_OFFSET +#define LCTR_DATA_PDU_START_OFFSET 2 /*!< Data PDU start offset in a buffer (match ACL header size). */ +#endif + +#define LCTR_DATA_PDU_FC_OFFSET 0 /*!< Flow control fields data PDU offset. */ +#define LCTR_DATA_PDU_LEN_OFFSET 1 /*!< Length field data PDU offset. */ + +#define LCTR_MAX_INSTANT 32767 /*!< Maximum instant value for connection update. */ + +#define LCTR_CTRL_DATA_HANDLE 0xFF /*!< Connection handle used for LL control PDUs. */ + +#define LCTR_LE_PING_ATTEMPTS 4 /*!< LE Ping attempts. */ + +#define LCTR_CH_SEL_MAX 2 /*!< Total number of channel selection algorithms. */ + +/*! \brief Resolve the connection handle from the context pointer. */ +#define LCTR_GET_CONN_HANDLE(pCtx) (pCtx - pLctrConnTbl) + +/*! \brief Resolve connection context from the handle. */ +#define LCTR_GET_CONN_CTX(h) &(pLctrConnTbl[h]) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Connected states. */ +enum +{ + LCTR_CONN_STATE_INITIALIZED, /*!< Connection initialized. */ + LCTR_CONN_STATE_ESTABLISHED_STARTUP, /*!< Connection established before ready to start LLCP. */ + LCTR_CONN_STATE_ESTABLISHED_READY, /*!< Connection established and ready to start LLCP. */ + LCTR_CONN_STATE_TERMINATING /*!< Connection terminating. */ +}; + +/*! \brief LLCP states. */ +enum +{ + LCTR_LLCP_STATE_IDLE, /*!< LLCP idle state. */ + LCTR_LLCP_STATE_BUSY, /*!< LLCP busy state. */ + LCTR_LLCP_STATE_TOTAL /*!< Total number of LLCP states. */ +}; + +/*! \brief Common LLCP states. */ +enum +{ + LCTR_CMN_STATE_IDLE, /*!< LLCP idle state. */ + LCTR_CMN_STATE_BUSY, /*!< LLCP busy state. */ + LCTR_CMN_STATE_TOTAL /*!< Total number of LLCP states. */ +}; + +/*! \brief Common LLCP procedure IDs. */ +enum +{ + /* Common SM LLCP procedures. */ + LCTR_PROC_CMN_TERM, /*!< Termination procedure. */ + LCTR_PROC_CMN_CH_MAP_UPD, /*!< Channel map update procedure. */ + LCTR_PROC_CMN_FEAT_EXCH, /*!< Feature exchange procedure. */ + LCTR_PROC_CMN_VER_EXCH, /*!< Version exchange procedure. */ + LCTR_PROC_CMN_DATA_LEN_UPD, /*!< Data length update procedure. */ + LCTR_PROC_CMN_SET_MIN_USED_CHAN, /*!< Set minimum number of used channels procedure. */ + LCTR_PROC_CMN_TOTAL, /*!< Total number of common procedures. */ + + /* Custom SM LLCP procedures. */ + LCTR_PROC_CONN_UPD, /*!< Connection update procedure. */ + LCTR_PROC_CONN_PARAM, /*!< Connection parameter procedure. */ + LCTR_PROC_ENCRYPT, /*!< Encryption Start or Restart procedure. */ + LCTR_PROC_LE_PING, /*!< LE Ping procedure. */ + LCTR_PROC_PHY_UPD, /*!< PHY update procedure. */ + LCTR_PROC_PHY_UPD_PEER, /*!< Peer-initiated PHY update procedure. */ + + LCTR_PROC_INVALID = 0xFF /*!< Invalid ID. */ + + /* Note: additional procedures without instants can be overridden. */ +}; + +/*! \brief Connection context. */ +typedef struct +{ + bool_t enabled; /*!< Context enabled. */ + uint8_t state; /*!< Current state. */ + uint8_t role; /*!< Connection role. */ + uint32_t opModeFlags; /*!< Operational mode flags. */ + + /* Host/API */ + uint8_t termReason; /*!< Termination reason code. */ + uint8_t replyWaitingMsk; /*!< Host reply waiting mask. */ + + /* BB data */ + BbOpDesc_t connBod; /*!< Connection BOD. */ + BbBleData_t bleData; /*!< BLE BB operation data. */ + + union + { + struct + { + uint16_t totalAcc; /*!< Combined sleep clock inaccuracy. */ + uint16_t lastActiveEvent; /*!< Last active event counter. */ + uint32_t txWinSizeUsec; /*!< Tx window size. */ + uint32_t anchorPoint; /*!< Anchor point. */ + uint32_t unsyncedTime; /*!< Unsynced time in BB tick before connection update. */ + bool_t initAckRcvd; /*!< Ack received from master. */ + bool_t abortSlvLatency; /*!< If TRUE abort slave latency. */ + } slv; /*!< Slave connection specific data. */ + + struct + { + bool_t sendConnUpdInd; /*!< Send LL_CONNECTION_UPDATE_IND flag. */ + } mst; /*!< Master connection specific data. */ + } data; /*!< Role specific data. */ + + /* Connection event parameters */ + uint16_t maxLatency; /*!< Maximum latency. */ + uint16_t eventCounter; /*!< Connection event counter. */ + uint16_t connInterval; /*!< Connection interval. */ + + /* RF parameters */ + int8_t rssi; /*!< RSSI. */ + + /* Channel parameters */ + uint8_t lastChanIdx; /*!< Current channel index. */ + uint8_t hopInc; /*!< Hop increment. */ + uint8_t numUsedChan; /*!< Number of used channels. */ + uint64_t chanMask; /*!< Channel mask. */ + uint8_t chanRemapTbl[LL_CHAN_DATA_MAX_IDX + 1]; + /*!< Channel remapping table. */ + uint8_t usedChSel; /*!< Used channel selection. */ + uint16_t chIdentifier; /*!< Channel identifier. */ + + /* Flow control */ + lctrDataPduHdr_t txHdr; /*!< Transmit data PDU header. */ + lctrDataPduHdr_t rxHdr; /*!< Receive data PDU header. */ + wsfQueue_t txLeuQ; /*!< Transmit LE-U queue. */ + wsfQueue_t txArqQ; /*!< Transmit ARQ queue. */ + wsfQueue_t rxDataQ; /*!< Receive data pending queue. */ + uint8_t numTxComp; /*!< Number of completed Tx buffers. */ + uint8_t numRxPend; /*!< Number of Rx pending buffers. */ + bool_t emptyPduPend; /*!< Empty PDU ACK pending. */ + bool_t emptyPduFirstAtt; /*!< Empty PDU first attempt. */ + + /* Supervision */ + uint16_t supTimeoutMs; /*!< Supervision timeout in milliseconds. */ + wsfTimer_t tmrSupTimeout; /*!< Supervision timer. */ + bool_t connEst; /*!< Connection established. */ + + /* Encryption */ + bool_t pauseRxData; /*!< Pause Rx data PDUs. */ + bool_t pauseTxData; /*!< Pause Tx data PDUs. */ + uint8_t ltk[LL_KEY_LEN]; /*!< Long term key. */ + uint8_t skd[LL_SKD_LEN]; /*!< Session key diversifier. */ + uint8_t iv[LL_IV_LEN]; /*!< Initialization vector. */ + uint8_t rand[LL_RAND_LEN]; /*!< Random number. */ + uint16_t ediv; /*!< Encrypted diversifier. */ + + uint64_t txPktCounter; /*!< Transmit packet counter. */ + uint64_t rxPktCounter; /*!< Transmit packet counter. */ + + /* Authentication */ + uint32_t pingPeriodMs; /*!< Ping period in milliseconds. */ + wsfTimer_t tmrPingTimeout; /*!< Ping timer. */ + uint32_t authTimeoutMs; /*!< Authentication payload timeout in milliseconds. */ + wsfTimer_t tmrAuthTimeout; /*!< Authentication payload timer. */ + + LlEncMode_t newEncMode; /*!< Pending encryption mode. */ + bool_t pendEncMode; /*!< New encryption mode pending. */ + + bool_t keyUpdFlag; /*!< Flag for key update. */ + + /* Peer device info */ + uint8_t numSentVerInd; /*!< Number of sent LL_VERSION_IND. */ + bool_t remoteVerValid; /*!< Peer version data valid. */ + lctrVerInd_t remoteVer; /*!< Peer version data. */ + bool_t featExchFlag; /*!< Flag for completed feature exchange. */ + uint64_t usedFeatSet; /*!< Used feature set. */ + + /* Data length */ + lctrDataLen_t localDataPdu; /*!< Local Data PDU parameters. */ + lctrDataLen_t effDataPdu; /*!< Effective Data PDU parameters. */ + uint16_t localConnDurUsec; /*!< Local connection event duration. */ + uint16_t effConnDurUsec; /*!< Effective connection event duration. */ + + /* PHY */ + uint8_t allPhys; /*!< Default all PHYs. */ + uint8_t txPhys; /*!< Default transmitter PHYs. */ + uint8_t rxPhys; /*!< Default receiver PHYs. */ + uint8_t txPhysPending; /*!< Pending transmitter PHYs. */ + + /* Peer minimum number of used channels */ + uint8_t peerMinUsedChan[LL_MAX_PHYS]; + /*!< Peer minimum number of used channels for PHYs. */ + + /* LLCP */ + uint8_t llcpState; /*!< Current LLCP state. */ + uint8_t encState; /*!< Current encryption state. */ + uint8_t pingState; /*!< Current ping state. */ + uint8_t connUpdState; /*!< Connection update state. */ + uint8_t phyUpdState; /*!< PHY update state. */ + uint8_t cmnState; /*!< Common LLCP state. */ + bool_t peerReplyWaiting; /*!< Peer waiting for reply. */ + bool_t llcpInstantComp; /*!< Procedure instant completed. */ + bool_t termAckReqd; /*!< Ack required for Rx'ed LL_TERMINATE_IND. */ + bool_t ackAfterCtrlPdu; /*!< Ack Tx'ed after last Control PDU Rx'ed. */ + bool_t llcpIsOverridden; /*!< Is the current procedure overridden by other procedure. */ + bool_t isSlvReadySent; /*!< True if slave ready to initiate startup LLCP procedure is sent. */ + bool_t isFirstNonCtrlPdu; /*!< True if first non-control PDU from master and slave. */ + bool_t isSlvPhyUpdInstant; /*!< True if slave is in PHY update instant state. */ + uint8_t llcpActiveProc; /*!< Current procedure. */ + uint16_t llcpNotifyMask; /*!< Host notification mask. */ + uint16_t llcpPendMask; /*!< Pending LLCP procedures. */ + uint16_t llcpIncompMask; /*!< Incomplete LLCP procedures. */ + LlConnSpec_t connUpdSpec; /*!< Host connection update specification. */ + lctrConnUpdInd_t connUpd; /*!< Connection update parameters. */ + lctrConnParam_t connParam; /*!< Stored peer connection parameter request or response. */ + lctrChanMapInd_t chanMapUpd; /*!< Channel map parameters. */ + lctrPhy_t phyReq; /*!< Stored peer PHY request. */ + lctrPhyUpdInd_t phyUpd; /*!< PHY update parameters. */ + wsfTimer_t tmrProcRsp; /*!< Procedure response timer. */ +} lctrConnCtx_t; + +/*! \brief Call signature of a cipher block handler. */ +typedef void (*lctrCipherBlkHdlr_t)(BbBleEnc_t *pEnc, uint8_t id, uint8_t dir); + +/*! \brief Call signature of a packet encryption handler. */ +typedef bool_t (*lctrPktEncHdlr_t)(BbBleEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic); + +/*! \brief Call signature of a packet decryption handler. */ +typedef bool_t (*lctrPktDecHdlr_t)(BbBleEnc_t *pEnc, uint8_t *pBuf); + +/*! \brief Call signature of a set packet count handler. */ +typedef void (*lctrPktCntHdlr_t)(BbBleEnc_t *pEnc, uint64_t pktCnt); + +/*! \brief Call signature of a LLCP state machine handler. */ +typedef bool_t (*LctrLlcpHdlr_t)(lctrConnCtx_t *pCtx, uint8_t event); + +/*! \brief Call signature of a control PDU handler. */ +typedef void (*lctrCtrlPduHdlr_t)(lctrConnCtx_t *pCtx, uint8_t *pBuf); + +/*! \brief Call signature of a Channel state machine handler. */ +typedef uint8_t (*LctrChSelHdlr_t)(lctrConnCtx_t *pCtx, uint16_t numSkip); + +/*! \brief LLCP state machine handlers. */ +enum +{ + LCTR_LLCP_SM_ENCRYPT, /*!< Encryption LLCP state machine. */ + LCTR_LLCP_SM_PING, /*!< Ping state machine. */ + LCTR_LLCP_SM_CONN_UPD, /*!< Connection update state machine. */ + LCTR_LLCP_SM_PHY_UPD, /*!< PHY update state machine. */ + LCTR_LLCP_SM_CMN, /*!< Common LLCP state machine. */ + LCTR_LLCP_SM_TOTAL /*!< Total number of LLCP state machine. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern lctrCipherBlkHdlr_t lctrInitCipherBlkHdlr; +extern lctrPktEncHdlr_t lctrPktEncryptHdlr; +extern lctrPktDecHdlr_t lctrPktDecryptHdlr; +extern lctrPktCntHdlr_t lctrSetEncryptPktCountHdlr; +extern lctrPktCntHdlr_t lctrSetDecryptPktCountHdlr; +extern lctrConnCtx_t *pLctrConnTbl; +extern lctrDataPdu_t lctrDataPdu; +extern lctrConnMsg_t *pLctrConnMsg; +extern const LctrVsHandlers_t *pLctrVsHdlrs; +extern lctrCtrlPduHdlr_t lctrCtrlPduHdlr; +extern LctrChSelHdlr_t lctrChSelHdlr[LCTR_CH_SEL_MAX]; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void lctrConnDefaults(void); + +/* Builder */ +lctrConnCtx_t *lctrAllocConnCtx(void); +void lctrFreeConnCtx(lctrConnCtx_t *pCtx); +uint8_t lctrSelectNextDataChannel(lctrConnCtx_t *pCtx, uint16_t numSkip); +uint8_t lctrSelectNextChannel2(lctrConnCtx_t *pCtx, uint16_t numSkip); +void lctrBuildRemapTable(lctrConnCtx_t *pCtx); + +/* Task event handler */ +void lctrConnTxCompletedHandler(void); +void lctrConnRxPendingHandler(void); + +/* Connection update actions */ +void lctrStoreConnUpdateSpec(lctrConnCtx_t *pCtx); +void lctrSendConnUpdateInd(lctrConnCtx_t *pCtx); +void lctrStoreConnUpdate(lctrConnCtx_t *pCtx); +void lctrNotifyHostConnUpdateInd(lctrConnCtx_t *pCtx, uint8_t status); +void lctrActNotifyHostConnUpdSuccess(lctrConnCtx_t *pCtx); +void lctrActHostNegReply(lctrConnCtx_t *pCtx); +void lctrActPeerRejectConnParam(lctrConnCtx_t *pCtx); + +/* Channel map actions */ +void lctrStoreChanMapUpdate(lctrConnCtx_t *pCtx); +void lctrSendChanMapUpdateInd(lctrConnCtx_t *pCtx); +void lctrStoreChanMap(lctrConnCtx_t *pCtx); + +/* Feature exchange actions */ +void lctrSendFeatureReq(lctrConnCtx_t *pCtx); +void lctrSendFeatureRsp(lctrConnCtx_t *pCtx); +void lctrStoreUsedFeatures(lctrConnCtx_t *pCtx); + +/* Version exchange actions */ +void lctrSendVersionInd(lctrConnCtx_t *pCtx); +void lctrStoreRemoteVer(lctrConnCtx_t *pCtx); +void lctrNotifyHostReadRemoteVerCnf(lctrConnCtx_t *pCtx); + +/* Terminate actions */ +void lctrSendTerminateInd(lctrConnCtx_t *pCtx); +void lctrNotifyHostDisconnectInd(lctrConnCtx_t *pCtx); +void lctrStoreTerminateReason(lctrConnCtx_t *pCtx); +void lctrStoreDisconnectReason(lctrConnCtx_t *pCtx); +void lctrStoreConnFailEstablishTerminateReason(lctrConnCtx_t *pCtx); +void lctrStoreLlcpTimeoutTerminateReason(lctrConnCtx_t *pCtx); +void lctrStoreResetTerminateReason(lctrConnCtx_t *pCtx); +void lctrStoreInstantPassedTerminateReason(lctrConnCtx_t *pCtx); +void lctrStoreMicFailedTerminateReason(lctrConnCtx_t *pCtx); + +/* Connection parameter actions */ +void lctrStoreConnParamReq(lctrConnCtx_t *pCtx); +void lctrStoreConnParamRsp(lctrConnCtx_t *pCtx); +void lctrStoreConnParamSpec(lctrConnCtx_t *pCtx); +void lctrSendConnParamReq(lctrConnCtx_t *pCtx); +void lctrSendConnParamRsp(lctrConnCtx_t *pCtx); +void lctrNotifyHostConnParamInd(lctrConnCtx_t *pCtx); + +/* Data length exchange actions */ +void lctrStoreLocalDataLength(lctrConnCtx_t *pCtx); +void lctrSendDataLengthReq(lctrConnCtx_t *pCtx); +void lctrSendDataLengthRsp(lctrConnCtx_t *pCtx); +void lctrStoreRemoteDataLength(lctrConnCtx_t *pCtx); +void lctrNotifyHostDataLengthInd(lctrConnCtx_t *pCtx, uint8_t status); + +/* Set minimum number of used channels actions */ +void lctrSendSetMinUsedChanInd(lctrConnCtx_t *pCtx); +void lctrStoreSetMinUsedChan(lctrConnCtx_t *pCtx); + +/* Unknown/Unsupported */ +void lctrSendUnknownRsp(lctrConnCtx_t *pCtx); +void lctrSendRejectInd(lctrConnCtx_t *pCtx, uint8_t reason, bool_t forceRejectExtInd); + +/* Tx data path */ +uint16_t lctrTxFragLen(lctrConnCtx_t *pTx); +uint16_t lctrTxInitMem(uint8_t *pFreeMem, uint32_t freeMemSize); +uint8_t *lctrTxCtrlPduAlloc(uint8_t pduLen); +void lctrTxDataPduQueue(lctrConnCtx_t *pCtx, uint16_t fragLen, lctrAclHdr_t *pAclHdr, uint8_t *pAclBuf); +void lctrTxCtrlPduQueue(lctrConnCtx_t *pCtx, uint8_t *pBuf); +uint8_t lctrTxQueuePeek(lctrConnCtx_t *pCtx, BbBleDrvTxBufDesc_t *bbDescs, bool_t *pMd); +bool_t lctrTxQueuePop(lctrConnCtx_t *pCtx); +void lctrTxQueuePopCleanup(lctrConnCtx_t *pCtx); +uint8_t lctrTxQueueClear(lctrConnCtx_t *pCtx); + +/* Rx data path */ +uint8_t *lctrRxPduAlloc(uint16_t maxRxLen); +void lctrRxPduFree(uint8_t *pBuf); +void lctrRxEnq(uint8_t *pBuf, uint16_t eventCounter, uint16_t connHandle); +uint8_t *lctrRxDeq(uint16_t *pConnHandle); +void lctrRxConnEnq(lctrConnCtx_t *pCtx, uint8_t *pBuf); +uint8_t *lctrRxConnDeqAcl(lctrConnCtx_t *pCtx); +uint8_t lctrRxConnClear(lctrConnCtx_t *pCtx); + +/* LLCP */ +void lctrStartLlcpTimer(lctrConnCtx_t *pCtx); +void lctrStopLlcpTimer(lctrConnCtx_t *pCtx); +void lctrStartPendingLlcp(lctrConnCtx_t *pCtx); + +/* Data path pause */ +void lctrPauseTxData(lctrConnCtx_t *pCtx); +void lctrUnpauseTxData(lctrConnCtx_t *pCtx); +void lctrCheckPauseComplete(lctrConnCtx_t *pCtx); +void lctrPauseRxData(lctrConnCtx_t *pCtx); +void lctrUnpauseRxData(lctrConnCtx_t *pCtx); + +/* Packet times */ +void lctrSetPacketTimeRestriction(lctrConnCtx_t *pCtx, uint8_t txPhys); +void lctrRemovePacketTimeRestriction(lctrConnCtx_t *pCtx); +uint16_t lctrCalcConnDurationUsec(lctrConnCtx_t *pCtx, const lctrDataLen_t *pDataLen); + +/* Scheduler */ +BbOpDesc_t *lctrConnResolveConflict(BbOpDesc_t *pNewOp, BbOpDesc_t *pExistOp); + +/* ISR */ +uint8_t *lctrProcessRxAck(lctrConnCtx_t *pCtx); +void lctrTxPduAck(lctrConnCtx_t *pCtx); +bool_t lctrProcessTxAck(lctrConnCtx_t *pCtx); +void lctrProcessTxAckCleanup(lctrConnCtx_t *pCtx); +uint16_t lctrSetupForTx(lctrConnCtx_t *pCtx, uint8_t rxStatus, bool_t reqTx); +void lctrRxPostProcessing(lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t *pNextRxBuf, bool_t loadRxBuf); + +/* Helper */ +void lctrSendConnMsg(lctrConnCtx_t *pCtx, uint8_t event); +bool_t lctrExceededMaxDur(lctrConnCtx_t *pCtx, uint32_t ceStart, uint32_t pendDurUsec); +uint32_t lctrCalcPingPeriodMs(lctrConnCtx_t *pCtx, uint32_t authTimeoutMs); +uint8_t lctrComputeSca(void); + +/* Reservation */ +void lctrGetConnOffsets(uint32_t rsvnOffs[], uint32_t refTime); + +/*************************************************************************************************/ +/*! + * \brief Check for a queue depth of 1 element. + * + * \param pArqQ Queue. + * + * \return TRUE if ARQ only has 1 element, FALSE otherwise. + * + * \note Checks without resource protection. This routine is only intended to be used in task + * context. + */ +/*************************************************************************************************/ +bool_t lctrIsQueueDepthOne(wsfQueue_t *pArqQ); + +/*************************************************************************************************/ +/*! + * \brief Set flags for link termination. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrFlagLinkTerm(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Service the Control PDU ACK state after a successful reception. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCheckControlPduAck(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Service the Control PDU ACK state after a successful transmission. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetControlPduAck(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Set flags for link termination. + * + * \param pCtx Connection context. + * + * \return TRUE if connection is terminated, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrCheckForLinkTerm(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Increment the Tx/encrypt packet counter. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrIncPacketCounterTx(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Increment the Rx/decrypt packet counter. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrIncPacketCounterRx(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Set the transmit packet counter value in the BB. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetBbPacketCounterTx(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Set the receive packet counter value in the BB. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetBbPacketCounterRx(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Check if procedure is active, if not pend the procedure. + * + * \param pCtx Connection context. + * \param proc Procedure ID to check/pend. + * + * \return TRUE if active procedure, FALSE if pended. + */ +/*************************************************************************************************/ +bool_t lctrCheckActiveOrPend(lctrConnCtx_t *pCtx, uint8_t proc); + +/*************************************************************************************************/ +/*! + * \brief Store connection timeout termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnTimeoutTerminateReason(lctrConnCtx_t *pCtx); + +/*************************************************************************************************/ +/*! + * \brief Increment available Tx data buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataTxIncAvailBuf(void); + +/*************************************************************************************************/ +/*! + * \brief Decrement available Tx data buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataTxDecAvailBuf(void); + +/*************************************************************************************************/ +/*! + * \brief Increment available Rx data buffers. +* + * \param numBufs Number of completed packets. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataRxIncAvailBuf(uint8_t numBufs); + +/*************************************************************************************************/ +/*! + * \brief Get connection operational mode flags. + * + * \param pCtx Connection context to get the flag. + * \param flag Flags. + * + * \return Status error code. + * + * Set mode flags governing LL operations of a given connection. + */ +/*************************************************************************************************/ +bool_t lctrGetConnOpFlag(lctrConnCtx_t *pCtx, uint32_t flag); + +/*************************************************************************************************/ +/*! + * \brief Convert PHYS bit to PHY. + * + * \param physBit PHYS bit. + * + * \return PHY. + */ +/*************************************************************************************************/ +uint8_t lctrPhysBitToPhy(uint8_t physBit); + +/*************************************************************************************************/ +/*! + * \brief Convert PHY to PHYS bit. + * + * \param phy PHY. + * + * \return PHYS bit. + */ +/*************************************************************************************************/ +uint8_t lctrPhyToPhysBit(uint8_t phy); + +/*************************************************************************************************/ +/*! + * \brief Get LLCP procedure ID. + * + * \param event Event. + * + * \return LLCP procedure event ID. + */ +/*************************************************************************************************/ +uint8_t lctrGetProcId(uint8_t event); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_CONN_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_master.h new file mode 100644 index 0000000000000000000000000000000000000000..7c6357444128f54e8b2e82bfd25a8d74fdc0813b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_master.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller master connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_CONN_MASTER_H +#define LCTR_INT_CONN_MASTER_H + +#include "lctr_int.h" +#include "lctr_int_conn.h" +#include "lctr_api_conn.h" +#include "lctr_pdu_conn.h" +#include "ll_defs.h" +#include "bb_ble_api.h" +#include "wsf_msg.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Buffer offset of txWinOffset in a CONN_IND PDU. */ +#define LCTR_CONN_IND_TX_WIN_OFFSET (LL_DATA_HDR_LEN + 6 + 6 + 8) + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern LctrLlcpHdlr_t lctrMstLlcpSmTbl[LCTR_LLCP_SM_TOTAL]; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +void lctrMstConnExecuteSm(lctrConnCtx_t *pConnCtx, uint8_t event); +void lctrMstLlcpExecuteSm(lctrConnCtx_t *pCtx, uint8_t event); +bool_t lctrMstLlcpExecuteConnUpdSm(lctrConnCtx_t *pCtx, uint8_t event); + +/* Builder */ +void lctrMstConnBuildOp(lctrConnCtx_t *pCtx, lctrConnInd_t *pConnInd); + +/* ISR */ +void lctrMstConnBeginOp(BbOpDesc_t *pOp); +void lctrMstConnCleanupOp(BbOpDesc_t *pOp); +void lctrMstConnEndOp(BbOpDesc_t *pOp); +void lctrMstConnAbortOp(BbOpDesc_t *pOp); +void lctrMstConnTxCompletion(BbOpDesc_t *pOp, uint8_t status); +void lctrMstConnRxCompletion(BbOpDesc_t *pOp, uint8_t *pRxBuf, uint8_t status); + +/* Action routines. */ +void lctrMstSetEstablishConn(lctrConnCtx_t *pCtx); +void lctrMstReloadDataPdu(lctrConnCtx_t *pCtx); + +/* Helper */ +uint32_t lctrMstConnAdjustOpStart(lctrConnCtx_t *pCtx, uint32_t scanRefTime, lctrConnInd_t *pConnInd); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_CONN_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_slave.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_slave.h new file mode 100644 index 0000000000000000000000000000000000000000..90a19f9a4d34a43a8f01f15f0c73752d33c77ec2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_conn_slave.h @@ -0,0 +1,75 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller slave connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_CONN_SLAVE_H +#define LCTR_INT_CONN_SLAVE_H + +#include "lctr_int_conn.h" +#include "bb_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern LctrLlcpHdlr_t lctrSlvLlcpSmTbl[LCTR_LLCP_SM_TOTAL]; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +void lctrSlvConnExecuteSm(lctrConnCtx_t *pConnCtx, uint8_t event); +void lctrSlvLlcpExecuteSm(lctrConnCtx_t *pCtx, uint8_t event); +bool_t lctrSlvLlcpExecuteConnUpdSm(lctrConnCtx_t *pCtx, uint8_t event); +void lctrConnStatelessEventHandler(lctrConnCtx_t *pCtx, uint8_t event); +bool_t lctrLlcpExecuteCommonSm(lctrConnCtx_t *pCtx, uint8_t event); +void lctrLlcpStatelessEventHandler(lctrConnCtx_t *pCtx, uint8_t event); + +/* Status */ +bool_t lctrSlvCheckEncOverrideConnParam(lctrConnCtx_t *pCtx); +bool_t lctrSlvCheckEncOverrideCommonParam(lctrConnCtx_t *pCtx); +bool_t lctrSlvCheckConnUpdInstant(lctrConnCtx_t *pCtx); + +/* Builder */ +uint32_t lctrCalcIntervalWindowWideningUsec(lctrConnCtx_t *pCtx, uint32_t unsyncTimeUsec); +void lctrSlvConnBuildOp(lctrConnCtx_t *pCtx); + +/* ISR */ +void lctrSlvConnBeginOp(BbOpDesc_t *pOp); +void lctrSlvConnCleanupOp(BbOpDesc_t *pOp); +void lctrSlvConnEndOp(BbOpDesc_t *pOp); +void lctrSlvConnTxCompletion(BbOpDesc_t *pOp, uint8_t status); +void lctrSlvConnRxCompletion(BbOpDesc_t *pOp, uint8_t *pRxBuf, uint8_t status); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_CONN_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_master.h new file mode 100644 index 0000000000000000000000000000000000000000..f605dd0220e84636692f737deb1235ccab99d43e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_master.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller master connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ENC_MASTER_H +#define LCTR_INT_ENC_MASTER_H + +#include "lctr_int_conn.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +bool_t lctrMstExecuteEncryptSm(lctrConnCtx_t *pCtx, uint8_t event); + +/* Action routines. */ +void lctrGenerateMstVectors(lctrConnCtx_t *pCtx); +void lctrStoreSlvVectors(lctrConnCtx_t *pCtx); +void lctrSendEncReq(lctrConnCtx_t *pCtx); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ENC_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_slave.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_slave.h new file mode 100644 index 0000000000000000000000000000000000000000..901acd45eb2007c9c8b1102138d8d39c4235718e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_enc_slave.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller slave connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_ENC_SLAVE_H +#define LCTR_INT_ENC_SLAVE_H + +#include "lctr_int.h" +#include "lctr_int_conn.h" +#include "lctr_api_conn.h" +#include "lctr_pdu_conn.h" +#include "ll_defs.h" +#include "bb_ble_api.h" +#include "wsf_msg.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Master SKD offset. */ +#define LCTR_SKD_M_OFFS 0 + +/*! \brief Master IV offset. */ +#define LCTR_IV_M_OFFS 0 + +/*! \brief Slave SKD offset. */ +#define LCTR_SKD_S_OFFS (LL_SKD_LEN / 2) + +/*! \brief Slave IV offset. */ +#define LCTR_IV_S_OFFS (LL_IV_LEN / 2) + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +bool_t lctrSlvExecuteEncryptSm(lctrConnCtx_t *pCtx, uint8_t event); +bool_t lctrExecutePingSm(lctrConnCtx_t *pCtx, uint8_t event); + +/* Action routines. */ +void lctrEnableTxDataEnc(lctrConnCtx_t *pCtx); +void lctrDisableTxDataEnc(lctrConnCtx_t *pCtx); +void lctrEnableRxDataEnc(lctrConnCtx_t *pCtx); +void lctrDisableRxDataEnc(lctrConnCtx_t *pCtx); +void lctrGenerateSlvVectors(lctrConnCtx_t *pCtx); +void lctrStoreLtkReply(lctrConnCtx_t *pCtx); +void lctrStoreLtkNegRepTerminateReason(lctrConnCtx_t *pCtx); +void lctrCalcSessionKey(lctrConnCtx_t *pCtx); +void lctrInvalidEncPduSeq(lctrConnCtx_t *pCtx); +void lctrSendEncRsp(lctrConnCtx_t *pCtx); +void lctrSendStartEncReq(lctrConnCtx_t *pCtx); +void lctrSendStartEncRsp(lctrConnCtx_t *pCtx); +void lctrSendPauseEncReq(lctrConnCtx_t *pCtx); +void lctrSendPauseEncRsp(lctrConnCtx_t *pCtx); +void lctrSendPingReq(lctrConnCtx_t *pCtx); +void lctrSendPingRsp(lctrConnCtx_t *pCtx); +void lctrEncNotifyHostLtkReqInd(lctrConnCtx_t *pCtx); +void lctrNotifyEncChangeInd(lctrConnCtx_t *pCtx, uint8_t status); +void lctrNotifyEncKeyRefreshInd(lctrConnCtx_t *pCtx); +void lctrNotifyAuthPayloadTimeout(lctrConnCtx_t *pCtx); +void lctrRestartAuthPayloadTimer(lctrConnCtx_t *pCtx); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_ENC_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master.h new file mode 100644 index 0000000000000000000000000000000000000000..9382d3fa102d84f307028fa7e020da42cc9d8673 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_INIT_MASTER_H +#define LCTR_INT_INIT_MASTER_H + +#include "lctr_api_init_master.h" +#include "lctr_int.h" +#include "lctr_int_adv_master.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master initiate states. */ +enum +{ + LCTR_INIT_STATE_DISABLED, /*!< Initiate disabled state. */ + LCTR_INIT_STATE_ENABLED, /*!< Initiate enabled state. */ + LCTR_INIT_STATE_SHUTDOWN, /*!< Scan shutdown in progress. */ + LCTR_INIT_STATE_RESET, /*!< Scan reset in progress. */ + LCTR_INIT_STATE_TOTAL /*!< Total number of scan states. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrMstScanCtx_t lctrMstInit; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Builder */ +void lctrMstInitiateBuildOp(LlConnSpec_t *pConnSpec, uint8_t peerAddrType, uint64_t peerAddr); +void lctrMstInitiateOpCommit(void); + +/* ISR */ +void lctrMstInitiateEndOp(BbOpDesc_t *pOp); +bool_t lctrMstInitiateAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstConnIndTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pIndBuf); + +/* Action routines. */ +void lctrInitActInitiate(void); +void lctrInitActConnect(void); +void lctrInitActShutdown(void); +void lctrInitActScanTerm(void); +void lctrInitActResetTerm(void); +void lctrInitActDisallowInitiate(void); +void lctrInitActDisallowCancel(void); + +/* Helper routines. */ +void lctrScanCleanup(lctrMstScanCtx_t *pCtx); +void lctrScanNotifyHostInitiateError(uint8_t reason, uint8_t peerAddrType, uint64_t peerAddr); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_INIT_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..3f2a5a370f4578dc3c0387f4ed86d69f84b5da42 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_init_master_ae.h @@ -0,0 +1,125 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller scanning master interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_INIT_MASTER_AE_H +#define LCTR_INT_INIT_MASTER_AE_H + +#include "lctr_api_init_master_ae.h" +#include "lctr_int.h" +#include "lctr_int_adv_master_ae.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ +/*! \brief Resolve the extended initiate handle from the context pointer. */ +#define LCTR_GET_EXT_INIT_HANDLE(pCtx) (pCtx - lctrMstExtInitTbl) + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Master initiate states. */ +enum +{ + LCTR_EXT_INIT_STATE_DISABLED, /*!< Initiate disabled state. */ + LCTR_EXT_INIT_STATE_ENABLED, /*!< Initiate enabled state. */ + LCTR_EXT_INIT_STATE_SHUTDOWN, /*!< Initiate shutdown in progress. */ + LCTR_EXT_INIT_STATE_RESET, /*!< Initiate reset in progress. */ + LCTR_EXT_INIT_STATE_TOTAL /*!< Total number of initiate states. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ +/*! \brief Extended initiating control block. */ +typedef struct +{ + /* Initiate */ + uint64_t peerAddr; /*!< Initiating peer address. */ + uint8_t peerAddrType; /*!< Initiating peer address type. */ + uint8_t estConnPhys; /*!< PHYs which established connections. */ + + /* State. */ + uint8_t enaPhys; /*!< Enabled PHYs. */ + bool_t initTermByHost; /*!< Host initiated initiate disable. */ + +} lctrExtInitCtrlBlk_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrExtScanCtx_t lctrMstExtInitTbl[LCTR_SCAN_PHY_TOTAL]; +extern lctrExtInitCtrlBlk_t lctrMstExtInit; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +void lctrMstExtInitExecuteSm(lctrExtScanCtx_t *pExtInitCtx, uint8_t event); + +/* Builder */ +uint8_t lctrMstExtInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType); +uint8_t lctrMstAuxInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType); +void lctrMstExtInitiateOpCommit(lctrExtScanCtx_t *pExtInitCtx); + +/* ISR: Initiate packet handlers */ +void lctrMstExtPreInitiateExecHandler(BbOpDesc_t *pOp); +bool_t lctrMstInitiateRxExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +void lctrMstInitiateRxExtAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstInitiateRxAuxAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf); +bool_t lctrMstInitiateRxAuxConnRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf); +bool_t lctrMstExtConnIndTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pIndBuf); + +/* ISR: Initiate BOD callback */ +void lctrMstExtInitiateEndOp(BbOpDesc_t *pOp); +void lctrMstAuxInitiateEndOp(BbOpDesc_t *pOp); +void lctrMstExtInitiateScanEndOp(BbOpDesc_t *pOp); +void lctrMstAuxInitiateScanEndOp(BbOpDesc_t *pOp); + +/* Action routines. */ +void lctrExtInitActConnect(lctrExtScanCtx_t *pExtInitCtx); +void lctrExtInitActShutdown(lctrExtScanCtx_t *pExtInitCtx); +void lctrExtInitActScanTerm(lctrExtScanCtx_t *pExtInitCtx); +void lctrExtInitActDisallowInitiate(lctrExtScanCtx_t *pExtInitCtx); +void lctrExtInitActDisallowCancel(lctrExtScanCtx_t *pExtInitCtx); + +/* Helper routines. */ +void lctrMstExtInitCleanupOp(lctrExtScanCtx_t *pExtInitCtx); +void lctrScanNotifyHostInitiateError(uint8_t reason, uint8_t peerAddrType, uint64_t peerAddr); +uint8_t lctrExtInitSetupInitiate(lctrExtScanCtx_t *pExtInitCtx, uint8_t peerAddrType, uint64_t peerAddr, uint8_t filtPolicy, uint8_t ownAddrType); + +/* Messaging */ +void lctrSendExtInitMsg(lctrExtScanCtx_t *pExtScanCtx, uint8_t event); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_INIT_MASTER_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_master_phy.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_master_phy.h new file mode 100644 index 0000000000000000000000000000000000000000..13e906948c126edf23b4520aaac6028754e0df66 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_master_phy.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller PHY features (master) interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_PHY_MASTER_H +#define LCTR_INT_PHY_MASTER_H + +#include "lctr_int.h" +#include "lctr_int_conn.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +bool_t lctrMstLlcpExecutePhyUpdateSm(lctrConnCtx_t *pCtx, uint8_t event); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_PHY_MASTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_priv.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_priv.h new file mode 100644 index 0000000000000000000000000000000000000000..0d77382bd63a6d93e04fce340dab464076ac76bd --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_priv.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller privacy interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_PRIV_H +#define LCTR_INT_PRIV_H + +#include "lctr_int.h" +#include "wsf_timer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Slave advertising state context. */ +typedef struct +{ + wsfTimer_t tmrResPrivAddrTimeout; /*!< Resolvable private address timeout timer. */ +} lctrPrivCtx_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +extern lctrPrivCtx_t lctrPriv; + + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_PRIV_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_slave_phy.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_slave_phy.h new file mode 100644 index 0000000000000000000000000000000000000000..af7b0c524f9d6e96f68b33db8ebf526a5ce56402 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_slave_phy.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller PHY features (slave) interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_PHY_SLAVE_H +#define LCTR_INT_PHY_SLAVE_H + +#include "lctr_int.h" +#include "lctr_int_conn.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* State machine */ +bool_t lctrSlvLlcpExecutePhyUpdateSm(lctrConnCtx_t *pCtx, uint8_t event); + +/* Action routines */ +void lctrStoreHostPhyUpdate(lctrConnCtx_t *pCtx); +void lctrStorePeerPhyReq(lctrConnCtx_t *pCtx); +void lctrStorePeerPhyUpdateInd(lctrConnCtx_t *pCtx); + +void lctrSendPhyReqPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys); +void lctrSendPhyRspPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys); +void lctrSendPhyUpdateIndPdu(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys); + +void lctrNotifyHostPhyUpdateInd(lctrConnCtx_t *pCtx, uint8_t status); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_PHY_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_tester.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_tester.h new file mode 100644 index 0000000000000000000000000000000000000000..2c54eb2007f375c2b09303a45c85d3288c893510 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_int_tester.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal link layer controller connection interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_INT_TESTER_H +#define LCTR_INT_TESTER_H + +#include "ll_tester_api.h" +#include "wsf_msg.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void LctrForceTxAcl(uint8_t *pAclBuf); + +/*************************************************************************************************/ +/*! + * \brief Force transmission of a data PDU. + * + * \param connHandle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrForceTxData(uint16_t connHandle); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_INT_TESTER_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..7baccad731020b41dfa0f79e8c3186ba5278541c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master.c @@ -0,0 +1,448 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master advertising event ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_init_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "bb_ble_api_reslist.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief End a discovery scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstDiscoverEndOp(BbOpDesc_t *pOp) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + lctrMstScanCtx_t *pCtx = (lctrMstScanCtx_t *)pOp->pCtx; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + WSF_ASSERT(pCtx); + + pBle = &pCtx->bleData; + pScan = &pBle->op.mstAdv; + + if (pCtx->shutdown || pCtx->selfTerm) + { + lctrMsgHdr_t *pMsg; + + /* Send SM a scan termination event. */ + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + if (pCtx == &lctrMstScan) + { + pMsg->dispId = LCTR_DISP_SCAN; + pMsg->event = LCTR_SCAN_MSG_TERMINATE; + } + else + { + pMsg->dispId = LCTR_DISP_INIT; + pMsg->event = LCTR_INIT_MSG_TERMINATE; + } + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + return; + } + + /*** Update scan data ***/ + + /* Update scanner's address. */ + if (lmgrCb.bdAddrRndModScan && + (pCtx->scanParam.ownAddrType & LL_ADDR_RANDOM)) + { + lmgrCb.bdAddrRndModScan = FALSE; + + if ((pCtx->scanParam.ownAddrType & LL_ADDR_IDENTITY_BIT) == 0) + { + /* Update ScanA field. */ + uint8_t *pBuf = pCtx->reqBuf + LL_ADV_HDR_LEN; + BDA64_TO_BSTREAM(pBuf, lmgrCb.bdAddrRnd); /* update ScanA field */ + } + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + } + + /*** Reschedule operation ***/ + + /* Reset due time to start of scan window. */ + pOp->due = pCtx->scanWinStart; + + if ((pScan->elapsedUsec + pOp->minDurUsec) < LCTR_BLE_TO_US(pCtx->scanParam.scanWindow)) + { + const uint32_t min = BB_US_TO_BB_TICKS(pScan->elapsedUsec); + const uint32_t max = BB_BLE_TO_BB_TICKS(pCtx->scanParam.scanWindow); + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + /* Continue interrupted operation. */ + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pCtx->scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + return; + } + } + + /* Advance to next scanInterval. */ + + pScan->elapsedUsec = 0; + + /* Compute next channel. */ + pBle->chan.chanIdx = lctrScanChanSelectNext(pBle->chan.chanIdx, pScan->scanChMap); + + if (pCtx->scanParam.scanInterval == pCtx->scanParam.scanWindow) + { + /* Continuous scan. */ + SchInsertNextAvailable(pOp); + pCtx->scanWinStart = pOp->due; + } + else + { + /* Next scan interval. */ + const uint32_t min = BB_BLE_TO_BB_TICKS(pCtx->scanParam.scanInterval); + const uint32_t max = min + BB_BLE_TO_BB_TICKS(pCtx->scanParam.scanWindow); + + while (TRUE) + { + /* Store start of next scan window. */ + pCtx->scanWinStart = pOp->due + min; + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pCtx->scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + break; + } + else + { + /* Advance to next scan window. */ + pOp->due = pCtx->scanWinStart; + + LL_TRACE_WARN1("!!! Scan schedule conflict at due=%u", pOp->due + min); + LL_TRACE_WARN1("!!! scanWindowUsec=%u", LCTR_BLE_TO_US(pCtx->scanParam.scanWindow)); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Scan discover state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if scan request transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + bool_t txScanReq = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + + /*** Transmit response PDU processing. ***/ + + if (pScan->pTxReqBuf) + { + switch (pScan->filtResults.pduType) + { + case LL_PDU_ADV_IND: + case LL_PDU_ADV_SCAN_IND: + { + uint8_t *pScanReqAdvA; + if (!pScan->filtResults.peerMatch) + { + /* Require peer match. */ + txScanReq = FALSE; + return txScanReq; + } + + /* Update scan request header with advertiser's address. */ + pScanReqAdvA = lctrMstScan.reqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pScanReqAdvA, pScan->filtResults.peerAddr); + lctrMstScan.reqPduHdr.rxAddrRnd = pScan->filtResults.peerAddrRand; + + /* Save AdvA in the SCAN_REQ here and compare it with the one from SCAN_RSP later. */ + lctrMstScan.data.disc.scanReqAdvAddr = pScan->filtResults.peerAddr; + + /* Update scan request header with scanner's address. */ + if (lctrMstScan.scanParam.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint8_t *pScanReqScanA; + bool_t localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + uint64_t localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + } + pScanReqScanA = lctrMstScan.reqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pScanReqScanA, localAddr); + lctrMstScan.reqPduHdr.txAddrRnd = localAddrRand; + } + + lctrPackAdvbPduHdr(lctrMstScan.reqBuf, &lctrMstScan.reqPduHdr); + + /* Scan backoff. */ + if (lctrGetOpFlag(LL_OP_MODE_FLAG_ENA_SCAN_BACKOFF)) + { + if (lctrMstScan.backoffCount) + { + lctrMstScan.backoffCount--; + } + + if (lctrMstScan.backoffCount == 0) + { + txScanReq = TRUE; + } + } + else + { + txScanReq = TRUE; + } + break; + } + + default: + break; + } + } + + return txScanReq; +} + +/*************************************************************************************************/ +/*! + * \brief Scan discover state advertising packet receive post process handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstDiscoverAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + uint8_t *pRxAdvBuf; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + + /*** Received advertising PDU post-processing. ***/ + + + /* The peer match will be enforced in the scan SM. */ + + switch (pScan->filtResults.pduType) + { + /* Valid PDU types. */ + case LL_PDU_ADV_DIRECT_IND: + case LL_PDU_ADV_IND: + case LL_PDU_ADV_NONCONN_IND: + case LL_PDU_ADV_SCAN_IND: + if ((lmgrMstScanCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pRxAdvBuf = WsfMsgAlloc(LCTR_ADVB_BUF_SIZE)) != NULL)) + { + /* Store data in extra buffer area. */ + pScan->pRxAdvBuf[LCTR_ADVB_BUF_OFFSET_RSSI] = pScan->advRssi; + pScan->pRxAdvBuf[LCTR_ADVB_BUF_OFFSET_RX_RPA] = + (pScan->filtResults.peerIdAddrRand != pScan->filtResults.peerAddrRand) || + (pScan->filtResults.peerIdAddr != pScan->filtResults.peerAddr); + UINT32_TO_BUF(pScan->pRxAdvBuf + LCTR_ADVB_BUF_OFFSET_CRC, pScan->advCrc); + + /* Queue the received AdvB buffer for post-processing. */ + + if (pScan->filtResults.localMatch) + { + WsfMsgEnq(&lctrMstScan.rxAdvbQ, 0, pScan->pRxAdvBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_ADVB)); + lctrAdvReportsInc(); + } + else + { + WsfMsgEnq(&lctrMstScan.rxDirectAdvbQ, 0, pScan->pRxAdvBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_DIRECT_ADVB)); + lctrAdvReportsInc(); + } + + /* Update scan operation with new allocated AdvB buffer. */ + pScan->pRxAdvBuf = pRxAdvBuf; + } + break; + + default: + break; + } +} + + +/*************************************************************************************************/ +/*! + * \brief Scan request Tx completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Transmitted request buffer. + * + * \return TRUE to signal receive scan response. + */ +/*************************************************************************************************/ +bool_t lctrMstScanReqTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + BbBleMstAdvEvent_t *pAdv; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pAdv = &pOp->prot.pBle->op.mstAdv; + + return pAdv->pRxRspBuf ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Master scan response receive completion handler. + * + * \param pOp Originating operation. + * \param pRspBuf Received response buffer, NULL if receive failed. + * + * \return Always return FALSE (ignored by BB). + */ +/*************************************************************************************************/ +bool_t lctrMstScanRspRxCompHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + + if (pRspBuf) + { + /*** Received advertising PDU post-processing. ***/ + + uint8_t *pRxRspBuf; + + switch (pScan->filtResults.pduType) + { + /* Valid PDU types. */ + case LL_PDU_SCAN_RSP: + + /* scanReqAdvAddr is assigned when LL_PDU_ADV_SCAN_IND is received. */ + if (lctrMstScan.data.disc.scanReqAdvAddr != pScan->filtResults.peerAddr) + { + LL_TRACE_WARN0("Ignore scan_rsp since advAddr doesn't match the one sent in the scan_req."); + break; + } + + if ((lmgrMstScanCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pRxRspBuf = WsfMsgAlloc(LCTR_ADVB_BUF_SIZE)) != NULL)) + { + /* Store data in extra buffer area. */ + pScan->pRxRspBuf[LCTR_ADVB_BUF_OFFSET_RSSI] = pScan->advRssi; + pScan->pRxRspBuf[LCTR_ADVB_BUF_OFFSET_RX_RPA] = + (pScan->filtResults.peerIdAddr != pScan->filtResults.peerAddrRand) && + (pScan->filtResults.peerIdAddr != pScan->filtResults.peerAddr); + UINT32_TO_BUF(pScan->pRxAdvBuf + LCTR_ADVB_BUF_OFFSET_CRC, pScan->advCrc); + + /* Queue the received AdvB buffer for post-processing. */ + WsfMsgEnq(&lctrMstScan.rxAdvbQ, 0, pScan->pRxRspBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_ADVB)); + lctrAdvReportsInc(); + + /* Update scan operation with new allocated AdvB buffer. */ + pScan->pRxRspBuf = pRxRspBuf; + } + break; + + default: + break; + } + } + + /*** Scan backoff maintenance ***/ + + if (pRspBuf) + { + if (++lctrMstScan.consRspSuccess >= 2) + { + lctrMstScan.upperLimit = lctrMstScan.upperLimit >> 1; /* divide by 2 */ + + if (lctrMstScan.upperLimit == 0) + { + lctrMstScan.upperLimit = 1; + } + + lctrMstScan.consRspSuccess = 0; + } + + lctrMstScan.consRspFailure = 0; + } + else + { + if (++lctrMstScan.consRspFailure >= 2) + { + lctrMstScan.upperLimit = lctrMstScan.upperLimit << 1; /* multiply by 2 */ + + if (lctrMstScan.upperLimit > 256) + { + lctrMstScan.upperLimit = 256; + } + + lctrMstScan.consRspFailure = 0; + } + + lctrMstScan.consRspSuccess = 0; + } + + /* backoffCount = [1..upperLimit] */ + lctrMstScan.backoffCount = (LlMathRandNum() & (lctrMstScan.upperLimit - 1)) + 1; + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..d2a15aa25b9daa919b911bddff38d24810348875 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c @@ -0,0 +1,1995 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master advertising event ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master_ae.h" +#include "lctr_int_conn_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api_reslist.h" +#include "bb_ble_api_whitelist.h" +#include "bb_ble_api_periodiclist.h" +#include "lmgr_api_adv_master_ae.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Data Status field number of bit shift. */ +#define LCTR_DATA_STATUS_SHIFT 5 + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Transitive context (valid only for a single Advertising Event). */ +struct +{ + uint8_t advPduType; /*!< Primary channel advertising PDU type. */ + bool_t filtResult; /*!< PDU filter result. */ + bool_t skipFiltAnonymous; /*!< If TRUE, skip PDU filtering due to anonymous advertising. */ + const uint8_t *pAdvData; /*!< Point to the advertising data payload. */ + uint8_t advDataLen; /*!< Advertising data length. */ + bool_t isHdrParsed; /*!< TRUE if header is received and parsed. */ + uint8_t extAdvHdrFlags; /*!< Extended advertising header flag. */ + uint8_t extAdvHdrLen; /*!< Extended advertising header length. */ + lctrAdvbPduHdr_t advHdr; /*!< Advertising header. */ + + /* Used for non-connectable non-scannable with auxiliary packet. */ + uint64_t advA; /*!< Advertising address. */ + uint64_t tgtA; /*!< Target address. */ + bool_t advAReceived; /*!< TRUE if advertising address is received. */ + bool_t advARand; /*!< TRUE if advertising address is random. */ + bool_t tgtAReceived; /*!< TRUE if target address is received. */ + bool_t tgtARand; /*!< TRUE if target address is random. */ + + /* Chain state. */ + uint8_t chainAdvMode; /*!< AdvMode field for chain reports. */ + uint16_t chainExtraEventType; /*!< Extra event type flags for chain reports. */ +} lctrMstExtScanIsr; + +/*! \brief Transitive context (valid only for a single Periodic Advertising Event). */ +struct +{ + bool_t filtResult; /*!< PDU filter result, filter out if TRUE, FAlSE otherwise. */ + bool_t syncWithSlave; /*!< Flag indicating synchronize packet received from slave. */ + uint32_t firstRxStartTs; /*!< Timestamp of the first received frame regardless of CRC error. */ +} lctrMstPerScanIsr; + +/************************************************************************************************** + Functions: Utility functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Get the local ID address. + * + * \param pExtScanCtx Scan context. + * \param targetAddr Received target address. + * \param pLocalIdAddr Storage for local ID address. + * \param pLocalIdAddrType Storage for local ID address type; + * \param peerIdAddr Peer ID address. + * \param peerIdAddrType Peer ID address type. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrGetLocalIdAddr(lctrExtScanCtx_t *pExtScanCtx, uint64_t targetAddr, + uint64_t *pLocalIdAddr, uint8_t *pLocalIdAddrType, + uint64_t peerIdAddr, uint8_t peerIdAddrType) +{ + if (BDA64_ADDR_IS_RPA(targetAddr)) + { + /* Identity address is either public or random in the resolving list. */ + peerIdAddrType &= ~(1 << 1); + + if (BbBleResListIsLocalResolved(targetAddr, peerIdAddrType, peerIdAddr)) + { + if (pExtScanCtx->scanParam.ownAddrType == LL_ADDR_RANDOM_IDENTITY) + { + *pLocalIdAddrType = LL_ADDR_RANDOM_IDENTITY; + *pLocalIdAddr = lmgrCb.bdAddrRnd; + } + else + { + *pLocalIdAddrType = LL_ADDR_PUBLIC_IDENTITY; + *pLocalIdAddr = lmgrPersistCb.bdAddr; + } + } + else + { + *pLocalIdAddrType = LL_ADDR_RANDOM_UNRESOLVABLE; + *pLocalIdAddr = targetAddr; + } + } + else + { + if (pExtScanCtx->scanParam.ownAddrType == LL_ADDR_RANDOM) + { + *pLocalIdAddrType = LL_ADDR_RANDOM; + *pLocalIdAddr = lmgrCb.bdAddrRnd; + } + else + { + *pLocalIdAddrType = LL_ADDR_PUBLIC; + *pLocalIdAddr = lmgrPersistCb.bdAddr; + } + } +} + +/************************************************************************************************** + Functions: Extended advertising reports +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Pend extended advertising report notification. + * + * \param pExtScanCtx Extended scan context. + * + * \return TRUE if report pended, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrExtAdvRptPend(lctrExtScanCtx_t *pExtScanCtx) +{ + LlExtAdvReportInd_t *pRpt; + uint64_t hash; + + /* Only called with the first report in the sequence. */ + WSF_ASSERT(pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_IDLE); + + if (pExtScanCtx->state != LCTR_EXT_SCAN_STATE_DISCOVER) + { + return FALSE; + } + + pRpt = &pExtScanCtx->data.scan.advRpt; + + /* Check for duplicate report. */ + lctrAdvRptGenerateExtHash(&hash, pRpt->addrType, BstreamToBda64(pRpt->addr), + pRpt->eventType, pRpt->advSID, pExtScanCtx->extAdvHdr.did); + if (lctrAdvRptCheckDuplicate(&lctrMstExtScan.advFilt, hash)) + { + /* Duplicate found, just exit. */ + return FALSE; + } + + pExtScanCtx->data.scan.advRptState = LCTR_RPT_STATE_IN_PROGRESS; + + /* Event handling offloaded to task context, cf. lctrMstExtDiscoverEndOp(), lctrMstAuxDiscoverEndOp(). */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Pend extended advertising report notification. + * + * \param pExtScanCtx Extended scan context. + * + * \return TRUE if report pended, FALSE otherwise. + */ +/*************************************************************************************************/ +static void lctrExtAdvRptSubmit(lctrExtScanCtx_t *pExtScanCtx) +{ + if (pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_IN_PROGRESS) + { + LlExtAdvReportInd_t * const pRpt = &pExtScanCtx->data.scan.advRpt; + + if (((pRpt->eventType >> 5) & LL_RPT_DATA_INC_TRUNC) == 0) + { + /* Only save the hash to the table when complete data is received. */ + uint64_t hash; + lctrAdvRptGenerateExtHash(&hash, pRpt->addrType, BstreamToBda64(pRpt->addr), + pRpt->eventType, pRpt->advSID, pExtScanCtx->extAdvHdr.did); + lctrAdvRptAddEntry(&lctrMstExtScan.advFilt, hash); + } + + pExtScanCtx->data.scan.advRptState = LCTR_RPT_STATE_COMP; + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_ADVB)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Create extended advertising report. + * + * \param pExtScanCtx Extended scan context. + * \param extraEventType Extra event type flags. + * \param pAdvHdr Advertising header. + * \param peerIdAddr Peer identify address. + * \param peerIdAddrType Peer identify address type. + * \param rssi RSSI value. + * \param pAdvBuf Advertising buffer. + * \param pRpt Extended advertising report. + * + * \return TRUE if report delivery successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrExtAdvRptPack(lctrExtScanCtx_t *pExtScanCtx, uint16_t extraEventType, + lctrAdvbPduHdr_t *pAdvHdr, uint64_t peerIdAddr, uint8_t peerIdAddrType, + int8_t rssi, const uint8_t *pAdvBuf, LlExtAdvReportInd_t *pRpt) +{ + /* Ensure single report generation. */ + if (pExtScanCtx->data.scan.advRptState != LCTR_RPT_STATE_IDLE) + { + LL_TRACE_WARN0("Report generation flow controlled due to outstanding report notification"); + return FALSE; + } + + memset(pRpt, 0, sizeof(*pRpt)); + + pRpt->rssi = rssi; + pRpt->eventType = extraEventType; + pRpt->advSID = LL_SID_NO_ADI; + pRpt->txPwr = LL_RSSI_NOT_AVAIL; + + switch (LCTR_GET_EXT_SCAN_HANDLE(pExtScanCtx)) + { + case LCTR_SCAN_PHY_1M: + pRpt->priPhy = LL_PHY_LE_1M; + break; + case LCTR_SCAN_PHY_CODED: + pRpt->priPhy = LL_PHY_LE_CODED; + break; + default: + break; + } + + switch (pAdvHdr->pduType) + { + /* Extended advertising PDUs. */ + case LL_PDU_ADV_EXT_IND: + /* case LL_PDU_AUX_ADV_IND: */ /* Shared auxiliary advertising PDU type values. */ + /* case LL_PDU_AUX_SCAN_RSP: */ + /* case LL_PDU_AUX_SYNC_IND: */ + /* case LL_PDU_AUX_CHAIN_IND: */ + case LL_PDU_AUX_CONNECT_RSP: + { + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) + { + pRpt->addrType = peerIdAddrType; + Bda64ToBstream(pRpt->addr, peerIdAddr); + } + else + { + pRpt->addrType = LL_ADDR_ANONYMOUS; + } + pRpt->pData = pExtScanCtx->pExtAdvData; + pRpt->len = 0; + pRpt->eventType |= ((pExtScanCtx->extAdvHdr.advMode & LCTR_ADV_MODE_CONN_BIT) ? LL_RPT_EVT_CONN_ADV_BIT : 0) | + ((pExtScanCtx->extAdvHdr.advMode & LCTR_ADV_MODE_SCAN_BIT) ? LL_RPT_EVT_SCAN_ADV_BIT : 0) | + ((pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) ? LL_RPT_EVT_DIRECT_ADV_BIT : 0); + pRpt->secPhy = lctrConvertAuxPtrPhyToAdvRptPhy(pExtScanCtx->priChAuxPtr.auxPhy); + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_ADI_BIT) + { + pRpt->advSID = pExtScanCtx->extAdvHdr.sid; + } + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_TX_PWR_BIT) + { + pRpt->txPwr = pExtScanCtx->extAdvHdr.txPwr; + } + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) + { + pRpt->perAdvInter = pExtScanCtx->secSyncInfo.syncInter; + } + + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) + { + uint64_t loocalIdAddr; + uint8_t localIdAddrType; + + lctrGetLocalIdAddr(pExtScanCtx, pExtScanCtx->extAdvHdr.tgtAddr, &loocalIdAddr, &localIdAddrType, peerIdAddr, peerIdAddrType); + + Bda64ToBstream(pRpt->directAddr, loocalIdAddr); + pRpt->directAddrType = localIdAddrType; + } + break; + } + + /* Legacy advertising PDU. */ + default: + { + const uint8_t *pData; + uint8_t dataLen; + + if ((pAdvHdr->len < LL_ADV_PREFIX_LEN) || /* invalid packet length. */ + (pAdvHdr->len > (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN))) + { + /* Do not send report for invalid packets. */ + return FALSE; + } + + /* Default advertising data values. */ + pData = pAdvBuf + LL_ADV_HDR_LEN + LL_ADV_PREFIX_LEN; + dataLen = pAdvHdr->len - LL_ADV_PREFIX_LEN; + + pRpt->eventType |= LL_RPT_EVT_LEGACY_ADV_BIT; + switch (pAdvHdr->pduType) + { + case LL_PDU_ADV_IND: + pRpt->eventType |= LL_RPT_EVT_CONN_ADV_BIT | LL_RPT_EVT_SCAN_ADV_BIT | 0; + break; + case LL_PDU_ADV_DIRECT_IND: + { + const uint8_t *pTargetA = pAdvBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + uint64_t loocalIdAddr; + uint8_t localIdAddrType; + + pRpt->eventType |= LL_RPT_EVT_CONN_ADV_BIT | /* --------------- */ 0 | LL_RPT_EVT_DIRECT_ADV_BIT; + dataLen = 0; /* no payload */ + + lctrGetLocalIdAddr(pExtScanCtx, BstreamToBda64(pTargetA), &loocalIdAddr, &localIdAddrType, peerIdAddr, peerIdAddrType); + Bda64ToBstream(pRpt->directAddr, loocalIdAddr); + pRpt->directAddrType = localIdAddrType; + break; + } + case LL_PDU_ADV_SCAN_IND: + pRpt->eventType |= /* --------------- */ 0 | LL_RPT_EVT_SCAN_ADV_BIT | /* ----------------- */ 0; + break; + case LL_PDU_ADV_NONCONN_IND: + pRpt->eventType |= /* --------------- */ 0 | /* --------------- */ 0 | /* ----------------- */ 0; + break; + case LL_PDU_SCAN_RSP: + pRpt->eventType |= /* --------------- */ 0 | LL_RPT_EVT_SCAN_ADV_BIT | /* ----------------- */ 0; + pRpt->eventType |= (lctrMstExtScanIsr.advPduType == LL_PDU_ADV_IND) ? LL_RPT_EVT_CONN_ADV_BIT : 0; + pRpt->eventType |= LL_RPT_EVT_SCAN_RSP_BIT; + break; + default: + /* Invalid packet type. */ + LL_TRACE_WARN1("Received advertising PDU with invalid PDU type=%u", pAdvHdr->pduType); + return FALSE; + } + + pRpt->addrType = peerIdAddrType; + Bda64ToBstream(pRpt->addr, peerIdAddr); + + pRpt->pData = pData; + pRpt->len = dataLen; + break; + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Reassemble extended advertising data. + * + * \param pExtScanCtx Extended scan context. + * \param pChainBuf Chain buffer. + * \param chainLen Chain length. + * \param rssi RSSI of received CHAIN_IND. + * + * \return TRUE if reassembly successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrExtAdvDataReassemble(lctrExtScanCtx_t *pExtScanCtx, const uint8_t *pChainBuf, uint8_t chainLen, int8_t rssi) +{ + LlExtAdvReportInd_t *pRpt; + uint16_t availLen, fragLen; + + /* Ensure report event is already packed. */ + WSF_ASSERT(pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_IN_PROGRESS); + + pRpt = &pExtScanCtx->data.scan.advRpt; + + availLen = pLctrRtCfg->maxExtScanDataLen - pRpt->len; + fragLen = WSF_MIN(availLen, chainLen); + + /* Reassemble AdvData with chain fragment. */ + memcpy(pExtScanCtx->pExtAdvData + pRpt->len, pChainBuf, fragLen); + pRpt->len += fragLen; + + if (fragLen < chainLen) + { + return FALSE; + } + + /* Update RSSI with last received CHAIN_IND. */ + pRpt->rssi = rssi; + + return TRUE; +} + +/************************************************************************************************** + Functions: Periodic advertising reports +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Pend periodic advertising report notification. + * + * \param pPerScanCtx Periodic scan context. + * + * \return TRUE if report pended, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrPerAdvRptPend(lctrPerScanCtx_t *pPerScanCtx) +{ + /* Only called with the first report in the sequence. */ + WSF_ASSERT(pPerScanCtx->advRptState == LCTR_RPT_STATE_IDLE); + + if (pPerScanCtx->state != LCTR_PER_SCAN_STATE_SYNC_ESTD) + { + return FALSE; + } + + pPerScanCtx->advRptState = LCTR_RPT_STATE_IN_PROGRESS; + + /* Event handling offloaded to task context, cf. lctrMstExtDiscoverEndOp(), lctrMstAuxDiscoverEndOp(). */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Pend periodic advertising report notification. + * + * \param pPerScanCtx Periodic scan context. + * + * \return TRUE if report pended, FALSE otherwise. + */ +/*************************************************************************************************/ +static void lctrPerAdvRptSubmit(lctrPerScanCtx_t *pPerScanCtx) +{ + if (pPerScanCtx->advRptState == LCTR_RPT_STATE_IN_PROGRESS) + { + pPerScanCtx->advRptState = LCTR_RPT_STATE_COMP; + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_ADVB)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Reassemble periodic advertising data. + * + * \param pPerScanCtx Periodic scan context. + * \param pChainBuf Chain buffer. + * \param chainLen Chain length. + * \param rssi RSSI of received CHAIN_IND. + * + * \return TRUE if reassembly successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrPerAdvDataReassemble(lctrPerScanCtx_t *pPerScanCtx, const uint8_t *pChainBuf, uint8_t chainLen, int8_t rssi) +{ + LlPerAdvReportInd_t *pRpt; + uint16_t availLen, fragLen; + + /* Ensure report event is already packed. */ + WSF_ASSERT(pPerScanCtx->advRptState == LCTR_RPT_STATE_IN_PROGRESS); + + pRpt = &pPerScanCtx->advRpt; + availLen = pLctrRtCfg->maxExtScanDataLen - pRpt->len; + fragLen = WSF_MIN(availLen, chainLen); + + /* Reassemble AdvData with chain fragment. */ + memcpy(pPerScanCtx->pPerAdvData + pRpt->len, pChainBuf, fragLen); + pRpt->len += fragLen; + + if (fragLen < chainLen) + { + return FALSE; + } + + /* Update RSSI with last received CHAIN_IND. */ + pRpt->rssi = rssi; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Pack periodic advertising report. + * + * \param pOp Originating operation. + * \param pAdvBuf Received adv buffer, NULL if receive failed. + * \param extAdvHdrFlags Extended adv header flags. + * \param pRpt Periodic advertising report. + * + * \return TRUE if pack report successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrPerAdvRptPack(BbOpDesc_t *pOp, const uint8_t *pAdvBuf, + uint8_t extAdvHdrFlags, + LlPerAdvReportInd_t *pRpt) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstPerScanEvent_t * const pPerScan= &pBle->op.mstPerScan; + lctrPerScanCtx_t * const pPerScanCtx = pOp->pCtx; + + memset(pRpt, 0, sizeof(*pRpt)); + + pRpt->syncHandle = LCTR_GET_PER_SCAN_HANDLE(pPerScanCtx); + if (extAdvHdrFlags & LL_EXT_HDR_TX_PWR_BIT) + { + pRpt->txPwr = pPerScanCtx->extAdvHdr.txPwr; + } + pRpt->rssi = pPerScan->perAdvRssi; + pRpt->unused = 0xFF; /* Defined by spec. */ + pRpt->pData = pPerScanCtx->pPerAdvData; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Pack periodic advertising truncate report. + * + * \param pOp Originating operation. + * \param pAdvBuf Received adv buffer, NULL if receive failed. + * \param pRpt Periodic advertising report. + * + * \return TRUE if pack report successful, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrPerAdvRptPackTruncate(BbOpDesc_t *pOp, const uint8_t *pAdvBuf, LlPerAdvReportInd_t *pRpt) +{ + lctrPerScanCtx_t * const pPerScanCtx = pOp->pCtx; + + memset(pRpt, 0, sizeof(LlPerAdvReportInd_t)); + + pRpt->syncHandle = LCTR_GET_PER_SCAN_HANDLE(pPerScanCtx); + pRpt->txPwr = LL_RSSI_NOT_AVAIL; + pRpt->rssi = LL_RSSI_NOT_AVAIL; + pRpt->unused = 0xFF; /* Defined by spec. */ + pRpt->dataStatus = LL_RPT_DATA_INC_TRUNC; + + return TRUE; +} + +/************************************************************************************************** + Functions: Scan backoff +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Scan backoff maintenance when response reception is successful. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanBackoffRspSuccess(lctrExtScanCtx_t *pExtScanCtx) +{ + if (++pExtScanCtx->data.scan.consRspSuccess >= 2) + { + pExtScanCtx->data.scan.upperLimit = pExtScanCtx->data.scan.upperLimit >> 1; /* divide by 2 */ + + if (pExtScanCtx->data.scan.upperLimit == 0) + { + pExtScanCtx->data.scan.upperLimit = 1; + } + + pExtScanCtx->data.scan.consRspSuccess = 0; + } + + pExtScanCtx->data.scan.consRspFailure = 0; + + /* backoffCount = [1..upperLimit] */ + pExtScanCtx->data.scan.backoffCount = (LlMathRandNum() & (pExtScanCtx->data.scan.upperLimit - 1)) + 1; +} + +/*************************************************************************************************/ +/*! + * \brief Scan backoff maintenance when response reception failed. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrScanBackoffRspFailed(lctrExtScanCtx_t *pExtScanCtx) +{ + if (++pExtScanCtx->data.scan.consRspFailure >= 2) + { + pExtScanCtx->data.scan.upperLimit = pExtScanCtx->data.scan.upperLimit << 1; /* multiply by 2 */ + + if (pExtScanCtx->data.scan.upperLimit > 256) + { + pExtScanCtx->data.scan.upperLimit = 256; + } + + pExtScanCtx->data.scan.consRspFailure = 0; + } + + pExtScanCtx->data.scan.consRspSuccess = 0; + + /* backoffCount = [1..upperLimit] */ + pExtScanCtx->data.scan.backoffCount = (LlMathRandNum() & (pExtScanCtx->data.scan.upperLimit - 1)) + 1; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether scan backoff should be applied. + * + * \param pExtScanCtx Extended scan context. + * + * \return TRUE if request should be sent, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrScanBackoffCheckReqAllowed(lctrExtScanCtx_t *pExtScanCtx) +{ + if (!lctrGetOpFlag(LL_OP_MODE_FLAG_ENA_SCAN_BACKOFF)) + { + /* Backoff is disabled, always send request. */ + return TRUE; + } + + if (pExtScanCtx->data.scan.backoffCount) + { + pExtScanCtx->data.scan.backoffCount--; + } + + if (pExtScanCtx->data.scan.backoffCount == 0) + { + /* No backoff; send request. */ + return TRUE; + } + + /* Apply backoff. */ + return FALSE; +} + +/************************************************************************************************** + Functions: Discovery packet handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Extended scan discover state advertising packet receive (primary channel) + * completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if scan request transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + lctrAdvbPduHdr_t advHdr; + bool_t txScanReq = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + + /* Store Advertising Event state. */ + lctrMstExtScanIsr.advPduType = advHdr.pduType; + + /*** Transmit response PDU processing. ***/ + + + switch (advHdr.pduType) + { + case LL_PDU_ADV_EXT_IND: + /* FIXME Check if secondary PHY is supported. */ + break; + default: + /* Legacy advertising. */ + txScanReq = lctrMstDiscoverRxLegacyAdvPktHandler(pOp, pAdvBuf); + break; + } + + return txScanReq; +} + +/*************************************************************************************************/ +/*! + * \brief Extended scan discover state advertising packet receive (primary channel) + * post process handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstDiscoverRxExtAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t * pBle; + BbBleMstAdvEvent_t * pScan; + lctrExtScanCtx_t * pExtScanCtx; + lctrAdvbPduHdr_t advHdr; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + pExtScanCtx = pOp->pCtx; + + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + + /*** Received advertising PDU post-processing. ***/ + + lctrMstExtScanIsr.filtResult = FALSE; + + switch (advHdr.pduType) + { + /* Extended advertising. */ + case LL_PDU_ADV_EXT_IND: + { + uint8_t const *pExtAdvHdr; + uint8_t extAdvHdrFlags; + bool_t advAMatch = FALSE; + + pExtScanCtx->extAdvHdr.extHdrFlags = 0; + + /*** Extended advertising event filtering. ***/ + pExtAdvHdr = pAdvBuf + LL_ADV_HDR_LEN; + lctrUnpackExtAdvHeader(&pExtScanCtx->extAdvHdr, &extAdvHdrFlags, pExtAdvHdr); + + if (pExtScanCtx->extAdvHdr.advMode == 0) /* Non-connectable and non-scannable. */ + { + if ((extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) == 0) + { + bbBlePduExtFiltParams_t params; + + if ((extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) == 0) + { + LL_TRACE_WARN0("Ignoring LL_PDU_ADV_EXT_IND due to missing mandatory advA when there is no auxiliary packet."); + lctrMstExtScanIsr.filtResult = TRUE; + break; + } + + /* AdvA and/or TargetA are received, go through the filter now. */ + params.pduType = advHdr.pduType; + params.extHdrFlags = pExtScanCtx->extAdvHdr.extHdrFlags; + params.peerAddr = pExtScanCtx->extAdvHdr.advAddr; + params.peerAddrRand = advHdr.txAddrRnd; + params.localAddr = pExtScanCtx->extAdvHdr.tgtAddr; + params.localAddrRand = advHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pScan->filtResults) == FALSE) + { + LL_TRACE_WARN0("Ignoring LL_PDU_ADV_EXT_IND due to PDU filtering."); + lctrMstExtScanIsr.filtResult = TRUE; + break; + } + } + else + { + /* Delay Non-connectable and non-scannable with auxiliary packet PDU filtering in the AUX_ADV_IND.*/ + lctrMstExtScanIsr.advAReceived = FALSE; + lctrMstExtScanIsr.tgtAReceived = FALSE; + lctrMstExtScanIsr.advA = 0; + lctrMstExtScanIsr.tgtA = 0; + lctrMstExtScanIsr.advARand = 0; + lctrMstExtScanIsr.tgtARand = 0; + + /* Retrieve advA and tgtA if present. */ + if (extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) + { + lctrMstExtScanIsr.advAReceived = TRUE; + lctrMstExtScanIsr.advA = pExtScanCtx->extAdvHdr.advAddr; + lctrMstExtScanIsr.advARand = advHdr.txAddrRnd; + } + if (extAdvHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) + { + lctrMstExtScanIsr.tgtAReceived = TRUE; + lctrMstExtScanIsr.tgtA = pExtScanCtx->extAdvHdr.tgtAddr; + lctrMstExtScanIsr.tgtARand = advHdr.rxAddrRnd; + } + } + } + /* else case, delay connectable and scannable PDU filtering in the AUX_ADV_IND. */ + + /*** Periodic advertising event filtering. ***/ + lctrMstPerScanIsr.filtResult = TRUE; + + if ((lctrPerCreateSync.state == LCTR_CREATE_SYNC_STATE_DISCOVER) && + (extAdvHdrFlags & LL_EXT_HDR_ADI_BIT) && + (extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)) + { + if (lctrPerCreateSync.filtParam.filterPolicy == LL_PER_SCAN_FILTER_PL_BIT) + { + if ((BbBlePeriodicListCheckAddr(advHdr.txAddrRnd, pExtScanCtx->extAdvHdr.advAddr, + pExtScanCtx->extAdvHdr.sid)) == FALSE) + { + /* Not in the periodic list. */ + break; + } + else + { + lctrMstPerScanIsr.filtResult = FALSE; + advAMatch = TRUE; + } + } + else + { + if ((lctrPerCreateSync.filtParam.advSID != pExtScanCtx->extAdvHdr.sid) || + (lctrPerCreateSync.filtParam.advAddrType != advHdr.txAddrRnd) || + (lctrPerCreateSync.filtParam.advAddr != pExtScanCtx->extAdvHdr.advAddr)) + { + /* Address type, address or SID does not match. */ + break; + } + else + { + lctrMstPerScanIsr.filtResult = FALSE; + advAMatch = TRUE; + } + } + } + + if (advAMatch == TRUE) + { + /* AdvA is received in the adv_ext_ind and pass the filtering, save info in the context. */ + lctrPerCreateSync.pPerScanCtx->advAddr = pExtScanCtx->extAdvHdr.advAddr; + lctrPerCreateSync.pPerScanCtx->advAddrType = advHdr.txAddrRnd; + lctrPerCreateSync.pPerScanCtx->advSID = pExtScanCtx->extAdvHdr.sid; + } + + if (extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) + { + uint32_t endTs; + pOp->minDurUsec = 0; /* Update primary scan BOD min duration so that secondary scan can be scheduled. */ + + lctrUnpackAuxPtr(&pExtScanCtx->priChAuxPtr, pExtScanCtx->extAdvHdr.pAuxPtr); + endTs = pScan->advStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pScan->advRxPhyOptions, LL_ADV_HDR_LEN + pScan->filtResults.pduLen)); + lctrMstAuxDiscoverOpCommit(pExtScanCtx, &pExtScanCtx->priChAuxPtr, pScan->advStartTs, endTs); + + if (pExtScanCtx->auxOpPending) + { + /* Extended advertising event continues with auxiliary BOD */ + BbSetBodTerminateFlag(); + } + + /* Auxiliary PDU expected; defer report. */ + } + else + { + /* No auxiliary PDU; send report now. */ + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + LlExtAdvReportInd_t *pRpt; + + BbBlePduFiltResultsGetPeerIdAddr(&pScan->filtResults, &peerIdAddr, &peerIdAddrType); + + pRpt = &pExtScanCtx->data.scan.advRpt; + if (lctrExtAdvRptPack(pExtScanCtx, 0, &advHdr, + peerIdAddr, peerIdAddrType, pScan->advRssi, pAdvBuf, + pRpt)) + { + pRpt->secPhy = LL_PHY_NONE; + if (lctrExtAdvRptPend(pExtScanCtx)) + { + lctrExtAdvRptSubmit(pExtScanCtx); + } + } + } + break; + } + + /* Legacy advertising. */ + default: + { + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + LlExtAdvReportInd_t *pRpt; + + BbBlePduFiltResultsGetPeerIdAddr(&pScan->filtResults, &peerIdAddr, &peerIdAddrType); + + pRpt = &pExtScanCtx->data.scan.advRpt; + if (lctrExtAdvRptPack(pExtScanCtx, 0, &advHdr, + peerIdAddr,peerIdAddrType, pScan->advRssi, pAdvBuf, + pRpt)) + { + pRpt->secPhy = LL_PHY_NONE; + if (lctrExtAdvRptPend(pExtScanCtx)) + { + lctrExtAdvRptSubmit(pExtScanCtx); + } + } + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Auxiliary scan discover state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if scan request transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxAuxAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAuxAdvEvent_t *pAuxScan; + lctrExtScanCtx_t * pExtScanCtx; + const uint8_t *pExtAdvHdr; + bool_t txScanReq = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_AUX_ADV_EVENT); + + pBle = pOp->prot.pBle; + pAuxScan = &pBle->op.mstAuxAdv; + pExtScanCtx = pOp->pCtx; + + pExtAdvHdr = pAdvBuf + lctrUnpackAdvbPduHdr(&lctrMstExtScanIsr.advHdr, pAdvBuf); + lctrMstExtScanIsr.extAdvHdrLen = lctrUnpackExtAdvHeader(&pExtScanCtx->extAdvHdr, &lctrMstExtScanIsr.extAdvHdrFlags, pExtAdvHdr); + lctrMstExtScanIsr.isHdrParsed = TRUE; + + /*** Extended advertising event filtering. ***/ + + switch (lctrMstExtScanIsr.advHdr.pduType) + { + case LL_PDU_AUX_ADV_IND: + { + bbBlePduExtFiltParams_t params; + bool_t advAMatch = FALSE; + if (pExtScanCtx->extAdvHdr.advMode == 0) /* Non-connectable and non-scannable. */ + { + /* Retrieve advA and tgtA if not present in the ADV_EXT_IND and present here. */ + if ((lctrMstExtScanIsr.advAReceived == FALSE) && + (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)) + { + lctrMstExtScanIsr.advAReceived = TRUE; + lctrMstExtScanIsr.advA = pExtScanCtx->extAdvHdr.advAddr; + lctrMstExtScanIsr.advARand = lctrMstExtScanIsr.advHdr.txAddrRnd; + } + + if ((lctrMstExtScanIsr.tgtAReceived == FALSE) && + (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT)) + { + lctrMstExtScanIsr.tgtAReceived = TRUE; + lctrMstExtScanIsr.tgtA = pExtScanCtx->extAdvHdr.tgtAddr; + lctrMstExtScanIsr.tgtARand = lctrMstExtScanIsr.advHdr.rxAddrRnd; + } + + /* Update extended flags, address types and addresses. */ + if (lctrMstExtScanIsr.advAReceived == TRUE) + { + pExtScanCtx->extAdvHdr.extHdrFlags |= LL_EXT_HDR_ADV_ADDR_BIT; + + } + pExtScanCtx->extAdvHdr.advAddr = lctrMstExtScanIsr.advA; + lctrMstExtScanIsr.advHdr.txAddrRnd = lctrMstExtScanIsr.advARand; + + if (lctrMstExtScanIsr.tgtAReceived == TRUE) + { + pExtScanCtx->extAdvHdr.extHdrFlags |= LL_EXT_HDR_TGT_ADDR_BIT; + } + pExtScanCtx->extAdvHdr.tgtAddr = lctrMstExtScanIsr.tgtA; + lctrMstExtScanIsr.advHdr.rxAddrRnd = lctrMstExtScanIsr.tgtARand; + } + else /* Connectable or scannable. */ + { + /* AdvA is mandatory. */ + if ((lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) == 0) + { + LL_TRACE_WARN0("Ignoring LL_PDU_AUX_ADV_IND due to missing mandatory advA."); + lctrMstExtScanIsr.filtResult = TRUE; + break; + } + } + + /* Go through the extended PDU filter. */ + params.pduType = lctrMstExtScanIsr.advHdr.pduType; + params.extHdrFlags = pExtScanCtx->extAdvHdr.extHdrFlags; + params.peerAddr = pExtScanCtx->extAdvHdr.advAddr; + params.peerAddrRand = lctrMstExtScanIsr.advHdr.txAddrRnd; + params.localAddr = pExtScanCtx->extAdvHdr.tgtAddr; + params.localAddrRand = lctrMstExtScanIsr.advHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxScan->filtResults) == FALSE) + { + LL_TRACE_INFO1("Ignoring LL_PDU_AUX_ADV_IND due to PDU filtering, SID=%u", pExtScanCtx->extAdvHdr.sid); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + /*** Periodic advertising event filtering. ***/ + + if ((lctrPerCreateSync.state == LCTR_CREATE_SYNC_STATE_DISCOVER) && + (lctrMstPerScanIsr.filtResult == TRUE) && + (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_ADI_BIT) && + (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)) + { + if (lctrPerCreateSync.filtParam.filterPolicy == LL_PER_SCAN_FILTER_PL_BIT) + { + if ((BbBlePeriodicListCheckAddr(lctrMstExtScanIsr.advHdr.txAddrRnd, pExtScanCtx->extAdvHdr.advAddr, + pExtScanCtx->extAdvHdr.sid)) == FALSE) + { + /* Not in the periodic list. */ + break; + } + else + { + lctrMstPerScanIsr.filtResult = FALSE; + advAMatch = TRUE; + } + } + else + { + if ((lctrPerCreateSync.filtParam.advSID != pExtScanCtx->extAdvHdr.sid) || + (lctrPerCreateSync.filtParam.advAddrType != lctrMstExtScanIsr.advHdr.txAddrRnd) || + (lctrPerCreateSync.filtParam.advAddr != pExtScanCtx->extAdvHdr.advAddr)) + { + /* Address type, address or SID does not match. */ + break; + } + else + { + lctrMstPerScanIsr.filtResult = FALSE; + advAMatch = TRUE; + } + } + } + + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) + { + lctrUnpackSyncInfo(&pExtScanCtx->secSyncInfo, pExtScanCtx->extAdvHdr.pSyncInfo); + } + + if ((lctrPerCreateSync.state == LCTR_CREATE_SYNC_STATE_DISCOVER) && + (lctrMstPerScanIsr.filtResult == FALSE) && + (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) && + lctrPerCreateSync.createSyncPending == FALSE) + { + uint32_t endTs; + lctrPerScanCtx_t *pPerScanCtx = lctrPerCreateSync.pPerScanCtx; + /*** Save peer periodic advertising parameters. ***/ + pPerScanCtx->eventCounter = pExtScanCtx->secSyncInfo.eventCounter; + pPerScanCtx->perInter = BB_US_TO_BB_TICKS(LCTR_PER_INTER_TO_US(pExtScanCtx->secSyncInfo.syncInter)); + pPerScanCtx->sca = pExtScanCtx->secSyncInfo.sca; + pPerScanCtx->rxPhys = lctrConvertAuxPtrPhyToBbPhy(pExtScanCtx->priChAuxPtr.auxPhy); + pPerScanCtx->skipInter = pPerScanCtx->perInter * pPerScanCtx->skip; + + if (advAMatch == TRUE) + { + /* AdvA is received in the aux_adv_ind and pass the filtering, save info in the context. */ + pPerScanCtx->advAddr = pExtScanCtx->extAdvHdr.advAddr; + pPerScanCtx->advAddrType = lctrMstExtScanIsr.advHdr.txAddrRnd; + pPerScanCtx->advSID = pExtScanCtx->extAdvHdr.sid; + } + + endTs = pAuxScan->auxStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pAuxScan->auxRxPhyOptions, LL_ADV_HDR_LEN + pAuxScan->txAuxReqLen)); + lctrMstPerScanOpCommit(pExtScanCtx, &pExtScanCtx->priChAuxPtr, &pExtScanCtx->secSyncInfo, pAuxScan->auxStartTs, endTs); + lctrMstPerScanIsr.syncWithSlave = FALSE; + } + break; + } + + default: + LL_TRACE_WARN1("Received advertising PDU with invalid PDU type=%u", lctrMstExtScanIsr.advHdr.pduType); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pExtScanCtx->extAdvHdr.pAcad; + + /*** Transmit request PDU processing. ***/ + + if (pExtScanCtx->extAdvHdr.advMode & LCTR_ADV_MODE_SCAN_BIT) + { + if (pAuxScan->pTxAuxReqBuf) /* Active scanner. */ + { + if (!pAuxScan->filtResults.peerMatch) + { + /* Require peer match. */ + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + if ((pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) == 0) + { + LL_TRACE_WARN0("Ignoring extended advertising event with anonymous advertiser"); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + /* Check backoff in effect. */ + if ((txScanReq = lctrScanBackoffCheckReqAllowed(pExtScanCtx)) == TRUE) + { + /* Update scan request header with advertiser's address. */ + uint8_t *pScanReqScanA; + uint8_t *pScanReqAdvA = pExtScanCtx->reqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pScanReqAdvA, pAuxScan->filtResults.peerAddr); + pExtScanCtx->reqPduHdr.rxAddrRnd = pAuxScan->filtResults.peerAddrRand; + + /* Save adv address here and compare it with the one from aux_scan_rsp later. */ + pExtScanCtx->data.scan.scanReqAdvAddr = pAuxScan->filtResults.peerAddr; + + /* TODO need to check if targetA is present, check whether we need to generate a new RPA. */ + + /* Update scan request header with scanner's address. */ + if (pExtScanCtx->scanParam.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + bool_t localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + uint64_t localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pAuxScan->filtResults.peerIdAddrRand, pAuxScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + } + pScanReqScanA = pExtScanCtx->reqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pScanReqScanA, localAddr); + pExtScanCtx->reqPduHdr.txAddrRnd = localAddrRand; + } + + lctrPackAdvbPduHdr(pExtScanCtx->reqBuf, &pExtScanCtx->reqPduHdr); + } + } + } + + /*** Advertising Data processing. ***/ + + /* Report handled by lctrMstDiscoverRxAuxChainHandler() */ + lctrMstExtScanIsr.chainAdvMode = pExtScanCtx->extAdvHdr.advMode; + lctrMstExtScanIsr.chainExtraEventType = 0; + + return txScanReq; +} + +/*************************************************************************************************/ +/*! + * \brief Master auxiliary scan response receive completion handler. + * + * \param pOp Originating operation. + * \param pRspBuf Received response buffer, NULL if receive failed. + * + * \return Always return FALSE (ignored by BB). + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxAuxScanRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf) +{ + lctrExtScanCtx_t *pExtScanCtx; + BbBleMstAuxAdvEvent_t *pAuxScan; + const uint8_t *pExtAdvHdr; + bbBlePduExtFiltParams_t params; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_AUX_ADV_EVENT); + + pExtScanCtx = pOp->pCtx; + pAuxScan = &pOp->prot.pBle->op.mstAuxAdv; + + /*** Scan backoff maintenance ***/ + + if (pRspBuf == NULL) + { + lctrScanBackoffRspFailed(pExtScanCtx); + return FALSE; + } + lctrScanBackoffRspSuccess(pExtScanCtx); + + pExtAdvHdr = pRspBuf + lctrUnpackAdvbPduHdr(&lctrMstExtScanIsr.advHdr, pRspBuf); + lctrMstExtScanIsr.extAdvHdrLen = lctrUnpackExtAdvHeader(&pExtScanCtx->extAdvHdr, &lctrMstExtScanIsr.extAdvHdrFlags, pExtAdvHdr); + lctrMstExtScanIsr.isHdrParsed = TRUE; + + /*** Extended advertising event filtering. ***/ + + params.pduType = lctrMstExtScanIsr.advHdr.pduType; + params.extHdrFlags = pExtScanCtx->extAdvHdr.extHdrFlags; + params.peerAddr = pExtScanCtx->extAdvHdr.advAddr; + params.peerAddrRand = lctrMstExtScanIsr.advHdr.txAddrRnd; + params.localAddr = pExtScanCtx->extAdvHdr.tgtAddr; + params.localAddrRand = lctrMstExtScanIsr.advHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxScan->filtResults) == FALSE) + { + LL_TRACE_WARN0("LL_PDU_AUX_SCAN_RSP failed PDU filtering."); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + if ((pExtScanCtx->extAdvHdr.advMode & (LCTR_ADV_MODE_SCAN_BIT | LCTR_ADV_MODE_CONN_BIT)) != 0) + { + LL_TRACE_WARN1("Received auxiliary PDU with invalid advMode=0x%02x", pExtScanCtx->extAdvHdr.advMode); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + /* scanReqAdvAddr is assigned when LL_PDU_ADV_SCAN_IND is received. */ + if (pExtScanCtx->data.scan.scanReqAdvAddr != pAuxScan->filtResults.peerAddr) + { + LL_TRACE_WARN0("Ignore aux_scan_rsp since advAddr doesn't match the one sent in the aux_scan_req."); + lctrMstExtScanIsr.filtResult = TRUE; + return FALSE; + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pExtScanCtx->extAdvHdr.pAcad; + + /*** Scan Response Data processing. ***/ + + /* Report handled by lctrMstDiscoverRxAuxChainHandler() */ + lctrMstExtScanIsr.chainExtraEventType = LL_RPT_EVT_SCAN_RSP_BIT; + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Master auxiliary chain indication receive completion handler. + * + * \param pOp Originating operation. + * \param pChainBuf Received chain buffer, NULL if receive failed. + * + * \return Next auxiliary offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrMstDiscoverRxAuxChainHandler(BbOpDesc_t *pOp, const uint8_t *pChainBuf) +{ + BbBleData_t *pBle; + lctrExtScanCtx_t *pExtScanCtx; + const uint8_t *pExtAdvHdr; + uint32_t auxOffsetUsec = 0; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_AUX_ADV_EVENT); + + if (lctrMstExtScanIsr.filtResult) + { + /* No further processing for filtered PDUs. */ + return 0; + } + + if (pChainBuf == NULL) + { + /* The report will be submitted in the lctrMstDiscoverRxAuxChainPostProcessHandler */ + return 0; + } + + pBle = pOp->prot.pBle; + pExtScanCtx = pOp->pCtx; + + WSF_ASSERT(pExtScanCtx->state != LCTR_EXT_SCAN_STATE_DISABLED); + + if (lctrMstExtScanIsr.isHdrParsed == TRUE) + { + pExtAdvHdr = pChainBuf + LL_ADV_HDR_LEN; + lctrMstExtScanIsr.pAdvData = pExtAdvHdr + lctrMstExtScanIsr.extAdvHdrLen; + lctrMstExtScanIsr.advDataLen = lctrMstExtScanIsr.advHdr.len - LCTR_EXT_HDR_CMN_LEN - pExtScanCtx->extAdvHdr.extHdrLen; + lctrMstExtScanIsr.isHdrParsed = FALSE; + } + else + { + pExtAdvHdr = pChainBuf + lctrUnpackAdvbPduHdr(&lctrMstExtScanIsr.advHdr, pChainBuf); + lctrMstExtScanIsr.pAdvData = pExtAdvHdr + lctrUnpackExtAdvHeader(&pExtScanCtx->extAdvHdr, &lctrMstExtScanIsr.extAdvHdrFlags, pExtAdvHdr); + lctrMstExtScanIsr.advDataLen = lctrMstExtScanIsr.advHdr.len - LCTR_EXT_HDR_CMN_LEN - pExtScanCtx->extAdvHdr.extHdrLen; + } + + /*** Extended advertising event filtering. ***/ + + switch (lctrMstExtScanIsr.advHdr.pduType) + { + case LL_PDU_AUX_CHAIN_IND: + /* case LL_PDU_AUX_ADV_IND: */ /* Same enum value as LL_PDU_AUX_CHAIN_IND. */ + /* case LL_PDU_AUX_SCAN_RSP: */ /* Same enum value as LL_PDU_AUX_CHAIN_IND. */ + break; + default: + LL_TRACE_WARN1("Received advertising PDU with invalid PDU type=%u", lctrMstExtScanIsr.advHdr.pduType); + return 0; + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pExtScanCtx->extAdvHdr.pAcad; + + /*** Advertising Data processing. ***/ + + if (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) + { + lctrAuxPtr_t auxPtr; + lctrUnpackAuxPtr(&auxPtr, pExtScanCtx->extAdvHdr.pAuxPtr); + + pBle->chan.chanIdx = auxPtr.auxChIdx; + + lctrMstComputeAuxOffset(&auxPtr, &auxOffsetUsec, &pBle->op.mstAuxAdv.rxSyncDelayUsec); + } + + return auxOffsetUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Master auxiliary chain indication receive completion post process handler. + * + * \param pOp Originating operation. + * \param pChainBuf Received chain buffer, NULL if receive failed. + * + * \return True if rx operation shall continue, False if rx operation shall terminate. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxAuxChainPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pChainBuf) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstAuxAdvEvent_t * const pAuxScan = &pBle->op.mstAuxAdv; + lctrExtScanCtx_t * const pExtScanCtx = pOp->pCtx; + bool_t result = TRUE; + + /*** Report generation. ***/ + if (lctrMstExtScanIsr.filtResult) + { + /* No further processing for filtered PDUs. */ + return FALSE; + } + + if (pChainBuf == NULL) + { + WSF_ASSERT(pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_IN_PROGRESS); + pExtScanCtx->data.scan.advRpt.eventType |= LL_RPT_DATA_INC_TRUNC << LCTR_DATA_STATUS_SHIFT; + lctrExtAdvRptSubmit(pExtScanCtx); + return FALSE; + } + + if (pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_COMP) + { + /* Do not finish receiving chain. */ + LL_TRACE_WARN1("Cannot generate report due to pending report; do not receive CHAIN_IND, SID=%u", pExtScanCtx->extAdvHdr.sid); + return FALSE; + } + + do + { + if (pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_IDLE) + { + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + LlExtAdvReportInd_t *pRpt; + + /* First PDU in Auxiliary Advertising Event. */ + + /* Restore AdvMode from original advertising event. */ + pExtScanCtx->extAdvHdr.advMode = lctrMstExtScanIsr.chainAdvMode; + + BbBlePduFiltResultsGetPeerIdAddr(&pAuxScan->filtResults, &peerIdAddr, &peerIdAddrType); + + pRpt = &pExtScanCtx->data.scan.advRpt; + if (!lctrExtAdvRptPack(pExtScanCtx, lctrMstExtScanIsr.chainExtraEventType, &lctrMstExtScanIsr.advHdr, + peerIdAddr, peerIdAddrType , pAuxScan->auxAdvRssi, NULL, + pRpt)) + { + /* Do not start receiving chain. */ + LL_TRACE_WARN1("Invalid report parameters; do not receive CHAIN_IND, SID=%u", pExtScanCtx->extAdvHdr.sid); + result = FALSE; + break; + } + + if (!lctrExtAdvRptPend(pExtScanCtx)) + { + /* Do not start receiving chain. */ + LL_TRACE_WARN1("Filter report; do not receive CHAIN_IND, SID=%u", pExtScanCtx->extAdvHdr.sid); + result = FALSE; + break; + } + } + + if (!lctrExtAdvDataReassemble(pExtScanCtx, lctrMstExtScanIsr.pAdvData, lctrMstExtScanIsr.advDataLen, pAuxScan->auxAdvRssi)) + { + /* Do not finish receiving chain. */ + LL_TRACE_WARN1("Insufficient scan buffer size; do not receive CHAIN_IND, SID=%u", pExtScanCtx->extAdvHdr.sid); + pExtScanCtx->data.scan.advRpt.eventType |= LL_RPT_DATA_INC_TRUNC << LCTR_DATA_STATUS_SHIFT; + result = FALSE; + break; + } + + } while (FALSE); + + if ((result == FALSE) || /* Invalid packet, duplicate found or insufficient buffer. */ + ((lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) == 0)) /* No more auxiliary packet. */ + { + /* End of auxiliary sequence. */ + lctrExtAdvRptSubmit(pExtScanCtx); + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Legacy discover state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if scan request transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxLegacyAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + lctrExtScanCtx_t *pExtScanCtx; + bool_t txScanReq = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + pExtScanCtx = pOp->pCtx; + + /*** Transmit response PDU processing. ***/ + + + if (pScan->pTxReqBuf) + { + switch (pScan->filtResults.pduType) + { + case LL_PDU_ADV_IND: + case LL_PDU_ADV_SCAN_IND: + { + uint8_t *pScanReqAdvA; + + if (!pScan->filtResults.peerMatch) + { + /* Require peer match. */ + return txScanReq; + } + + /* Update scan request header with advertiser's address. */ + pScanReqAdvA = pExtScanCtx->reqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pScanReqAdvA, pScan->filtResults.peerAddr); + pExtScanCtx->reqPduHdr.rxAddrRnd = pScan->filtResults.peerAddrRand; + + /* Save AdvA in the SCAN_REQ here and compare it with the one from SCAN_RSP later. */ + pExtScanCtx->data.scan.scanReqAdvAddr = pScan->filtResults.peerAddr; + + /* Update scan request header with scanner's address. */ + if (pExtScanCtx->scanParam.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint8_t *pScanReqScanA; + bool_t localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + uint64_t localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + } + pScanReqScanA = pExtScanCtx->reqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pScanReqScanA, localAddr); + pExtScanCtx->reqPduHdr.txAddrRnd = localAddrRand; + } + + lctrPackAdvbPduHdr(pExtScanCtx->reqBuf, &pExtScanCtx->reqPduHdr); + + /* Check whether backoff is in effect. */ + txScanReq = lctrScanBackoffCheckReqAllowed(pExtScanCtx); + break; + } + + default: + break; + } + } + + return txScanReq; +} + +/*************************************************************************************************/ +/*! + * \brief Scan request Tx completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Transmitted request buffer. + * + * \return TRUE to signal receive scan response. + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverTxLegacyScanReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + /* Take same action as legacy scanning. */ + return lctrMstScanReqTxCompHandler(pOp, pReqBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Master legacy scan response receive completion handler. + * + * \param pOp Originating operation. + * \param pRspBuf Received response buffer, NULL if receive failed. + * + * \return Always return FALSE (ignored by BB). + */ +/*************************************************************************************************/ +bool_t lctrMstDiscoverRxLegacyScanRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + lctrExtScanCtx_t *pExtScanCtx; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + pExtScanCtx = pOp->pCtx; + + if (pRspBuf) + { + lctrAdvbPduHdr_t advHdr; + lctrUnpackAdvbPduHdr(&advHdr, pRspBuf); + + /*** Received advertising PDU post-processing. ***/ + + switch (pScan->filtResults.pduType) + { + /* Valid PDU types. */ + case LL_PDU_SCAN_RSP: + { + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + LlExtAdvReportInd_t *pRpt; + + /* scanReqAdvAddr is assigned when LL_PDU_ADV_SCAN_IND is received. */ + if (pExtScanCtx->data.scan.scanReqAdvAddr != pScan->filtResults.peerAddr) + { + LL_TRACE_WARN0("Ignore scan_rsp since advAddr doesn't match the one sent in the scan_req."); + break; + } + + BbBlePduFiltResultsGetPeerIdAddr(&pScan->filtResults, &peerIdAddr, &peerIdAddrType); + + pRpt = &pExtScanCtx->data.scan.advRpt; + if (lctrExtAdvRptPack(pExtScanCtx, 0, &advHdr, + peerIdAddr, peerIdAddrType, pScan->advRssi, pRspBuf, + pRpt)) + { + pRpt->secPhy = LL_PHY_NONE; + if (lctrExtAdvRptPend(pExtScanCtx)) + { + lctrExtAdvRptSubmit(pExtScanCtx); + } + } + break; + } + default: + break; + } + + /*** Scan backoff maintenance ***/ + + lctrScanBackoffRspSuccess(pExtScanCtx); + } + else + { + lctrScanBackoffRspFailed(pExtScanCtx); + } + + return FALSE; +} + +/************************************************************************************************** + Functions: Discovery BOD handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Reschedule primary scan operation. + * + * \param pExtScanCtx Extended scan context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtDiscoverReschedule(lctrExtScanCtx_t *pExtScanCtx) +{ + BbOpDesc_t *pOp = &pExtScanCtx->scanBod; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + /*** Reschedule primary operation ***/ + + /* Reset due time to start of scan window. */ + pOp->due = pExtScanCtx->scanWinStart; + + if ((pScan->elapsedUsec + pOp->minDurUsec) < LCTR_BLE_TO_US(pExtScanCtx->scanParam.scanWindow)) + { + const uint32_t min = BB_US_TO_BB_TICKS(pScan->elapsedUsec); + const uint32_t max = BB_BLE_TO_BB_TICKS(pExtScanCtx->scanParam.scanWindow); + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + /* Continue interrupted operation. */ + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pExtScanCtx->scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + return; + } + } + + /* Advance to next scanInterval. */ + + pScan->elapsedUsec = 0; + + /* Compute next channel. */ + pBle->chan.chanIdx = lctrScanChanSelectNext(pBle->chan.chanIdx, pScan->scanChMap); + + if (pExtScanCtx->scanParam.scanInterval == pExtScanCtx->scanParam.scanWindow) + { + /* Continuous scan. */ + SchInsertNextAvailable(pOp); + pExtScanCtx->scanWinStart = pOp->due; + } + else + { + /* Next scan interval. */ + const uint32_t min = BB_BLE_TO_BB_TICKS(pExtScanCtx->scanParam.scanInterval); + const uint32_t max = min + BB_BLE_TO_BB_TICKS(pExtScanCtx->scanParam.scanWindow); + + while (TRUE) + { + /* Store start of next scan window. */ + pExtScanCtx->scanWinStart = pOp->due + min; + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pExtScanCtx->scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + break; + } + else + { + /* Advance to next scan window. */ + pOp->due = pExtScanCtx->scanWinStart; + + LL_TRACE_WARN1("!!! Scan schedule conflict at due=%u", pOp->due + min); + LL_TRACE_WARN1("!!! scanWindowUsec=%u", LCTR_BLE_TO_US(pExtScanCtx->scanParam.scanWindow)); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief End a discovery scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtDiscoverEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtScanCtx = pOp->pCtx; + + if (pExtScanCtx->shutdown || pExtScanCtx->selfTerm) + { + pExtScanCtx->bodTermCnt++; + if (( pExtScanCtx->auxOpPending && (pExtScanCtx->bodTermCnt >= 2)) || /* Wait for both ExtScan and AuxScan operations. */ + (!pExtScanCtx->auxOpPending && (pExtScanCtx->bodTermCnt >= 1))) /* Wait only for ExtScan operation. */ + { + lctrSendExtScanMsg(pExtScanCtx, LCTR_EXT_SCAN_MSG_TERMINATE); + } + return; + } + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + /*** Reschedule operation ***/ + + if (!pExtScanCtx->auxOpPending) + { + lctrMstExtDiscoverReschedule(pExtScanCtx); + } + /* else postpone until lctrMstAuxDiscoverEndOp(). */ +} + +/*************************************************************************************************/ +/*! + * \brief End an auxiliary discovery scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstAuxDiscoverEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtScanCtx = pOp->pCtx; + + if (pExtScanCtx->shutdown || pExtScanCtx->selfTerm) + { + lctrSendExtScanMsg(pExtScanCtx, LCTR_EXT_SCAN_MSG_TERMINATE); + return; + } + + pExtScanCtx->auxOpPending = FALSE; + + /* Reschedule primary channel scan operation. */ + lctrMstExtDiscoverReschedule(pExtScanCtx); +} + +/************************************************************************************************** + Functions: Periodic packet handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief End an periodic scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstPerScanEndOp(BbOpDesc_t *pOp) +{ + uint16_t skip, numUnsyncIntervals; + lctrPerScanCtx_t * const pPerScanCtx = pOp->pCtx; + BbBleData_t * const pBle = &pPerScanCtx->bleData; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_PER_SCAN_EVENT); + + if (pPerScanCtx->cancelCreateSync) + { + lctrSendCreateSyncMsg(LCTR_CREATE_SYNC_MSG_TERMINATE); + return; + } + + if (pPerScanCtx->shutdown) + { + pPerScanCtx->shutdown = FALSE; + /* Last BOD to terminate; send terminate event. */ + lctrSendPerScanMsg(pPerScanCtx, LCTR_PER_SCAN_MSG_TERMINATE_DONE); + WsfTimerStop(&pPerScanCtx->tmrSupTimeout); + return; + } + + /*** Reschedule operation ***/ + if (lctrMstPerScanIsr.syncWithSlave) + { + /* Re-sync with advertiser */ + pPerScanCtx->lastAnchorPoint = lctrMstPerScanIsr.firstRxStartTs; + lctrMstPerScanIsr.syncWithSlave = FALSE; + pPerScanCtx->lastActiveEvent = pPerScanCtx->eventCounter; + + if (pPerScanCtx->skipInter && + pPerScanCtx->skipInter < BB_US_TO_BB_TICKS(pPerScanCtx->syncTimeOutMs * 1000)) + { + /* Skip is set and shorter than the sync timeout. */ + skip = pPerScanCtx->skip; + } + else + { + skip = 1; + } + } + else + { + /* Not able to re-sync with advertiser, stop skip. */ + skip = 1; + } + + numUnsyncIntervals = pPerScanCtx->eventCounter - pPerScanCtx->lastActiveEvent; + + while (TRUE) + { + uint32_t unsyncTimeUsec, caPpm, wwTotalUsec, wwTotal, connInterUsec, connInter; + int16_t dueOffsetUsec; + + pPerScanCtx->eventCounter += skip; + numUnsyncIntervals += skip; + + unsyncTimeUsec = BB_TICKS_TO_US(pPerScanCtx->perInter * numUnsyncIntervals); + caPpm = lctrCalcTotalAccuracy(pPerScanCtx->sca); + wwTotalUsec = lctrCalcAuxAdvWindowWideningUsec(unsyncTimeUsec, caPpm); + wwTotal = BB_US_TO_BB_TICKS(wwTotalUsec); + connInterUsec = BB_TICKS_TO_US(numUnsyncIntervals * pPerScanCtx->perInter); + connInter = BB_US_TO_BB_TICKS(connInterUsec); + dueOffsetUsec = (connInterUsec - wwTotalUsec) - BB_TICKS_TO_US(connInter - wwTotal); + + /* Advance to next interval. */ + pOp->due = pPerScanCtx->lastAnchorPoint + connInter - wwTotal; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + pOp->minDurUsec = pPerScanCtx->minDurUsec + wwTotalUsec; + pBle->op.mstPerScan.rxSyncDelayUsec = pPerScanCtx->rxSyncDelayUsec + (wwTotalUsec << 1); + + pBle->chan.chanIdx = lctrPeriodicSelectNextChannel(&pPerScanCtx->chanParam, pPerScanCtx->eventCounter); + + if (SchInsertAtDueTime(pOp, NULL)) + { + break; + } + LL_TRACE_WARN1("!!! Periodic scanning schedule conflict eventCounter=%u", pPerScanCtx->eventCounter); + } +} + +/*************************************************************************************************/ +/*! + * \brief Master periodic scan Rx periodic adv handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received Periodic ADV packet buffer, NULL if receive failed. + * \param status Reception status. + * + * \return Next auxiliary offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrMstPerScanRxPerAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf, uint8_t status) +{ + BbBleData_t *pBle; + lctrPerScanCtx_t *pPerScanCtx; + uint8_t advHdrLen; + const uint8_t *pExtAdvHdr; + uint32_t auxOffsetUsec = 0; + BbBleMstPerScanEvent_t *pMstPerScan; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_PER_SCAN_EVENT); + + pBle = pOp->prot.pBle; + pPerScanCtx = pOp->pCtx; + + /* RX_TIMEOUT with pAdvBuf NULL. */ + if (pAdvBuf == NULL) + { + /* The report will be submitted in the lctrMstPerScanRxPerAdvPktPostHandler */ + return 0; + } + + advHdrLen = pAdvBuf[1]; + pExtAdvHdr = pAdvBuf + LL_ADV_HDR_LEN; + pMstPerScan = &pBle->op.mstPerScan; + lctrMstExtScanIsr.pAdvData = pExtAdvHdr + lctrUnpackExtAdvHeader(&pPerScanCtx->extAdvHdr, &lctrMstExtScanIsr.extAdvHdrFlags, pExtAdvHdr); + lctrMstExtScanIsr.advDataLen = advHdrLen - 1 - pPerScanCtx->extAdvHdr.extHdrLen; /* 1 byte for the extended header length + advMode. */ + + if (pPerScanCtx->firstPerAdvRcv == FALSE) + { + pPerScanCtx->firstPerAdvRcv = TRUE; + /* Notify create sync state machine with sync done. */ + lctrSendCreateSyncMsg(LCTR_CREATE_SYNC_MSG_DONE); + /* Notify periodic scan state machine with sync established. */ + lctrSendPerScanMsg(pPerScanCtx, LCTR_PER_SCAN_MSG_SYNC_ESTD); + } + + /* Store anchor point. */ + if ((!lctrMstPerScanIsr.syncWithSlave) && + (pMstPerScan->perIsFirstTs == TRUE) && + ((status == BB_STATUS_SUCCESS) || (status == BB_STATUS_CRC_FAILED))) + { + lctrMstPerScanIsr.firstRxStartTs = pMstPerScan->perStartTs; + lctrMstPerScanIsr.syncWithSlave = TRUE; + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pPerScanCtx->extAdvHdr.pAcad; + + /*** Periodic Advertising Data processing. ***/ + if (lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) + { + lctrAuxPtr_t auxPtr; + lctrUnpackAuxPtr(&auxPtr, pPerScanCtx->extAdvHdr.pAuxPtr); + + pBle->chan.chanIdx = auxPtr.auxChIdx; + + lctrMstComputeAuxOffset(&auxPtr, &auxOffsetUsec, &pBle->op.mstPerScan.rxSyncDelayUsec); + } + + return auxOffsetUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Master periodic scan Rx periodic adv post handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Advertising buffer. + * + * \return None + */ +/*************************************************************************************************/ +bool_t lctrMstPerScanRxPerAdvPktPostHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + lctrPerScanCtx_t * const pPerScanCtx = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstPerScanEvent_t * const pMstPerScan = &pBle->op.mstPerScan; + bool_t result = TRUE; + + if (pPerScanCtx->state == LCTR_PER_SCAN_STATE_SYNC_ESTD) + { + WsfTimerStartMs(&pPerScanCtx->tmrSupTimeout, pPerScanCtx->syncTimeOutMs); + } + + /* RX_TIMEOUT with pAdvBuf NULL. */ + if (pAdvBuf == NULL) + { + /* Send truncated event. */ + if (pPerScanCtx->advRptState == LCTR_RPT_STATE_IDLE) + { + if (lctrPerAdvRptPackTruncate(pOp, pAdvBuf, &pPerScanCtx->advRpt)) + { + if (lctrPerAdvRptPend(pPerScanCtx)) + { + lctrPerAdvRptSubmit(pPerScanCtx); + } + } + } + return FALSE; + } + + /*** Report generation. ***/ + + if (pPerScanCtx->advRptState == LCTR_RPT_STATE_COMP) + { + /* Do not finish receiving chain. */ + LL_TRACE_WARN1("Cannot generate periodic report due to pending report; do not receive CHAIN_IND, SID=%u", pPerScanCtx->extAdvHdr.sid); + return FALSE; + } + + do + { + if (pPerScanCtx->advRptState == LCTR_RPT_STATE_IDLE) + { + /* First PDU in Auxiliary Advertising Event. */ + + if (!lctrPerAdvRptPack(pOp, pAdvBuf, lctrMstExtScanIsr.extAdvHdrFlags, &pPerScanCtx->advRpt)) + { + /* Stop receiving chain. */ + LL_TRACE_WARN1("Invalid report parameters; do not receive CHAIN_IND, SID=%u", pPerScanCtx->extAdvHdr.sid); + result = FALSE; + break; + } + + if (!lctrPerAdvRptPend(pPerScanCtx)) + { + /* Stop receiving chain. */ + LL_TRACE_WARN1("Filter report; do not receive CHAIN_IND, SID=%u", pPerScanCtx->extAdvHdr.sid); + result = FALSE; + break; + } + } + + if (!lctrPerAdvDataReassemble(pPerScanCtx, lctrMstExtScanIsr.pAdvData, lctrMstExtScanIsr.advDataLen, pMstPerScan->perAdvRssi)) + { + /* Stop receiving chain. */ + LL_TRACE_WARN1("Insufficient periodic scan buffer size; do not receive CHAIN_IND, SID=%u", pPerScanCtx->extAdvHdr.sid); + pPerScanCtx->advRpt.dataStatus = LL_RPT_DATA_INC_TRUNC; + result = FALSE; + break; + } + } while (FALSE); + + if ((result == FALSE) || /* Invalid packet, duplicate found or insufficient buffer. */ + ((lctrMstExtScanIsr.extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) == 0)) /* No more auxiliary packet. */ + { + /* End of auxiliary sequence. */ + lctrPerAdvRptSubmit(pPerScanCtx); + } + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..554c22bd834515ba3bbe5df9f9922648d9324fca --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave.c @@ -0,0 +1,424 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_api.h" +#include "bb_ble_api.h" +#include "ll_math.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Scan request packet handler. + * + * \param pOp Originating operation. + * \param reqLen Request packet length. + * + * \return TRUE if response transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrScanReqHandler(BbOpDesc_t *pOp, uint8_t reqLen) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + if (pAdv->pTxRspBuf && + (reqLen == LL_SCAN_REQ_PDU_LEN)) + { + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Connection indication packet handler. + * + * \param pOp Originating operation. + * \param reqLen Request packet length. + * \param pReqBuf Received request buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrConnIndHandler(BbOpDesc_t *pOp, uint8_t reqLen, const uint8_t *pReqBuf) +{ + if (lctrMsgDispTbl[LCTR_DISP_CONN] && + (reqLen == LL_CONN_IND_PDU_LEN)) + { + /* Stop advertising. */ + lctrSlvAdv.connIndRcvd = TRUE; + BbSetBodTerminateFlag(); + + /* CONN_IND packet delivered when advertising termination completes. + * cf. lctrAdvActSelfTerm() */ + + /*** Received advertising PDU post-processing. ***/ + + if ((lctrSlvAdv.advBuf[0] & (1 << LCTR_ADV_HDR_CH_SEL_SHIFT)) && /* local advertiser supports CS#2 */ + (pReqBuf[0] & (1 << LCTR_ADV_HDR_CH_SEL_SHIFT))) /* peer initiator supports CS#2 */ + { + lctrSlvAdv.usedChSel = LL_CH_SEL_2; + } + else + { + lctrSlvAdv.usedChSel = LL_CH_SEL_1; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return TRUE if response transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvAdvHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + bool_t sendRsp = FALSE; + + /* Unwanted PDUs must have been filtered in the BB. */ + uint8_t pduLen = pAdv->filtResults.pduLen; + uint8_t pduType = pAdv->filtResults.pduType; + switch (pduType) + { + case LL_PDU_SCAN_REQ: + /* Require that the peer address matched. */ + if (pAdv->filtResults.peerMatch) + { + sendRsp = lctrScanReqHandler(pOp, pduLen); + } + break; + case LL_PDU_CONNECT_IND: + /* BOD must be terminated before setting up the next operation. */ + lctrConnIndHandler(pOp, pduLen, pReqBuf); + lctrSlvAdv.reqEndTs = pAdv->reqStartTs + + BB_US_TO_BB_TICKS(LCTR_CONN_IND_PKT_1M_US); /* N.B.: may round to an earlier time */ + + /* Requirement for peer address match will be enforced in action handler. */ + break; + default: + break; + } + + return sendRsp; +} + +/*************************************************************************************************/ +/*! + * \brief Slave advertising packet receive post process handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAdvPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + bool_t sendRsp = FALSE; + + /* Unwanted PDUs must have been filtered in the BB. */ + uint8_t pduLen = pAdv->filtResults.pduLen; + uint8_t pduType = pAdv->filtResults.pduType; + switch (pduType) + { + case LL_PDU_SCAN_REQ: + /* Require that the peer address matched. */ + if (pAdv->filtResults.peerMatch) + { + sendRsp = lctrScanReqHandler(pOp, pduLen); + /* lctrSlvAdv.reqEndTs = 0; */ /* not needed */ + if (sendRsp && lmgrSlvAdvCb.scanReportEna) + { + lctrSlvScanReport_t *pScanReq; + if ((pScanReq = WsfMsgAlloc(sizeof(lctrSlvScanReport_t))) != NULL) + { + pScanReq->scanIdAddr = pAdv->filtResults.peerIdAddr; + pScanReq->scanIdAddrType = pAdv->filtResults.peerIdAddrRand; + pScanReq->scanAddr = pAdv->filtResults.peerAddr; + pScanReq->scanAddrType = pAdv->filtResults.peerAddrRand; + WsfMsgEnq(&lctrSlvAdv.rxScanReqQ, 0, pScanReq); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_SCAN_REQ)); + } + } + } + break; + case LL_PDU_CONNECT_IND: + break; + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief End an advertising operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAdvEndOp(BbOpDesc_t *pOp) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + bool_t update = FALSE; + uint64_t newAddr = 0; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pBle->chan.opType == BB_BLE_OP_SLV_ADV_EVENT); + + if (lctrSlvAdv.shutdown || lctrSlvAdv.connIndRcvd) + { + lctrMsgHdr_t *pMsg; + + /* Send SM an advertising termination event. */ + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->handle = 0; */ /* not used */ + pMsg->dispId = LCTR_DISP_ADV; + pMsg->event = LCTR_ADV_MSG_TERMINATE; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return; + } + + /*** Update advertising data ***/ + + /* Update local private address. */ + if (lmgrCb.bdAddrRndModAdv && + (lmgrSlvAdvCb.ownAddrType == LL_ADDR_RANDOM)) /* Should be comparison; not valid for RPA. */ + { + lmgrCb.bdAddrRndModAdv = FALSE; + + update = TRUE; + newAddr = lmgrCb.bdAddrRnd; + } + else if (lmgrSlvAdvCb.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint64_t localRpa; + if (BbBleResListReadLocal(lmgrSlvAdvCb.advParam.peerAddrType, lmgrSlvAdvCb.advParam.peerAddr, &localRpa)) + { + update = TRUE; + newAddr = localRpa; + } + } + if (update) + { + uint8_t *pBuf = lctrSlvAdv.advBuf + LL_ADV_HDR_LEN; + + BDA64_TO_BSTREAM(pBuf, newAddr); /* update adv PDU */ + memcpy(lctrSlvAdv.scanRspBuf + LL_ADV_HDR_LEN, /* update scan response PDU */ + lctrSlvAdv.advBuf + LL_ADV_HDR_LEN, + BDA_ADDR_LEN); + pBle->pduFilt.localAddrMatch = newAddr; + } + + /* Update peer address. */ + if ((lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_DIRECT_LOW_DUTY) || + (lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_DIRECT_HIGH_DUTY)) + { + if (BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, PEER_ADDR_MATCH_ENA) && + BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, PEER_ADDR_RES_ENA)) + { + uint64_t peerRpa; + + if (BbBleResListReadPeer(lmgrSlvAdvCb.advParam.peerAddrType, lmgrSlvAdvCb.advParam.peerAddr, &peerRpa)) + { + uint8_t *pBuf = lctrSlvAdv.advBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + BDA64_TO_BSTREAM(pBuf, peerRpa); /* update adv PDU */ + } + } + } + + /* Update advertising data. */ + if ((lmgrSlvAdvCb.advParam.advType != LL_ADV_CONN_DIRECT_LOW_DUTY) && + (lmgrSlvAdvCb.advParam.advType != LL_ADV_CONN_DIRECT_HIGH_DUTY) && + lmgrSlvAdvCb.advData.modified) + { + lmgrSlvAdvCb.advData.modified = FALSE; + pAdv->txAdvLen = LL_ADVB_MIN_LEN + lmgrSlvAdvCb.advData.len; + lctrSlvAdv.advBuf[LL_ADV_HDR_LEN_OFFS] = LL_ADV_PREFIX_LEN + lmgrSlvAdvCb.advData.len; + memcpy(lctrSlvAdv.advBuf + LL_ADVB_MIN_LEN, + lmgrSlvAdvCb.advData.buf, + lmgrSlvAdvCb.advData.len); +#if (LL_ENABLE_TESTER) + if (pAdv->pTxAdvBuf == llTesterCb.txAdvPdu) + { + pAdv->txAdvLen = llTesterCb.txAdvPduLen; /* restore alternate length */ + } +#endif + } + + /* Update scan response data. */ + if (lmgrSlvAdvCb.scanRspData.modified) + { + lmgrSlvAdvCb.scanRspData.modified = FALSE; + pAdv->txRspLen = LL_ADVB_MIN_LEN + lmgrSlvAdvCb.scanRspData.len; + lctrSlvAdv.scanRspBuf[LL_ADV_HDR_LEN_OFFS] = LL_SCAN_PREFIX_LEN + lmgrSlvAdvCb.scanRspData.len; + memcpy(lctrSlvAdv.scanRspBuf + LL_ADVB_MIN_LEN, + lmgrSlvAdvCb.scanRspData.buf, + lmgrSlvAdvCb.scanRspData.len); + +#if (LL_ENABLE_TESTER) + if (pAdv->pTxRspBuf == llTesterCb.txScanRspPdu) + { + pAdv->txRspLen = llTesterCb.txScanRspPduLen; /* restore alternate length */ + } +#endif + } + SchBleCalcAdvOpDuration(pOp); + + /*** Reschedule operation ***/ + + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_UNDIRECT: + case LL_ADV_SCAN_UNDIRECT: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + case LL_ADV_NONCONN_UNDIRECT: + { + bool_t result; + + do + { + if (lctrGetOpFlag(LL_OP_MODE_FLAG_ENA_ADV_DLY)) + { + /* maxDelay is 16, it times 625 still fits in uint32_t. */ + /* coverity[overflow_before_widen] */ + pOp->due += BB_BLE_TO_BB_TICKS(lctrCalcAdvDelay()); + } + + if (lmgrSlvAdvCb.advParam.advInterMin == lmgrSlvAdvCb.advParam.advInterMax) + { + pOp->due += lmgrSlvAdvCb.advParam.advInterMin; + result = SchInsertAtDueTime(pOp, NULL); + } + else + { + result = SchInsertEarlyAsPossible(pOp, + lmgrSlvAdvCb.advParam.advInterMin, + lmgrSlvAdvCb.advParam.advInterMax); + if (!result) + { + pOp->due += lmgrSlvAdvCb.advParam.advInterMax; + } + } + + if (!result) + { + LL_TRACE_WARN1("!!! Adv schedule conflict at due=%u", pOp->due); + LL_TRACE_WARN1("!!! minDurUsec=%u", pOp->minDurUsec); + } + + } while (!result); + + break; + } + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + { + uint32_t advEventStart = pOp->due; + uint32_t advTermCntDown = lmgrSlvAdvCb.advTermCntDown; + bool_t result = FALSE; + + while (!result && lmgrSlvAdvCb.advTermCntDown) + { + uint32_t advEventDur; + result = SchInsertLateAsPossible(pOp, lmgrSlvAdvCb.advParam.advInterMin, lmgrSlvAdvCb.advParam.advInterMax); + if (!result) + { + pOp->due += lmgrSlvAdvCb.advParam.advInterMax; + } + + advEventDur = pOp->due - advEventStart; + + if ((advEventDur + lmgrSlvAdvCb.advParam.advInterMax) < advTermCntDown) + { + lmgrSlvAdvCb.advTermCntDown = advTermCntDown - advEventDur; + } + else + { + /* Terminate at end of next advertising event. */ + lmgrSlvAdvCb.advTermCntDown = 0; + } + } + + if (!result && !lmgrSlvAdvCb.advTermCntDown) + { + lctrMsgHdr_t *pMsg; + + /* Send SM an advertising termination event. */ + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->handle = 0; */ /* not used */ + pMsg->dispId = LCTR_DISP_ADV; + pMsg->event = LCTR_ADV_MSG_TERMINATE; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + break; + } + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Compute a random advDelay value between 0 and 10 ms. + * + * \return Value for advDelay in 625 us ticks. + */ +/*************************************************************************************************/ +uint32_t lctrCalcAdvDelay(void) +{ + uint32_t randNum = LlMathRandNum(); + + /* Compute "randNum % (maxDelay + 1)" with no division, where maxDelay=16 (10ms). */ + return (randNum & 0xF) + ((randNum >> 4) & 1); +} + diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..805c658f90f376cbd8c4cc0a74cde7b2d6e26c55 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c @@ -0,0 +1,1004 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave extended advertising ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave_ae.h" +#include "lctr_int_adv_slave.h" +#include "lctr_pdu_adv_ae.h" +#include "lctr_pdu_adv.h" +#include "lctr_int.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_api.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Advertising header (lifetime single ISR context). */ +static lctrAdvbPduHdr_t lctrAdvIsrAdvHdr; + +/*! \brief Scan request PDU (lifetime single ISR context). */ +static lctrScanReq_t lctrAdvIsrScanReq; + +/************************************************************************************************** + Functions: Packet handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Transmit setup complete for an extended advertising primary channel operation. + * + * \param pOp Completed operation. + * \param advTxTime Start time of advertising packet. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvTxSetupExtAdvHandler(BbOpDesc_t *pOp, uint32_t advTxTime) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + + if (pAdvSet->pExtAdvAuxPtr && pAdvSet->auxBodUsed) + { + uint32_t auxOffsetUsec = BB_TICKS_TO_US(pAdvSet->auxAdvBod.due - advTxTime); + + /* Compute EXT_ADV_IND PDU OTA time. */ + uint32_t txAdvUsec; + + txAdvUsec = SchBleCalcAdvPktDurationUsec(pAdvSet->advBod.prot.pBle->chan.txPhy, + pAdvSet->bleData.chan.initTxPhyOptions, + pAdvSet->advBod.prot.pBle->op.slvAdv.txAdvLen); + + if (auxOffsetUsec < (txAdvUsec + LL_BLE_MAFS_US)) + { + LL_TRACE_WARN1("AUX Offset does not meet T_MAFS, afsUsec=%u", (auxOffsetUsec - txAdvUsec)); + } + + lctrPackAuxPtr(pAdvSet, auxOffsetUsec, pAdvSet->auxChIdx, pAdvSet->pExtAdvAuxPtr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Transmit setup for an auxiliary advertising data. + * + * \param pOp Setup operation. + * \param isChainInd Is packet a CHAIN_IND. + * + * \return Next auxiliary offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrSlvTxSetupAuxAdvDataHandler(BbOpDesc_t *pOp, bool_t isChainInd) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = &pAdvSet->auxBleData; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + /* Store/use current AuxPtr values. */ + uint32_t auxOffsUsec = pAdvSet->auxOffsUsec; + pBle->chan.chanIdx = pAdvSet->auxChIdx; + + if (!isChainInd) + { + /* Reset AdvData to initial fragment. */ + pAdvSet->advData.txOffs = 0; + + /* Compute new AuxPtr values. */ + pAdvSet->auxChHopInc = lctrComputeHopInc(); + lctrSelectNextAuxChannel(pAdvSet); + pAuxAdv->txAuxAdvPdu[0].len = lctrPackAuxAdvIndPdu(pAdvSet, pAdvSet->auxAdvHdrBuf, &pAdvSet->advData, FALSE); + + /* Set initial fragment. */ + pAuxAdv->txAuxAdvPdu[1].pBuf = pAdvSet->advData.pBuf; + pAuxAdv->txAuxAdvPdu[1].len = pAdvSet->advData.txOffs; + } + else + { + /* Store/use current AuxPtr values. */ + uint16_t advDataOffs = pAdvSet->advData.txOffs; + + /* Compute new AuxPtr values. */ + if (pAdvSet->advData.txOffs < pAdvSet->advData.len) + { + lctrSelectNextAuxChannel(pAdvSet); + } + pAuxAdv->txAuxChainPdu[0].len = lctrPackAuxChainIndPdu(pAdvSet, pAdvSet->auxAdvHdrBuf, &pAdvSet->advData, FALSE); + + /* Set next fragment. */ + pAuxAdv->txAuxChainPdu[1].pBuf = pAdvSet->advData.pBuf + advDataOffs; + pAuxAdv->txAuxChainPdu[1].len = pAdvSet->advData.txOffs - advDataOffs; + } + + return auxOffsUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Transmit setup for an periodic advertising data. + * + * \param pOp Setup operation. + * \param isChainInd Is packet a CHAIN_IND. + * + * \return Next periodic offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrSlvTxSetupPeriodicAdvDataHandler(BbOpDesc_t *pOp, bool_t isChainInd) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = &pAdvSet->perParam.perBleData; + BbBleSlvAuxAdvEvent_t * const pPerAdv = &pBle->op.slvPerAdv; + + /* Store/use current AuxPtr values. */ + uint32_t perOffsUsec = pAdvSet->perParam.perOffsUsec; + + pBle->chan.chanIdx = pAdvSet->perParam.perChIdx; + + if (!isChainInd) + { + /* Reset AdvData to initial fragment. */ + pAdvSet->perAdvData.txOffs = 0; + + /* Compute new chanIdx for next chain packet. */ + lctrSelectNextPerChannel(pAdvSet); + + pPerAdv->txAuxAdvPdu[0].len = lctrPackSyncIndPdu(pAdvSet, pAdvSet->perAdvHdrBuf, &pAdvSet->perAdvData, TRUE); + + /* Set initial fragment. */ + pPerAdv->txAuxAdvPdu[1].pBuf = pAdvSet->perAdvData.pBuf; + pPerAdv->txAuxAdvPdu[1].len = pAdvSet->perAdvData.txOffs; + } + else + { + /* Store/use current AuxPtr values. */ + uint16_t advDataOffs = pAdvSet->perAdvData.txOffs; + + /* Compute new chanIdx for next chainpacket if there is any. */ + if (pAdvSet->perAdvData.txOffs < pAdvSet->perAdvData.len) + { + lctrSelectNextPerChannel(pAdvSet); + } + + pPerAdv->txAuxChainPdu[0].len = lctrPackAuxChainIndPdu(pAdvSet, pAdvSet->perAdvHdrBuf, &pAdvSet->perAdvData, TRUE); + + /* Set next fragment. */ + pPerAdv->txAuxChainPdu[1].pBuf = pAdvSet->perAdvData.pBuf + advDataOffs; + pPerAdv->txAuxChainPdu[1].len = pAdvSet->perAdvData.txOffs - advDataOffs; + } + + return perOffsUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Transmit setup for an auxiliary scan response data. + * + * \param pOp Setup operation. + * \param isChainInd Packet is a chain indication. + * + * \return Next auxiliary offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrSlvTxSetupAuxScanRspDataHandler(BbOpDesc_t *pOp, bool_t isChainInd) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = &pAdvSet->auxBleData; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + /* Store/use current AuxPtr values. */ + uint32_t auxOffsUsec = pAdvSet->auxOffsUsec; + pBle->chan.chanIdx = pAdvSet->auxChIdx; + + if (!isChainInd) + { + /* Reset ScanRspData to initial fragment. */ + pAdvSet->scanRspData.txOffs = 0; + + /* Compute new AuxPtr values. */ + lctrSelectNextAuxChannel(pAdvSet); + pAuxAdv->txAuxRspPdu[0].len = lctrPackAuxScanRspPdu(pAdvSet, pAdvSet->auxRspHdrBuf, FALSE); + + /* Set initial fragment. */ + pAuxAdv->txAuxRspPdu[1].pBuf = pAdvSet->scanRspData.pBuf; + pAuxAdv->txAuxRspPdu[1].len = pAdvSet->scanRspData.txOffs; + } + else + { + /* Store/use current AuxPtr values. */ + uint16_t scanRspDataOffs = pAdvSet->scanRspData.txOffs; + + /* Compute new AuxPtr values. */ + if (pAdvSet->scanRspData.txOffs < pAdvSet->scanRspData.len) + { + lctrSelectNextAuxChannel(pAdvSet); + } + pAuxAdv->txAuxChainPdu[0].len = lctrPackAuxChainIndPdu(pAdvSet, pAdvSet->auxRspHdrBuf, &pAdvSet->scanRspData, FALSE); + + /* Set next fragment. */ + pAuxAdv->txAuxChainPdu[1].pBuf = pAdvSet->scanRspData.pBuf + scanRspDataOffs; + pAuxAdv->txAuxChainPdu[1].len = pAdvSet->scanRspData.txOffs - scanRspDataOffs; + } + + return auxOffsUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Slave auxiliary scan request packet receive completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return TRUE if response transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvRxAuxScanReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + bbBlePduExtFiltParams_t params; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + lctrUnpackAdvbPduHdr(&lctrAdvIsrAdvHdr, pReqBuf); + + /* PDU type and length match. */ + if ((lctrAdvIsrAdvHdr.pduType != LL_PDU_AUX_SCAN_REQ) || /* LL_PDU_AUX_SCAN_REQ has the same value as LL_PDU_SCAN_REQ */ + (lctrAdvIsrAdvHdr.len != LL_SCAN_REQ_PDU_LEN)) + { + return FALSE; + } + + lctrUnpackScanReqPdu(&lctrAdvIsrScanReq, pReqBuf + LL_ADV_HDR_LEN); + + /*** Extended advertising event filtering. ***/ + + memset(¶ms, 0, sizeof(bbBlePduExtFiltParams_t)); + params.pduType = lctrAdvIsrAdvHdr.pduType; + params.extHdrFlags |= (LL_EXT_HDR_ADV_ADDR_BIT | LL_EXT_HDR_TGT_ADDR_BIT); /* ScanA and AdvA are mandatory. */ + params.peerAddr = lctrAdvIsrScanReq.scanAddr; + params.peerAddrRand = lctrAdvIsrAdvHdr.txAddrRnd; + params.localAddr = lctrAdvIsrScanReq.advAddr; + params.localAddrRand = lctrAdvIsrAdvHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxAdv->filtResults) == FALSE) + { + LL_TRACE_WARN0("Ignoring LL_PDU_AUX_SCAN_REQ due to PDU filtering."); + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Slave auxiliary advertising packet receive post process handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvRxAuxScanReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + if (pAdvSet->param.scanReqNotifEna) + { + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + + BbBlePduFiltResultsGetPeerIdAddr(&pAuxAdv->filtResults, &peerIdAddr, &peerIdAddrType); + + // TODO Offload report to task context. + LmgrSendScanReqReceivedInd(pAdvSet->handle, + peerIdAddrType, + peerIdAddr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave auxiliary advertising packet receive post process handler for legacy scan request. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvRxLegacyScanReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + if (pAdvSet->param.scanReqNotifEna) + { + uint64_t peerIdAddr = 0; + uint8_t peerIdAddrType = 0; + + BbBlePduFiltResultsGetPeerIdAddr(&pAdv->filtResults, &peerIdAddr, &peerIdAddrType); + + // TODO Offload report to task context. + LmgrSendScanReqReceivedInd(pAdvSet->handle, + peerIdAddrType, + peerIdAddr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave auxiliary connect request packet receive completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return TRUE if response transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvRxAuxConnReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + uint8_t *pAuxConnRspTgtA; + uint8_t *pAuxConnRspAdvA; + bool_t localAddrRand; + uint64_t localAddr; + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = &pAdvSet->auxBleData; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + + bool_t sendRsp = FALSE; + const uint8_t *pBuf; + lctrConnInd_t connInd; + + pBuf = pReqBuf; + pBuf += lctrUnpackAdvbPduHdr(&lctrAdvIsrAdvHdr, pBuf); + lctrUnpackConnIndPdu(&connInd, pBuf); + + if ((lctrAdvIsrAdvHdr.pduType == LL_PDU_AUX_CONNECT_REQ) && + (lctrMsgDispTbl[LCTR_DISP_CONN]) && + (lctrAdvIsrAdvHdr.len == LL_CONN_IND_PDU_LEN)) + { + + /*** Extended advertising event filtering. ***/ + bbBlePduExtFiltParams_t params; + + memset(¶ms, 0, sizeof(bbBlePduExtFiltParams_t)); + params.pduType = lctrAdvIsrAdvHdr.pduType; + params.extHdrFlags |= (LL_EXT_HDR_ADV_ADDR_BIT | LL_EXT_HDR_TGT_ADDR_BIT); /* ScanA and AdvA are mandatory. */ + params.peerAddr = connInd.initAddr; + params.peerAddrRand = lctrAdvIsrAdvHdr.txAddrRnd; + params.localAddr = connInd.advAddr; + params.localAddrRand = lctrAdvIsrAdvHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxAdv->filtResults) == FALSE) + { + LL_TRACE_WARN0("Ignoring LL_PDU_AUX_CON_REQ due to PDU filtering."); + return sendRsp; + } + + /* Update auxiliary connection response header's target address. */ + pAuxConnRspTgtA = pAdvSet->auxRspHdrBuf + LL_ADV_HDR_LEN + LCTR_EXT_HDR_CMN_LEN + LCTR_EXT_HDR_FLAG_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pAuxConnRspTgtA, pAuxAdv->filtResults.peerAddr); + pAdvSet->rspPduHdr.rxAddrRnd = pAuxAdv->filtResults.peerAddrRand; + + /* Update auxiliary connection response header's advertiser address. */ + + localAddrRand = lctrAdvIsrAdvHdr.rxAddrRnd; + localAddr = BstreamToBda64(pReqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN); + + if (pAdvSet->param.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + /* Update the local RPA if the received one is RPA. */ + if (BDA64_ADDR_IS_RPA(localAddr)) + { + lmgrSlvAdvCb.localRpa = localAddr; + BbBleResListUpdateLocal(pAuxAdv->filtResults.peerIdAddrRand, pAuxAdv->filtResults.peerIdAddr, &localAddr); + } + } + else + { + lmgrSlvAdvCb.localRpa = 0; + } + pAuxConnRspAdvA = pAdvSet->auxRspHdrBuf + LL_ADV_HDR_LEN + LCTR_EXT_HDR_CMN_LEN + LCTR_EXT_HDR_FLAG_LEN; + Bda64ToBstream(pAuxConnRspAdvA, localAddr); + pAdvSet->rspPduHdr.txAddrRnd = localAddrRand; + + lctrPackAdvbPduHdr(pAdvSet->auxRspHdrBuf, &pAdvSet->rspPduHdr); + + /* Stop advertising. */ + pAdvSet->connIndRcvd = TRUE; + + pAdvSet->isAuxConnReq = TRUE; + + /* CONN_REQ packet delivered when advertising termination completes. + * cf. lctrExtAdvActSelfTerm() */ + + /*** Received advertising PDU post-processing. ***/ + + pAdvSet->usedChSel = LL_CH_SEL_2; /* LL_PDU_AUX_CONNECT_REQ always uses Channel Selection #2. */ + pAdvSet->connIndEndTs = pAuxAdv->auxReqStartTs + + /* N.B.: May round to an earlier time. */ + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pAuxAdv->auxRxPhyOptions, + LL_CONN_IND_PDU_LEN)); + + sendRsp = TRUE; + } + + return sendRsp; +} + +/*************************************************************************************************/ +/*! + * \brief Slave legacy advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return TRUE if response transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvRxLegacyReqHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + bool_t sendRsp = FALSE; + + /* Unwanted PDUs must have been filtered in the BB. */ + uint8_t pduType = pAdv->filtResults.pduType; + switch (pduType) + { + case LL_PDU_SCAN_REQ: + /* Require that the peer address matched. */ + if (pAdv->filtResults.peerMatch) + { + sendRsp = lctrScanReqHandler(pOp, pAdv->filtResults.pduLen); + } + break; + case LL_PDU_CONNECT_IND: + lctrUnpackAdvbPduHdr(&lctrAdvIsrAdvHdr, pReqBuf); + + if ((lctrAdvIsrAdvHdr.pduType == LL_PDU_CONNECT_IND) && + (lctrMsgDispTbl[LCTR_DISP_CONN]) && + (lctrAdvIsrAdvHdr.len == LL_CONN_IND_PDU_LEN)) + { + /* Stop advertising. */ + pAdvSet->connIndRcvd = TRUE; + pAdvSet->isAuxConnReq = FALSE; + BbSetBodTerminateFlag(); + } + break; + default: + break; + } + + return sendRsp; +} + +/*************************************************************************************************/ +/*! + * \brief Slave advertising packet receive post process handler. + * + * \param pOp Originating operation. + * \param pReqBuf Received request buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvRxLegacyReqPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pReqBuf) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + /* Unwanted PDUs must have been filtered in the BB. */ + switch (pAdv->filtResults.pduType) + { + case LL_PDU_SCAN_REQ: + /* Require that the peer address matched. */ + if (pAdv->filtResults.peerMatch) + { + lctrSlvRxLegacyScanReqPostProcessHandler(pOp, pReqBuf); + } + break; + case LL_PDU_CONNECT_IND: + if ((pAdvSet->advHdrBuf[0] & (1 << LCTR_ADV_HDR_CH_SEL_SHIFT)) && /* Local advertiser supports CS#2. */ + lctrAdvIsrAdvHdr.chSel) /* Peer initiator supports CS#2. */ + { + pAdvSet->usedChSel = LL_CH_SEL_2; + } + else + { + pAdvSet->usedChSel = LL_CH_SEL_1; + } + + pAdvSet->connIndEndTs = pAdv->reqStartTs + + BB_US_TO_BB_TICKS(LCTR_CONN_IND_PKT_1M_US); /* N.B.: May round to an earlier time. */ + break; + default: + break; + } +} + +/************************************************************************************************** + Functions: BOD handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief End an extended advertising primary channel operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvExtAdvEndOp(BbOpDesc_t *pOp) +{ + const uint8_t LEGACY_HIGH_DUTY = (LL_ADV_EVT_PROP_LEGACY_ADV_BIT | LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | + LL_ADV_EVT_PROP_DIRECT_ADV_BIT | LL_ADV_EVT_PROP_CONN_ADV_BIT); + + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_SLV_ADV_EVENT); + + do + { + if (pAdvSet->shutdown || pAdvSet->connIndRcvd) + { + } + else if (!pAdvSet->auxBodUsed && pAdvSet->maxEvents && + (++pAdvSet->numEvents >= pAdvSet->maxEvents)) + { + pAdvSet->termReason = LL_ERROR_CODE_LIMIT_REACHED; + } + else + { + /* Continue operation. */ + break; + } + + /* Disable (do not reschedule) advertising PDU. */ + pAdvSet->shutdown = TRUE; + + if (pAdvSet->auxBodUsed && + (pAdvSet->bodTermCnt++ == 0)) + { + /* Ensure all BODs are de-scheduled. */ + bool_t result = SchRemove(&pAdvSet->auxAdvBod); + WSF_ASSERT(result); /* Non-head elements are always removeable. */ + (void)result; + } + else + { + /* Last BOD to terminate; send terminate event. */ + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + } + return; + + } while (FALSE); + + if (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) + { + /* Set PHY options to host defined behavior for ADV_EXT_IND. */ + pBle->chan.initTxPhyOptions = pBle->chan.tifsTxPhyOptions; + } + else + { + /* Set PHY options to default behavior for ADV_EXT_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + } + + /*** Update advertising data ***/ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) + { + /* Update superior PDU including AdvA and TgtA. */ + pAdv->txAdvLen = lctrPackAdvExtIndPdu(pAdvSet, pAdvSet->advHdrBuf, FALSE); + + if (pAdvSet->advData.alt.ext.modified && + !pAdvSet->auxBodUsed) + { + pAdvSet->advData.alt.ext.modified = FALSE; + memcpy(pAdvSet->advData.pBuf, pAdvSet->advData.alt.ext.buf, pAdvSet->advData.alt.ext.len); + pAdvSet->advData.len = pAdvSet->advData.alt.ext.len; + pAdvSet->advData.did = pAdvSet->advData.alt.ext.did; + pAdvSet->advData.fragPref = pAdvSet->advData.alt.ext.fragPref; + + /* Advertising offloading to auxiliary channel. */ + if (pAdvSet->pExtAdvAuxPtr) + { + /* Enable auxiliary PDU. */ + lctrSlvAuxNonConnNonScanBuildOp(pAdvSet); + pAdvSet->auxBodUsed = TRUE; + } + } + + /* Schedule aux BOD if periodic advertisng is enabled. */ + if ((pAdvSet->perParam.perAuxStart == TRUE) && + pAdvSet->perParam.perAdvEnabled && + pAdvSet->pExtAdvAuxPtr && + (pAdvSet->auxBodUsed == FALSE)) + { + pAdvSet->perParam.perAuxStart = FALSE; + lctrSlvAuxNonConnNonScanBuildOp(pAdvSet); + pAdvSet->auxBodUsed = TRUE; + } + } + else /* (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) */ + { + + /* Update local private address. */ + bool_t update = FALSE; + uint64_t newAddr = 0; + if (pAdvSet->bdAddrRndMod && + (lmgrSlvAdvCb.ownAddrType == LL_ADDR_RANDOM)) + { + pAdvSet->bdAddrRndMod = FALSE; + pAdvSet->advA = pAdvSet->bdAddrRnd; + + update = TRUE; + newAddr = pAdvSet->bdAddrRnd; + } + else if (lmgrSlvAdvCb.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint64_t localRpa; + if (BbBleResListReadLocal(pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, &localRpa)) + { + update = TRUE; + newAddr = localRpa; + pAdvSet->advA = localRpa; + lmgrSlvAdvCb.localRpa = localRpa; + } + } + + if (update) + { + uint8_t *pBuf = pAdvSet->advHdrBuf + LL_ADV_HDR_LEN; + + BDA64_TO_BSTREAM(pBuf, newAddr); /* update adv PDU */ + memcpy(pAdvSet->scanRspHdrBuf + LL_ADV_HDR_LEN, /* update scan response PDU */ + pAdvSet->advHdrBuf + LL_ADV_HDR_LEN, + BDA_ADDR_LEN); + pBle->pduFilt.localAddrMatch = newAddr; + } + + /* Update peer address. */ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_DIRECT_ADV_BIT) == LL_ADV_EVT_PROP_DIRECT_ADV_BIT) + { + if (BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, PEER_ADDR_MATCH_ENA) && + BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, PEER_ADDR_RES_ENA)) + { + uint64_t peerRpa; + + if (BbBleResListReadPeer(pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, &peerRpa)) + { + uint8_t *pBuf = pAdvSet->advHdrBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + BDA64_TO_BSTREAM(pBuf, peerRpa); /* update adv PDU */ + pAdvSet->tgtA = peerRpa; + } + } + } + + if (pAdvSet->advData.alt.legacy.modified) + { + pAdvSet->advData.alt.legacy.modified = FALSE; + + switch ((pAdv->pTxAdvBuf[0] >> LCTR_ADV_HDR_PDU_TYPE_SHIFT) & 0xF) + { + case LL_PDU_ADV_IND: + case LL_PDU_ADV_NONCONN_IND: + case LL_PDU_ADV_SCAN_IND: + pAdv->txAdvLen = LL_ADVB_MIN_LEN + pAdvSet->advData.alt.legacy.len; + pAdv->pTxAdvBuf[LL_ADV_HDR_LEN_OFFS] = LL_ADV_PREFIX_LEN + pAdvSet->advData.alt.legacy.len; + memcpy(pAdv->pTxAdvBuf + LL_ADVB_MIN_LEN, + pAdvSet->advData.alt.legacy.buf, + pAdvSet->advData.alt.legacy.len); + #if (LL_ENABLE_TESTER) + if (pAdv->pTxAdvBuf == llTesterCb.txAdvPdu) + { + pAdv->txAdvLen = llTesterCb.txAdvPduLen; + } + #endif + break; + case LL_PDU_ADV_DIRECT_IND: + default: + break; + } + } + + if (pAdvSet->scanRspData.alt.legacy.modified) + { + pAdvSet->scanRspData.alt.legacy.modified = FALSE; + pAdv->txRspLen = LL_ADVB_MIN_LEN + pAdvSet->scanRspData.alt.legacy.len; + pAdv->pTxRspBuf[LL_ADV_HDR_LEN_OFFS] = LL_SCAN_PREFIX_LEN + pAdvSet->scanRspData.alt.legacy.len; + memcpy(pAdv->pTxRspBuf + LL_ADVB_MIN_LEN, + pAdvSet->scanRspData.alt.legacy.buf, + pAdvSet->scanRspData.alt.legacy.len); + #if (LL_ENABLE_TESTER) + if (pAdv->pTxAdvBuf == llTesterCb.txAdvPdu) + { + pAdv->txRspLen = llTesterCb.txAdvPduLen; + } + #endif + } + } + + SchBleCalcAdvOpDuration(pOp); + + /*** Reschedule operation ***/ + + + if ((pAdvSet->param.advEventProp & LEGACY_HIGH_DUTY) == LEGACY_HIGH_DUTY) + { + { + uint32_t advEventStart = pOp->due; + uint32_t advTermCntDown = pAdvSet->param.priAdvTermCntDown; + bool_t result = FALSE; + + while (!result && pAdvSet->param.priAdvTermCntDown) + { + uint32_t advEventDur; + result = SchInsertLateAsPossible(pOp, pAdvSet->param.priAdvInterMin, pAdvSet->param.priAdvInterMax); + if (!result) + { + pOp->due += pAdvSet->param.priAdvInterMax; + } + + advEventDur = pOp->due - advEventStart; + + if ((advEventDur + pAdvSet->param.priAdvInterMax) < advTermCntDown) + { + pAdvSet->param.priAdvTermCntDown = advTermCntDown - advEventDur; + } + else + { + /* Terminate at end of next advertising event. */ + pAdvSet->param.priAdvTermCntDown = 0; + } + } + + if (!result && !pAdvSet->param.priAdvTermCntDown) + { + pAdvSet->termReason = LL_ERROR_CODE_ADV_TIMEOUT; + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + } + } + } + else + { + bool_t result; + + do + { + if (lctrGetOpFlag(LL_OP_MODE_FLAG_ENA_ADV_DLY)) + { + pOp->due += BB_BLE_TO_BB_TICKS(lctrCalcAdvDelay()); + } + + if (pAdvSet->param.priAdvInterMin == pAdvSet->param.priAdvInterMax) + { + pOp->due += pAdvSet->param.priAdvInterMin; + result = SchInsertAtDueTime(pOp, NULL); + } + else + { + result = SchInsertEarlyAsPossible(pOp, + pAdvSet->param.priAdvInterMin, + pAdvSet->param.priAdvInterMax); + if (!result) + { + pOp->due += pAdvSet->param.priAdvInterMax; + } + } + + if (!result) + { + LL_TRACE_WARN1("!!! ExtAdv schedule conflict at due=%u", pOp->due); + LL_TRACE_WARN1("!!! handle=%u", pAdvSet->handle); + } + + } while (!result); + } +} + +/*************************************************************************************************/ +/*! + * \brief End an extended advertising secondary channel operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAuxAdvEndOp(BbOpDesc_t *pOp) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_SLV_AUX_ADV_EVENT); + + do + { + if (pAdvSet->shutdown || pAdvSet->connIndRcvd) + { + } + else if (pAdvSet->maxEvents && + (++pAdvSet->numEvents >= pAdvSet->maxEvents)) + { + pAdvSet->termReason = LL_ERROR_CODE_LIMIT_REACHED; + } + else + { + /* Continue operation. */ + break; + } + + /* Disable (do not reschedule) auxiliary PDU. */ + pAdvSet->shutdown = TRUE; + pAdvSet->auxBodUsed = FALSE; + + if (pAdvSet->bodTermCnt++ == 0) + { + /* Ensure all BODs are de-scheduled. */ + bool_t result = SchRemove(&pAdvSet->advBod); + WSF_ASSERT(result); /* Non-head elements are always removeable. */ + (void)result; + } + else + { + /* Last BOD to terminate; send terminate event. */ + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + } + return; + + } while (FALSE); + + if (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) + { + /* Set PHY options to host defined behavior for AUX_ADV_IND. */ + pBle->chan.initTxPhyOptions = pBle->chan.tifsTxPhyOptions; + } + else + { + /* Set PHY options to default behavior for AUX_ADV_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + } + + /*** Update advertising data ***/ + + if (pAdvSet->advData.alt.ext.modified) + { + BbBleSlvAdvEvent_t *pAdv; + + pAdvSet->advData.alt.ext.modified = FALSE; + memcpy(pAdvSet->advData.pBuf, pAdvSet->advData.alt.ext.buf, pAdvSet->advData.alt.ext.len); + pAdvSet->advData.len = pAdvSet->advData.alt.ext.len; + pAdvSet->advData.did = pAdvSet->advData.alt.ext.did; + pAdvSet->advData.fragPref = pAdvSet->advData.alt.ext.fragPref; + + /* Update superior PDU. */ + pAdv = &pAdvSet->bleData.op.slvAdv; + pAdv->txAdvLen = lctrPackAdvExtIndPdu(pAdvSet, pAdvSet->advHdrBuf, FALSE); + + if (!pAdvSet->pExtAdvAuxPtr) + { + /* Disable (do not reschedule) auxiliary PDU. */ + pAdvSet->auxBodUsed = FALSE; + return; + } + } + + if (pAdvSet->scanRspData.alt.ext.modified) + { + pAdvSet->scanRspData.alt.ext.modified = FALSE; + memcpy(pAdvSet->scanRspData.pBuf, pAdvSet->scanRspData.alt.ext.buf, pAdvSet->scanRspData.alt.ext.len); + pAdvSet->scanRspData.len = pAdvSet->scanRspData.alt.ext.len; + pAdvSet->scanRspData.did = pAdvSet->scanRspData.alt.ext.did; + pAdvSet->scanRspData.fragPref = pAdvSet->scanRspData.alt.ext.fragPref; + } + + /*** Update operation ***/ + + /* Updated in lctrSlvTxSetupAuxAdvDataHandler(). */ + + /*** Reschedule operation ***/ + + lctrSlvAuxRescheduleOp(pAdvSet, pOp); +} + +/*************************************************************************************************/ +/*! + * \brief End an periodic advertising channel operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvPeriodicAdvEndOp(BbOpDesc_t *pOp) +{ + lctrAdvSet_t * const pAdvSet = pOp->pCtx; + BbBleData_t * const pBle = pOp->prot.pBle; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_SLV_PER_ADV_EVENT); + + if (pAdvSet->perParam.shutdown) + { + /* Last BOD to terminate; send terminate event. */ + lctrSendPeriodicAdvSetMsg(pAdvSet, LCTR_PER_ADV_MSG_TERMINATE); + return; + } + + if (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) + { + /* Set PHY options to host defined behavior for AUX_SYNC_IND. */ + pBle->chan.initTxPhyOptions = pBle->chan.tifsTxPhyOptions; + } + else + { + /* Set PHY options to default behavior for AUX_SYNC_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + } + + /*** Update advertising data ***/ + + if (pAdvSet->perAdvData.alt.ext.modified) + { + pAdvSet->perAdvData.alt.ext.modified = FALSE; + memcpy(pAdvSet->perAdvData.pBuf, pAdvSet->perAdvData.alt.ext.buf, pAdvSet->perAdvData.alt.ext.len); + pAdvSet->perAdvData.len = pAdvSet->perAdvData.alt.ext.len; + } + + /*** Update operation ***/ + + /* Updated in lctrSlvTxSetupPeriodicAdvDataHandler(). */ + + /*** Reschedule operation ***/ + + while (TRUE) + { + pOp->due += pAdvSet->perParam.perAdvInter; + + pAdvSet->perParam.perEventCounter++; + pAdvSet->perParam.perChIdx = lctrPeriodicSelectNextChannel(&pAdvSet->perParam.perChanParam, + pAdvSet->perParam.perEventCounter); + + if (SchInsertAtDueTime(pOp, NULL)) + { + break; + } + LL_TRACE_WARN1("!!! Periodic advertising schedule conflict eventCounter=%u", pAdvSet->perParam.perEventCounter); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..b1ef8cbd7edde2d7b92dee11eb59c75c15a35815 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn.c @@ -0,0 +1,423 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave connection ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lmgr_api_conn.h" +#include "bb_ble_api.h" +#include "bb_drv.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Slave connection ISR control block. */ +static union +{ + /* Added at top of structure for 32-bit alignment. */ + uint8_t emptyPdu[LL_EMPTY_PDU_LEN]; + /*!< Empty PDU buffer. Used only by active operation. */ + uint32_t align32; /*!< Not used, declared for alignment of emptyPdu. */ +} lctrConnIsr; + +/*************************************************************************************************/ +/*! + * \brief Setup next transmit data buffer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrBuildEmptyPdu(lctrConnCtx_t *pCtx) +{ + pCtx->txHdr.llid = LL_LLID_EMPTY_PDU; + /* pCtx->txHdr.nesn = 0; */ /* FC bits already valid */ + /* pCtx->txHdr.sn = 0; */ /* FC bits already valid */ + /* pCtx->txHdr.md = 0; */ /* already set */ + pCtx->txHdr.len = 0; + + lctrPackDataPduHdr(lctrConnIsr.emptyPdu, &pCtx->txHdr); +} + +/*************************************************************************************************/ +/*! + * \brief Set flow control bits in PDU. + * + * \param pHdr Unpacked PDU header. + * \param pBuf Packed packet buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrUpdateFlowCtrlBits(const lctrDataPduHdr_t *pHdr, uint8_t *pBuf) +{ + const uint8_t FC_BITMASK = 0x1C; + + pBuf[LCTR_DATA_PDU_FC_OFFSET] &= ~FC_BITMASK; + + pBuf[LCTR_DATA_PDU_FC_OFFSET] |= (pHdr->nesn & 1) << 2; + pBuf[LCTR_DATA_PDU_FC_OFFSET] |= (pHdr->sn & 1) << 3; + pBuf[LCTR_DATA_PDU_FC_OFFSET] |= (pHdr->md & 1) << 4; +} + +/*************************************************************************************************/ +/*! + * \brief Get the LLID of a Data PDU. + * + * \param pBuf Data PDU packet buffer. + * + * \return LLID of the Data PDU. + */ +/*************************************************************************************************/ +static uint8_t lctrRecoverLlid(uint8_t *pBuf) +{ + return pBuf[LCTR_DATA_PDU_FC_OFFSET] & 0x03; +} + +/*************************************************************************************************/ +/*! + * \brief Process Rx acknowledgment. + * + * \param pCtx Connection context. + * + * \return Pointer to next Rx buffer. + */ +/*************************************************************************************************/ +uint8_t *lctrProcessRxAck(lctrConnCtx_t *pCtx) +{ + uint8_t *pNextRxBuf = NULL; + if (pCtx->rxHdr.llid == LL_LLID_VS_PDU) + { + if (pLctrVsHdlrs && pLctrVsHdlrs->rxPduAck) + { + if (pLctrVsHdlrs->rxPduAck(LCTR_GET_CONN_HANDLE(pCtx))) + { + return NULL; + } + if ((pNextRxBuf = lctrRxPduAlloc(pCtx->localDataPdu.maxRxLen)) == NULL) + { + WSF_ASSERT(FALSE); + return NULL; /* flow control Rx */ + } + return pNextRxBuf; + } + else + { + /* Labeling this packet a re-transmission effectively drops this packet. */ + return NULL; + } + } + + /* Acknowledgment of received PDU (new data PDU). */ + if (((pCtx->rxHdr.sn ^ pCtx->txHdr.nesn) & 1) == 0) /* bits are same */ + { + /* Accept packets up to the maximum length because peer may queue packets before length change. */ + if (pCtx->rxHdr.len > (pCtx->localDataPdu.maxRxLen + LL_DATA_MIC_LEN)) + { + /* Invalid length value; ack PDU but drop it (don't process it). */ + pCtx->txHdr.nesn++; + return NULL; + } + else if (pCtx->rxHdr.len) /* zero length implies Empty PDU */ + { + switch (pCtx->rxHdr.llid) + { + case LL_LLID_CONT_PDU: + case LL_LLID_START_PDU: + case LL_LLID_CTRL_PDU: + if (!lmgrConnCb.availRxBuf) + { + return NULL; /* flow control Rx */ + } + if ((pNextRxBuf = lctrRxPduAlloc(pCtx->localDataPdu.maxRxLen)) == NULL) + { + WSF_ASSERT(FALSE); + return NULL; /* flow control Rx */ + } + lmgrConnCb.availRxBuf--; + break; + default: + /* Invalid LLID value; ack PDU but drop it (don't process it). */ + pCtx->txHdr.nesn++; + return NULL; + } + + // Only increment packet counter for non-empty packets + lctrIncPacketCounterRx(pCtx); + } + + pCtx->txHdr.nesn++; + return pNextRxBuf; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Last Data PDU acknowledged by peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrTxPduAck(lctrConnCtx_t *pCtx) +{ + pCtx->txHdr.len = 0; + + /* Remove last transmitted PDU. */ + if (lctrTxQueuePop(pCtx)) + { + lctrIncPacketCounterTx(pCtx); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process Tx acknowledgment. + * + * \param pCtx Connection context. + * + * \return TRUE if peer ACK last Tx PDU, FALSE if peer NACK'ed last PDU. + * + * Free ARQ element on peer acknowledgment. + */ +/*************************************************************************************************/ +bool_t lctrProcessTxAck(lctrConnCtx_t *pCtx) +{ + if (((pCtx->rxHdr.nesn ^ pCtx->txHdr.sn) & 1) == 1) /* bits are different */ + { + pCtx->txHdr.sn++; + + if (pCtx->txHdr.len) /* last packet from ARQ queue; zero length implies empty PDU */ + { + /*** Peer ACK'ed a Data PDU ***/ + + lctrTxPduAck(pCtx); + } + else + { + /*** Peer ACK'ed a Empty PDU ***/ + // Do not increment packet counter for empty PDUs + pCtx->emptyPduPend = FALSE; + } + + return TRUE; + } + + /* Peer NACK'ed PDU. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Post-process Tx acknowledgment. + * + * \param pCtx Connection context. + * + * \return None. + * + * Cleanup from Tx acknowledgment processing. + */ +/*************************************************************************************************/ +void lctrProcessTxAckCleanup(lctrConnCtx_t *pCtx) +{ + /* Complete buffer cleanup. */ + lctrTxQueuePopCleanup(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Setup for PDU transmission. + * + * \param pCtx Connection context. + * \param rxStatus Status of last receive. + * \param reqTx Require Tx. + * + * \return Number of bytes transmitted, 0 if no packet transmitted. + */ +/*************************************************************************************************/ +uint16_t lctrSetupForTx(lctrConnCtx_t *pCtx, uint8_t rxStatus, bool_t reqTx) +{ + uint16_t numTxBytes = 0; + + if ((rxStatus != BB_STATUS_SUCCESS) || + pCtx->rxHdr.md || /* peer has more data */ + pCtx->txHdr.md || /* peer is informed more data is pending */ + reqTx) + { + BbBleDrvTxBufDesc_t bbDesc[3]; + uint8_t bbDescCnt; + bool_t md; + + pCtx->txHdr.llid = ~LL_LLID_VS_PDU; /* reset last PDU LLID */ + + /* Do not remove from ARQ until acknowledged by peer. */ + bbDescCnt = lctrTxQueuePeek(pCtx, &bbDesc[0], &md); + if (!pCtx->emptyPduPend && + (bbDescCnt > 0)) + { + /* Set flow control bits. */ + md = md || (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_SLV_REQ_IMMED_ACK) && (pCtx->role == LL_ROLE_SLAVE)); /* try to get ACK from master for this Tx */; + pCtx->txHdr.md = md; + pCtx->txHdr.len = bbDesc[0].pBuf[LCTR_DATA_PDU_LEN_OFFSET]; + pCtx->txHdr.llid = lctrRecoverLlid(bbDesc[0].pBuf); + + if ((pCtx->txHdr.llid == LL_LLID_VS_PDU) && + (pLctrVsHdlrs && pLctrVsHdlrs->txPduFc)) + { + pLctrVsHdlrs->txPduFc(LCTR_GET_CONN_HANDLE(pCtx), bbDesc[0].pBuf); + } + else + { + WSF_ASSERT(pCtx->txHdr.len); + lctrUpdateFlowCtrlBits(&pCtx->txHdr, bbDesc[0].pBuf); + } + +#if (LL_ENABLE_TESTER) + bbDesc[0].pBuf[0] ^= llTesterCb.pktLlId & 0x03; +#endif + + lctrSetBbPacketCounterTx(pCtx); + BbBleTxData(&bbDesc[0], bbDescCnt); + numTxBytes = LL_DATA_HDR_LEN + bbDesc[0].pBuf[LCTR_DATA_PDU_LEN_OFFSET]; + } + else + { + /*** Send Empty PDU ***/ + + bool_t sendAck = TRUE; + + if ((rxStatus == BB_STATUS_SUCCESS) && + (pCtx->rxHdr.llid == LL_LLID_VS_PDU)) + { + if (pLctrVsHdlrs && pLctrVsHdlrs->txPduAck) + { + sendAck = pLctrVsHdlrs->txPduAck(LCTR_GET_CONN_HANDLE(pCtx)); + } + /* else ignore illegal LLID */ + } + + if (sendAck) + { + BbBleDrvTxBufDesc_t desc; + + /* Empty PDU with MD=1 implies previous transmitted empty PDU was NACK'ed. */ + pCtx->txHdr.md = (bbDescCnt > 0) ? TRUE : FALSE; + /* Transmit empty PDU. */ + lctrBuildEmptyPdu(pCtx); + desc.pBuf = lctrConnIsr.emptyPdu; + desc.len = sizeof(lctrConnIsr.emptyPdu); + + BbBleTxData(&desc, 1); + numTxBytes = desc.len; + + pCtx->emptyPduFirstAtt = !pCtx->emptyPduPend; + pCtx->emptyPduPend = TRUE; + } + } + } + /* else nothing to transmit */ + + return numTxBytes; +} + +/*************************************************************************************************/ +/*! + * \brief Rx post processing. + * + * \param pCtx Connection context. + * \param pRxBuf Rx buffer. + * \param pNextRxBuf Next Rx buffer. + * \param loadRxBuf Rx buffer loading is required. + */ +/*************************************************************************************************/ +void lctrRxPostProcessing(lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t *pNextRxBuf, bool_t loadRxBuf) +{ + if (pNextRxBuf) /* Another buffer ready to replace the received one. */ + { + lctrRxEnq(pRxBuf, pCtx->eventCounter, LCTR_GET_CONN_HANDLE(pCtx)); + pRxBuf = pNextRxBuf; + } + + /*** Reload receive buffer ***/ + + if (loadRxBuf) + { + lctrSetBbPacketCounterRx(pCtx); + BbBleRxData(pRxBuf, LCTR_DATA_PDU_LEN(pCtx->localDataPdu.maxRxLen)); + } + else + { + if (pRxBuf) + { + lctrRxPduFree(pRxBuf); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Check for maximum CE duration. + * + * \param pCtx Connection context. + * \param ceStart CE start time. + * \param pendDurUsec Pending operation duration in microseconds. + * + * \return FALSE if within duration period, TRUE if exceeds period. + */ +/*************************************************************************************************/ +bool_t lctrExceededMaxDur(lctrConnCtx_t *pCtx, uint32_t ceStart, uint32_t pendDurUsec) +{ + uint32_t curTime, setupDelayUsec, availCeUsec; + BbOpDesc_t *pOp = &pCtx->connBod; + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_BYPASS_CE_GUARD)) + { + return FALSE; + } + + curTime = BbDrvGetCurrentTime(); + setupDelayUsec = BbGetSchSetupDelayUs(); + + availCeUsec = LCTR_CONN_IND_US(pCtx->connInterval); + + if (pOp->pNext) + { + /* Limit CE duration to the edge of neighboring BOD. */ + availCeUsec = WSF_MIN(availCeUsec, BB_TICKS_TO_US(pOp->pNext->due - ceStart)); + } + + if ((BB_TICKS_TO_US(curTime - ceStart) + LL_BLE_TIFS_US + pendDurUsec + setupDelayUsec) > availCeUsec) + { + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..a1798592f806aeacbc1ce6dd45b4ad88d085c1f6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_master.c @@ -0,0 +1,612 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_adv_master.h" +#include "lmgr_api_conn.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Master connection ISR control block. */ +static struct +{ + uint8_t consCrcFailed; /*!< Number of consecutive CRC failures. Used only by active operation. */ + bool_t rxFromSlave; /*!< At least one packet received from slave. */ +} lctrMstConnIsr; + +/*! \brief Check BB meets data PDU requirements. */ +WSF_CT_ASSERT((BB_FIXED_DATA_PKT_LEN == 0) || + (BB_FIXED_DATA_PKT_LEN >= LCTR_DATA_PDU_MAX_LEN)); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +#if (LL_ENABLE_TESTER) +void LctrProcessRxTxAck(lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t **pNextRxBuf, bool_t *pTxPduIsAcked); +#endif + +/*************************************************************************************************/ +/*! + * \brief Update a connection operation. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstConnUpdateOp(lctrConnCtx_t *pCtx) +{ + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pCtx->connBod; + lctrConnUpdInd_t * const pConnUpdInd = &pCtx->connUpd; + + /*** Connection context setup ***/ + + const uint16_t connIntervalOld = pCtx->connInterval; + const uint16_t latencyOld = pCtx->maxLatency; + const uint16_t supTimeoutMsOld = pCtx->supTimeoutMs; + uint32_t txWinOffset; + + pCtx->connInterval = pConnUpdInd->interval; + pCtx->maxLatency = pConnUpdInd->latency; + pCtx->supTimeoutMs = LCTR_CONN_IND_TO_MS(pConnUpdInd->timeout); + + SchRmCommitUpdate(LCTR_GET_CONN_HANDLE(pCtx)); + + /*** General setup ***/ + + txWinOffset = BB_BLE_TO_BB_TICKS(LCTR_CONN_IND_TICKS(pConnUpdInd->txWinOffset)); + + pOp->due += txWinOffset; + pOp->maxDurUsec = LCTR_CONN_IND_US(pCtx->connInterval); + + /* Unconditionally reset supervision timer with transitional value. + * connIntervalOld + supervisionTimeoutNew */ + WsfTimerStartMs(&pCtx->tmrSupTimeout, LCTR_CONN_IND_MS(connIntervalOld) + pCtx->supTimeoutMs); + + /*** Notifications ***/ + + /* Notify host only if connection parameters changed. */ + if ((connIntervalOld != pCtx->connInterval) || + (latencyOld != pCtx->maxLatency) || + (supTimeoutMsOld != pCtx->supTimeoutMs)) + { + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CONN_UPD; + } + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + LL_TRACE_INFO2(" >>> Connection updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); + LL_TRACE_INFO1(" connIntervalUsec=%u", LCTR_CONN_IND_US(pCtx->connInterval)); +} + +/*************************************************************************************************/ +/*! + * \brief Update the channel map. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstChanMapUpdateOp(lctrConnCtx_t *pCtx) +{ + pCtx->chanMask = pCtx->chanMapUpd.chanMask; + lctrBuildRemapTable(pCtx); + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + LL_TRACE_INFO2(" >>> Channel map updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); +} + +/*************************************************************************************************/ +/*! + * \brief Update the selected PHY. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstPhyUpdateOp(lctrConnCtx_t *pCtx) +{ + uint8_t txPhyOld = lctrPhyToPhysBit(pCtx->bleData.chan.txPhy); + uint8_t rxPhyOld = lctrPhyToPhysBit(pCtx->bleData.chan.rxPhy); + + /* Notify host only if PHY changed. */ + if ((pCtx->phyUpd.masterToSlavePhy != LL_PHYS_NONE) && + (pCtx->phyUpd.masterToSlavePhy != txPhyOld)) + { + pCtx->bleData.chan.txPhy = lctrPhysBitToPhy(pCtx->phyUpd.masterToSlavePhy); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + } + if ((pCtx->phyUpd.slaveToMasterPhy != LL_PHYS_NONE) && + (pCtx->phyUpd.slaveToMasterPhy != rxPhyOld)) + { + pCtx->bleData.chan.rxPhy = lctrPhysBitToPhy(pCtx->phyUpd.slaveToMasterPhy); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + } + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + /* Update connection event durations. */ + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); + + LL_TRACE_INFO2(" >>> PHY updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); +} + +/*************************************************************************************************/ +/*! + * \brief Begin a connection operation. + * + * \param pOp Begin operation. + * + * \return None. + * + * \note Scheduler may call this routine multiple times in the following situations: + * (1) this BOD is pending and a BOD is inserted before, or (2) a Data PDU is queued + * into an empty list. + */ +/*************************************************************************************************/ +void lctrMstConnBeginOp(BbOpDesc_t *pOp) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + uint8_t *pBuf; + + if (lctrCheckForLinkTerm(pCtx)) + { + BbSetBodTerminateFlag(); + return; + } + + if (pLctrVsHdlrs && pLctrVsHdlrs->ceSetup) + { + pLctrVsHdlrs->ceSetup(LCTR_GET_CONN_HANDLE(pCtx)); + } + + /*** Initialize connection event resources. ***/ + + lctrMstConnIsr.consCrcFailed = 0; + lctrMstConnIsr.rxFromSlave = FALSE; + + /*** Setup for transmit ***/ + + pCtx->rxHdr.md = 0; /* clear Rx header */ + pCtx->rxHdr.len = 0; + pCtx->rxHdr.llid = LL_LLID_EMPTY_PDU; + + /* Guarantee Tx at least 1 packet per CE. */ + (void)lctrSetupForTx(pCtx, BB_STATUS_SUCCESS /* does not matter */, TRUE); /* always returns TRUE */ + + /* Check for Tx failure. */ + if (BbGetBodTerminateFlag()) + { + return; + } + + /*** Setup for receive ***/ + + if ((pBuf = lctrRxPduAlloc(pCtx->localDataPdu.maxRxLen)) != NULL) + { + lctrSetBbPacketCounterRx(pCtx); + BbBleRxData(pBuf, LCTR_DATA_PDU_LEN(pCtx->localDataPdu.maxRxLen)); + + /* Rx may fail; no more important statements in this code path */ + } + else + { + LL_TRACE_ERR1("!!! OOM while initializing receive buffer at start of CE, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + BbSetBodTerminateFlag(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup a connection operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnCleanupOp(BbOpDesc_t *pOp) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + + /* Reset operation to state before BOD began */ + if (pCtx->emptyPduPend && + pCtx->emptyPduFirstAtt) + { + /* A Tx was setup for a first empty PDU, but that empty PDU was never transmitted. */ + pCtx->emptyPduPend = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief End a connection operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnEndOp(BbOpDesc_t *pOp) +{ + /* Pre-resolve common structures for efficient access. */ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstConnEvent_t * const pConn = &pBle->op.mstConn; + lctrConnCtx_t * const pCtx = pOp->pCtx; + uint32_t anchorPoint; + uint16_t anchorPointOffsetUsec, numIntervals; + + /* Process event completion */ + + if (!pCtx->connEst && (lctrMstConnIsr.rxFromSlave || (lctrMstConnIsr.consCrcFailed > 0))) + { + lctrStoreConnTimeoutTerminateReason(pCtx); + WsfTimerStartMs(&pCtx->tmrSupTimeout, pCtx->supTimeoutMs); + + pCtx->connEst = TRUE; + } + else if (lctrMstConnIsr.rxFromSlave) + { + /* Reset supervision timer. */ + WsfTimerStartMs(&pCtx->tmrSupTimeout, pCtx->supTimeoutMs); + } + + pCtx->rssi = pConn->rssi; + + SchRmSetReference(LCTR_GET_CONN_HANDLE(pCtx)); + + /* Terminate connection */ + if (lctrCheckForLinkTerm(pCtx)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_TERMINATED); + WsfTimerStop(&pCtx->tmrSupTimeout); + return; + } + + if (pCtx->data.mst.sendConnUpdInd) + { + uint8_t *pPdu; + + if ((pPdu = lctrTxCtrlPduAlloc(LL_CONN_UPD_IND_PDU_LEN)) != NULL) + { + uint16_t ceOffset; + uint32_t rsvnOffs[SCH_RM_MAX_RSVN]; + uint32_t txWinOffsetUsec; + pCtx->data.mst.sendConnUpdInd = FALSE; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.eventCounterOffset) + { + ceOffset = pCtx->eventCounter + + llTesterCb.eventCounterOffset + 1; /* +1 for next CE */ + } + else +#endif + { + ceOffset = LL_MIN_INSTANT + 1 + /* +1 for next CE */ + pCtx->maxLatency; /* ensure slave will listen this packet */ + + /* TODO: accommodate pCtx->connParam.offset[]. */ + } + pCtx->connUpd.instant = pCtx->eventCounter + ceOffset; + + memset(&rsvnOffs[0], 0, sizeof(rsvnOffs)); + if (lctrGetConnOffsetsCback) + { + lctrGetConnOffsetsCback(rsvnOffs, pOp->due); + } + if (lctrGetPerOffsetsCback) + { + lctrGetPerOffsetsCback(&rsvnOffs[LL_MAX_CONN], pOp->due); + } + /* Use smallest txWindowOffset (i.e. 0) to minimize data loss. */ + txWinOffsetUsec = SchRmGetOffsetUsec(rsvnOffs, 0, LCTR_GET_CONN_HANDLE(pCtx)); + pCtx->connUpd.txWinOffset = LCTR_US_TO_CONN_IND(txWinOffsetUsec); + + lctrPackConnUpdInd(pPdu, &pCtx->connUpd); + lctrTxCtrlPduQueue(pCtx, pPdu); + } + /* else retry at next lctrMstConnEndOp() event. */ + } + + /*** Update for next operation ***/ + + anchorPoint = pOp->due; + anchorPointOffsetUsec = pOp->dueOffsetUsec; + numIntervals = 0; + + if (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) + { + /* Set PHY options to host defined behavior. */ + pBle->chan.initTxPhyOptions = pBle->chan.tifsTxPhyOptions; + } + else + { + /* Set PHY options to RX PHY Options*/ + pBle->chan.initTxPhyOptions = pConn->rxPhyOptions; + } + + while (TRUE) + { + uint32_t connInterUsec, connInter; + int16_t dueOffsetUsec; + numIntervals += 1; + pCtx->eventCounter += 1; + + connInterUsec = LCTR_CONN_IND_US(numIntervals * pCtx->connInterval) + anchorPointOffsetUsec; + connInter = BB_US_TO_BB_TICKS(connInterUsec); + dueOffsetUsec = connInterUsec - BB_TICKS_TO_US(connInter); +#if (LL_ENABLE_TESTER) + if (llTesterCb.connIntervalUs) + { + connInter = BB_US_TO_BB_TICKS(llTesterCb.connIntervalUs); + dueOffsetUsec = llTesterCb.connIntervalUs - BB_TICKS_TO_US(connInter); + } +#endif + + /* Advance to next interval. */ + pOp->due = anchorPoint + connInter; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); +#if (LL_ENABLE_TESTER) + if (llTesterCb.connIntervalUs) + { + pOp->due = anchorPoint + BB_US_TO_BB_TICKS(llTesterCb.connIntervalUs); + pOp->dueOffsetUsec = 0; + } +#endif + + if ((pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) && + (pCtx->eventCounter == pCtx->connUpd.instant)) + { + lctrMstConnUpdateOp(pCtx); + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_CMN_CH_MAP_UPD) && + (pCtx->eventCounter == pCtx->chanMapUpd.instant)) + { + lctrMstChanMapUpdateOp(pCtx); + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) && + (pCtx->eventCounter == pCtx->phyUpd.instant)) + { + lctrMstPhyUpdateOp(pCtx); + } + + pBle->chan.chanIdx = lctrChSelHdlr[pCtx->usedChSel](pCtx, 0); + + if (SchInsertAtDueTime(pOp, lctrConnResolveConflict)) + { + break; + } + + LL_TRACE_WARN2("!!! CE schedule conflict handle=%u, eventCounter=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); + } +} + +/*************************************************************************************************/ +/*! + * \brief Abort a connection operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnAbortOp(BbOpDesc_t *pOp) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + + /* Reset operation to state before BOD began */ + if (pCtx->emptyPduPend && + pCtx->emptyPduFirstAtt) + { + /* A Tx was setup for a first empty PDU, but that empty PDU was never transmitted. */ + pCtx->emptyPduPend = FALSE; + } + + if (pCtx->state == LCTR_CONN_STATE_INITIALIZED) + { + return; + } + + lctrMstConnEndOp(pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Complete a transmitted data buffer. + * + * \param pOp Operation context. + * \param status Transmit status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnTxCompletion(BbOpDesc_t *pOp, uint8_t status) +{ + if (status == BB_STATUS_SUCCESS) + { + lctrConnCtx_t * const pCtx = pOp->pCtx; + + lctrSetControlPduAck(pCtx); + } +} + +/*************************************************************************************************/ +/*! + * \brief Complete a received data buffer. + * + * \param pOp Operation context. + * \param pRxBuf Next receive buffer or NULL to flow control. + * \param status Receive status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnRxCompletion(BbOpDesc_t *pOp, uint8_t *pRxBuf, uint8_t status) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + + /* Local state */ + uint8_t *pNextRxBuf = NULL; + bool_t loadRxBuf = FALSE; + bool_t txPduIsAcked = FALSE; + + /*** LLCP instant completion processing ***/ + + if (pCtx->llcpInstantComp) + { + pCtx->llcpInstantComp = FALSE; + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + + /*** Cancellation processing ***/ + + if (status == BB_STATUS_CANCELED) + { + lctrRxPduFree(pRxBuf); + goto Done; + } + + /*** Connection event pre-processing ***/ + + if (lctrCheckForLinkTerm(pCtx) || + (status == BB_STATUS_FAILED) || + (status == BB_STATUS_RX_TIMEOUT)) + { + if (status == BB_STATUS_RX_TIMEOUT) + { + LL_TRACE_WARN3("lctrMstConnRxCompletion: BB failed with status=RX_TIMEOUT, eventCounter=%u, bleChan=%u, handle=%u", pCtx->eventCounter, pCtx->bleData.chan.chanIdx, LCTR_GET_CONN_HANDLE(pCtx)); + } + + if (status == BB_STATUS_FAILED) + { + LL_TRACE_ERR3("lctrMstConnRxCompletion: BB failed with status=FAILED, eventCounter=%u, bleChan=%u, handle=%u", pCtx->eventCounter, pCtx->bleData.chan.chanIdx, LCTR_GET_CONN_HANDLE(pCtx)); + } + + BbSetBodTerminateFlag(); + lctrRxPduFree(pRxBuf); + goto Done; + } + + /*** Receive packet pre-processing ***/ + + if (status == BB_STATUS_SUCCESS) + { + lctrMstConnIsr.rxFromSlave = TRUE; + + /* Reset consecutive CRC failure counter. */ + lctrMstConnIsr.consCrcFailed = 0; + } + else if (status == BB_STATUS_CRC_FAILED) + { + lctrMstConnIsr.consCrcFailed++; + if (lctrMstConnIsr.consCrcFailed >= LCTR_MAX_CONS_CRC) + { + /* Close connection event. */ + BbSetBodTerminateFlag(); + lctrRxPduFree(pRxBuf); + goto Done; + } + goto SetupTx; + } + + lctrUnpackDataPduHdr(&pCtx->rxHdr, pRxBuf); + +#if (LL_ENABLE_TESTER) + if (llTesterCb.ackMode != LL_TESTER_ACK_MODE_NORMAL) + { + LctrProcessRxTxAck(pCtx, pRxBuf, &pNextRxBuf, &txPduIsAcked); + } + else +#endif + { + pNextRxBuf = lctrProcessRxAck(pCtx); + txPduIsAcked = lctrProcessTxAck(pCtx); + } + + /*** Scheduler termination ***/ + + if (lctrExceededMaxDur(pCtx, pOp->due, pCtx->effConnDurUsec)) + { + BbSetBodTerminateFlag(); + goto PostProcessing; + } + + /*** Setup for transmit ***/ +SetupTx: + + /* Optionally require Tx if last packet was NACK'ed. */ + txPduIsAcked = txPduIsAcked || !lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_MST_RETX_AFTER_RX_NACK); + if (lctrSetupForTx(pCtx, status, !txPduIsAcked) == 0) + { + BbSetBodTerminateFlag(); + goto PostProcessing; + } + + /* If Tx failed, return immediately after queueing Rx data. */ + if (BbGetBodTerminateFlag()) + { + goto PostProcessing; + } + + /*** Setup for receive ***/ + + /* Always Rx after a Tx. */ + loadRxBuf = TRUE; + + /*** Packet post-processing ***/ +PostProcessing: + + /* Tx post-processing. */ + lctrProcessTxAckCleanup(pCtx); + + /* Rx post-processing. */ + lctrCheckControlPduAck(pCtx); + lctrRxPostProcessing(pCtx, pRxBuf, pNextRxBuf, loadRxBuf); + + /*** ISR complete ***/ +Done: + return; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..11193a20b6cab1ca1cfc3900182631eed9e1acb9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_conn_slave.c @@ -0,0 +1,727 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave connection ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_adv_slave.h" +#include "lmgr_api_conn.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "bb_drv.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Slave connection ISR control block (used only by active operation). */ +static struct +{ + uint8_t consCrcFailed; /*!< Number of consecutive CRC failures. */ + bool_t syncWithMaster; /*!< Flag indicating synchronize packet received from master. */ + uint8_t syncConnHandle; /*!< Connection handle where synchronized packet was received. */ + bool_t rxFromMaster; /*!< At least one successful packet received from master. */ + uint32_t firstRxStartTs; /*!< Timestamp of the first received frame regardless of CRC error. */ +} lctrSlvConnIsr; + +/*! \brief Assert BB meets data PDU requirements. */ +WSF_CT_ASSERT((BB_FIXED_DATA_PKT_LEN == 0) || + (BB_FIXED_DATA_PKT_LEN >= LCTR_DATA_PDU_MAX_LEN)); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +#if (LL_ENABLE_TESTER) +void LctrProcessRxTxAck(lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t **pNextRxBuf, bool_t *pTxPduIsAcked); +#endif + +/*************************************************************************************************/ +/*! + * \brief Abort the slave latency and recover connection BOD due time and event counter. + * + * \param pOp Connection operation. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvAbortSlvLatency(BbOpDesc_t *pOp) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + const uint32_t curTime = BbDrvGetCurrentTime(); + uint32_t connInterval = BB_US_TO_BB_TICKS(LCTR_CONN_IND_US(pCtx->connInterval)); + uint32_t count = 0; + + if ((pOp->due - curTime) >= LCTR_SCH_MAX_SPAN) + { + /* Slave tries to exit latency while the current BoD is executing, do nothing. */ + } + else if (pOp->due - curTime > connInterval) /* Imply (pOp->due - curTime) < LCTR_SCH_MAX_SPAN */ + { + /* If the connection BOD is due in the future and after the next immediate anchor point, + * adjust the event counter. */ + count = LlMathDivideUint32((pOp->due - curTime), connInterval); + pCtx->eventCounter -= count; + + /* Need to adjust the lastChanIdx for channel selection algorithm 1. */ + if (pCtx->usedChSel == LL_CH_SEL_1) + { + if (pCtx->lastChanIdx >= (count * pCtx->hopInc)) + { + pCtx->lastChanIdx -= (count * pCtx->hopInc); + } + else + { + if (((count * pCtx->hopInc) - pCtx->lastChanIdx) <= LL_MAX_NUM_CHAN_DATA) + { + /* Avoid modulo operation. */ + pCtx->lastChanIdx = LL_MAX_NUM_CHAN_DATA - ((count * pCtx->hopInc) - pCtx->lastChanIdx); + } + else + { + pCtx->lastChanIdx = LL_MAX_NUM_CHAN_DATA - LL_MATH_MOD_37(((count * pCtx->hopInc) - pCtx->lastChanIdx)); + } + } + } + + /* The anchor point, due time, minimum duration and Rx timeout will be adjusted accordingly later. */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Update a connection operation. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvConnUpdateOp(lctrConnCtx_t *pCtx) +{ + uint32_t txWinOffsetUsec, txWinOffset, txWinSizeUsec, wwTxWinOffsetUsec, wwTxWinOffset; + + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pCtx->connBod; + BbBleData_t * const pBle = &pCtx->bleData; + BbBleSlvConnEvent_t * const pConn = &pBle->op.slvConn; + lctrConnUpdInd_t * const pConnUpdInd = &pCtx->connUpd; + + /*** Connection context setup ***/ + + const uint16_t connIntervalOld = pCtx->connInterval; + const uint16_t latencyOld = pCtx->maxLatency; + const uint16_t supTimeoutMsOld = pCtx->supTimeoutMs; + + /* Make sure set the anchor point to the instant in the connection update indication. */ + const uint16_t numIntervals = pCtx->eventCounter - pCtx->data.slv.lastActiveEvent + 1; + const uint32_t timeUsec = LCTR_CONN_IND_US(connIntervalOld * numIntervals); + const uint32_t time = BB_US_TO_BB_TICKS(timeUsec); + pCtx->data.slv.anchorPoint += time; + + if (pCtx->connUpd.instant != pCtx->data.slv.lastActiveEvent) + { + /* Save the unsynced time before the connection update. */ + pCtx->data.slv.unsyncedTime = time; + } + + pCtx->data.slv.lastActiveEvent = pCtx->eventCounter + 1; /* guarantee execution of first connection event. */ + /* Update connection parameters. */ + pCtx->connInterval = pConnUpdInd->interval; + pCtx->maxLatency = pConnUpdInd->latency; + pCtx->supTimeoutMs = LCTR_CONN_IND_TO_MS(pConnUpdInd->timeout); + + /*** General setup ***/ + + txWinOffsetUsec = LCTR_CONN_IND_US(pConnUpdInd->txWinOffset); + txWinOffset = BB_US_TO_BB_TICKS(txWinOffsetUsec); + txWinSizeUsec = LCTR_CONN_IND_US(pConnUpdInd->txWinSize); + wwTxWinOffsetUsec = lctrCalcIntervalWindowWideningUsec(pCtx, txWinOffsetUsec); + wwTxWinOffset = BB_US_TO_BB_TICKS(wwTxWinOffsetUsec); + + /* txWinOffset is relative to anchorPoint. */ + pCtx->data.slv.anchorPoint += txWinOffset; + + /* Add additional time due to Tx window offset and subtract WW due to Tx window offset. */ + pOp->due += txWinOffset - wwTxWinOffset; + + pCtx->data.slv.txWinSizeUsec = txWinSizeUsec; + + /* Add additional time due to Tx window size and WW due to Tx window offset. */ + pOp->minDurUsec += txWinSizeUsec + wwTxWinOffsetUsec; + + /*** BLE general setup ***/ + + pConn->rxSyncDelayUsec += txWinSizeUsec + (wwTxWinOffsetUsec << 1); + + /* Unconditionally reset supervision timer with transitional value. + * connIntervalOld + supervisionTimeoutNew */ + WsfTimerStartMs(&pCtx->tmrSupTimeout, LCTR_CONN_IND_MS(connIntervalOld) + pCtx->supTimeoutMs); + + /*** Notifications ***/ + + /* Notify host only if connection parameters changed. */ + if ((connIntervalOld != pCtx->connInterval) || + (latencyOld != pCtx->maxLatency) || + (supTimeoutMsOld != pCtx->supTimeoutMs)) + { + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CONN_UPD; + } + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + /* Reset flags. */ + pCtx->data.slv.initAckRcvd = FALSE; + + LL_TRACE_INFO2(" >>> Connection updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); + LL_TRACE_INFO1(" connIntervalUsec=%u", LCTR_CONN_IND_US(pCtx->connInterval)); +} + +/*************************************************************************************************/ +/*! + * \brief Update the channel map. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvChanMapUpdateOp(lctrConnCtx_t *pCtx) +{ + pCtx->chanMask = pCtx->chanMapUpd.chanMask; + lctrBuildRemapTable(pCtx); + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + LL_TRACE_INFO2(" >>> Channel map updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); +} + +/*************************************************************************************************/ +/*! + * \brief Update the selected PHY. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvPhyUpdateOp(lctrConnCtx_t *pCtx) +{ + uint8_t txPhyOld = lctrPhyToPhysBit(pCtx->bleData.chan.txPhy); + uint8_t rxPhyOld = lctrPhyToPhysBit(pCtx->bleData.chan.rxPhy); + + /* Notify host only if PHY changed. */ + if ((pCtx->phyUpd.slaveToMasterPhy != LL_PHYS_NONE) && + (pCtx->phyUpd.slaveToMasterPhy != txPhyOld)) + { + pCtx->bleData.chan.txPhy = lctrPhysBitToPhy(pCtx->phyUpd.slaveToMasterPhy); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + } + if ((pCtx->phyUpd.masterToSlavePhy != LL_PHYS_NONE) && + (pCtx->phyUpd.masterToSlavePhy != rxPhyOld)) + { + pCtx->bleData.chan.rxPhy = lctrPhysBitToPhy(pCtx->phyUpd.masterToSlavePhy); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + } + + /* Delay notification until CE starts. */ + pCtx->llcpInstantComp = TRUE; + + /* Update connection event durations. */ + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); + + LL_TRACE_INFO2(" >>> PHY updated, handle=%u, eventCounter=%u <<<", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); +} + +/*************************************************************************************************/ +/*! + * \brief Begin a connection operation. + * + * \param pOp Begin operation. + * + * \return None. + * + * \note Scheduler may call this routine multiple times in the following situation: + * this BOD is pending and a BOD is inserted before. + */ +/*************************************************************************************************/ +void lctrSlvConnBeginOp(BbOpDesc_t *pOp) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + uint8_t *pBuf; + + if (lctrCheckForLinkTerm(pCtx)) + { + BbSetBodTerminateFlag(); + } + + if (pLctrVsHdlrs && pLctrVsHdlrs->ceSetup) + { + pLctrVsHdlrs->ceSetup(LCTR_GET_CONN_HANDLE(pCtx)); + } + + /*** Initialize connection event resources. ***/ + + lctrSlvConnIsr.consCrcFailed = 0; + lctrSlvConnIsr.syncWithMaster = FALSE; + lctrSlvConnIsr.syncConnHandle = 0xFF; + lctrSlvConnIsr.rxFromMaster = FALSE; + + /*** Setup receiver ***/ + + if ((pBuf = lctrRxPduAlloc(pCtx->localDataPdu.maxRxLen)) != NULL) + { + lctrSetBbPacketCounterRx(pCtx); + BbBleRxData(pBuf, LCTR_DATA_PDU_LEN(pCtx->localDataPdu.maxRxLen)); + + /* Rx may fail; no more important statements in this code path */ + } + else + { + LL_TRACE_ERR1("!!! OOM while initializing receive buffer at start of CE, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + BbSetBodTerminateFlag(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup a connection operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvConnCleanupOp(BbOpDesc_t *pOp) +{ + +} + +/*************************************************************************************************/ +/*! + * \brief End a connection operation. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvConnEndOp(BbOpDesc_t *pOp) +{ + /* Pre-resolve common structures for efficient access. */ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleSlvConnEvent_t * const pConn = &pBle->op.slvConn; + lctrConnCtx_t * const pCtx = pOp->pCtx; + uint16_t numUnsyncIntervals; + uint16_t numSkipCe = 0; + + /* Process event completion */ + if (pCtx->data.slv.abortSlvLatency) + { + lctrSlvAbortSlvLatency(pOp); + } + + pCtx->rssi = pConn->rssi; + + if ((lctrSlvConnIsr.syncWithMaster) && (lctrSlvConnIsr.syncConnHandle == LCTR_GET_CONN_HANDLE(pCtx))) + { + /* Re-sync to master's clock. */ + pCtx->data.slv.anchorPoint = lctrSlvConnIsr.firstRxStartTs; + pCtx->data.slv.lastActiveEvent = pCtx->eventCounter + 1; + + /* Tx window no longer needed. */ + pCtx->data.slv.txWinSizeUsec = 0; + + /* Now sync'd to master, reset the unsynced time before connection update. */ + pCtx->data.slv.unsyncedTime = 0; + } + + if (!pCtx->connEst && (lctrSlvConnIsr.rxFromMaster || (lctrSlvConnIsr.consCrcFailed > 0))) + { + lctrStoreConnTimeoutTerminateReason(pCtx); + WsfTimerStartMs(&pCtx->tmrSupTimeout, pCtx->supTimeoutMs); + + pCtx->connEst = TRUE; + } + else if (lctrSlvConnIsr.rxFromMaster) + { + /* Reset supervision timer. */ + WsfTimerStartMs(&pCtx->tmrSupTimeout, pCtx->supTimeoutMs); + } + + /* Terminate connection */ + if (lctrCheckForLinkTerm(pCtx)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_TERMINATED); + WsfTimerStop(&pCtx->tmrSupTimeout); + return; + } + + if (pLctrVsHdlrs && pLctrVsHdlrs->ceCleanup) + { + pLctrVsHdlrs->ceCleanup(LCTR_GET_CONN_HANDLE(pCtx)); + } + + /* Slave initiates the startup LLCP procedure when receiving a non-control PDU from both master and slave. + * This message shall be sent only once. */ + if ((pCtx->isFirstNonCtrlPdu == TRUE) && + (pCtx->isSlvReadySent == FALSE)) + { + pCtx->isSlvReadySent = TRUE; + lctrSendConnMsg(pCtx, LCTR_CONN_SLV_INIT_STARTUP_LLCP); + } + + /*** Update for next operation ***/ + + numUnsyncIntervals = pCtx->eventCounter - pCtx->data.slv.lastActiveEvent + 1; + + if ((pCtx->data.slv.abortSlvLatency == FALSE) && + lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_SLV_LATENCY) && + (pCtx->maxLatency && + pCtx->data.slv.initAckRcvd && + lctrSlvConnIsr.rxFromMaster && + (pCtx->state != LCTR_CONN_STATE_TERMINATING))) + { + if ((pCtx->llcpActiveProc == LCTR_PROC_INVALID)) + { + numSkipCe = pCtx->maxLatency; + } + else + { + /* Still apply the slave latency if the instant is not reached for the following LLCPs. */ + if ((pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) && lctrSlvCheckConnUpdInstant(pCtx)) + { + if ((uint16_t)(pCtx->connUpd.instant - pCtx->eventCounter) >= (pCtx->maxLatency + 1)) + { + numSkipCe = pCtx->maxLatency; + } + else + { + numSkipCe = pCtx->connUpd.instant - pCtx->eventCounter - 1; + } + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_CMN_CH_MAP_UPD) && + (pCtx->cmnState == LCTR_CMN_STATE_BUSY)) + { + if ((uint16_t)(pCtx->chanMapUpd.instant - pCtx->eventCounter) >= (pCtx->maxLatency + 1)) + { + numSkipCe = pCtx->maxLatency; + } + else + { + numSkipCe = pCtx->chanMapUpd.instant - pCtx->eventCounter - 1; + } + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) && (pCtx->isSlvPhyUpdInstant == TRUE)) + { + if ((uint16_t)(pCtx->phyUpd.instant - pCtx->eventCounter) >= (pCtx->maxLatency + 1)) + { + numSkipCe = pCtx->maxLatency; + } + else + { + numSkipCe = pCtx->phyUpd.instant - pCtx->eventCounter - 1; + } + } + } + } + + if (numSkipCe > 0) + { + pCtx->eventCounter += numSkipCe; + numUnsyncIntervals += numSkipCe; + + lctrChSelHdlr[pCtx->usedChSel](pCtx, numSkipCe - 1); + + LL_TRACE_INFO2("Applying slave latency, waking up at eventCounter=%u, numSkipCE=%u", pCtx->eventCounter + 1, numSkipCe); + } + + if (pCtx->data.slv.abortSlvLatency) + { + pCtx->data.slv.abortSlvLatency = FALSE; + } + + while (TRUE) + { + uint32_t unsyncTimeUsec, wwTotalUsec, wwTotal, connInterUsec, connInter; + uint16_t dueOffsetUsec; + + pCtx->eventCounter += 1; + numUnsyncIntervals += 1; + + unsyncTimeUsec = LCTR_CONN_IND_US(pCtx->connInterval * numUnsyncIntervals); + + /* Need to add the unsynced time before connection update. */ + unsyncTimeUsec += pCtx->data.slv.unsyncedTime; + + wwTotalUsec = lctrCalcIntervalWindowWideningUsec(pCtx, unsyncTimeUsec); + wwTotal = BB_US_TO_BB_TICKS(wwTotalUsec); + connInterUsec = LCTR_CONN_IND_US(numUnsyncIntervals * pCtx->connInterval); + connInter = BB_US_TO_BB_TICKS(connInterUsec); + dueOffsetUsec = (connInterUsec - wwTotalUsec) - BB_TICKS_TO_US(connInter - wwTotal); + + if (wwTotalUsec >= ((connInterUsec >> 1) - WSF_MAX(LL_BLE_TIFS_US, BbGetSchSetupDelayUs()))) + { + LL_TRACE_WARN2("!!! Terminating connection due to excessive WW handle=%u, eventCounter=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); + lctrSendConnMsg(pCtx, LCTR_CONN_TERMINATED); + WsfTimerStop(&pCtx->tmrSupTimeout); + return; + } + + /* Advance to next interval. */ + pOp->due = pCtx->data.slv.anchorPoint + connInter - wwTotal; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + pOp->minDurUsec = pCtx->data.slv.txWinSizeUsec + pCtx->localConnDurUsec + wwTotalUsec; + pConn->rxSyncDelayUsec = pCtx->data.slv.txWinSizeUsec + (wwTotalUsec << 1); + + if ((pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) && + (pCtx->eventCounter == pCtx->connUpd.instant)) + { + lctrSlvConnUpdateOp(pCtx); + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_CMN_CH_MAP_UPD) && + (pCtx->eventCounter == pCtx->chanMapUpd.instant)) + { + lctrSlvChanMapUpdateOp(pCtx); + } + else if ((pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) && + (pCtx->eventCounter == pCtx->phyUpd.instant)) + { + lctrSlvPhyUpdateOp(pCtx); + } + + pBle->chan.chanIdx = lctrChSelHdlr[pCtx->usedChSel](pCtx, 0); + + if (SchInsertAtDueTime(pOp, lctrConnResolveConflict)) + { + break; + } + + /* TODO: When latency is applied, scheduling conflicts should subtract connection intervals. */ + + LL_TRACE_WARN2("!!! CE schedule conflict handle=%u, eventCounter=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->eventCounter); + } +} + +/*************************************************************************************************/ +/*! + * \brief Complete a transmitted data buffer. + * + * \param pOp Operation context. + * \param status Transmit status. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvConnTxCompletion(BbOpDesc_t *pOp, uint8_t status) +{ + if (status == BB_STATUS_SUCCESS) + { + lctrConnCtx_t * const pCtx = pOp->pCtx; + + lctrSetControlPduAck(pCtx); + } +} + +/*************************************************************************************************/ +/*! + * \brief Complete a received data buffer. + * + * \param pOp Operation context. + * \param pRxBuf Receive buffer. + * \param status Receive status. + * + * \return None. + * + * \note 1. pRxBuf must be freed or placed into a queue by this function. + * 2. If the BOD is terminated during this function, no further receive buffer should + * remain allocated for the caller to clean up. + */ +/*************************************************************************************************/ +void lctrSlvConnRxCompletion(BbOpDesc_t *pOp, uint8_t *pRxBuf, uint8_t status) +{ + lctrConnCtx_t * const pCtx = pOp->pCtx; + + BbBleData_t * const pBle = &pCtx->bleData; + BbBleSlvConnEvent_t * const pConn = &pBle->op.slvConn; + + /* Local state */ + bool_t loadRxBuf = FALSE; + bool_t txPduIsAcked = FALSE; + uint8_t *pNextRxBuf = NULL; + uint16_t txLen = 0; + + /*** LLCP instant completion processing ***/ + + if (pCtx->llcpInstantComp) + { + pCtx->llcpInstantComp = FALSE; + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + + /*** Cancellation processing ***/ + + if (status == BB_STATUS_CANCELED) + { + lctrRxPduFree(pRxBuf); + goto Done; + } + + /*** Connection event pre-processing ***/ + + if (lctrCheckForLinkTerm(pCtx) || + (status == BB_STATUS_FAILED) || + (status == BB_STATUS_RX_TIMEOUT)) + { + if (status == BB_STATUS_RX_TIMEOUT) + { + LL_TRACE_WARN3("lctrSlvConnRxCompletion: BB failed with status=RX_TIMEOUT, eventCounter=%u, bleChan=%u, handle=%u", pCtx->eventCounter, pBle->chan.chanIdx, LCTR_GET_CONN_HANDLE(pCtx)); + } + + if (status == BB_STATUS_FAILED) + { + LL_TRACE_ERR3("lctrSlvConnRxCompletion: BB failed with status=FAILED, eventCounter=%u, bleChan=%u, handle=%u", pCtx->eventCounter, pBle->chan.chanIdx, LCTR_GET_CONN_HANDLE(pCtx)); + } + + BbSetBodTerminateFlag(); + lctrRxPduFree(pRxBuf); + goto Done; + } + + /* Store anchor point. */ + if ((!lctrSlvConnIsr.syncWithMaster) && + ((status == BB_STATUS_SUCCESS) || (status == BB_STATUS_CRC_FAILED))) + { + lctrSlvConnIsr.firstRxStartTs = pConn->startTs; + lctrSlvConnIsr.syncWithMaster = TRUE; + lctrSlvConnIsr.syncConnHandle = LCTR_GET_CONN_HANDLE(pCtx); + } + + /*** Receive packet pre-processing ***/ + + if (status == BB_STATUS_SUCCESS) + { + lctrSlvConnIsr.rxFromMaster = TRUE; + + /* Reset consecutive CRC failure counter. */ + lctrSlvConnIsr.consCrcFailed = 0; + } + else if (status == BB_STATUS_CRC_FAILED) + { + lctrSlvConnIsr.consCrcFailed++; + + if (lctrSlvConnIsr.consCrcFailed >= LCTR_MAX_CONS_CRC) + { + /* Close connection event. */ + BbSetBodTerminateFlag(); + lctrRxPduFree(pRxBuf); + goto Done; + } + + goto SetupTx; + } + + lctrUnpackDataPduHdr(&pCtx->rxHdr, pRxBuf); + + /* Check LLID from master. */ + if ((pCtx->isSlvReadySent == FALSE) && + (pCtx->rxHdr.llid != LL_LLID_CTRL_PDU) && + (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP))) + { + pCtx->isFirstNonCtrlPdu = TRUE; + } + +#if (LL_ENABLE_TESTER) + if (llTesterCb.ackMode != LL_TESTER_ACK_MODE_NORMAL) + { + LctrProcessRxTxAck(pCtx, pRxBuf, &pNextRxBuf, &txPduIsAcked); + } + else +#endif + { + pNextRxBuf = lctrProcessRxAck(pCtx); + txPduIsAcked = lctrProcessTxAck(pCtx); + + if (!pCtx->data.slv.initAckRcvd && + txPduIsAcked) + { + pCtx->data.slv.initAckRcvd = TRUE; + } + } + + /*** Setup for transmit ***/ +SetupTx: + + /* Slave always transmits after receiving. */ + if ((txLen = lctrSetupForTx(pCtx, status, TRUE)) == 0) + { + BbSetBodTerminateFlag(); + goto PostProcessing; + } + + /* Tx llid is obtained from lctrSetupForTx(). */ + if ((pCtx->isSlvReadySent == FALSE) && + (pCtx->isFirstNonCtrlPdu == TRUE) && + (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP))) + { + /* Set the flag when both master and slave send non-control PDU. */ + if (pCtx->txHdr.llid == LL_LLID_CTRL_PDU) + { + pCtx->isFirstNonCtrlPdu = FALSE; + } + } + + /* If Tx failed, return immediately after queueing Rx data. */ + if (BbGetBodTerminateFlag()) + { + goto PostProcessing; + } + + /*** Setup for receive ***/ + + loadRxBuf = ((status == BB_STATUS_CRC_FAILED) || pCtx->rxHdr.md || pCtx->txHdr.md) && + !lctrExceededMaxDur(pCtx, pConn->startTs, SchBleCalcDataPktDurationUsec(pCtx->bleData.chan.txPhy, txLen) + pCtx->effConnDurUsec); + + /*** Packet post-processing ***/ +PostProcessing: + + /* Tx post-processing. */ + lctrProcessTxAckCleanup(pCtx); + + /* Rx post-processing. */ + lctrCheckControlPduAck(pCtx); + lctrRxPostProcessing(pCtx, pRxBuf, pNextRxBuf, loadRxBuf); + + /*** ISR complete ***/ +Done: + return; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master.c new file mode 100644 index 0000000000000000000000000000000000000000..629a4910eb3d4d826e0c0099aa98a74dcae4ad36 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master.c @@ -0,0 +1,225 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master advertising event ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_init_master.h" +#include "lctr_int_adv_master.h" +#include "lctr_int_conn_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "bb_ble_api_reslist.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief End an initiate scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstInitiateEndOp(BbOpDesc_t *pOp) +{ + if (!lctrMstInit.selfTerm) /* implies not a LL_CONN_IND Tx completion */ + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(lctrMstInit.data.init.connHandle); + + /* Service RM. */ + SchRmSetReference(lctrMstInit.data.init.connHandle); + + /* Connection cleanup. */ + if (lctrMstInit.data.init.connBodLoaded) + { + bool_t result; + lctrMstInit.data.init.connBodLoaded = FALSE; + + result = SchRemove(&pCtx->connBod); + (void)result; + WSF_ASSERT(result); /* non-head BOD always remove-able */ + } + } + + /* Same as discovery scan. */ + pOp->pCtx = &lctrMstInit; + lctrMstDiscoverEndOp(pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Initiate state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if connection indication transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstInitiateAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + lctrConnCtx_t *pCtx; + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + uint32_t advEndTs; + bool_t txConnInd = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pCtx = LCTR_GET_CONN_CTX(lctrMstInit.data.init.connHandle); + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + + advEndTs = pScan->advStartTs + BB_US_TO_BB_TICKS(LCTR_ADV_PKT_1M_US(pScan->filtResults.pduLen)); + + /*** Transmit response PDU processing. ***/ + + + if (!pScan->filtResults.peerMatch) + { + /* Require peer match. */ + } + else if (!lctrMstInit.data.init.connBodLoaded) + { + BbSetBodTerminateFlag(); + } + else if (pScan->pTxReqBuf) + { + /* Update connection indication header with advertiser's address. */ + uint32_t txWinOffsetUsec; + uint16_t txWinOffset; + uint8_t *pConnIndAdvA = pScan->pTxReqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pConnIndAdvA, pScan->filtResults.peerAddr); + lctrMstInit.reqPduHdr.rxAddrRnd = pScan->filtResults.peerAddrRand; + + /* Update connection indication header with scanner's address. */ + if (lctrMstInit.scanParam.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint8_t *pConnIndInitA; + bool_t localAddrRand; + uint64_t localAddr; + + if (pScan->filtResults.pduType == LL_PDU_ADV_DIRECT_IND) + { + /* If peer is using directed advertising then use the InitA from the */ + /* ADV_DIRECT_IND as our local address in the connect indication. */ + localAddrRand = ((pAdvBuf[0] >> LCTR_ADV_HDR_RX_ADD_SHIFT) & 1); + localAddr = BstreamToBda64(pAdvBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN); + + /* Update the local RPA if the received one is RPA. */ + if (BDA64_ADDR_IS_RPA(localAddr)) + { + lctrMstInit.data.init.localRpa = localAddr; + BbBleResListUpdateLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr); + } + } + else + { + localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + lctrMstInit.data.init.localRpa = localAddr; + } + else + { + lctrMstInit.data.init.localRpa = 0; + } + } + pConnIndInitA = pScan->pTxReqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pConnIndInitA, localAddr); + lctrMstInit.reqPduHdr.txAddrRnd = localAddrRand; + } + else + { + lctrMstInit.data.init.localRpa = 0; + } + + lctrPackAdvbPduHdr(pScan->pTxReqBuf, &lctrMstInit.reqPduHdr); + + /* Update txWinOffset field in CONN_IND PDU. */ + txWinOffsetUsec = BB_TICKS_TO_US(lctrMstInit.data.init.firstCeDue - advEndTs) - LL_BLE_TIFS_US - LCTR_CONN_IND_PKT_1M_US; + txWinOffset = LCTR_US_TO_CONN_IND(txWinOffsetUsec) - LCTR_DATA_CHAN_DLY; + UINT16_TO_BUF(pScan->pTxReqBuf + LCTR_CONN_IND_TX_WIN_OFFSET, txWinOffset); + lctrMstInit.data.init.connInd.txWinOffset = txWinOffset; + + if (txWinOffsetUsec < LCTR_CONN_IND_US(LCTR_DATA_CHAN_DLY)) + { + LL_TRACE_WARN1("AE too close to initial CE deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(lctrMstInit.data.init.firstCeDue - advEndTs)); + + /* Restart scanning with better initial CE margin. */ + BbSetBodTerminateFlag(); + } + else if (txWinOffset > pCtx->connInterval) + { + LL_TRACE_WARN1("Scan period exceeded initial CE time by deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(advEndTs - lctrMstInit.data.init.firstCeDue)); + + /* Restart scanning with CE in the future. */ + BbSetBodTerminateFlag(); + } + else + { + txConnInd = TRUE; + + /*** Received advertising PDU post-processing. ***/ + + if ((lctrMstInit.reqPduHdr.chSel == LL_CH_SEL_2) && /* local initiator supports CS#2 */ + (pAdvBuf[0] & (1 << LCTR_ADV_HDR_CH_SEL_SHIFT))) /* peer advertiser supports CS#2 */ + { + lctrMstInit.data.init.usedChSel = LL_CH_SEL_2; + } + else + { + lctrMstInit.data.init.usedChSel = LL_CH_SEL_1; + } + } + } + + return txConnInd; +} + +/*************************************************************************************************/ +/*! + * \brief Connection indication Tx completion handler. + * + * \param pOp Originating operation. + * \param pIndBuf Transmitted request buffer. + * + * \return FALSE to signal no scan response. + */ +/*************************************************************************************************/ +bool_t lctrMstConnIndTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pIndBuf) +{ + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + lctrMstInit.selfTerm = TRUE; + BbSetBodTerminateFlag(); + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..544ca9c47c67c1e670e192f8f4dee297ef965c58 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_isr_init_master_ae.c @@ -0,0 +1,855 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master advertising event ISR callbacks. + */ +/*************************************************************************************************/ + +#include "lctr_int_init_master_ae.h" +#include "lctr_int_conn_master.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "bb_ble_api_reslist.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Functions: Initiate BOD handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Reschedule primary scan operation for initiation. + * + * \param pExtInitCtx Extended initiate context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtInitiateScanReschedule(lctrExtScanCtx_t *pExtInitCtx) +{ + BbOpDesc_t *pOp = &pExtInitCtx->scanBod; + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + /*** Reschedule primary operation ***/ + + /* Reset due time to start of scan window. */ + pOp->due = pExtInitCtx->data.init.scanWinStart; + + if ((pScan->elapsedUsec + pOp->minDurUsec) < LCTR_BLE_TO_US(pExtInitCtx->data.init.param.scanWindow)) + { + const uint32_t min = BB_US_TO_BB_TICKS(pScan->elapsedUsec); + const uint32_t max = BB_BLE_TO_BB_TICKS(pExtInitCtx->data.init.param.scanWindow); + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + /* Continue interrupted operation. */ + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pExtInitCtx->data.init.scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + return; + } + } + + /* Advance to next scanInterval. */ + + pScan->elapsedUsec = 0; + + /* Compute next channel. */ + pBle->chan.chanIdx = lctrScanChanSelectNext(pBle->chan.chanIdx, pScan->scanChMap); + + if (pExtInitCtx->data.init.param.scanInterval == pExtInitCtx->data.init.param.scanWindow) + { + /* Continuous scan. */ + SchInsertNextAvailable(pOp); + pExtInitCtx->data.init.scanWinStart = pOp->due; + } + else + { + /* Next scan interval. */ + const uint32_t min = BB_BLE_TO_BB_TICKS(pExtInitCtx->data.init.param.scanInterval); + const uint32_t max = min + BB_BLE_TO_BB_TICKS(pExtInitCtx->data.init.param.scanWindow); + + while (TRUE) + { + /* Store start of next scan window. */ + pExtInitCtx->data.init.scanWinStart = pOp->due + min; + + if (SchInsertEarlyAsPossible(pOp, min, max)) + { + pScan->elapsedUsec = BB_TICKS_TO_US(pOp->due - pExtInitCtx->data.init.scanWinStart); + WSF_ASSERT(pScan->elapsedUsec < pOp->maxDurUsec); + break; + } + else + { + /* Advance to next scan window. */ + pOp->due = pExtInitCtx->data.init.scanWinStart; + + LL_TRACE_WARN1("!!! Scan schedule conflict at due=%u", pOp->due + min); + LL_TRACE_WARN1("!!! scanWindowUsec=%u", LCTR_BLE_TO_US(pExtInitCtx->data.init.param.scanWindow)); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Handler for pre-initiate scan execution. + * + * \param pOp BB operation descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtPreInitiateExecHandler(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtInitCtx = pOp->pCtx; + + if (!pExtInitCtx->shutdown || !pExtInitCtx->selfTerm) + { + /* Setup connection's initial CE now that RM is synchronized BB. This step must be performed + * before initiate's scan operation sets up its executing duration (i.e. "pre-execute"). */ + pExtInitCtx->data.init.firstCeDue = lctrMstConnAdjustOpStart(LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle), + pOp->due, + &pExtInitCtx->data.init.connInd); + pExtInitCtx->data.init.connBodLoaded = TRUE; + } +} + +/*************************************************************************************************/ +/*! + * \brief End a initiate scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtInitiateScanEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtInitCtx = pOp->pCtx; + + if (pExtInitCtx->shutdown || pExtInitCtx->selfTerm) + { + pExtInitCtx->bodTermCnt++; + if (( pExtInitCtx->auxOpPending && (pExtInitCtx->bodTermCnt >= 2)) || /* Wait for both ExtScan and AuxScan operations. */ + (!pExtInitCtx->auxOpPending && (pExtInitCtx->bodTermCnt >= 1))) /* Wait only for ExtScan operation. */ + { + lctrSendExtInitMsg(pExtInitCtx, LCTR_EXT_INIT_MSG_TERMINATE); + } + return; + } + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + /*** Reschedule operation ***/ + + if (!pExtInitCtx->auxOpPending) + { + lctrMstExtInitiateScanReschedule(pExtInitCtx); + } + /* else postpone until lctrMstAuxDiscoverEndOp(). */ +} + +/*************************************************************************************************/ +/*! + * \brief End an auxiliary initiate scan operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstAuxInitiateScanEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtInitCtx = pOp->pCtx; + + if (pExtInitCtx->shutdown || pExtInitCtx->selfTerm) + { + lctrSendExtInitMsg(pExtInitCtx, LCTR_EXT_INIT_MSG_TERMINATE); + return; + } + + pExtInitCtx->auxOpPending = FALSE; + + /* Reschedule primary channel scan operation. */ + lctrMstExtInitiateScanReschedule(pExtInitCtx); +} + +/*************************************************************************************************/ +/*! + * \brief End an initiate operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtInitiateEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtInitCtx = pOp->pCtx; + + if (!pExtInitCtx->selfTerm && /* Implies not a LL_CONN_IND Tx completion. */ + !pExtInitCtx->auxOpPending) /* Auxiliary EndOp handles cleanup. */ + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle); + + /* Service RM. */ + SchRmSetReference(pExtInitCtx->data.init.connHandle); + + /* Connection cleanup. */ + if (pExtInitCtx->data.init.connBodLoaded) + { + bool_t result; + + pExtInitCtx->data.init.connBodLoaded = FALSE; + + result = SchRemove(&pCtx->connBod); + (void)result; + WSF_ASSERT(result); /* Non-head BOD always remove-able. */ + } + } + else if (!pExtInitCtx->selfTerm && /* Implies not a LL_CONN_IND Tx completion. */ + pExtInitCtx->auxOpPending) /* AuxBod is scheduled. */ + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle); + + if (pExtInitCtx->data.init.connBodLoaded && + pCtx->connBod.due < pExtInitCtx->auxScanBod.due) + { + bool_t result; + + /* connBod is scheduled and due before auxScanBod, need to reschedule connBod. */ + pExtInitCtx->data.init.connBodLoaded = FALSE; + + result = SchRemove(&pCtx->connBod); + (void)result; + WSF_ASSERT(result); /* Non-head BOD always remove-able. */ + + pExtInitCtx->data.init.firstCeDue = lctrMstConnAdjustOpStart(LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle), + pExtInitCtx->auxScanBod.due, + &pExtInitCtx->data.init.connInd); + pExtInitCtx->data.init.connBodLoaded = TRUE; + } + } + + lctrMstExtInitiateScanEndOp(pOp); +} + +/*************************************************************************************************/ +/*! + * \brief End an auxiliary initiate operation in the master role. + * + * \param pOp Completed operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstAuxInitiateEndOp(BbOpDesc_t *pOp) +{ + lctrExtScanCtx_t * const pExtInitCtx = pOp->pCtx; + + if (!pExtInitCtx->selfTerm) /* Implies not a LL_CONN_IND Tx completion. */ + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle); + + /* Service RM. */ + SchRmSetReference(pExtInitCtx->data.init.connHandle); + + /* Connection cleanup. */ + if (pExtInitCtx->data.init.connBodLoaded) + { + bool_t result; + + pExtInitCtx->data.init.connBodLoaded = FALSE; + + result = SchRemove(&pCtx->connBod); + (void)result; + WSF_ASSERT(result); /* Non-head BOD always remove-able. */ + } + } + + lctrMstAuxInitiateScanEndOp(pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Connection indication Tx completion handler. + * + * \param pOp Originating operation. + * \param pIndBuf Transmitted request buffer. + * + * \return FALSE to signal no scan response. + */ +/*************************************************************************************************/ +bool_t lctrMstExtConnIndTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pIndBuf) +{ + lctrExtScanCtx_t *pExtInitCtx; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pExtInitCtx = pOp->pCtx; + + pExtInitCtx->selfTerm = TRUE; + BbSetBodTerminateFlag(); + + return FALSE; +} + +/************************************************************************************************** + Functions: Initiate packet handlers +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initiate state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if connection indication transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstInitiateExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + lctrExtScanCtx_t *pCtx; + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + uint32_t advEndTs, txWinOffsetUsec; + uint8_t *pConnIndInitA; + uint16_t txWinOffset; + bool_t txConnInd; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pCtx = pOp->pCtx; + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + + advEndTs = pScan->advStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pScan->advRxPhyOptions, + pScan->filtResults.pduLen)); + + /*** Transmit response PDU processing. ***/ + + txConnInd = FALSE; + + if (!pScan->filtResults.peerMatch) + { + /* Require peer match. */ + } + else if (!pCtx->data.init.connBodLoaded) + { + BbSetBodTerminateFlag(); + } + else if (pScan->pTxReqBuf) + { + /* Update connection indication header with advertiser's address. */ + uint8_t *pConnIndAdvA = pScan->pTxReqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pConnIndAdvA, pScan->filtResults.peerAddr); + pCtx->reqPduHdr.rxAddrRnd = pScan->filtResults.peerAddrRand; + + /* Update connection indication header with scanner's address. */ + if (pCtx->data.init.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + bool_t localAddrRand; + uint64_t localAddr; + + if (pScan->filtResults.pduType == LL_PDU_ADV_DIRECT_IND) + { + /* If peer is using directed advertising then use the InitA from the */ + /* ADV_DIRECT_IND as our local address in the connect indication. */ + localAddrRand = ((pAdvBuf[0] >> LCTR_ADV_HDR_RX_ADD_SHIFT) & 1); + localAddr = BstreamToBda64(pAdvBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN); + pCtx->data.init.localRpa = localAddr; + /* Update the local RPA if the received one is RPA. */ + if (BDA64_ADDR_IS_RPA(localAddr)) + { + BbBleResListUpdateLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr); + } + } + else + { + localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pScan->filtResults.peerIdAddrRand, pScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + pCtx->data.init.localRpa = localAddr; + } + else + { + pCtx->data.init.localRpa = 0; + } + } + pConnIndInitA = pScan->pTxReqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pConnIndInitA, localAddr); + pCtx->reqPduHdr.txAddrRnd = localAddrRand; + } + else + { + pCtx->data.init.localRpa = 0; + } + + lctrPackAdvbPduHdr(pScan->pTxReqBuf, &pCtx->reqPduHdr); + + /* Update txWinOffset field in CONN_IND PDU. */ + txWinOffsetUsec = BB_TICKS_TO_US(pCtx->data.init.firstCeDue - advEndTs) - LL_BLE_TIFS_US - + SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, pScan->advRxPhyOptions, LL_CONN_IND_PDU_LEN); /* Assume conn_ind uses the same PHY as adv_ind. */ + txWinOffset = LCTR_US_TO_CONN_IND(txWinOffsetUsec) - LCTR_DATA_CHAN_DLY; + UINT16_TO_BUF(pScan->pTxReqBuf + LCTR_CONN_IND_TX_WIN_OFFSET, txWinOffset); + pCtx->data.init.connInd.txWinOffset = txWinOffset; + + if (txWinOffsetUsec < LCTR_CONN_IND_US(LCTR_DATA_CHAN_DLY)) + { + LL_TRACE_WARN1("AE too close to initial CE deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(pCtx->data.init.firstCeDue - advEndTs)); + + /* Restart scanning with better initial CE margin. */ + BbSetBodTerminateFlag(); + } + else if (txWinOffset > pCtx->data.init.connInterval) + { + LL_TRACE_WARN1("Scan period exceeded initial CE time by deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(advEndTs - pCtx->data.init.firstCeDue)); + + /* Restart scanning with CE in the future. */ + BbSetBodTerminateFlag(); + } + else + { + txConnInd = TRUE; + + /*** Received advertising PDU post-processing. ***/ + + if ((pCtx->reqPduHdr.chSel == LL_CH_SEL_2) && /* local initiator supports CS#2 */ + (pAdvBuf[0] & (1 << LCTR_ADV_HDR_CH_SEL_SHIFT))) /* peer advertiser supports CS#2 */ + { + pCtx->data.init.usedChSel = LL_CH_SEL_2; + } + else + { + pCtx->data.init.usedChSel = LL_CH_SEL_1; + } + + pCtx->data.init.phy = pBle->chan.txPhy; + + pCtx->data.init.isLegacy = TRUE; + } + } + + return txConnInd; +} + +/*************************************************************************************************/ +/*! + * \brief Extended initiate state advertising packet receive (primary channel) + * completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if connect indication transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstInitiateRxExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + lctrAdvbPduHdr_t advHdr; + bool_t txConnInd = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + + /*** Transmit response PDU processing (legacy advertising). ***/ + + + switch (advHdr.pduType) + { + case LL_PDU_ADV_EXT_IND: + break; + default: + /* Legacy advertising. */ + txConnInd = lctrMstInitiateExtAdvPktHandler(pOp, pAdvBuf); + break; + } + + return txConnInd; +} + +/*************************************************************************************************/ +/*! + * \brief Extended initiate state advertising packet receive (primary channel) + * post process handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstInitiateRxExtAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAdvEvent_t *pScan; + lctrExtScanCtx_t *pExtInitCtx; + lctrAdvbPduHdr_t advHdr; + uint32_t endTs; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_ADV_EVENT); + + pBle = pOp->prot.pBle; + pScan = &pBle->op.mstAdv; + pExtInitCtx = pOp->pCtx; + + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + + /*** Received advertising PDU post-processing. ***/ + + switch (advHdr.pduType) + { + /* Extended advertising. */ + case LL_PDU_ADV_EXT_IND: + { + const uint8_t *pExtAdvHdr = pAdvBuf + LL_ADV_HDR_LEN; + uint8_t extAdvHdrFlags; + pExtInitCtx->extAdvHdr.extHdrFlags = 0; + lctrUnpackExtAdvHeader(&pExtInitCtx->extAdvHdr, &extAdvHdrFlags, pExtAdvHdr); + + if (extAdvHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) + { + lctrAuxPtr_t auxPtr; + lctrUnpackAuxPtr(&auxPtr, pExtInitCtx->extAdvHdr.pAuxPtr); + + do + { + /* Confirm auxiliary PHY is supported. */ + bool_t auxPhy = lctrConvertAuxPtrPhyToBbPhy(auxPtr.auxPhy); + if ((auxPhy == BB_PHY_BLE_2M) && ((lmgrCb.features & LL_FEAT_LE_2M_PHY) == 0)) + { + /* 2M PHY requested, but not supported. */ + break; + } + if ((auxPhy == BB_PHY_BLE_CODED) && ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) == 0)) + { + /* Coded PHY requested, but not supported. */ + break; + } + + pOp->minDurUsec = 0; /* Update primary scan BOD min duration so that secondary scan can be scheduled. */ + + endTs = pScan->advStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pScan->advRxPhyOptions, LL_ADV_HDR_LEN + pScan->filtResults.pduLen)); + lctrMstAuxDiscoverOpCommit(pExtInitCtx, &auxPtr, pScan->advStartTs, endTs); + + if (pExtInitCtx->auxOpPending) + { + /* Extended advertising event continues with auxiliary BOD */ + BbSetBodTerminateFlag(); + } + } while (FALSE); + } + break; + } + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Auxiliary initiate state advertising packet receive completion handler. + * + * \param pOp Originating operation. + * \param pAdvBuf Received advertising buffer. + * + * \return TRUE if scan request transmission is required, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstInitiateRxAuxAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf) +{ + BbBleData_t *pBle; + BbBleMstAuxAdvEvent_t *pAuxScan; + lctrExtScanCtx_t *pExtInitCtx; + lctrAdvbPduHdr_t advHdr; + const uint8_t *pExtAdvHdr; + uint8_t extAdvHdrFlags; + bbBlePduExtFiltParams_t params; + bool_t txConnInd = FALSE; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_AUX_ADV_EVENT); + + pBle = pOp->prot.pBle; + pAuxScan = &pBle->op.mstAuxAdv; + pExtInitCtx = pOp->pCtx; + + pExtAdvHdr = pAdvBuf + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + lctrUnpackExtAdvHeader(&pExtInitCtx->extAdvHdr, &extAdvHdrFlags, pExtAdvHdr); + + /*** Extended advertising event filtering. ***/ + + if ((pExtInitCtx->extAdvHdr.advMode & LCTR_ADV_MODE_CONN_BIT) != LCTR_ADV_MODE_CONN_BIT) + { + return FALSE; + } + + /* AdvA is mandatory. */ + if ((extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) == 0) + { + LL_TRACE_WARN0("Ignoring LL_PDU_AUX_ADV_IND due to missing mandatory advA."); + return FALSE; + } + + params.pduType = advHdr.pduType; + params.extHdrFlags = pExtInitCtx->extAdvHdr.extHdrFlags; + params.peerAddr = pExtInitCtx->extAdvHdr.advAddr; + params.peerAddrRand = advHdr.txAddrRnd; + params.localAddr = pExtInitCtx->extAdvHdr.tgtAddr; + params.localAddrRand = advHdr.rxAddrRnd; + + /* Go through the extended PDU filter. */ + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxScan->filtResults) == FALSE) + { + LL_TRACE_WARN0("Ignoring LL_PDU_AUX_ADV_IND due to PDU filtering."); + return FALSE; + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pExtInitCtx->extAdvHdr.pAcad; + + /*** Transmit request PDU processing. ***/ + + + if (!pAuxScan->filtResults.peerMatch) + { + /* Require peer match. */ + } + else if (!pExtInitCtx->data.init.connBodLoaded) + { + BbSetBodTerminateFlag(); + } + else if (pAuxScan->pTxAuxReqBuf) + { +#if (LL_ENABLE_TESTER) + uint16_t hdr; + uint8_t *ptr; +#endif + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(pExtInitCtx->data.init.connHandle); + uint32_t txWinOffsetUsec; + uint16_t txWinOffset; + unsigned int chanDelay; + uint32_t connReqEndTs = pAuxScan->auxStartTs + + BB_US_TO_BB_TICKS(SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, pAuxScan->auxRxPhyOptions, advHdr.len) + + LL_BLE_TIFS_US + + SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) ? pBle->chan.tifsTxPhyOptions : pAuxScan->auxRxPhyOptions, LL_CONN_IND_PDU_LEN)); + + /* Update auxiliary connection request header's advertiser address. */ + uint8_t *pAuxConnReqAdvA = pAuxScan->pTxAuxReqBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + Bda64ToBstream(pAuxConnReqAdvA, pAuxScan->filtResults.peerAddr); + pExtInitCtx->reqPduHdr.rxAddrRnd = pAuxScan->filtResults.peerAddrRand; + + /* Update auxiliary connection request header's initiator's address. */ + if (pExtInitCtx->data.init.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + bool_t localAddrRand; + uint64_t localAddr; + uint8_t *pAuxConnReqInitA; + + if (extAdvHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) + { + /* If peer is using directed advertising then use tgtA from the */ + /* AUX_ADV_IND as our InitA in the auxiliary connect request. */ + localAddrRand = advHdr.rxAddrRnd; + localAddr = pExtInitCtx->extAdvHdr.tgtAddr; + /* Update the local RPA if the received one is RPA. */ + if (BDA64_ADDR_IS_RPA(localAddr)) + { + pExtInitCtx->data.init.localRpa = localAddr; + BbBleResListUpdateLocal(pAuxScan->filtResults.peerIdAddrRand, pAuxScan->filtResults.peerIdAddr, &localAddr); + } + } + else + { + /* Otherwise, use local address, could be public, static random or RPA. */ + localAddrRand = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + localAddr = pBle->pduFilt.localAddrMatch; + if (BbBleResListReadLocal(pAuxScan->filtResults.peerIdAddrRand, pAuxScan->filtResults.peerIdAddr, &localAddr)) + { + localAddrRand = TRUE; + pExtInitCtx->data.init.localRpa = localAddr; + } + else + { + pExtInitCtx->data.init.localRpa = 0; + } + } + pAuxConnReqInitA = pAuxScan->pTxAuxReqBuf + LL_ADV_HDR_LEN; + Bda64ToBstream(pAuxConnReqInitA, localAddr); + pExtInitCtx->reqPduHdr.txAddrRnd = localAddrRand; + } + else + { + pExtInitCtx->data.init.localRpa = 0; + } + +#if (LL_ENABLE_TESTER) + if (llTesterCb.auxReq.len) + { + memcpy(pAuxScan->pTxAuxReqBuf, llTesterCb.auxReq.buf, llTesterCb.auxReq.len); + pAuxScan->txAuxReqLen = llTesterCb.auxReq.len; + + ptr = llTesterCb.auxReq.buf; + BSTREAM_TO_UINT16(hdr, ptr); + + pExtInitCtx->reqPduHdr.txAddrRnd = (hdr >> LCTR_ADV_HDR_TX_ADD_SHIFT) & 0x0001; + pExtInitCtx->reqPduHdr.rxAddrRnd = (hdr >> LCTR_ADV_HDR_RX_ADD_SHIFT) & 0x0001; + + } +#endif + + lctrPackAdvbPduHdr(pExtInitCtx->reqBuf, &pExtInitCtx->reqPduHdr); + + /* Update txWinOffset field in AUX_CONN_REQ PDU. */ + txWinOffsetUsec = BB_TICKS_TO_US(pExtInitCtx->data.init.firstCeDue - connReqEndTs); + txWinOffset = LCTR_US_TO_CONN_IND(txWinOffsetUsec); + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + case BB_PHY_BLE_2M: + default: + chanDelay = LCTR_DATA_CHAN_DLY_AUX_UNCODED; + break; + case BB_PHY_BLE_CODED: + chanDelay = LCTR_DATA_CHAN_DLY_AUX_CODED; + break; + } + UINT16_TO_BUF(pExtInitCtx->reqBuf + LCTR_CONN_IND_TX_WIN_OFFSET, txWinOffset - chanDelay); + + if (txWinOffsetUsec < LCTR_CONN_IND_US(chanDelay)) + { + LL_TRACE_WARN1("AE too close to initial CE deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(pExtInitCtx->data.init.firstCeDue - connReqEndTs)); + + /* Restart scanning with better initial CE margin. */ + BbSetBodTerminateFlag(); + } + else if (txWinOffset > pCtx->connInterval) + { + LL_TRACE_WARN1("Scan period exceeded initial CE time by deltaUsec=%u, suppressed LL_CONN_IND delivery", BB_TICKS_TO_US(connReqEndTs - pExtInitCtx->data.init.firstCeDue)); + + /* Restart scanning with CE in the future. */ + BbSetBodTerminateFlag(); + } + else + { + txConnInd = TRUE; + + pExtInitCtx->data.init.usedChSel = LL_CH_SEL_2; /* LL_PDU_AUX_CONNECT_REQ always uses Channel Selection #2. */ + pExtInitCtx->data.init.phy = pBle->chan.txPhy; + + pExtInitCtx->data.init.isLegacy = FALSE; + } + } + + return txConnInd; +} + +/*************************************************************************************************/ +/*! + * \brief Master auxiliary connection response receive completion handler. + * + * \param pOp Originating operation. + * \param pRspBuf Received response buffer, NULL if receive failed. + * + * \return Always return FALSE (ignored by BB). + */ +/*************************************************************************************************/ +bool_t lctrMstInitiateRxAuxConnRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf) +{ + lctrExtScanCtx_t * pExtInitCtx; + BbBleMstAuxAdvEvent_t * pAuxScan; + lctrAdvbPduHdr_t advHdr; + const uint8_t *pExtAdvHdr; + uint8_t extAdvHdrFlags; + bbBlePduExtFiltParams_t params; + + WSF_ASSERT(pOp->protId == BB_PROT_BLE); + WSF_ASSERT(pOp->prot.pBle->chan.opType == BB_BLE_OP_MST_AUX_ADV_EVENT); + + pExtInitCtx = pOp->pCtx; + pAuxScan = &pOp->prot.pBle->op.mstAuxAdv; + + if (pRspBuf == NULL) + { + return FALSE; + } + + pExtAdvHdr = pRspBuf + lctrUnpackAdvbPduHdr(&advHdr, pRspBuf); + lctrUnpackExtAdvHeader(&pExtInitCtx->extAdvHdr, &extAdvHdrFlags, pExtAdvHdr); + + /*** Extended advertising event filtering. ***/ + /*** We may bypass this PDU filtering, since the response is irrelevant. ***/ + + /* AdvA and tgtA are mandatory. */ + if (((extAdvHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) == 0) || + ((extAdvHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) == 0)) + { + LL_TRACE_WARN0("LL_PDU_AUX_CONNECT_RSP missing mandatory advA and tgtA."); + } + + params.pduType = advHdr.pduType; + params.extHdrFlags = pExtInitCtx->extAdvHdr.extHdrFlags; + params.peerAddr = pExtInitCtx->extAdvHdr.advAddr; + params.peerAddrRand = advHdr.txAddrRnd; + params.localAddr = pExtInitCtx->extAdvHdr.tgtAddr; + params.localAddrRand = advHdr.rxAddrRnd; + + if (BbBleExtPduFiltCheck(¶ms, &pOp->prot.pBle->pduFilt, FALSE, &pAuxScan->filtResults) == FALSE) + { + LL_TRACE_WARN0("LL_PDU_AUX_CONNECT_RSP failed PDU filtering."); + } + + if ((pExtInitCtx->extAdvHdr.advMode & (LCTR_ADV_MODE_SCAN_BIT | LCTR_ADV_MODE_CONN_BIT)) != 0) + { + LL_TRACE_WARN1("Received auxiliary PDU with invalid advMode=0x%02x", pExtInitCtx->extAdvHdr.advMode); + } + + /*** ACAD processing. ***/ + + /* TODO route ACAD */ + (void)pExtInitCtx->extAdvHdr.pAcad; + + /* Signal termination only; initiate termination processing handled in lctrMstAuxInitiateEndOp(). */ + pExtInitCtx->selfTerm = TRUE; + BbSetBodTerminateFlag(); + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main.c new file mode 100644 index 0000000000000000000000000000000000000000..305544be95e81053919e0b4cecad9d7873fab75b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main.c @@ -0,0 +1,301 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Main link layer controller implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int.h" +#include "lmgr_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api_reslist.h" +#include "bb_ble_api_whitelist.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Link layer controller reset handler lookup table. */ +LctrResetHdlr_t lctrResetHdlrTbl[LCTR_DISP_TOTAL]; + +/*! \brief Link layer controller message dispatcher lookup table. */ +LctrMsgDisp_t lctrMsgDispTbl[LCTR_DISP_TOTAL]; + +/*! \brief Link layer task event handler lookup table. */ +LctrEvtHdlr_t lctrEventHdlrTbl[LCTR_EVENT_TOTAL]; + +/*! \brief Event message which triggered the current execution context. */ +lctrMsgHdr_t *pLctrMsg; + +/*! \brief Reset enabled. */ +static bool_t lctrResetEnabled = FALSE; + +/*************************************************************************************************/ +/*! + * \brief Notify host reset confirm. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyHostResetCnf(void) +{ + wsfMsgHdr_t evt; + evt.event = LL_RESET_CNF; + evt.status = LL_SUCCESS; + + LL_TRACE_INFO0("### LlEvent ### LL_RESET_CNF, status=LL_SUCCESS"); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Set the supporting state bitmask. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSetSupStates(void) +{ + const bool_t supAdv = lctrMsgDispTbl[LCTR_DISP_ADV] ? TRUE : FALSE; + const bool_t supScan = lctrMsgDispTbl[LCTR_DISP_SCAN] ? TRUE : FALSE; + const bool_t supInit = lctrMsgDispTbl[LCTR_DISP_INIT] ? TRUE : FALSE; + const bool_t supConn = lctrMsgDispTbl[LCTR_DISP_CONN] ? TRUE : FALSE; + + lmgrPersistCb.supStates = 0; + + /* Non-connectable advertising is supported. */ + if (supAdv) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_NON_CONN_ADV | + LL_SUP_STATE_SCAN_ADV; + } + + /* Non-connectable advertising while scanning is supported. */ + if (supAdv && supScan) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_NON_CONN_ADV_AND_PASS_SCAN | + LL_SUP_STATE_SCAN_ADV_AND_PASS_SCAN | + LL_SUP_STATE_NON_CONN_ADV_AND_ACT_SCAN | + LL_SUP_STATE_SCAN_ADV_AND_ACT_SCAN | + LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_PASS_SCAN | + LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_ACT_SCAN; + } + + /* Connectable advertising and slave connection are supported. */ + if (supAdv && supConn) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_CONN_ADV | + LL_SUP_STATE_HI_DUTY_DIR_ADV | + LL_SUP_STATE_LO_DUTY_DIR_ADV | + LL_SUP_STATE_CONN_SLV; + if (pLctrRtCfg->maxConn > 1) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_CONN_ADV_SLV | + LL_SUP_STATE_HI_DUTY_DIR_ADV_SLV | + LL_SUP_STATE_LO_DUTY_DIR_ADV_SLV; + } + } + + /* Scanning is supported. */ + if (supScan) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_PASS_SCAN | + LL_SUP_STATE_ACT_SCAN; + } + + /* Initiating and scanning while connected are supported. */ + if (supScan && supConn) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_INIT | + LL_SUP_STATE_PASS_SCAN_MST | + LL_SUP_STATE_ACT_SCAN_MST | + LL_SUP_STATE_PASS_SCAN_SLV | + LL_SUP_STATE_ACT_SCAN_SLV; + + if (pLctrRtCfg->maxConn > 1) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_INIT_MST; + } + + if (supInit) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_PASS_SCAN_AND_INIT | + LL_SUP_STATE_ACT_SCAN_AND_INIT; + } + } + + /* Connectable advertising while scanning and advertising while initiating and advertising while connected are supported. */ + if (supAdv && supScan && supConn) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_CONN_ADV_AND_PASS_SCAN | + LL_SUP_STATE_HI_DUTY_DIR_ADV_AND_PASS_SCAN | + LL_SUP_STATE_CONN_ADV_AND_ACT_SCAN | + LL_SUP_STATE_HI_DUTY_DIR_ADV_ACT_SCAN | + LL_SUP_STATE_NON_CONN_ADV_AND_INIT | + LL_SUP_STATE_SCAN_ADV_AND_INIT | + LL_SUP_STATE_NON_CONN_ADV_MST | + LL_SUP_STATE_SCAN_ADV_MST | + LL_SUP_STATE_NON_CONN_ADV_SLV | + LL_SUP_STATE_SCAN_ADV_SLV; + + if (pLctrRtCfg->maxConn > 1) + { + lmgrPersistCb.supStates |= LL_SUP_STATE_CONN_ADV_AND_INIT | + LL_SUP_STATE_HI_DUTY_DIR_ADV_AND_INIT | + LL_SUP_STATE_LO_DUTY_DIR_ADV_AND_INIT | + LL_SUP_STATE_CONN_ADV_MST | + LL_SUP_STATE_HI_DUTY_DIR_ADV_MST | + LL_SUP_STATE_LO_DUTY_DIR_ADV_MST | + LL_SUP_STATE_INIT_SLV; + } + } + + LL_TRACE_INFO1(" LCTR_DISP_CONN_IND = %c", lctrMsgDispTbl[LCTR_DISP_CONN_IND] ? 'Y' : 'N'); + LL_TRACE_INFO1(" LCTR_DISP_CONN = %c", lctrMsgDispTbl[LCTR_DISP_CONN] ? 'Y' : 'N'); + LL_TRACE_INFO1(" LCTR_DISP_SCAN = %c", lctrMsgDispTbl[LCTR_DISP_SCAN] ? 'Y' : 'N'); + LL_TRACE_INFO1(" LCTR_DISP_INIT = %c", lctrMsgDispTbl[LCTR_DISP_INIT] ? 'Y' : 'N'); + LL_TRACE_INFO1(" LCTR_DISP_ADV = %c", lctrMsgDispTbl[LCTR_DISP_ADV] ? 'Y' : 'N'); +} + +/*************************************************************************************************/ +/*! + * \brief Link layer controller message dispatch handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMsgDispatcher(lctrMsgHdr_t *pMsg) +{ + uint8_t dispId = pMsg->dispId; + + pLctrMsg = pMsg; + + if (dispId != LCTR_DISP_BCST) + { + /*** Unicast message ***/ + + WSF_ASSERT(dispId < LCTR_DISP_TOTAL); + + if (lctrMsgDispTbl[dispId]) + { + lctrMsgDispTbl[dispId](pMsg); + } + } + else + { + /*** Broadcast message ***/ + + if (pMsg->event == LCTR_MSG_RESET) + { + lctrResetEnabled = TRUE; + } + + for (dispId = LCTR_DISP_FIRST_SM; dispId <= LCTR_DISP_LAST_SM; dispId++) + { + if (lctrMsgDispTbl[dispId]) + { + lctrMsgDispTbl[dispId](pMsg); + } + } + } + + if (lctrResetEnabled && (lmgrCb.resetDelayRefCnt == 0)) + { + /* Reset common/shared subsystems. */ + BbBleWhiteListClear(); + BbBleResListClear(); + LmgrSetDefaults(); + #if (LL_ENABLE_TESTER) + LlTesterInit(); + #endif + + for (dispId = LCTR_DISP_FIRST_SM; dispId <= LCTR_DISP_LAST_SM; dispId++) + { + if (lctrResetHdlrTbl[dispId]) + { + lctrResetHdlrTbl[dispId](); + } + } + + lctrResetEnabled = FALSE; + lctrNotifyHostResetCnf(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Link layer controller task event handler. + * + * \param event Event id. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrEventHandler(uint8_t event) +{ + WSF_ASSERT(event < LCTR_EVENT_TOTAL); + + if (lctrEventHdlrTbl[event]) + { + lctrEventHdlrTbl[event](); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host HW error indication. + * + * \param code Error code. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrNotifyHostHwErrInd(uint8_t code) +{ + LlHwErrorInd_t evt; + evt.hdr.param = 0; + evt.hdr.event = LL_ERROR_IND; + evt.hdr.status = code; + + evt.code = code; + + LL_TRACE_INFO1("### LlEvent ### LL_ERROR_IND, status=%u", code); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Get operational mode flag. + * + * \param flag Flag to check. + * + * \return TRUE if flag is set. + * + * Get mode flag governing LL operations. + */ +/*************************************************************************************************/ +bool_t lctrGetOpFlag(uint32_t flag) +{ + return (lmgrCb.opModeFlags & flag) ? TRUE : FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..17aa66582bd534c5866815d8f71ef8ea88287804 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master.c @@ -0,0 +1,792 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scanning operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master.h" +#include "lctr_int_conn_master.h" +#include "lctr_int.h" +#include "sch_api.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> +#include <stddef.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Scan operational context. */ +lctrMstScanCtx_t lctrMstScan; + +/*************************************************************************************************/ +/*! + * \brief Master scan reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstScanResetHandler(void) +{ + BbBleScanMasterInit(); + LctrMstScanDefaults(); + LmgrMstInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Master scan message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstScanDisp(lctrMsgHdr_t *pMsg) +{ + lctrMstScanExecuteSm(pMsg->event); +} + +/*************************************************************************************************/ +/*! + * \brief Advertising report notification. + * + * \param pRpt Advertising report. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstScanAdvRptNotify(LlAdvReportInd_t *pRpt) +{ + uint64_t hash; + lctrAdvRptGenerateLegacyHash(&hash, pRpt->addrType, BstreamToBda64(pRpt->addr), pRpt->eventType); + + if (lctrAdvRptCheckDuplicate(&lctrMstScan.data.disc.advFilt, hash)) + { + /* Duplicate found, just exit. */ + return; + } + + lctrAdvRptAddEntry(&lctrMstScan.data.disc.advFilt, hash); + + if (lctrMstScan.state == LCTR_SCAN_STATE_DISCOVER) + { + pRpt->hdr.param = 0; + pRpt->hdr.event = LL_ADV_REPORT_IND; + pRpt->hdr.status = LL_SUCCESS; + + LL_TRACE_INFO1("### LlEvent ### LL_ADV_REPORT_IND, status=LL_SUCCESS addressType=%u", pRpt->addrType); + + LmgrSendEvent((LlEvt_t *)pRpt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Create advertising report. + * + * \param pAdvBuf Received ADV buffer. + * \param pRpt Advertising report indication. + * \param pLocalMatch Checks if the received ADV packet matches with local address. + * + * \return None. + */ +/*************************************************************************************************/ +static bool_t lctrMstCreateAdvRpt(uint8_t *pAdvBuf, LlAdvReportInd_t *pRpt, bool_t *pLocalMatch) +{ + uint8_t *pData; + uint8_t dataLen, peerIdAddrType; + uint64_t peerIdAddr; + + bbBlePduFiltResults_t filtResults; + lctrAdvbPduHdr_t advHdr; + const bbBlePduFiltParams_t *pFiltParams = &lctrMstScan.bleData.pduFilt; + + lctrUnpackAdvbPduHdr(&advHdr, pAdvBuf); + if ((advHdr.len < LL_ADV_PREFIX_LEN) || /* invalid packet length. */ + (advHdr.len > (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN))) + { + return FALSE; + } + + /*** Construct report ***/ + + /* Default advertising data values. */ + pData = pAdvBuf + LL_ADV_HDR_LEN + LL_ADV_PREFIX_LEN; + dataLen = advHdr.len - LL_ADV_PREFIX_LEN; + + switch (advHdr.pduType) + { + case LL_PDU_ADV_IND: + pRpt->eventType = LL_RPT_TYPE_ADV_IND; + break; + case LL_PDU_ADV_DIRECT_IND: + pRpt->eventType = LL_RPT_TYPE_ADV_DIRECT_IND; + dataLen = 0; /* no payload */ + break; + case LL_PDU_ADV_NONCONN_IND: + pRpt->eventType = LL_RPT_TYPE_ADV_NONCONN_IND; + break; + case LL_PDU_SCAN_RSP: + pRpt->eventType = LL_RPT_TYPE_SCAN_RSP; + break; + case LL_PDU_ADV_SCAN_IND: + pRpt->eventType = LL_RPT_TYPE_ADV_SCAN_IND; + break; + default: + /* Invalid packet type. */ + WSF_ASSERT(FALSE); + return FALSE; + } + + pRpt->pData = pData; + pRpt->len = dataLen; + pRpt->rssi = pAdvBuf[LCTR_ADVB_BUF_OFFSET_RSSI]; + /* BYTES_TO_UINT32(hash, pAdvBuf + LCTR_ADVB_BUF_OFFSET_CRC); */ /* TODO: use hash */ + + /*** Process PDU again ***/ + + /* + * Note: Peer RPA may not have been resolved in TIFS. The PDU must be reprocessed to provide + * a final result. + */ + + /* Pass through filters. */ + if (!BbBlePduFiltCheck(pAdvBuf, pFiltParams, TRUE, &filtResults)) + { + return FALSE; + } + + peerIdAddr = 0; + peerIdAddrType = 0; + + BbBlePduFiltResultsGetPeerIdAddr(&filtResults, &peerIdAddr, &peerIdAddrType); + + pRpt->addrType = peerIdAddrType; + Bda64ToBstream(pRpt->addr, peerIdAddr); + + *pLocalMatch = filtResults.localMatch; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief ADVB packet post-processing. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstRxAdvBPduHandler(void) +{ + uint8_t *pAdvBuf; + wsfHandlerId_t handlerId; + + while ((pAdvBuf = WsfMsgDeq(&lctrMstScan.rxAdvbQ, &handlerId)) != NULL) + { + LlAdvReportInd_t rpt; + bool_t localMatch; + + if (lctrMstCreateAdvRpt(pAdvBuf, &rpt, &localMatch)) + { + rpt.directAddrType = 0xFF; + + lctrMstScanAdvRptNotify(&rpt); + } + + WsfMsgFree(pAdvBuf); + lctrAdvReportsDec(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Direct ADVB packet post-processing. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstRxDirectAdvBPduHandler(void) +{ + uint8_t *pAdvBuf; + uint8_t *pInitA; + wsfHandlerId_t handlerId; + + while ((pAdvBuf = WsfMsgDeq(&lctrMstScan.rxDirectAdvbQ, &handlerId)) != NULL) + { + LlAdvReportInd_t rpt; + bool_t localMatch; + + if (lctrMstCreateAdvRpt(pAdvBuf, &rpt, &localMatch)) + { + WSF_ASSERT(rpt.eventType == LL_RPT_TYPE_ADV_DIRECT_IND); + + pInitA = pAdvBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN; + rpt.directAddrType = LL_ADDR_RANDOM; + memcpy(rpt.directAddr, pInitA, BDA_ADDR_LEN); + + /* Local address may have actually not have been resolved in TIFS. */ + if (localMatch) + { + /* Generate normal advertising report. */ + rpt.directAddrType = 0xFF; + } + + lctrMstScanAdvRptNotify(&rpt); + } + + WsfMsgFree(pAdvBuf); + lctrAdvReportsDec(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Build scan discovery operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstDiscoverBuildOp(void) +{ + uint8_t *pBuf; + + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &lctrMstScan.scanBod; + BbBleData_t * const pBle = &lctrMstScan.bleData; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->pCtx = &lctrMstScan; + pOp->endCback = lctrMstDiscoverEndOp; + pOp->abortCback = lctrMstDiscoverEndOp; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_ADV_EVENT; + + pBle->chan.chanIdx = lctrScanChanSelectInit(lmgrMstScanCb.scanChanMap); + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.rxPhy = BB_PHY_BLE_1M; + pBle->chan.txPhy = BB_PHY_BLE_1M; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_ADV_IND) | + (1 << LL_PDU_ADV_DIRECT_IND) | + (1 << LL_PDU_ADV_NONCONN_IND) | + (1 << LL_PDU_SCAN_RSP) | + (1 << LL_PDU_ADV_SCAN_IND); + if (lctrMstScan.scanParam.scanFiltPolicy & LL_SCAN_FILTER_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + /* Local addresses that are resolvable and cannot be resolved are optionally allowed. */ + if (lctrMstScan.scanParam.scanFiltPolicy & LL_SCAN_FILTER_RES_INIT_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_OPT); + } + + /*** BLE Scan Setup: Rx packets ***/ + + pScan->scanChMap = lmgrMstScanCb.scanChanMap; + + pScan->rxAdvCback = lctrMstDiscoverAdvPktHandler; + pScan->rxAdvPostCback = lctrMstDiscoverAdvPktPostProcessHandler; + pScan->txReqCback = lctrMstScanReqTxCompHandler; + pScan->rxRspCback = lctrMstScanRspRxCompHandler; + + if ((pScan->pRxAdvBuf = WsfMsgAlloc(LCTR_ADVB_BUF_SIZE)) == NULL) + { + /* Attempt to obtain buffer on next advertising operation. */ + LL_TRACE_ERR0("Could not allocate advertising buffer"); + // TODO need OOM recovery + WSF_ASSERT(FALSE); + } + + switch (lctrMstScan.scanParam.scanType) + { + case LL_SCAN_ACTIVE: + { + if ((pScan->pRxRspBuf = WsfMsgAlloc(LCTR_ADVB_BUF_SIZE)) == NULL) + { + /* Attempt to obtain buffer on next advertising operation. */ + LL_TRACE_ERR0("Could not allocate advertising buffer"); + // TODO need OOM recovery + WSF_ASSERT(FALSE); + } + + break; + } + case LL_SCAN_PASSIVE: + default: + break; + } + + /*** BLE Scan Setup: Tx scan request packet ***/ + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (lctrMstScan.scanParam.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + switch (lctrMstScan.scanParam.scanType) + { + case LL_SCAN_ACTIVE: + { + lctrScanReq_t scanReq = { 0 }; + + lctrMstScan.reqPduHdr.pduType = LL_PDU_SCAN_REQ; + lctrMstScan.reqPduHdr.len = LL_SCAN_REQ_PDU_LEN; + + lctrMstScan.reqPduHdr.txAddrRnd = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + scanReq.scanAddr = pBle->pduFilt.localAddrMatch; + + /* Pack only known packet information, advertiser's address resolved in Rx handler. */ + pBuf = lctrMstScan.reqBuf; + pBuf += LL_ADV_HDR_LEN; + /* pBuf += */ lctrPackScanReqPdu(pBuf, &scanReq); + + pScan->pTxReqBuf = lctrMstScan.reqBuf; + pScan->txReqLen = LL_ADV_HDR_LEN + LL_SCAN_REQ_PDU_LEN; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txScanReqPduLen) + { + pScan->pTxReqBuf = llTesterCb.txScanReqPdu; + pScan->txReqLen = llTesterCb.txScanReqPduLen; + } +#endif + + break; + } + case LL_SCAN_PASSIVE: + default: + pScan->pTxReqBuf = NULL; + break; + } + + lctrMstScan.reqPduHdr.chSel = LL_CH_SEL_1; + + /*** Commit operation ***/ + + pOp->minDurUsec = pOp->maxDurUsec = LCTR_BLE_TO_US(lctrMstScan.scanParam.scanWindow); + + lctrMstScan.selfTerm = FALSE; + lctrMstScan.shutdown = FALSE; + + SchInsertNextAvailable(pOp); + lctrMstScan.scanWinStart = pOp->due; +} + + +/*************************************************************************************************/ +/*! + * \brief Cleanup resources on advertising operation termination. + * + * \param pCtx Scan context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstScanCleanupOp(lctrMstScanCtx_t *pCtx) +{ + uint8_t *pBuf; + + pBuf = pCtx->bleData.op.mstAdv.pRxAdvBuf; + pCtx->bleData.op.mstAdv.pRxAdvBuf = NULL; + + if (pBuf) + { + /* Recover header. */ + WsfMsgFree(pBuf); + } + + pBuf = pCtx->bleData.op.mstAdv.pRxRspBuf; + pCtx->bleData.op.mstAdv.pRxRspBuf = NULL; + + if (pBuf) + { + /* Recover header. */ + WsfMsgFree(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief Select initial scan channel. + * + * \param chanMap Scan channel map. + * + * \return Scan channel. + */ +/*************************************************************************************************/ +uint8_t lctrScanChanSelectInit(uint8_t chanMap) +{ + uint8_t chanIdx = LL_CHAN_ADV_MIN_IDX; + + /* Compute next channel. */ + while (!((1 << (chanIdx - LL_CHAN_ADV_MIN_IDX)) & chanMap)) + { + if (++chanIdx > LL_CHAN_ADV_MAX_IDX) + { + return LL_CHAN_ADV_MIN_IDX; + } + } + + return chanIdx; +} + +/*************************************************************************************************/ +/*! + * \brief Select next scan channel. + * + * \param chanIdx Current scan channel. + * \param chanMap Scan channel map. + * + * \return Next scan channel. + */ +/*************************************************************************************************/ +uint8_t lctrScanChanSelectNext(uint8_t chanIdx, uint8_t chanMap) +{ + if (!chanMap) + { + return LL_CHAN_ADV_MIN_IDX; + } + + /* Compute next channel. */ + do + { + if (++chanIdx > LL_CHAN_ADV_MAX_IDX) + { + chanIdx = LL_CHAN_ADV_MIN_IDX; + } + } + while (!((1 << (chanIdx - LL_CHAN_ADV_MIN_IDX)) & chanMap)); + + return chanIdx; +} + +/*************************************************************************************************/ +/*! + * \brief Send initiate error host notification. + * + * \param reason Status code. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrScanNotifyHostInitiateError(uint8_t reason, uint8_t peerAddrType, uint64_t peerAddr) +{ + LlConnInd_t evt; + evt.hdr.event = LL_CONN_IND; + evt.hdr.status = reason; + evt.status = reason; + evt.addrType = peerAddrType; + + Bda64ToBstream(evt.peerAddr, peerAddr); + + LL_TRACE_INFO1("### LlEvent ### LL_CONN_IND, status=%u", reason); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Enable advertising report filtering. + * + * \param pAdvFilt Advertising report filter data. + * \param filtEna Enable advertising report filtering. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvRptEnable(lctrAdvRptFilt_t *pAdvFilt, bool_t filtEna) +{ + memset(pAdvFilt, 0, sizeof(lctrAdvRptFilt_t)); + pAdvFilt->enable = filtEna; +} + +/*************************************************************************************************/ +/*! + * \brief Create legacy advertising hash. + * + * \param pHash Storage for hash. + * \param addrType Address type. + * \param addr Address. + * \param eventType Event type. + * + * \return TRUE if duplicate, FALSE is unique or filter is disabled. + */ +/*************************************************************************************************/ +void lctrAdvRptGenerateLegacyHash(uint64_t *pHash, uint8_t addrType, uint64_t addr, uint8_t eventType) +{ + addrType &= 0x3; /* 2 valid bits. */ + eventType &= 0x07; /* 3 valid bits. */ + + *pHash = addr; /* 48 bits. */ + *pHash |= ((uint64_t)addrType << 48); /* 2 bits. */ + *pHash |= ((uint64_t)eventType << 50); /* 3 bits. */ +} + +/*************************************************************************************************/ +/*! + * \brief Create extended advertising hash. + * + * \param pHash Storage for hash. + * \param addrType Address type. + * \param addr Address. + * \param eventType Event type. + * \param sid Advertising Set ID (0 for legacy). + * \param did Advertising Data ID (0 for legacy). + * + * \return TRUE if duplicate, FALSE is unique or filter is disabled. + */ +/*************************************************************************************************/ +void lctrAdvRptGenerateExtHash(uint64_t *pHash, uint8_t addrType, uint64_t addr, uint8_t eventType, + uint8_t sid, uint16_t did) +{ + uint8_t pktId; + + addrType &= 0x3; /* 2 valid bits. */ + eventType &= 0x1F; /* 5 valid bits; ignore Data Status. */ + sid &= 0xF; /* 4 valid bits. */ + + /* Fit packet identifier into 8 bits. */ + pktId = did ^ (did >> 4) ^ sid ^ (sid << 4); + + *pHash = addr; /* 48 bits. */ + *pHash |= ((uint64_t)addrType << 48); /* 2 bits. */ + *pHash |= ((uint64_t)eventType << 50); /* 5 bits. */ + *pHash |= ((uint64_t)pktId << 55); /* 8 bits. */ +} + +/*************************************************************************************************/ +/*! + * \brief Check for duplicate report. + * + * \param pAdvFilt Advertising report filter data. + * \param hash Advertising report hash. + * + * \return TRUE if duplicate, FALSE is unique or filter is disabled. + */ +/*************************************************************************************************/ +bool_t lctrAdvRptCheckDuplicate(lctrAdvRptFilt_t *pAdvFilt, uint64_t hash) +{ + uint8_t i; + uint8_t headIdx = pAdvFilt->headIdx; + uint32_t validMask = pAdvFilt->validMask; + + if (!pAdvFilt->enable) + { + return FALSE; + } + + for (i = 0; i < LL_NUM_ADV_FILT; i++) + { + if (((validMask & (1 << i)) != 0) && (pAdvFilt->filtTbl[i] == hash)) + { + /* If this advertisement was the last received, do not modify table. */ + if (i != headIdx) + { + /* Rotate older entries into duplicate location. */ + unsigned int j = i; + unsigned int k = (j == LL_NUM_ADV_FILT - 1) ? 0 : (j + 1); + while (k != headIdx) + { + /* Stop when next entry not valid. */ + if ((validMask & (1 << k)) == 0) + { + validMask &= ~(1 << j); + break; + } + + /* Copy next entry to current location. */ + pAdvFilt->filtTbl[j] = pAdvFilt->filtTbl[k]; + + /* Move to next entry. */ + j = k; + k = (j == LL_NUM_ADV_FILT - 1) ? 0 : (j + 1); + } + + /* Back head to previous entry. */ + headIdx = (headIdx == 0) ? (LL_NUM_ADV_FILT - 1) : (headIdx - 1); + pAdvFilt->headIdx = headIdx; + + /* Copy entry to head of table. */ + pAdvFilt->validMask = validMask | (1 << headIdx); + pAdvFilt->filtTbl[headIdx] = hash; + } + + /* Duplicate found. */ + return TRUE; + } + } + + pAdvFilt->addToFiltTbl = TRUE; + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Add the new hash to the filter table. Using ring buffer to store the entries. + * + * \param pAdvFilt Advertising report filter data. + * \param hash Advertising report hash. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvRptAddEntry(lctrAdvRptFilt_t *pAdvFilt, uint64_t hash) +{ + uint8_t headIdx = pAdvFilt->headIdx; + uint32_t validMask = pAdvFilt->validMask; + + if (!pAdvFilt->enable) + { + return; + } + + WSF_ASSERT(pAdvFilt->addToFiltTbl == TRUE); + + /* Store advertiser address for filtering. */ + + /* Back head to previous entry. */ + headIdx = (headIdx == 0) ? (LL_NUM_ADV_FILT - 1) : (headIdx - 1); + pAdvFilt->headIdx = headIdx; + + /* Copy entry to head of table. */ + pAdvFilt->validMask = validMask | (1 << headIdx); + pAdvFilt->filtTbl[headIdx] = hash; + pAdvFilt->addToFiltTbl = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstScanInit(void) +{ + /* Add scan reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_SCAN] = lctrMstScanResetHandler; + + /* Add scan message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_SCAN] = (LctrMsgDisp_t)lctrMstScanDisp; + + /* Add scan event handlers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_ADVB] = lctrMstRxAdvBPduHandler; + lctrEventHdlrTbl[LCTR_EVENT_RX_DIRECT_ADVB] = lctrMstRxDirectAdvBPduHandler; + + LctrMstScanDefaults(); + + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_2) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_EXT_SCAN_FILT_POLICY; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstScanDefaults(void) +{ + memset(&lctrMstScan, 0, sizeof(lctrMstScan)); +} + +/*************************************************************************************************/ +/*! + * \brief Increment number of pending advertising reports. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvReportsInc(void) +{ + WSF_CS_INIT(cs); + + WSF_ASSERT(lmgrMstScanCb.numAdvReport < pLctrRtCfg->maxAdvReports); + + WSF_CS_ENTER(cs); + lmgrMstScanCb.numAdvReport++; + WSF_CS_EXIT(cs); +} + +/*************************************************************************************************/ +/*! + * \brief Decrement number of pending advertising reports. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrAdvReportsDec(void) +{ + WSF_CS_INIT(cs); + + WSF_ASSERT(lmgrMstScanCb.numAdvReport > 0); + + WSF_CS_ENTER(cs); + lmgrMstScanCb.numAdvReport--; + WSF_CS_EXIT(cs); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..15a2afcc9e5f42a8a5e64890c41f651510d744cb --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_master_ae.c @@ -0,0 +1,1398 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scanning operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master_ae.h" +#include "lctr_int_adv_master.h" +#include "lctr_api_adv_master_ae.h" +#include "lmgr_api_adv_master_ae.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_math.h" +#include "util/bstream.h" + +// TODO Hide in conn only file +#include "lctr_int_conn_master.h" + +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Extended scan operational context. */ +lctrExtScanCtx_t lctrMstExtScanTbl[LCTR_SCAN_PHY_TOTAL]; // TODO: share memory with legacy lctrMstScan + +/*! \brief Extended scan control block. */ +lctrExtScanCtrlBlk_t lctrMstExtScan; + +/*! \brief Periodic scan control block. */ +lctrPerCreateSyncCtrlBlk_t lctrPerCreateSync; + +/*! \brief Periodic Advertising message data. */ +LctrPerScanMsg_t *pLctrMstPerScanMsg; + +/*! \brief Periodic scan context table. */ +lctrPerScanCtx_t lctrMstPerScanTbl[LL_MAX_PER_SCAN]; + +/*! \brief Pointer to periodic scan context table. */ +lctrPerScanCtx_t *pLctrPerScanTbl; + +/*! \brief Extended scan data buffer table. */ +static uint8_t *lctrMstExtScanDataBufTbl[LCTR_SCAN_PHY_TOTAL]; + +/*! \brief Periodic scan data buffer table. */ +static uint8_t *lctrMstPerScanDataBufTbl[LL_MAX_PER_SCAN]; + +/*************************************************************************************************/ +/*! + * \brief Master create sync message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstCreateSyncDisp(LctrPerScanMsg_t *pMsg) +{ + pLctrMstPerScanMsg = pMsg; + + lctrMstCreateSyncExecuteSm(pMsg->hdr.event); +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstPerScanDisp(LctrPerScanMsg_t *pMsg) +{ + lctrPerScanCtx_t *pPerScanCtx; + pLctrMstPerScanMsg = pMsg; + + if (pMsg->hdr.dispId != LCTR_DISP_BCST) + { + WSF_ASSERT(pMsg->hdr.handle < LL_MAX_PER_SCAN); + pPerScanCtx = LCTR_GET_PER_SCAN_CTX(pMsg->hdr.handle); + + lctrMstPerScanExecuteSm(pPerScanCtx, pMsg->hdr.event); + } + else + { + unsigned int i; + /* Broadcast message to all contexts. */ + for (i = 0; i < LL_MAX_PER_SCAN; i++) + { + lctrMstPerScanExecuteSm(LCTR_GET_PER_SCAN_CTX(i), pMsg->hdr.event); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Periodic scanning reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstPerScanResetHandler(void) +{ + BbBlePerScanMasterInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Master extended scan reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtScanResetHandler(void) +{ + BbBleScanMasterInit(); + BbBleAuxScanMasterInit(); + LctrMstExtScanDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Execute common master scan state machine. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtScanExecuteCommonSm(LctrExtScanMsg_t *pMsg) +{ + /* Subsystem event handling. */ + switch (pMsg->hdr.event) + { + case LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=DISCOVER_ENABLE", lmgrCb.numScanEnabled, lmgrCb.scanMode); + + lctrMstExtScan.scanTermByHost = FALSE; + + /* Enable filter. */ + lctrMstExtScan.filtDup = pMsg->enable.filtDup; + lctrAdvRptEnable(&lctrMstExtScan.advFilt, + (lctrMstExtScan.filtDup == LL_SCAN_FILTER_DUP_DISABLE) ? FALSE: TRUE); + + /* Start/Restart timers. */ + WsfTimerStop(&lctrMstExtScan.tmrScanDur); + WsfTimerStop(&lctrMstExtScan.tmrScanPer); + + lctrMstExtScan.scanDurMs = pMsg->enable.durMs; + lctrMstExtScan.scanPerMs = pMsg->enable.perMs; + if (lctrMstExtScan.scanDurMs) + { + WsfTimerStartMs(&lctrMstExtScan.tmrScanDur, lctrMstExtScan.scanDurMs); + if (lctrMstExtScan.scanPerMs) + { + WsfTimerStartMs(&lctrMstExtScan.tmrScanPer, lctrMstExtScan.scanPerMs); + } + } + break; + + case LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=DISCOVER_DISABLE", lmgrCb.numScanEnabled, lmgrCb.scanMode); + + /* Disable timers. */ + WsfTimerStop(&lctrMstExtScan.tmrScanDur); + WsfTimerStop(&lctrMstExtScan.tmrScanPer); + break; + + case LCTR_EXT_SCAN_MSG_TERMINATE: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=TERMINATE", lmgrCb.numScanEnabled, lmgrCb.scanMode); + if (!lctrMstExtScan.scanTermByHost && + (lctrMstExtScan.scanPerMs == 0)) + { + LmgrSendScanTimeoutInd(); + } + break; + + case LCTR_EXT_SCAN_MSG_TMR_DUR_EXP: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=TMR_DUR_EXP", lmgrCb.numScanEnabled, lmgrCb.scanMode); + break; + + case LCTR_EXT_SCAN_MSG_TMR_PER_EXP: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=TMR_PER_EXP", lmgrCb.numScanEnabled, lmgrCb.scanMode); + /* Reset filter. */ + if (lctrMstExtScan.filtDup == LL_SCAN_FILTER_DUP_ENABLE_PERIODIC) + { + lctrAdvRptEnable(&lctrMstExtScan.advFilt, + (lctrMstExtScan.filtDup == LL_SCAN_FILTER_DUP_DISABLE) ? FALSE: TRUE); + } + + /* Restart timers. */ + WsfTimerStartMs(&lctrMstExtScan.tmrScanDur, lctrMstExtScan.scanDurMs); + WsfTimerStartMs(&lctrMstExtScan.tmrScanPer, lctrMstExtScan.scanPerMs); + break; + + case LCTR_EXT_SCAN_MSG_RESET: + LL_TRACE_INFO2("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=RESET", lmgrCb.numScanEnabled, lmgrCb.scanMode); + break; + + default: + LL_TRACE_ERR3("lctrMstExtScanExecuteCommonSm: numScanEnabled=%u, scanMode=%u, event=%u -- unknown event", lmgrCb.numScanEnabled, lmgrCb.scanMode, pMsg->hdr.event); + /* No action required. */ + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Master extended scan message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtScanDisp(LctrExtScanMsg_t *pMsg) +{ + lctrExtScanCtx_t *pExtScanCtx; + uint8_t event = pMsg->hdr.event; + + bool_t isBcstMsg = FALSE; + + if (pMsg->hdr.dispId == LCTR_DISP_BCST) + { + /* Global broadcast message. */ + isBcstMsg = TRUE; + } + + /* Set message property. */ + switch (event) + { + case LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE: + lctrMstExtScan.scanTermByHost = TRUE; + break; + default: + break; + } + + /* Remap subsystem message to context message. */ + switch (event) + { + case LCTR_EXT_SCAN_MSG_TMR_DUR_EXP: + event = LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE; + break; + case LCTR_EXT_SCAN_MSG_TMR_PER_EXP: + event = LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE; + break; + default: + break; + } + + /* Broadcast message. */ + switch (event) + { + case LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE: + case LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE: + isBcstMsg = TRUE; + break; + default: + break; + } + if (pMsg->hdr.handle == LCTR_SCAN_PHY_ALL) + { + isBcstMsg = TRUE; + } + + /* Route message to SM. */ + if (!isBcstMsg) + { + WSF_ASSERT(pMsg->hdr.handle < LCTR_SCAN_PHY_TOTAL); + if (lctrMstExtScan.enaPhys & (1 << pMsg->hdr.handle)) + { + pExtScanCtx = &lctrMstExtScanTbl[pMsg->hdr.handle]; + lctrMstExtScanExecuteSm(pExtScanCtx, event); + } + } + else + { + unsigned int i; + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtScan.enaPhys & (1 << i)) + { + pExtScanCtx = &lctrMstExtScanTbl[i]; + lctrMstExtScanExecuteSm(pExtScanCtx, event); + } + } + } + + lctrMstExtScanExecuteCommonSm(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send pending extended advertising report. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstSendPendingAdvRptHandler(void) +{ + if (LmgrIsExtCommandAllowed()) + { + unsigned int i; + /* Extended advertising report. */ + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + lctrExtScanCtx_t *pExtScanCtx = &lctrMstExtScanTbl[i]; + + if (pExtScanCtx->data.scan.advRptState == LCTR_RPT_STATE_COMP) + { + LmgrSendExtAdvRptInd(&pExtScanCtx->data.scan.advRpt); + pExtScanCtx->data.scan.advRptState = LCTR_RPT_STATE_IDLE; + } + } + + /* Periodic advertising report. */ + for (i = 0; i < LL_MAX_PER_SCAN; i++) + { + lctrPerScanCtx_t *pPerScanCtx = &lctrMstPerScanTbl[i]; + + if (pPerScanCtx->advRptState == LCTR_RPT_STATE_COMP) + { + LmgrSendPerAdvRptInd(&pPerScanCtx->advRpt); + pPerScanCtx->advRptState = LCTR_RPT_STATE_IDLE; + } + } + } + else + { + /* Legacy mode. */ + lctrMstRxAdvBPduHandler(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Build extended scan discovery operation. + * + * \param pExtScanCtx Extended scan context. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrMstExtDiscoverBuildOp(lctrExtScanCtx_t *pExtScanCtx) +{ + BbOpDesc_t * const pOp = &pExtScanCtx->scanBod; + BbBleData_t * const pBle = &pExtScanCtx->scanBleData; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstExtDiscoverEndOp; + pOp->abortCback = lctrMstExtDiscoverEndOp; + pOp->pCtx = pExtScanCtx; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_ADV_EVENT; + + pBle->chan.chanIdx = lctrScanChanSelectInit(lmgrMstScanCb.scanChanMap); + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + switch (LCTR_GET_EXT_SCAN_HANDLE(pExtScanCtx)) + { + case LCTR_SCAN_PHY_1M: + default: + pBle->chan.txPhy = pBle->chan.rxPhy = BB_PHY_BLE_1M; + break; + case LCTR_SCAN_PHY_CODED: + pBle->chan.txPhy = pBle->chan.rxPhy = BB_PHY_BLE_CODED; + break; + } + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_ADV_IND) | + (1 << LL_PDU_ADV_DIRECT_IND) | + (1 << LL_PDU_ADV_NONCONN_IND) | + (1 << LL_PDU_SCAN_RSP) | + (1 << LL_PDU_ADV_SCAN_IND) | + (1 << LL_PDU_ADV_EXT_IND); + if (pExtScanCtx->scanParam.scanFiltPolicy & LL_SCAN_FILTER_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + /* Local addresses that are resolvable and cannot be resolved are optionally allowed. */ + if (pExtScanCtx->scanParam.scanFiltPolicy & LL_SCAN_FILTER_RES_INIT_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_OPT); + } + + /*** BLE Scan Setup: Rx advertising packet ***/ + + pScan->scanChMap = lmgrMstScanCb.scanChanMap; + + pScan->rxAdvCback = lctrMstDiscoverRxExtAdvPktHandler; + pScan->rxAdvPostCback = lctrMstDiscoverRxExtAdvPktPostProcessHandler; + + if ((pScan->pRxAdvBuf = WsfMsgAlloc(LL_ADV_HDR_LEN + LL_EXT_ADV_HDR_MAX_LEN)) == NULL) + { + LL_TRACE_ERR0("Could not allocate advertising buffer"); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + /*** BLE Scan Setup: Tx scan request packet ***/ + + pScan->txReqCback = lctrMstDiscoverTxLegacyScanReqHandler; + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (pExtScanCtx->scanParam.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + switch (pExtScanCtx->scanParam.scanType) + { + case LL_SCAN_ACTIVE: + { + uint8_t *pBuf; + lctrScanReq_t scanReq = { 0 }; + + pExtScanCtx->reqPduHdr.pduType = LL_PDU_SCAN_REQ; + pExtScanCtx->reqPduHdr.len = LL_SCAN_REQ_PDU_LEN; + + pExtScanCtx->reqPduHdr.txAddrRnd = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + scanReq.scanAddr = pBle->pduFilt.localAddrMatch; + + /* Pack only known packet information, advertiser's address resolved in Rx handler. */ + pBuf = pExtScanCtx->reqBuf; + pBuf += LL_ADV_HDR_LEN; + /* pBuf += */ lctrPackScanReqPdu(pBuf, &scanReq); + + pScan->pTxReqBuf = pExtScanCtx->reqBuf; + pScan->txReqLen = LL_ADV_HDR_LEN + LL_SCAN_REQ_PDU_LEN; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txScanReqPduLen) + { + pScan->pTxReqBuf = llTesterCb.txScanReqPdu; + pScan->txReqLen = llTesterCb.txScanReqPduLen; + } +#endif + + break; + } + case LL_SCAN_PASSIVE: + default: + pScan->pTxReqBuf = NULL; + break; + } + + pExtScanCtx->reqPduHdr.chSel = LL_CH_SEL_1; + + /*** BLE Scan Setup: Rx scan response packet ***/ + + pScan->rxRspCback = lctrMstDiscoverRxLegacyScanRspHandler; + + switch (pExtScanCtx->scanParam.scanType) + { + case LL_SCAN_ACTIVE: + { + /* Allow only legacy scan response. */ + if ((pScan->pRxRspBuf = WsfMsgAlloc(LL_ADVB_MAX_LEN)) == NULL) + { + WsfMsgFree(pScan->pRxAdvBuf); + pScan->pRxAdvBuf = NULL; + + LL_TRACE_ERR0("Could not allocate scan response buffer"); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + break; + } + case LL_SCAN_PASSIVE: + default: + /* pScan->pRxRspBuf = NULL; */ /* cleared in alloc */ + break; + } + + /*** Commit operation ***/ + + pOp->minDurUsec = pOp->maxDurUsec = LCTR_BLE_TO_US(pExtScanCtx->scanParam.scanWindow); + + pExtScanCtx->selfTerm = FALSE; + pExtScanCtx->shutdown = FALSE; + + SchInsertNextAvailable(pOp); + pExtScanCtx->scanWinStart = pOp->due; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Build auxiliary scan discovery operation. + * + * \param pExtScanCtx Extended scan context. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrMstAuxDiscoverBuildOp(lctrExtScanCtx_t *pExtScanCtx) +{ + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pExtScanCtx->auxScanBod; + BbBleData_t * const pBle = &pExtScanCtx->auxBleData; + BbBleMstAuxAdvEvent_t * const pAuxScan = &pBle->op.mstAuxAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstAuxDiscoverEndOp; + pOp->abortCback = lctrMstAuxDiscoverEndOp; + pOp->pCtx = pExtScanCtx; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_AUX_ADV_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* write after ADV_EXT_IND is received */ + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + /* pBle->chan.txPhy = 0; */ /* write after ADV_EXT_IND is received */ + /* pBle->chan.rxPhy = 0; */ /* write after ADV_EXT_IND is received */ + /* pBle->chan.phyOptions = 0; */ /* write after ADV_EXT_IND is received */ + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_AUX_ADV_IND) | + (1 << LL_PDU_AUX_SCAN_RSP); + if (pExtScanCtx->scanParam.scanFiltPolicy & LL_SCAN_FILTER_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + /* Local addresses that are resolvable and cannot be resolved are optionally allowed. */ + if (pExtScanCtx->scanParam.scanFiltPolicy & LL_SCAN_FILTER_RES_INIT_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_OPT); + } + + /*** BLE Scan Setup: Rx packets ***/ + pAuxScan->isInit = FALSE; + pAuxScan->rxAuxAdvCback = lctrMstDiscoverRxAuxAdvPktHandler; + + /*** BLE Scan Setup: Tx scan request packet ***/ + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (pExtScanCtx->scanParam.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + switch (pExtScanCtx->scanParam.scanType) + { + case LL_SCAN_ACTIVE: + { + /* Use primary channel's SCAN_REQ PDU. */ + pAuxScan->pTxAuxReqBuf = pExtScanCtx->reqBuf; + pAuxScan->txAuxReqLen = sizeof(pExtScanCtx->reqBuf); + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txScanReqPduLen) + { + pAuxScan->pTxAuxReqBuf = llTesterCb.txScanReqPdu; + pAuxScan->txAuxReqLen = llTesterCb.txScanReqPduLen; + } +#endif + + break; + } + case LL_SCAN_PASSIVE: + default: + pAuxScan->pTxAuxReqBuf = NULL; + break; + } + + /*** BLE Scan Setup: Rx scan response packet ***/ + + pAuxScan->rxAuxRspCback = lctrMstDiscoverRxAuxScanRspHandler; + + /*** BLE Scan Setup: Rx chain packet ***/ + + pAuxScan->rxAuxChainCback = lctrMstDiscoverRxAuxChainHandler; + pAuxScan->rxAuxChainPostCback = lctrMstDiscoverRxAuxChainPostProcessHandler; + + /*** Commit operation ***/ + + /* pOp->minDurUsec = 0; */ /* Defer assignment until AuxPtr is received. */ + /* pOp->maxDurUsec = 0; */ /* Not used for aux scan. */ + + pExtScanCtx->selfTerm = FALSE; + pExtScanCtx->shutdown = FALSE; + pExtScanCtx->auxOpPending = FALSE; + + /* Defer scheduling until AuxPtr is received. */ + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Commit auxiliary discovery operation. + * + * \param pExtScanCtx Extended scan context. + * \param pAuxPtr Auxiliary Pointer. + * \param startTs Start of ADV_EXT_IND packet (offset origin). + * \param endTs End of ADV_EXT_IND packet. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstAuxDiscoverOpCommit(lctrExtScanCtx_t *pExtScanCtx, lctrAuxPtr_t *pAuxPtr, uint32_t startTs, uint32_t endTs) +{ + uint32_t auxOffsetUsec; + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pExtScanCtx->auxScanBod; + BbBleData_t * const pBle = &pExtScanCtx->auxBleData; + + /*** BLE General Setup ***/ + + pBle->chan.chanIdx = pAuxPtr->auxChIdx; + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_TX_PWR_BIT) + { + pBle->chan.txPower = pExtScanCtx->extAdvHdr.txPwr; + } + pBle->chan.txPhy = pBle->chan.rxPhy = lctrConvertAuxPtrPhyToBbPhy(pAuxPtr->auxPhy); + + /*** Commit operation ***/ + + WSF_ASSERT(pExtScanCtx->auxOpPending == FALSE); + + lctrMstComputeAuxOffset(pAuxPtr, &auxOffsetUsec, &pBle->op.mstAuxAdv.rxSyncDelayUsec); + + if (auxOffsetUsec < LL_BLE_MAFS_US) + { + LL_TRACE_WARN1("Peer requested AUX offset does not meet T_MAFS, actual afsUsec=%u", BB_US_TO_BB_TICKS(pOp->due - endTs)); + } + + pOp->due = startTs + BB_US_TO_BB_TICKS(auxOffsetUsec); + SchBleCalcAdvOpDuration(pOp); + + if (SchInsertAtDueTime(pOp, NULL)) + { + pExtScanCtx->auxOpPending = TRUE; + } + else + { + LL_TRACE_WARN1("Fail to schedule auxiliary scan, scanHandle=%u", LCTR_GET_EXT_SCAN_HANDLE(pExtScanCtx)); + } +} + + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtScanInit(void) +{ + /* Add extended scan message dispatchers. */ + lctrResetHdlrTbl[LCTR_DISP_EXT_SCAN] = lctrMstExtScanResetHandler; + + /* Add extended scan message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_EXT_SCAN] = (LctrMsgDisp_t)lctrMstExtScanDisp; + + /* Add extended scan event dispatchers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_ADVB] = lctrMstSendPendingAdvRptHandler; + + LctrMstExtScanDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtScanDefaults(void) +{ + static const LlScanParam_t defScanParam = + { + /*.scanInterval */ 0x0010, + /*.scanWindow */ 0x0010, + /*.scanType */ LL_SCAN_PASSIVE, + /*.ownAddrType */ LL_ADDR_PUBLIC, + /*.scanFiltPolicy */ LL_SCAN_FILTER_NONE + }; + unsigned int i; + lctrMsgHdr_t *pMsg; + + memset(&lctrMstExtScanTbl, 0, sizeof(lctrMstExtScanTbl)); + memset(&lctrMstExtScan, 0, sizeof(lctrMstExtScan)); + + lmgrCb.numExtScanPhys = 1; + lctrMstExtScanTbl[LCTR_SCAN_PHY_1M].scanParam = defScanParam; + lctrMstExtScan.enaPhys = 1 << LCTR_SCAN_PHY_1M; + + /* Assign buffers. */ + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + lctrMstExtScanTbl[i].pExtAdvData = lctrMstExtScanDataBufTbl[i]; + } + + /* Setup timers. */ + lctrMstExtScan.tmrScanDur.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&lctrMstExtScan.tmrScanDur.msg; + /* pMsg->handle = 0; */ /* Unused. */ + pMsg->dispId = LCTR_DISP_EXT_SCAN; + pMsg->event = LCTR_EXT_SCAN_MSG_TMR_DUR_EXP; + lctrMstExtScan.tmrScanPer.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&lctrMstExtScan.tmrScanPer.msg; + /* pMsg->handle = 0; */ /* Unused. */ + pMsg->dispId = LCTR_DISP_EXT_SCAN; + pMsg->event = LCTR_EXT_SCAN_MSG_TMR_PER_EXP; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize extended scanner memory resources. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint16_t LctrInitExtScanMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + unsigned int i; + + /* Extended Scanning requires receiving at least 251 bytes. */ + WSF_ASSERT(pLctrRtCfg->maxExtScanDataLen >= LL_EXT_ADVBU_MAX_LEN); + + + /* Allocate extended scan buffer memory. */ + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + lctrMstExtScanDataBufTbl[i] = pAvailMem; + pAvailMem += pLctrRtCfg->maxExtScanDataLen; + } + + /* Allocate periodic scan buffer memory. */ + for (i = 0; i < LL_MAX_PER_SCAN; i++) + { + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + lctrMstPerScanDataBufTbl[i] = pAvailMem; + pAvailMem += pLctrRtCfg->maxExtScanDataLen; + } + + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + LL_TRACE_ERR2("LctrInitExtScanMem: failed to allocate scan buffers, need=%u available=%u", (pAvailMem - pFreeMem), freeMemSize); + WSF_ASSERT(FALSE); + return 0; + } + + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Validate all scan parameters. + * + * \return TRUE if parameters are valid, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrMstExtScanValidateParam(void) +{ + if (!lmgrCb.bdAddrRndValid) + { + unsigned int i; + + /* Check for use of random address. */ + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtScan.enaPhys & (1 << i)) + { + if (!LmgrIsAddressTypeAvailable(lctrMstExtScanTbl[i].scanParam.ownAddrType)) + { + LL_TRACE_WARN1("Address type invalid or not available, ownAddrType=%u", lctrMstExtScanTbl[i].scanParam.ownAddrType); + return FALSE; + } + } + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set enabled scanning PHY. + * + * \param scanPhy Enabled scanning PHY. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtScanSetScanPhy(uint8_t scanPhy) +{ + WSF_ASSERT(scanPhy < LCTR_SCAN_PHY_TOTAL); + + lctrMstExtScan.enaPhys |= 1 << scanPhy; +} + +/*************************************************************************************************/ +/*! + * \brief Clear (disable) scanning PHY. + * + * \param scanPhy Disabled scanning PHY. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtScanClearScanPhy(uint8_t scanPhy) +{ + WSF_ASSERT(scanPhy < LCTR_SCAN_PHY_TOTAL); + + lctrMstExtScan.enaPhys &= ~(1 << scanPhy); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended scan parameters. + * + * \param scanPhy Extended scanning PHY. + * \param ownAddrType Address type used by this device. + * \param scanFiltPolicy Scan filter policy. + * \param pParam Extended scanning parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtScanSetParam(uint8_t scanPhy, uint8_t ownAddrType, uint8_t scanFiltPolicy, const LlExtScanParam_t *pParam) +{ + WSF_ASSERT(scanPhy < LCTR_SCAN_PHY_TOTAL); + + lctrMstExtScanTbl[scanPhy].scanParam.scanInterval = pParam->scanInterval; + lctrMstExtScanTbl[scanPhy].scanParam.scanWindow = pParam->scanWindow; + lctrMstExtScanTbl[scanPhy].scanParam.scanType = pParam->scanType; + lctrMstExtScanTbl[scanPhy].scanParam.ownAddrType = ownAddrType; + lctrMstExtScanTbl[scanPhy].scanParam.scanFiltPolicy = scanFiltPolicy; +} + +/*************************************************************************************************/ +/*! + * \brief Send internal extended scan subsystem message. + * + * \param pExtScanCtx Extended scan context. + * \param event Extended scan event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendExtScanMsg(lctrExtScanCtx_t *pExtScanCtx, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = (pExtScanCtx) ? LCTR_GET_EXT_SCAN_HANDLE(pExtScanCtx) : LCTR_SCAN_PHY_ALL; + pMsg->dispId = LCTR_DISP_EXT_SCAN; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send internal periodic create sync subsystem message. + * + * \param event Periodic scan event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendCreateSyncMsg(uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->dispId = LCTR_DISP_PER_CREATE_SYNC; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send internal periodic advertising subsystem message. + * + * \param pCtx Periodic scanning context. + * \param event Periodic advertising event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPerScanMsg(lctrPerScanCtx_t *pCtx, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = LCTR_GET_PER_SCAN_HANDLE(pCtx); + pMsg->dispId = LCTR_DISP_PER_SCAN; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if create sync is pending or not. + * + * \return TRUE if create sync is pending, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrMstPerIsSyncPending(void) +{ + return (lctrPerCreateSync.state == LCTR_CREATE_SYNC_STATE_DISCOVER); +} + +/*************************************************************************************************/ +/*! + * \brief Check if create sync is disabled. + * + * \return TRUE if create sync is disabled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrMstPerIsSyncDisabled(void) +{ + return (lctrPerCreateSync.state == LCTR_CREATE_SYNC_STATE_DISABLED); +} + +/*************************************************************************************************/ +/*! + * \brief Check if scanner is already sync with the same advertiser with the same advertising + * set. + * + * \param advSID Advertising SID. + * \param advAddrType Advertiser address type. + * \param advAddr Advertiser address. + * + * \return TRUE if already sync, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrMstPerIsSync(uint8_t advSID, uint8_t advAddrType, uint64_t advAddr) +{ + unsigned int index; + for (index = 0; index < LL_MAX_PER_SCAN; index++) + { + if (lctrMstPerScanTbl[index].enabled) + { + lctrPerScanCtx_t *pPerScanCtx = LCTR_GET_PER_SCAN_CTX(index); + + if ((pPerScanCtx->advSID == advSID) && + (pPerScanCtx->advAddrType == advAddrType) && + (pPerScanCtx->advAddr == advAddr)) + { + return TRUE; + } + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for master create sync. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstPerCreateSyncInit(void) +{ + /* Add create sync reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_PER_CREATE_SYNC] = NULL; /* Not needed. */ + + /* Add create sync task message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_PER_CREATE_SYNC] = (LctrMsgDisp_t)lctrMstCreateSyncDisp; + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_PER_ADV; + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for master periodic scanning. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstPerScanInit(void) +{ + /* Add periodic scanning reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_PER_SCAN] = lctrMstPerScanResetHandler; + + /* Add periodic scanning task message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_PER_SCAN] = (LctrMsgDisp_t)lctrMstPerScanDisp; + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_PER_ADV; + } + + lmgrPersistCb.perScanCtxSize = sizeof(lctrPerScanCtx_t); +} + +/*************************************************************************************************/ +/*! + * \brief Build periodic scan operation. + * + * \param pPerScanCtx Periodic scan context. + * \param pMsg Periodic create sync message. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrMstPerScanBuildOp(lctrPerScanCtx_t *pPerScanCtx, lctrPerCreateSyncMsg_t *pMsg) +{ + BbOpDesc_t * const pOp = &pPerScanCtx->bod; + BbBleData_t * const pBle = &pPerScanCtx->bleData; + BbBleMstPerScanEvent_t * const pPerScan = &pBle->op.mstPerScan; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_PERIODIC; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstPerScanEndOp; + pOp->abortCback = lctrMstPerScanEndOp; + pOp->pCtx = pPerScanCtx; + + /*** BLE General Setup ***/ + pBle->chan.opType = BB_BLE_OP_MST_PER_SCAN_EVENT; + + /*** BLE Scan Setup: Rx advertising packet ***/ + /*** BLE Scan Setup: Rx chain packet ***/ + pPerScan->rxPerAdvCback = lctrMstPerScanRxPerAdvPktHandler; + pPerScan->rxPerAdvPostCback = lctrMstPerScanRxPerAdvPktPostHandler; + + pPerScanCtx->shutdown = FALSE; + + /* Defer scheduling until SyncInfo is received. */ + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Commit periodic scan discovery operation. + * + * \param pExtScanCtx Extended scan context. + * \param pAuxPtr Auxiliary Pointer. + * \param pSyncInfo Sync info. + * \param startTs Start of AUX_ADV_IND packet (offset origin). + * \param endTs End of AUX_ADV_IND packet. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstPerScanOpCommit(lctrExtScanCtx_t *pExtScanCtx, lctrAuxPtr_t *pAuxPtr, + lctrSyncInfo_t *pSyncInfo, uint32_t startTs, uint32_t endTs) +{ + uint32_t syncOffsetUsec, offsetUsec, caPpm, wwUsec; + uint16_t dueOffsetUsec; + uint16_t numUnsyncIntervals = 0; + + /* Pre-resolve common structures for efficient access. */ + lctrPerScanCtx_t *pPerScanCtx = lctrPerCreateSync.pPerScanCtx; + BbOpDesc_t * const pOp = &pPerScanCtx->bod; + BbBleData_t * const pBle = &pPerScanCtx->bleData; + + /*** BLE General Setup for Channel ***/ + + pPerScanCtx->chanParam.chanMask = pSyncInfo->chanMap; + pPerScanCtx->chanParam.usedChSel = LL_CH_SEL_2; + + lctrPeriodicBuildRemapTable(&pPerScanCtx->chanParam); + pPerScanCtx->chanParam.chIdentifier = (pSyncInfo->accAddr >> 16) ^ + (pSyncInfo->accAddr >> 0); + + pBle->chan.chanIdx = lctrPeriodicSelectNextChannel(&pPerScanCtx->chanParam, pPerScanCtx->eventCounter); + + if (pExtScanCtx->extAdvHdr.extHdrFlags & LL_EXT_HDR_TX_PWR_BIT) + { + pBle->chan.txPower = pExtScanCtx->extAdvHdr.txPwr; + } + + pBle->chan.accAddr = pSyncInfo->accAddr; + pBle->chan.crcInit = pSyncInfo->crcInit; + /* FIXME: Only if scan enabled */ + pBle->chan.txPhy = pBle->chan.rxPhy = lctrConvertAuxPtrPhyToBbPhy(pAuxPtr->auxPhy); + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + /*** Commit operation ***/ + offsetUsec = pSyncInfo->syncOffset * ((pSyncInfo->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); + pPerScanCtx->lastAnchorPoint = startTs + BB_US_TO_BB_TICKS(offsetUsec); + pPerScanCtx->lastActiveEvent = pPerScanCtx->eventCounter; + caPpm = lctrCalcTotalAccuracy(pSyncInfo->sca); + wwUsec = lctrCalcAuxAdvWindowWideningUsec(offsetUsec, caPpm); + syncOffsetUsec = offsetUsec - wwUsec; + pPerScanCtx->rxSyncDelayUsec = pBle->op.mstPerScan.rxSyncDelayUsec = (wwUsec << 1) + ((pSyncInfo->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); /* rounding compensation */ + dueOffsetUsec = (offsetUsec - wwUsec) - BB_TICKS_TO_US(BB_US_TO_BB_TICKS(offsetUsec) - BB_US_TO_BB_TICKS(wwUsec)); + + if (syncOffsetUsec < LL_BLE_MAFS_US) + { + LL_TRACE_WARN1("Peer requested AuxPtr offset does not meet T_MAFS, actual afsUsec=%u", BB_US_TO_BB_TICKS(pOp->due - endTs)); + return; + } + + pOp->due = startTs + BB_US_TO_BB_TICKS(syncOffsetUsec); + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + SchBleCalcAdvOpDuration(pOp); + pPerScanCtx->minDurUsec = pOp->minDurUsec; + + while (TRUE) + { + uint32_t unsyncTimeUsec, unsyncTime,wwTotalUsec, wwTotal; + if (SchInsertAtDueTime(pOp, NULL)) + { + LL_TRACE_INFO1(" >>> Periodic scan started, handle=%u <<<", LCTR_GET_PER_SCAN_HANDLE(pPerScanCtx)); + LL_TRACE_INFO1(" pOp=%08x", pOp); + LL_TRACE_INFO1(" due=%u", pOp->due); + LL_TRACE_INFO1(" eventCounter=%u", pPerScanCtx->eventCounter); + LL_TRACE_INFO1(" pBle->chan.chanIdx=%u", pBle->chan.chanIdx); + + break; + } + + LL_TRACE_WARN0("!!! Start periodic scanning schedule conflict"); + + pPerScanCtx->eventCounter++; + pBle->chan.chanIdx = lctrPeriodicSelectNextChannel(&pPerScanCtx->chanParam, pPerScanCtx->eventCounter); + numUnsyncIntervals++; + + unsyncTimeUsec = BB_TICKS_TO_US(pPerScanCtx->perInter * numUnsyncIntervals); + unsyncTime = BB_US_TO_BB_TICKS(unsyncTimeUsec); + wwTotalUsec = lctrCalcAuxAdvWindowWideningUsec(unsyncTimeUsec, caPpm); + wwTotal = BB_US_TO_BB_TICKS(wwTotalUsec); + dueOffsetUsec = (unsyncTimeUsec - wwTotalUsec) - BB_TICKS_TO_US(unsyncTime - wwTotal); + + /* Advance to next interval. */ + pOp->due = pPerScanCtx->lastAnchorPoint + unsyncTime - wwTotal; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + pOp->minDurUsec = pPerScanCtx->minDurUsec + wwTotalUsec; + pBle->op.mstPerScan.rxSyncDelayUsec = pPerScanCtx->rxSyncDelayUsec + (wwTotalUsec << 1); + } + + lctrPerCreateSync.createSyncPending = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a periodic scan context. + * + * \return Periodic sync context. + */ +/*************************************************************************************************/ +lctrPerScanCtx_t *lctrAllocPerScanCtx(void) +{ + unsigned int index; + for (index = 0; index < LL_MAX_PER_SCAN; index++) + { + if (!lctrMstPerScanTbl[index].enabled) + { + lctrMsgHdr_t *pMsg; + lctrPerScanCtx_t *pCtx = LCTR_GET_PER_SCAN_CTX(index); + + memset(&lctrMstPerScanTbl[index], 0, sizeof(lctrPerScanCtx_t)); + + pCtx->enabled = TRUE; + + /* Setup periodic advertising data buffer. */ + pCtx->pPerAdvData = lctrMstPerScanDataBufTbl[index]; + + /* Setup supervision timer. */ + pCtx->tmrSupTimeout.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pCtx->tmrSupTimeout.msg; + pMsg->handle = index; + pMsg->dispId = LCTR_DISP_PER_SCAN; + pMsg->event = LCTR_PER_SCAN_SUP_TIMEOUT; + + /* Update once PHY is known). */ + pCtx->bleData.chan.txPhy = pCtx->bleData.chan.rxPhy = BB_PHY_BLE_1M; + + /* Default PHY. */ + pCtx->rxPhys = lmgrConnCb.rxPhys; + + return pCtx; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Convert PHY value to PHY value in extended advertising report. + * + * \param auxPtrPhy Auxiliary Pointer PHY field. + * + * \return LL PHY value. + */ +/*************************************************************************************************/ +uint8_t lctrConvertAuxPtrPhyToAdvRptPhy(uint8_t auxPtrPhy) +{ + switch (auxPtrPhy) + { + case 0: /* LE_1M */ + default: + return LL_PHY_LE_1M; + case 1: /* LE_2M */ + return LL_PHY_LE_2M; + case 2: /* LE_Coded */ + return LL_PHY_LE_CODED; + } +} + +/*************************************************************************************************/ +/*! + * \brief Convert AuxPtr PHY value to PHY value in extended advertising report. + * + * \param auxPtrPhy Auxiliary Pointer PHY field. + * + * \return BB PHY value. + */ +/*************************************************************************************************/ +uint8_t lctrConvertAuxPtrPhyToBbPhy(uint8_t auxPtrPhy) +{ + switch (auxPtrPhy) + { + case 0: /* LE_1M */ + default: + return BB_PHY_BLE_1M; + case 1: /* LE_2M */ + return BB_PHY_BLE_2M; + case 2: /* LE_Coded */ + return BB_PHY_BLE_CODED; + } +} + +/*************************************************************************************************/ +/*! + * \brief Compute the connection interval window widening delay in microseconds. + * + * \param unsyncTimeUsec Unsynchronized time in microseconds. + * \param caPpm Total clock accuracy. + * + * \return Window widening delay in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrCalcAuxAdvWindowWideningUsec(uint32_t unsyncTimeUsec, uint32_t caPpm) +{ + if (lctrGetOpFlag(LL_OP_MODE_FLAG_ENA_WW)) + { + /* Largest unsynchronized time is 1,996 seconds (interval=4s and latency=499) and + * largest total accuracy is 1000 ppm. */ + /* coverity[overflow_before_widen] */ + uint64_t wwDlyUsec = LL_MATH_DIV_10E6(((uint64_t)unsyncTimeUsec * caPpm) + + 999999); /* round up */ + + /* Reduce to 32-bits and always round up to a sleep clock tick. */ + return wwDlyUsec + pLctrRtCfg->ceJitterUsec; + } + else + { + return 0; + } +} + +/*************************************************************************************************/ +/*! + * \brief Compute auxiliary offset. + * + * \param pAuxPtr Auxiliary Pointer. + * \param pOffsetUsec Return auxiliary offset in microseconds. + * \param pSyncDelayUsec Return synchronization delay in microseconds. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstComputeAuxOffset(lctrAuxPtr_t *pAuxPtr, uint32_t *pOffsetUsec, uint32_t *pSyncDelayUsec) +{ + uint32_t offsetUsec = pAuxPtr->auxOffset * ((pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); + uint32_t caPpm = BbGetClockAccuracy() + ((pAuxPtr->ca == LCTR_CLK_ACC_0_50_PPM) ? 50 : 500); + uint32_t wwUsec = lctrCalcAuxAdvWindowWideningUsec(offsetUsec, caPpm); + + *pOffsetUsec = offsetUsec - wwUsec; + *pSyncDelayUsec = (wwUsec << 1) + ((pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); /* rounding compensation */ +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..18aff34d4c55a2c87d8084327d8b1564e7bb6d67 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave.c @@ -0,0 +1,540 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_ble_api.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_cs.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Advertising operational context. */ +lctrSlvAdvCtx_t lctrSlvAdv; + +/*! \brief Assert BB meets advertising PDU requirements. */ +WSF_CT_ASSERT((BB_FIXED_ADVB_PKT_LEN == 0) || + (BB_FIXED_ADVB_PKT_LEN >= LL_ADVB_MAX_LEN)); + +/*************************************************************************************************/ +/*! + * \brief Slave advertising reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvAdvResetHandler(void) +{ + BbBleAdvSlaveInit(); + LctrSlvAdvDefaults(); + LmgrSlvInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Slave advertising message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvAdvDisp(LctrAdvMsg_t *pMsg) +{ + lctrSlvAdvExecuteSm(pMsg->hdr.event); +} + +/*************************************************************************************************/ +/*! + * \brief Compute new access address. + * + * \return New access address value. + */ +/*************************************************************************************************/ +uint32_t lctrComputeAccessAddr(void) +{ + uint32_t accessAddr = LlMathRandNum(); + + /* + * The following code enforces a pattern to make sure the address meets all requirements + * (including requirements for the LE coded PHY). The pattern is + * + * 0byyyyyy1x 0xxxx1x0 xxxx1x0x xx11x0x1 + * + * with 2^5 choices for the upper six bits. This provides 2^5 * 2^16 = 2097152 variations. + */ + + /* Patterns for upper six bits. The lower row contains complemented values of the upper row. */ + static const uint8_t upperSixBits[] = + { + /* 000010 000100 000101 000110 001000 001100 001101 001110 010000 010001 010011 010111 010110 011000 011100 011110 */ + 0x08, 0x10, 0x14, 0x18, 0x20, 0x30, 0x34, 0x38, 0x40, 0x44, 0x4C, 0x5C, 0x58, 0x60, 0x70, 0x78, + /* 111101 111011 111010 111001 110111 110011 110010 110001 101111 101110 101100 101000 101001 100111 100011 100001 */ + 0xF4, 0xEC, 0xE8, 0xE4, 0xDC, 0xCC, 0xC8, 0xC4, 0xBC, 0xB8, 0xB0, 0xA0, 0xA4, 0x9C, 0x8C, 0x84 + }; + + /* Set the upper six bits. */ + accessAddr = (accessAddr & ~0xFC000000) | (upperSixBits[accessAddr >> 27] << 24); + + /* Set ones with the mask 0b00000010 00000100 00001000 00110001 */ + accessAddr |= 0x02040831; + + /* Clear zeros with the mask 0b00000000 10000001 00000010 00000100 */ + accessAddr &= ~0x00810204; + + return accessAddr; +} + +/*************************************************************************************************/ +/*! + * \brief Scan request post-processing. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvRxScanReq(void) +{ + lctrSlvScanReport_t *pScanReport; + wsfHandlerId_t handlerId; + + while ((pScanReport = WsfMsgDeq(&lctrSlvAdv.rxScanReqQ, &handlerId)) != NULL) + { + LlScanReportInd_t evt; + evt.hdr.param = 0; + evt.hdr.event = LL_SCAN_REPORT_IND; + evt.hdr.status = LL_SUCCESS; + + evt.peerAddr = pScanReport->scanIdAddr; + evt.peerAddrType = pScanReport->scanIdAddrType; + evt.peerRpa = 0; + + if ((evt.peerAddr != pScanReport->scanAddr) || + (evt.peerAddrType != pScanReport->scanAddrType)) + { + evt.peerAddrType |= LL_ADDR_IDENTITY_BIT; + evt.peerRpa = pScanReport->scanAddr; + } + + LmgrSendEvent((LlEvt_t *)&evt); + WsfMsgFree(pScanReport); + } +} + +/*************************************************************************************************/ +/*! + * \brief Choose Advertising Address. + * + * \param pBle BLE data. + * \param pPduHdr PDU header. + * \param ownAddrType Own address type. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * \param pAdvA Storage for AdvA. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrChooseAdvA(BbBleData_t * const pBle, lctrAdvbPduHdr_t *pPduHdr, + uint8_t ownAddrType, uint8_t peerAddrType, uint64_t peerAddr, + uint64_t *pAdvA) +{ + /* Choose advertiser's address type. */ + lmgrSlvAdvCb.ownAddrType = ownAddrType & ~LL_ADDR_IDENTITY_BIT; /* Fallback to non-RPA. */ + lmgrSlvAdvCb.localRpa = 0; + + /* Fallback onto non-RPA if local IRK is zero or peer address is not in resolving list. */ + if ((lmgrSlvAdvCb.ownAddrType == LL_ADDR_RANDOM_BIT) && + (lmgrCb.bdAddrRndValid)) + { + pPduHdr->txAddrRnd = TRUE; + *pAdvA = lmgrCb.bdAddrRnd; + lmgrCb.bdAddrRndModAdv = FALSE; + } + else + { + pPduHdr->txAddrRnd = FALSE; + *pAdvA = lmgrPersistCb.bdAddr; + } + + /* Generate local RPA for advertisement. */ + if (lmgrCb.addrResEna && (ownAddrType & LL_ADDR_IDENTITY_BIT)) + { + uint64_t localRpa; + + if (BbBleResListReadLocal(peerAddrType, peerAddr, &localRpa)) + { + /* Actually using RPA. Even though this is a RPA, any received local address will be strictly matched (never resolved). */ + pPduHdr->txAddrRnd = TRUE; + *pAdvA = localRpa; + lmgrSlvAdvCb.ownAddrType = ownAddrType; + lmgrSlvAdvCb.localRpa = localRpa; /* Save local RPA for connection complete event. */ + } + } + + /* Always match local address in PDU to advertiser's address. */ + pBle->pduFilt.localAddrMatch = *pAdvA; + if (pPduHdr->txAddrRnd) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Sometimes match peer address, but always match to command parameters. */ + pBle->pduFilt.peerAddrMatch = peerAddr; + if (peerAddrType) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_RAND); + } +} + +/*************************************************************************************************/ +/*! + * \brief Choose peer address. + * + * \param pBle BLE data. + * \param ownAddrType Own address type. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * \param pPeerRpa Storage for peer RPA. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrChoosePeerAddr(BbBleData_t * const pBle, uint8_t ownAddrType, + uint8_t peerAddrType, uint64_t peerAddr, uint64_t *pPeerRpa) +{ + if (lmgrCb.addrResEna) + { + /* Attempt to generate RPA for peer. */ + if (ownAddrType & LL_ADDR_IDENTITY_BIT) + { + BbBleResListGeneratePeer(peerAddrType, peerAddr, pPeerRpa); + } + /* Resolve peer RPAs whether or not a RPA was generated for peer. */ + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + } +} + +/*************************************************************************************************/ +/*! + * \brief Build advertising operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAdvBuildOp(void) +{ + uint64_t advA; + uint64_t peerRpa = 0; + uint8_t *pBuf; + BbOpDesc_t *pOp; + BbBleData_t *pBle; + BbBleSlvAdvEvent_t *pAdv; + + lctrAdvbPduHdr_t pduHdr = { 0 }; + + if ((lmgrCb.features & LL_FEAT_CH_SEL_2) && + ((lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_DIRECT_HIGH_DUTY) || + (lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_DIRECT_LOW_DUTY) || + (lmgrSlvAdvCb.advParam.advType == LL_ADV_CONN_UNDIRECT))) + { + pduHdr.chSel = LL_CH_SEL_2; + } + /* else use LL_CH_SEL_1 */ + + /* Pre-resolve common structures for efficient access. */ + pOp = &lctrSlvAdv.advBod; + pBle = &lctrSlvAdv.bleData; + pAdv = &pBle->op.slvAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvAdvEndOp; + pOp->abortCback = lctrSlvAdvEndOp; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_ADV_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* overridden by BB */ + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.rxPhy = BB_PHY_BLE_1M; + pBle->chan.txPhy = BB_PHY_BLE_1M; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + /* Activate white list only for undirected advertisement. */ + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + break; + default: + if (lmgrSlvAdvCb.advParam.advFiltPolicy & LL_ADV_FILTER_SCAN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_SCAN_REQ); + } + if (lmgrSlvAdvCb.advParam.advFiltPolicy & LL_ADV_FILTER_CONN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_CONNECT_IND); + } + break; + } + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pAdv->advChMap = lmgrSlvAdvCb.advParam.advChanMap; + + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_UNDIRECT: + pduHdr.pduType = LL_PDU_ADV_IND; + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_SCAN_REQ) | (1 << LL_PDU_CONNECT_IND); + break; + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + /* Advertising interval is determined by LL not host. */ + lmgrSlvAdvCb.advParam.advInterMin = 0; + lmgrSlvAdvCb.advParam.advInterMax = BB_BLE_TO_BB_TICKS(LL_DIR_ADV_INTER_TICKS); + lmgrSlvAdvCb.advTermCntDown = BB_BLE_TO_BB_TICKS(LL_DIR_ADV_DUR_TICKS); + /* no break */ + case LL_ADV_CONN_DIRECT_LOW_DUTY: + pduHdr.pduType = LL_PDU_ADV_DIRECT_IND; + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_CONNECT_IND); + break; + case LL_ADV_SCAN_UNDIRECT: + pduHdr.pduType = LL_PDU_ADV_SCAN_IND; + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_SCAN_REQ); + break; + case LL_ADV_NONCONN_UNDIRECT: + pduHdr.pduType = LL_PDU_ADV_NONCONN_IND; + break; + default: + return; + } + + /* Choose advertiser's address type. */ + lctrChooseAdvA(pBle, &pduHdr, lmgrSlvAdvCb.advParam.ownAddrType, + lmgrSlvAdvCb.advParam.peerAddrType, lmgrSlvAdvCb.advParam.peerAddr, + &advA); + + lctrChoosePeerAddr(pBle, lmgrSlvAdvCb.advParam.ownAddrType, + lmgrSlvAdvCb.advParam.peerAddrType, lmgrSlvAdvCb.advParam.peerAddr, + &peerRpa); + + pBuf = lctrSlvAdv.advBuf + LL_ADV_HDR_LEN; + switch (lmgrSlvAdvCb.advParam.advType) + { + /* Pack using generic advertising PDU construction. */ + case LL_ADV_CONN_UNDIRECT: + case LL_ADV_SCAN_UNDIRECT: + case LL_ADV_NONCONN_UNDIRECT: + default: + pduHdr.len = lctrPackAdvPdu(pBuf, advA, &lmgrSlvAdvCb.advData); + pBuf += pduHdr.len; + lmgrSlvAdvCb.advData.modified = FALSE; + break; + + /* Pack using directed advertising PDU construction. */ + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + { + uint8_t initAType = lmgrSlvAdvCb.advParam.peerAddrType; + uint64_t initA = lmgrSlvAdvCb.advParam.peerAddr; + if (peerRpa != 0) + { + initAType = TRUE; + initA = peerRpa; + } + + pduHdr.rxAddrRnd = initAType; + pduHdr.len = lctrPackConnDirectIndAdvPdu(pBuf, advA, initA); + pBuf += pduHdr.len; + + /* Always match peer address in PDU to initiator's address for directed advertising. */ + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_ENA); + break; + } + } + + lctrPackAdvbPduHdr(lctrSlvAdv.advBuf, &pduHdr); + + pAdv->txAdvLen = pBuf - lctrSlvAdv.advBuf; + pAdv->pTxAdvBuf = lctrSlvAdv.advBuf; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txAdvPduLen) + { + pAdv->txAdvLen = llTesterCb.txAdvPduLen; + pAdv->pTxAdvBuf = llTesterCb.txAdvPdu; + } +#endif + + /*** BLE Advertising Setup: Rx scan request/connection indication packet ***/ + + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_UNDIRECT: + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + case LL_ADV_SCAN_UNDIRECT: + { + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t) + BB_REQ_PDU_MAX_LEN)) != NULL) + { + pAdv->pRxReqBuf = (uint8_t *)(pMsg + 1); /* hide header */ + pAdv->rxReqCback = lctrSlvAdvHandler; + pAdv->rxReqPostCback = lctrSlvAdvPostProcessHandler; + } + else + { + /* Attempt to obtain buffer on next advertising operation. */ + LL_TRACE_ERR0("Could not allocate response buffer"); + // TODO need OOM recovery + } + break; + } + case LL_ADV_NONCONN_UNDIRECT: + default: + pAdv->pRxReqBuf = NULL; + break; + } + + /*** BLE Advertising Setup: Tx scan response packet ***/ + + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_UNDIRECT: + case LL_ADV_SCAN_UNDIRECT: + { + pduHdr.pduType = LL_PDU_SCAN_RSP; + pduHdr.len = LL_SCAN_PREFIX_LEN + lmgrSlvAdvCb.scanRspData.len; + + pBuf = lctrSlvAdv.scanRspBuf; + pBuf += lctrPackAdvbPduHdr(pBuf, &pduHdr); + pBuf += lctrPackScanRspPdu(pBuf, advA, &lmgrSlvAdvCb.scanRspData); + lmgrSlvAdvCb.scanRspData.modified = FALSE; + + pAdv->pTxRspBuf = lctrSlvAdv.scanRspBuf; + pAdv->txRspLen = pBuf - lctrSlvAdv.scanRspBuf; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txScanRspPduLen) + { + pAdv->pTxRspBuf = llTesterCb.txScanRspPdu; + pAdv->txRspLen = llTesterCb.txScanRspPduLen; + } +#endif + break; + } + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + case LL_ADV_NONCONN_UNDIRECT: + default: + pAdv->pTxRspBuf = NULL; + break; + } + + /*** Commit operation ***/ + + lctrSlvAdv.shutdown = FALSE; + lctrSlvAdv.connIndRcvd = FALSE; + SchBleCalcAdvOpDuration(pOp); + SchInsertNextAvailable(pOp); + + LL_TRACE_INFO1("### AdvEvent ### Advertising enabled, due=%u", pOp->due); +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup resources on advertising operation termination. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAdvCleanupOp(void) +{ + lctrMsgHdr_t *pMsg = (lctrMsgHdr_t *)lctrSlvAdv.bleData.op.slvAdv.pRxReqBuf; + + if (pMsg) + { + /* Recover header. */ + WsfMsgFree(pMsg - 1); + } + + LL_TRACE_INFO0("### AdvEvent ### Advertising disabled"); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for advertising slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvAdvInit(void) +{ + /* Add advertising reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_ADV] = lctrSlvAdvResetHandler; + + /* Add advertising message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_ADV] = (LctrMsgDisp_t)lctrSlvAdvDisp; + + /* Add advertising event handlers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_SCAN_REQ] = lctrSlvRxScanReq; + + LctrSlvAdvDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for advertising slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvAdvDefaults(void) +{ + memset(&lctrSlvAdv, 0, sizeof(lctrSlvAdv)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..78597c134c17736ab4bee9da5ac61441dc62b82d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c @@ -0,0 +1,2548 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave extended advertising operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave_ae.h" +#include "lctr_int_adv_slave.h" +#include "lctr_pdu_adv_ae.h" +#include "lctr_pdu_adv.h" +#include "lctr_int.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "bb_api.h" +#include "bb_drv.h" +#include "bb_ble_api_reslist.h" +#include "wsf_assert.h" +#include "wsf_buf.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/crc32.h" +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ +/*! \brief Advertising set table. */ +lctrAdvSet_t *pLctrAdvSetTbl; // TODO: share memory with legacy lctrSlvAdv + +/*! \brief Common storage for task message data (parameter passing to action routines). */ +LctrExtAdvMsg_t *pLctrSlvExtAdvMsg; + +/*! \brief Common storage for task message data (parameter passing to action routines). */ +LctrPerAdvMsg_t *pLctrSlvPerAdvMsg; + +/*! \brief Extended advertising operational context. */ +lctrSlvExtAdvCtx_t lctrSlvExtAdv; + +/*! \brief Extended advertising data buffer table. */ +static uint8_t *lctrExtAdvDataBufTbl[LL_MAX_ADV_SETS]; + +/*! \brief Periodic advertising data buffer table. */ +static uint8_t *lctrPerAdvDataBufTbl[LL_MAX_ADV_SETS]; + +/*************************************************************************************************/ +/*! + * \brief Calculate permutation. + * + * \param v Input value. + * + * \return Result of permutation calculation. + */ +/*************************************************************************************************/ +static uint32_t lctrCalcPerm(uint32_t v) +{ + uint32_t mask; + + /* abcd efgh ijkl mnop */ + mask = 0x0F0F0F0F; + v = ((v << 8) & mask) | (v & ~mask); + + /* efgh abcd mnop ijkl xxxx */ + mask = mask ^ (mask << 2); + v = ((v << 4) & mask) | (v & ~mask); + + /* gh efcd abop mnkl ijxx xxxx */ + mask = mask ^ (mask << 1); + v = ((v << 2) & mask) | (v & ~mask); + + /* hgf edcb apon mlkj ixxx xxxx */ + return v >> 7; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate MAM (Multiply, Add, Modulo). + * + * \param a Input value a. + * \param b Input value b. + * + * \return Result of MAM. + */ +/*************************************************************************************************/ +static uint16_t lctrCalcMAM(uint16_t a, uint16_t b) +{ + /* (17 x a + b) mod 2^16 */ + return ((17 * a) + b) & 0xFFFFF; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate DID. + * + * \param pBuf Data buffer. + * \param len Length of data buffer. + * + * \return DID value. + */ +/*************************************************************************************************/ +static uint16_t lctrCalcDID(const uint8_t *pBuf, uint16_t len) +{ + return CalcCrc32(LlMathRandNum(), len, pBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an advertising set. + * + * \param handle Advertising handle. + * + * \return Advertising set or NULL if at capacity. + */ +/*************************************************************************************************/ +static lctrAdvSet_t *lctrAllocAdvSet(uint8_t handle) +{ + unsigned int i; + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + lctrAdvSet_t *pAdvSet = &pLctrAdvSetTbl[i]; + + if (!pAdvSet->enabled) + { + lctrMsgHdr_t *pMsg; + memset(pAdvSet, 0, sizeof(lctrAdvSet_t)); + + pAdvSet->enabled = TRUE; + pAdvSet->handle = handle; + + /* Defaults. */ + pAdvSet->advDataFragLen = WSF_MAX(pLctrRtCfg->defExtAdvDataFrag, 1); + + /* Extended adv and scan response data buffer use is mutually exclusive; they share the same storage. */ + pAdvSet->advData.pBuf = lctrExtAdvDataBufTbl[i]; + pAdvSet->advData.ready = TRUE; + pAdvSet->scanRspData.pBuf = lctrExtAdvDataBufTbl[i]; + pAdvSet->scanRspData.ready = TRUE; + pAdvSet->perAdvData.pBuf = lctrPerAdvDataBufTbl[i]; + pAdvSet->perAdvData.ready = TRUE; + + /* Setup duration timer. */ + pAdvSet->tmrAdvDur.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pAdvSet->tmrAdvDur.msg; + pMsg->handle = pAdvSet->handle; + pMsg->dispId = LCTR_DISP_EXT_ADV; + pMsg->event = LCTR_EXT_ADV_MSG_TMR_DUR_EXP; + + LmgrIncResetRefCount(); + + return pAdvSet; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Free an advertising set. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrFreeAdvSet(lctrAdvSet_t *pAdvSet) +{ + WSF_ASSERT(pAdvSet->enabled); + pAdvSet->enabled = FALSE; + LmgrDecResetRefCount(); +} + +/*************************************************************************************************/ +/*! + * \brief Find an advertising set data. + * + * \param handle Advertising handle. + * + * \return Advertising set or NULL if not found. + */ +/*************************************************************************************************/ +static lctrAdvSet_t *lctrFindAdvSet(uint8_t handle) +{ + unsigned int i; + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + lctrAdvSet_t *pAdvSet = &pLctrAdvSetTbl[i]; + + if ((pAdvSet->handle == handle) && + (pAdvSet->enabled)) + { + return pAdvSet; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Update auxiliary channel. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSelectNextAuxChannel(lctrAdvSet_t *pAdvSet) +{ + pAdvSet->auxChIdx = LL_MATH_MOD_37(pAdvSet->auxChIdx + pAdvSet->auxChHopInc); +} + +/*************************************************************************************************/ +/*! + * \brief Update periodic channel. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSelectNextPerChannel(lctrAdvSet_t *pAdvSet) +{ + pAdvSet->perParam.perChIdx = LL_MATH_MOD_37(pAdvSet->perParam.perChIdx + pAdvSet->perParam.perChHopInc); +} + +/*************************************************************************************************/ +/*! + * \brief Compute next channel index, algorithm #2. + * + * \param pChanParam Channel parameters. + * \param eventCounter Event Counter. + * + * \return Next data channel index. + */ +/*************************************************************************************************/ +uint8_t lctrPeriodicSelectNextChannel(lctrChanParam_t *pChanParam, uint16_t eventCounter) +{ + unsigned int prn; + unsigned int prn_e; + uint16_t unmapChan; + + /* Pseudo random number */ + + prn = eventCounter ^ pChanParam->chIdentifier; + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pChanParam->chIdentifier); + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pChanParam->chIdentifier); + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pChanParam->chIdentifier); + /* uint16_t prn_s = prn; */ + prn_e = prn ^ pChanParam->chIdentifier; + + /* unmappedChannel */ + + unmapChan = LL_MATH_MOD_37(prn_e & 0xFFFF); + + pChanParam->lastChanIdx = unmapChan; + + /* remappingIndex */ + + if (!((UINT64_C(1) << unmapChan) & pChanParam->chanMask)) + { + /* remappingIndex = (N * prn_e) / 2^16 */ + uint8_t remapIdx = (pChanParam->numUsedChan * prn_e) >> 16; + return pChanParam->chanRemapTbl[remapIdx]; + } + + return unmapChan; +} + +/*************************************************************************************************/ +/*! + * \brief Extended advertising reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvExtAdvResetHandler(void) +{ + BbBleAdvSlaveInit(); + BbBleAuxAdvSlaveInit(); + LctrSlvExtAdvDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Slave extended advertising message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvExtAdvDisp(LctrExtAdvMsg_t *pMsg) +{ + lctrAdvSet_t *pAdvSet; + unsigned int i; + pLctrSlvExtAdvMsg = pMsg; + + if (pMsg->hdr.dispId != LCTR_DISP_BCST) + { + if ((pAdvSet = lctrFindAdvSet(pMsg->hdr.handle)) != NULL) + { + lctrSlvExtAdvExecuteSm(pAdvSet, pMsg->hdr.event); + } + } + else + { + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + pAdvSet = &pLctrAdvSetTbl[i]; + if (pAdvSet->enabled) + { + lctrSlvExtAdvExecuteSm(pAdvSet, pMsg->hdr.event); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Scan request post-processing. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvRxExtScanReq(void) +{ + LlScanReqRcvdInd_t *pScanReqRcvd; + wsfHandlerId_t handlerId; + + while ((pScanReqRcvd = WsfMsgDeq(&lctrSlvExtAdv.rxScanReqQ, &handlerId)) != NULL) + { + LmgrSendEvent((LlEvt_t *)&pScanReqRcvd); + WsfMsgFree(pScanReqRcvd); + } + + /* Handle legacy scan request. */ + lctrSlvRxScanReq(); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising or scan response data. + * + * \param pAdvSet Advertising set. + * \param pDataBuf Advertising or scan response data buffer descriptor. + * \param fragOp Fragment operation. + * \param fragPref Fragment preference. + * \param fragLen Fragment data buffer length. + * \param pFragBuf Fragment data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +static uint8_t lctrSetExtAdvDataSm(lctrAdvSet_t *pAdvSet, lctrAdvDataBuf_t *pDataBuf, uint8_t fragOp, + uint8_t fragPref, uint8_t fragLen, const uint8_t *pFragBuf) +{ + switch (fragOp) + { + case LL_ADV_DATA_OP_FRAG_INTER: + case LL_ADV_DATA_OP_FRAG_LAST: + if (pDataBuf->ready) + { + LL_TRACE_WARN2("Operation=%u missing a preceding LL_ADV_DATA_OP_FRAG_FIRST, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((pDataBuf->len + fragLen) > pLctrRtCfg->maxExtAdvDataLen) + { + /* Discard buffer. */ + pDataBuf->len = 0; + pDataBuf->ready = FALSE; + LL_TRACE_WARN2("Fragments exceeded maximum buffer length -- discarding buffer, maxExtAdvDataLen=%u, handle=%u", pLctrRtCfg->maxExtAdvDataLen, pAdvSet->handle); + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } + /* no break */ + case LL_ADV_DATA_OP_FRAG_FIRST: + if (pAdvSet->state != LCTR_EXT_ADV_STATE_DISABLED) /* e.g. advertising enabled */ + { + LL_TRACE_WARN2("Operation=%u not permitted when advertising enabled, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + if (fragLen == 0) + { + LL_TRACE_WARN2("Fragments for operation=%u must have data, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + case LL_ADV_DATA_OP_COMP: + /*** Complete single fragment buffer (no reassembly required) while advertising is enabled. ***/ + if (pAdvSet->state == LCTR_EXT_ADV_STATE_ENABLED) + { + pDataBuf->alt.ext.len = fragLen; + memcpy(pDataBuf->alt.ext.buf, pFragBuf, fragLen); + pDataBuf->alt.ext.did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->alt.ext.fragPref = fragPref; + pDataBuf->alt.ext.modified = TRUE; + + return LL_SUCCESS; + } + break; + case LL_ADV_DATA_OP_UNCHANGED: + if (pAdvSet->state == LCTR_EXT_ADV_STATE_DISABLED) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted when advertising disabled, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (fragLen > 0) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted with data fragment, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (pDataBuf->len == 0) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted when no data buffer present, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + default: + LL_TRACE_WARN2("Invalid operation=%u, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /*** Reassemble data buffer ***/ + + switch (fragOp) + { + case LL_ADV_DATA_OP_FRAG_INTER: + /* Append buffer. */ + memcpy(pDataBuf->pBuf + pDataBuf->len, pFragBuf, fragLen); + pDataBuf->len += fragLen; + pDataBuf->ready = FALSE; + break; + case LL_ADV_DATA_OP_FRAG_FIRST: + /* New buffer (discard old buffer). */ + memcpy(pDataBuf->pBuf, pFragBuf, fragLen); + pDataBuf->len = fragLen; + pDataBuf->ready = FALSE; + break; + case LL_ADV_DATA_OP_FRAG_LAST: + /* Append buffer. */ + memcpy(pDataBuf->pBuf + pDataBuf->len, pFragBuf, fragLen); + pDataBuf->len += fragLen; + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->fragPref = fragPref; + pDataBuf->ready = TRUE; + break; + case LL_ADV_DATA_OP_COMP: + /* New buffer (discard old buffer). */ + memcpy(pDataBuf->pBuf, pFragBuf, fragLen); + pDataBuf->len = fragLen; + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->fragPref = fragPref; + pDataBuf->ready = TRUE; + break; + case LL_ADV_DATA_OP_UNCHANGED: + /* Same buffer. */ + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->fragPref = fragPref; + pDataBuf->ready = TRUE; + break; + default: + /* coverity[dead_error_begin] */ + break; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising data. + * + * \param pAdvSet Advertising set. + * \param pDataBuf Advertising or scan response data buffer descriptor. + * \param fragOp Fragment operation. + * \param fragLen Fragment data buffer length. + * \param pFragBuf Fragment data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +static uint8_t lctrSetPerAdvDataSm(lctrAdvSet_t *pAdvSet, lctrAdvDataBuf_t *pDataBuf, uint8_t fragOp, + uint8_t fragLen, const uint8_t *pFragBuf) +{ + switch (fragOp) + { + case LL_ADV_DATA_OP_FRAG_INTER: + case LL_ADV_DATA_OP_FRAG_LAST: + if (pDataBuf->ready) + { + LL_TRACE_WARN2("Operation=%u missing a preceding LL_ADV_DATA_OP_FRAG_FIRST, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((pDataBuf->len + fragLen) > pLctrRtCfg->maxExtAdvDataLen) + { + /* Discard buffer. */ + pDataBuf->len = 0; + pDataBuf->ready = FALSE; + LL_TRACE_WARN2("Fragments exceeded maximum buffer length -- discarding buffer, maxExtAdvDataLen=%u, handle=%u", pLctrRtCfg->maxExtAdvDataLen, pAdvSet->handle); + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } + /* no break */ + case LL_ADV_DATA_OP_FRAG_FIRST: + if (pAdvSet->perParam.perState != LCTR_PER_ADV_STATE_DISABLED) /* e.g. advertising enabled */ + { + LL_TRACE_WARN2("Operation=%u not permitted when periodic advertising enabled, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + if (fragLen == 0) + { + LL_TRACE_WARN2("Fragments for operation=%u must have data, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + case LL_ADV_DATA_OP_COMP: + /*** Complete single fragment buffer (no reassembly required) while advertising is enabled. ***/ + if (pAdvSet->perParam.perState == LCTR_PER_ADV_STATE_ENABLED) + { + pDataBuf->alt.ext.len = fragLen; + memcpy(pDataBuf->alt.ext.buf, pFragBuf, fragLen); + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->alt.ext.modified = TRUE; + + return LL_SUCCESS; + } + break; + case LL_ADV_DATA_OP_UNCHANGED: + if (pAdvSet->perParam.perState == LCTR_PER_ADV_STATE_DISABLED) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted when periodic advertising disabled, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (fragLen > 0) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted with data fragment, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (pDataBuf->len == 0) + { + LL_TRACE_WARN1("Operation=LL_ADV_DATA_OP_UNCHANGED not permitted when no data buffer present, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + default: + LL_TRACE_WARN2("Invalid operation=%u, handle=%u", fragOp, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /*** Reassemble data buffer ***/ + + switch (fragOp) + { + case LL_ADV_DATA_OP_FRAG_INTER: + /* Append buffer. */ + memcpy(pDataBuf->pBuf + pDataBuf->len, pFragBuf, fragLen); + pDataBuf->len += fragLen; + pDataBuf->ready = FALSE; + break; + case LL_ADV_DATA_OP_FRAG_FIRST: + /* New buffer (discard old buffer). */ + memcpy(pDataBuf->pBuf, pFragBuf, fragLen); + pDataBuf->len = fragLen; + pDataBuf->ready = FALSE; + break; + case LL_ADV_DATA_OP_FRAG_LAST: + /* Append buffer. */ + memcpy(pDataBuf->pBuf + pDataBuf->len, pFragBuf, fragLen); + pDataBuf->len += fragLen; + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->ready = TRUE; + break; + case LL_ADV_DATA_OP_COMP: + /* New buffer (discard old buffer). */ + memcpy(pDataBuf->pBuf, pFragBuf, fragLen); + pDataBuf->len = fragLen; + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->ready = TRUE; + break; + case LL_ADV_DATA_OP_UNCHANGED: + /* Same buffer. */ + pDataBuf->did = lctrCalcDID(pFragBuf, fragLen); + pDataBuf->ready = TRUE; + break; + default: + /* coverity[dead_error_begin] */ + break; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set legacy advertising or scan response data. + * + * \param pAdvSet Advertising set. + * \param pDataBuf Advertising data buffer descriptor. + * \param fragOp Fragment operation. + * \param len Fragment data buffer length. + * \param pData Fragment data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +static uint8_t lctrSetLegacyAdvDataSm(lctrAdvSet_t *pAdvSet, lctrAdvDataBuf_t *pDataBuf, + uint8_t fragOp, uint8_t len, const uint8_t *pData) +{ + if (fragOp != LL_ADV_DATA_OP_COMP) + { + LL_TRACE_WARN1("Legacy advertising does not accept data fragments, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (len > LL_ADVBU_MAX_LEN) + { + LL_TRACE_WARN2("Exceeded maximum legacy data buffer size=%u, handle=%u", LL_ADVBU_MAX_LEN, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Legacy buffers always stored in cache (exclusive buffer). */ + pDataBuf->alt.legacy.len = len; + memcpy(pDataBuf->alt.legacy.buf, pData, len); + + if (pAdvSet->state == LCTR_EXT_ADV_STATE_ENABLED) + { + /* Always complete. */ + pDataBuf->ready = TRUE; + } + + pDataBuf->alt.legacy.modified = TRUE; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Build extended advertising (primary channel) operation. + * + * \param pAdvSet Advertising set. + * \param maxStartMs Maximum allowable start time in milliseconds, or 0 for no maximum. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrSlvExtAdvBuildOp(lctrAdvSet_t *pAdvSet, uint32_t maxStartMs) +{ + BbOpDesc_t * const pOp = &pAdvSet->advBod; + BbBleData_t * const pBle = &pAdvSet->bleData; + BbBleSlvAdvEvent_t * const pAdv = &pBle->op.slvAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvExtAdvEndOp; + pOp->abortCback = lctrSlvExtAdvEndOp; + pOp->pCtx = pAdvSet; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_ADV_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* overridden by BB */ + pBle->chan.txPower = pAdvSet->param.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.txPhy = pAdvSet->param.priAdvPhy; + pBle->chan.rxPhy = pAdvSet->param.priAdvPhy; + + /* Set PHY options to default behavior for ADV_EXT_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.wlPduTypeFilt = 0; + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_SCAN_REQ) | (1 << LL_PDU_CONNECT_IND); + + /* Activate white list only for undirected advertisement. */ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_DIRECT_ADV_BIT) == 0) + { + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) + { + if (pAdvSet->param.advFiltPolicy & LL_ADV_FILTER_SCAN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_SCAN_REQ); + } + } + + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) + { + if (pAdvSet->param.advFiltPolicy & LL_ADV_FILTER_CONN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_CONNECT_IND); + } + } + } + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pAdv->advChMap = pAdvSet->param.priAdvChanMap; + + pAdv->txAdvSetupCback = lctrSlvTxSetupExtAdvHandler; + + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) + { + const uint8_t LEGACY_HIGH_DUTY = (LL_ADV_EVT_PROP_LEGACY_ADV_BIT | LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | + LL_ADV_EVT_PROP_DIRECT_ADV_BIT | LL_ADV_EVT_PROP_CONN_ADV_BIT); + /* Advertising interval is determined by LL for high duty cycle directed adv. */ + if ((pAdvSet->param.advEventProp & LEGACY_HIGH_DUTY) == LEGACY_HIGH_DUTY ) + { + pAdvSet->param.priAdvInterMin = 0; + pAdvSet->param.priAdvInterMax = BB_BLE_TO_BB_TICKS(LL_DIR_ADV_INTER_TICKS); + pAdvSet->param.priAdvTermCntDown = BB_US_TO_BB_TICKS(pLctrSlvExtAdvMsg->enable.durMs * 1000); + } + + pAdv->txAdvLen = lctrPackLegacyAdvPdu(pAdvSet, pAdvSet->advHdrBuf); + } + else + { + pAdv->txAdvLen = lctrPackAdvExtIndPdu(pAdvSet, pAdvSet->advHdrBuf, FALSE); + } + pAdv->pTxAdvBuf = pAdvSet->advHdrBuf; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.txAdvPduLen) + { + pAdv->pTxAdvBuf = llTesterCb.txAdvPdu; + pAdv->txAdvLen = llTesterCb.txAdvPduLen; + } +#endif + + /* Primary channel scan */ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) && + /* Either connectable or scannable. */ + (pAdvSet->param.advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT))) + { + /*** BLE Advertising Setup: Rx scan request packet ***/ + + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t) + BB_REQ_PDU_MAX_LEN)) != NULL) + { + pAdv->pRxReqBuf = (uint8_t *)(pMsg + 1); /* hide header */ + pAdv->rxReqCback = lctrSlvRxLegacyReqHandler; + pAdv->rxReqPostCback = lctrSlvRxLegacyReqPostProcessHandler; + } + else + { + LL_TRACE_ERR0("Could not allocate request buffer"); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + /*** BLE Advertising Setup: Tx scan response packet ***/ + + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) + { + pAdv->txRspLen = lctrPackLegacyScanRspPdu(pAdvSet, pAdvSet->scanRspHdrBuf); + pAdv->pTxRspBuf = pAdvSet->scanRspHdrBuf; + } + +#if (LL_ENABLE_TESTER == TRUE) + if (llTesterCb.txScanRspPduLen) + { + pAdv->txRspLen = llTesterCb.txScanRspPduLen; + pAdv->pTxRspBuf = llTesterCb.txScanRspPdu; + } +#endif + } + + /*** Commit operation ***/ + + /* Setup auxiliary channel before primary channel operation calls lctrSlvTxSetupExtAdvHandler(). */ + pAdvSet->auxChHopInc = lctrComputeHopInc(); + lctrSelectNextAuxChannel(pAdvSet); + + SchBleCalcAdvOpDuration(pOp); + + if (pLctrSlvExtAdvMsg->enable.durMs) + { + uint32_t maxTime; + pOp->due = BbDrvGetCurrentTime() + BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs()); + + maxTime = BB_US_TO_BB_TICKS(maxStartMs * 1000); + if (!SchInsertEarlyAsPossible(pOp, 0, maxTime)) + { + LL_TRACE_WARN1("Could not enable ExtAdv operation within given durMs=%u", maxStartMs); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + else + { + SchInsertNextAvailable(pOp); + } + + LL_TRACE_INFO1("### ExtAdvEvent ### Advertising enabled, due=%u", pOp->due); + + /* Advertising offloading to auxiliary channel. */ + if (pAdvSet->pExtAdvAuxPtr) + { + switch (pAdvSet->param.advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)) + { + case LL_ADV_EVT_PROP_NON_CONN_NON_SCAN: + /* Setup auxiliary non-connectable, non-scannable operation. */ + lctrSlvAuxNonConnNonScanBuildOp(pAdvSet); + pAdvSet->auxBodUsed = TRUE; + break; + case LL_ADV_EVT_PROP_SCAN_ADV_BIT: + /* Setup auxiliary scan operation. */ + lctrSlvAuxScanBuildOp(pAdvSet); + pAdvSet->auxBodUsed = TRUE; + break; + case LL_ADV_EVT_PROP_CONN_ADV_BIT: + if (pLctrRtCfg->maxConn > 0) + { + /* Setup auxiliary connect operation. */ + lctrSlvAuxConnBuildOp(pAdvSet); + pAdvSet->auxBodUsed = TRUE; + } + else + { + LL_TRACE_ERR0("Extended connectable advertising not supported"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + case LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT: + default: + LL_TRACE_ERR0("Connectable and scannable extended advertising not valid"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Update AuxPtr now that AUX packet is ready. */ + lctrSlvTxSetupExtAdvHandler(pOp, pOp->due); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Reschedule auxiliary operation. + * + * \param pAdvSet Advertising set. + * \param pOp Auxiliary BOD. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAuxRescheduleOp(lctrAdvSet_t *pAdvSet, BbOpDesc_t * const pOp) +{ + uint32_t auxOffs = BB_US_TO_BB_TICKS(pAdvSet->advBod.minDurUsec + + WSF_MAX(BbGetSchSetupDelayUs(), LL_BLE_MAFS_US) + + WSF_MAX(pAdvSet->auxDelayUsec, pLctrRtCfg->auxDelayUsec)); + auxOffs = WSF_MIN(auxOffs, BB_US_TO_BB_TICKS(LL_AUX_PTR_MAX_USEC)); + + pOp->due = pAdvSet->advBod.due + auxOffs; + + if (pAdvSet->auxSkipInter == 0) + { + do + { + /* No delay after primary channel operation. */ + if (SchInsertAtDueTime(pOp, NULL)) + { + break; + } + + LL_TRACE_WARN1("!!! AuxAdv schedule conflict at due=%u", BB_TICKS_TO_US(pOp->due)); + LL_TRACE_WARN1("!!! handle=%u", pAdvSet->handle); + /* Try next advertising interval. */ + pOp->due += pAdvSet->param.priAdvInterMax; + + } while (TRUE); + } + else + { + do + { + /* Link multiple primary channel operations. */ + if (SchInsertLateAsPossible(pOp, 0, pAdvSet->auxSkipInter)) + { + break; + } + + /* Try next skip interval. */ + pOp->due += pAdvSet->auxSkipInter; + + /* TODO restart advertising at next skip interval or use large skip? */ + + LL_TRACE_WARN1("!!! AuxAdv schedule conflict at due=%u", pOp->due); + LL_TRACE_WARN1("!!! handle=%u", pAdvSet->handle); + + } while (TRUE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Commit auxiliary operation. + * + * \param pAdvSet Advertising set. + * \param pOp Auxiliary BOD. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvAuxCommitOp(lctrAdvSet_t *pAdvSet, BbOpDesc_t * const pOp) +{ + SchBleCalcAdvOpDuration(pOp); + + if (pAdvSet->param.secAdvMaxSkip) + { + uint32_t advEvtDur = BB_US_TO_BB_TICKS(pAdvSet->advBod.minDurUsec); + + uint32_t skipTimeUsec = pAdvSet->param.secAdvMaxSkip * /* number of skip events */ + (BB_TICKS_TO_US(pAdvSet->param.priAdvInterMin) + /* minimum interval */ + ((LL_MAX_ADV_DLY_MS >> 1) * 1000)) + /* average advDelay */ + (LL_MAX_ADV_DLY_MS * 1000); /* ensure no overlap due to advDelay */ + skipTimeUsec = WSF_MIN(skipTimeUsec, + LCTR_AUX_PTR_MAX_OFFSET * 300); /* limit maximum */ + + pAdvSet->auxSkipInter = WSF_MAX(BB_US_TO_BB_TICKS(skipTimeUsec), advEvtDur); /* ensure minimum */ + } + + lctrSlvAuxRescheduleOp(pAdvSet, pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Build auxiliary non-connectable and non-scannable operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAuxNonConnNonScanBuildOp(lctrAdvSet_t *pAdvSet) +{ + BbOpDesc_t *pOp; + BbBleData_t *pBle; + BbBleSlvAuxAdvEvent_t *pAuxAdv; + + /* Must be non-connectable, non-scannable. */ + WSF_ASSERT((pAdvSet->param.advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)) == 0); + + pOp = &pAdvSet->auxAdvBod; + pBle = &pAdvSet->auxBleData; + pAuxAdv = &pBle->op.slvAuxAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvAuxAdvEndOp; + pOp->abortCback = lctrSlvAuxAdvEndOp; + pOp->pCtx = pAdvSet; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_AUX_ADV_EVENT; + + pBle->chan.chanIdx = pAdvSet->auxChIdx; + pBle->chan.txPower = pAdvSet->param.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.txPhy = pAdvSet->param.secAdvPhy; + pBle->chan.rxPhy = pAdvSet->param.secAdvPhy; + + /* Set PHY options to default behavior for AUX_ADV_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.auxAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.auxAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.auxCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.auxCrcInitTx ^ pBle->chan.crcInit; +#endif + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pAuxAdv->txAuxSetupCback = lctrSlvTxSetupAuxAdvDataHandler; + + pAdvSet->advData.txOffs = 0; + pAuxAdv->txAuxAdvPdu[0].pBuf = pAdvSet->auxAdvHdrBuf; + /* pAuxAdv->txAuxAdvPdu[0].len = 0; */ /* Cleared in memset(). */ + /* Auxiliary advertising buffer setup dynamically in lctrSlvTxSetupAuxAdvDataHandler(). */ + /* pAuxAdv->txAuxAdvPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxAdvPdu[1].len = 0; */ + + /*** BLE Advertising Setup: Rx request packet ***/ + + pAuxAdv->pRxAuxReqBuf = NULL; + pAuxAdv->rxAuxReqCback = NULL; + + /*** BLE Advertising Setup: Tx scan response packet ***/ + + /* pAuxAdv->txAuxRspPdu[0].len = 0; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxRspPdu[0].pBuf = NULL; */ + /* pAuxAdv->txAuxRspPdu[1].len = 0; */ + /* pAuxAdv->txAuxRspPdu[1].pBuf = NULL; */ + + /*** BLE Advertising Setup: Tx chain indication packet ***/ + + pAuxAdv->txAuxChainPdu[0].pBuf = pAdvSet->auxAdvHdrBuf; + /* Chain buffer setup dynamically in lctrSlvTxSetupAuxAdvDataHandler(). */ + /* pAuxAdv->txAuxChainPdu[0].len = 0; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxChainPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxChainPdu[1].len = 0; */ + + /*** Commit operation ***/ + + lctrSlvAuxCommitOp(pAdvSet, pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Build auxiliary scannable operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAuxScanBuildOp(lctrAdvSet_t *pAdvSet) +{ + BbOpDesc_t * const pOp = &pAdvSet->auxAdvBod; + BbBleData_t * const pBle = &pAdvSet->auxBleData; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + lctrMsgHdr_t *pMsg; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvAuxAdvEndOp; + pOp->abortCback = lctrSlvAuxAdvEndOp; + pOp->pCtx = pAdvSet; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_AUX_ADV_EVENT; + + pBle->chan.chanIdx = pAdvSet->auxChIdx; + pBle->chan.txPower = pAdvSet->param.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.txPhy = pAdvSet->param.secAdvPhy; + pBle->chan.rxPhy = pAdvSet->param.secAdvPhy; + + /* Set PHY options to default behavior for AUX_ADV_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.auxAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.auxAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.auxCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.auxCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.wlPduTypeFilt = 0; + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_AUX_SCAN_REQ); + + /* Activate white list only for undirected advertisement. */ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_DIRECT_ADV_BIT) == 0) + { + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) + { + if (pAdvSet->param.advFiltPolicy & LL_ADV_FILTER_SCAN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_AUX_SCAN_REQ); + } + } + } + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pAdvSet->advData.txOffs = 0; + pAuxAdv->txAuxAdvPdu[0].pBuf = pAdvSet->auxAdvHdrBuf; + pAuxAdv->txAuxAdvPdu[0].len = lctrPackAuxAdvIndPdu(pAdvSet, pAdvSet->auxAdvHdrBuf, NULL, FALSE); + /* pAuxAdv->txAuxAdvPdu[1].pBuf = NULL; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxAdvPdu[1].len = 0; */ + + /*** BLE Advertising Setup: Rx request packet ***/ + + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t) + LL_ADV_HDR_LEN + LL_SCAN_REQ_PDU_LEN)) != NULL) + { + pAuxAdv->pRxAuxReqBuf = (uint8_t *)(pMsg + 1); /* hide header */ + pAuxAdv->rxAuxReqCback = lctrSlvRxAuxScanReqHandler; + pAuxAdv->rxAuxReqPostCback = lctrSlvRxAuxScanReqPostProcessHandler; + } + else + { + LL_TRACE_ERR0("Could not allocate request buffer"); + pAdvSet->termReason = LL_ERROR_CODE_UNSPECIFIED_ERROR; + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + } + + /*** BLE Advertising Setup: Tx scan response packet ***/ + + pAdvSet->scanRspData.txOffs = 0; + pAuxAdv->txAuxRspPdu[0].pBuf = pAdvSet->auxRspHdrBuf; + /* Scan response buffer setup dynamically in lctrSlvTxSetupAuxScanRspDataHandler(). */ + /* pAuxAdv->txAuxRspPdu[0].len = 0; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxRspPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxRspPdu[1].len = 0; */ + + /*** BLE Advertising Setup: Tx chain indication packet ***/ + + pAuxAdv->txAuxSetupCback = lctrSlvTxSetupAuxScanRspDataHandler; + + pAuxAdv->txAuxChainPdu[0].pBuf = pAdvSet->auxRspHdrBuf; + /* Chain buffer setup dynamically in lctrSlvTxSetupAuxScanRspDataHandler(). */ + /* pAuxAdv->txAuxChainPdu[0].len = 0; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxChainPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxChainPdu[1].len = 0; */ + + /*** Commit operation ***/ + + pAdvSet->auxBleData.chan.chanIdx = pAdvSet->auxChIdx; + lctrSlvAuxCommitOp(pAdvSet, pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Build auxiliary connectable operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAuxConnBuildOp(lctrAdvSet_t *pAdvSet) +{ + BbOpDesc_t * const pOp = &pAdvSet->auxAdvBod; + BbBleData_t * const pBle = &pAdvSet->auxBleData; + BbBleSlvAuxAdvEvent_t * const pAuxAdv = &pBle->op.slvAuxAdv; + lctrMsgHdr_t *pMsg; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvAuxAdvEndOp; + pOp->abortCback = lctrSlvAuxAdvEndOp; + pOp->pCtx = pAdvSet; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_AUX_ADV_EVENT; + + pBle->chan.chanIdx = pAdvSet->auxChIdx; + pBle->chan.txPower = pAdvSet->param.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.txPhy = pAdvSet->param.secAdvPhy; + pBle->chan.rxPhy = pAdvSet->param.secAdvPhy; + + /* Set PHY options to default behavior for AUX_ADV_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.auxAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.auxAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.auxCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.auxCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.wlPduTypeFilt = 0; + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_AUX_CONNECT_REQ); + + /* Activate white list only for undirected advertisement. */ + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_DIRECT_ADV_BIT) == 0) + { + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) + { + if (pAdvSet->param.advFiltPolicy & LL_ADV_FILTER_CONN_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt |= (1 << LL_PDU_AUX_CONNECT_REQ); + } + } + } + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pAdvSet->advData.txOffs = 0; + pAuxAdv->txAuxAdvPdu[0].pBuf = pAdvSet->auxAdvHdrBuf; + pAuxAdv->txAuxAdvPdu[0].len = lctrPackAuxAdvIndPdu(pAdvSet, pAdvSet->auxAdvHdrBuf, &pAdvSet->advData, FALSE); + /* Only complete AdvData allowed AUX_ADV_IND (CHAIN_IND not allowed). */ + pAuxAdv->txAuxAdvPdu[1].pBuf = pAdvSet->advData.pBuf; + pAuxAdv->txAuxAdvPdu[1].len = pAdvSet->advData.len; + + /*** BLE Advertising Setup: Rx request packet ***/ + + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t) + LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN)) != NULL) + { + pAuxAdv->pRxAuxReqBuf = (uint8_t *)(pMsg + 1); /* hide header */ + pAuxAdv->rxAuxReqCback = lctrSlvRxAuxConnReqHandler; + } + else + { + LL_TRACE_ERR0("Could not allocate request buffer"); + pAdvSet->termReason = LL_ERROR_CODE_UNSPECIFIED_ERROR; + lctrSendAdvSetMsg(pAdvSet, LCTR_EXT_ADV_MSG_TERMINATE); + } + + /*** BLE Advertising Setup: Tx scan response packet ***/ + + pAuxAdv->txAuxRspPdu[0].pBuf = pAdvSet->auxRspHdrBuf; + pAuxAdv->txAuxRspPdu[0].len = lctrPackAuxConnRspPdu(pAdvSet, pAdvSet->auxRspHdrBuf, FALSE); + /* pAuxAdv->txAuxRspPdu[1].pBuf = NULL; */ /* Cleared in memset(). */ + /* pAuxAdv->txAuxRspPdu[1].len = 0; */ + + /*** BLE Advertising Setup: Tx chain indication packet ***/ + + /* pAuxAdv->txAuxSetupCback = NULL; */ /* Cleared in memset(). */ + + /* pAuxAdv->txAuxChainPdu[0].pBuf = NULL; */ + /* pAuxAdv->txAuxChainPdu[0].len = 0; */ + /* pAuxAdv->txAuxChainPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxChainPdu[1].len = 0; */ + + /*** Commit operation ***/ + + lctrSlvAuxCommitOp(pAdvSet, pOp); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for advertising slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvExtAdvInit(void) +{ + /* Add extended advertising reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_EXT_ADV] = lctrSlvExtAdvResetHandler; + + /* Add extended advertising task message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_EXT_ADV] = (LctrMsgDisp_t)lctrSlvExtAdvDisp; + + /* Add advertising task event handlers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_SCAN_REQ] = lctrSlvRxExtScanReq; + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_EXT_ADV; + } + + LctrSlvExtAdvDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for advertising slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvExtAdvDefaults(void) +{ + memset(pLctrAdvSetTbl, 0, (sizeof(lctrAdvSet_t) * pLctrRtCfg->maxAdvSets)); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize advertising set memory resources. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint16_t LctrInitAdvSetMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + unsigned int i; + + /*** Advertising Set Context ***/ + + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + LL_TRACE_INFO2(" RAM: %u x %u bytes -- advertising set context", pLctrRtCfg->maxAdvSets, sizeof(lctrAdvSet_t)); + + /* Allocate context memory. */ + pLctrAdvSetTbl = (lctrAdvSet_t *)pAvailMem; + pAvailMem += sizeof(lctrAdvSet_t) * pLctrRtCfg->maxAdvSets; + + /* Allocate adv/scan rsp buffer memory. */ + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + lctrExtAdvDataBufTbl[i] = pAvailMem; + pAvailMem += pLctrRtCfg->maxExtAdvDataLen; + } + + /* Allocate periodic adv buffer memory. */ + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + lctrPerAdvDataBufTbl[i] = pAvailMem; + pAvailMem += pLctrRtCfg->maxExtAdvDataLen; + } + + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + LL_TRACE_ERR2("LctrInitAdvSetMem: failed to allocate advertising set context, need=%u available=%u", (pAvailMem - pFreeMem), freeMemSize); + WSF_ASSERT(FALSE); + return 0; + } + + lmgrPersistCb.advSetCtxSize = sizeof(lctrAdvSet_t); + + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Is set extended advertising enable parameter valid + * + * \param enable True if enable extented adv, False otherwise. + * \param pEnaParam Set extended adv enable parameters. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LctrIsExtAdvEnableParamValid(uint8_t enable, LlExtAdvEnableParam_t *pEnaParam) +{ + lctrAdvSet_t *pAdvSet; + const uint8_t LEGACY_HIGH_DUTY = (LL_ADV_EVT_PROP_LEGACY_ADV_BIT | LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | + LL_ADV_EVT_PROP_DIRECT_ADV_BIT | LL_ADV_EVT_PROP_CONN_ADV_BIT); + const uint8_t HIGH_DUTY_MAX_DURATION = 128; /* unit in 10ms. */ + + if (enable == FALSE) + { + /* Skip validation if enable is False. */ + return LL_SUCCESS; + } + + if ((pAdvSet = lctrFindAdvSet(pEnaParam->handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + /* Advertising interval is determined by LL for high duty cycle directed adv. */ + if ((pAdvSet->param.advEventProp & LEGACY_HIGH_DUTY) == LEGACY_HIGH_DUTY ) + { + if ((pEnaParam->duration > HIGH_DUTY_MAX_DURATION) || + (pEnaParam->duration == 0)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Is advertising set ready for enable? + * + * \param handle Advertising handle. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LctrIsExtAdvEnableReady(uint8_t handle) +{ + lctrAdvSet_t *pAdvSet; + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if (!pAdvSet->advData.ready || !pAdvSet->scanRspData.ready) + { + LL_TRACE_WARN1("Incomplete AdvData or ScanRspData buffer, handle=%u", handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + switch (pAdvSet->param.ownAddrType) + { + case LL_ADDR_RANDOM: + case LL_ADDR_RANDOM_IDENTITY: + if (!pAdvSet->bdAddrRndValid) + { + LL_TRACE_WARN1("Random address not available, handle=%u", handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + break; + default: + break; + } + + if (((pAdvSet->param.advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_LEGACY_ADV_BIT)) == + (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_LEGACY_ADV_BIT)) && /* Extended advertising with legacy PDU. */ + (pAdvSet->advData.len > LL_ADVBU_MAX_LEN)) + { + LL_TRACE_WARN1("AdvData too large with legacy connectable advertising, handle=%u", handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + else if (((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) == + LL_ADV_EVT_PROP_CONN_ADV_BIT) && /* Extended advertising PDU. */ + (pAdvSet->advData.len > (LL_EXT_ADVB_MAX_LEN - LL_ADV_HDR_LEN - LL_EXT_ADV_HDR_MAX_LEN))) /* Assume maximum advertising header length. */ + { + LL_TRACE_WARN1("AdvData too large with extended connectable advertising, handle=%u", handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Check if the advertising handle is valid. + * + * \param handle Advertising handle. + * + * \return TRUE if valid, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrIsAdvHandleValid(uint8_t handle) +{ + return (lctrFindAdvSet(handle) != NULL); +} + +/*************************************************************************************************/ +/*! + * \brief Get extended advertising TX power level. + * + * \param handle Advertising handle. + * \param pLevel Transmit power level. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LctrGetExtAdvTxPowerLevel(uint16_t handle, int8_t *pLevel) +{ + lctrAdvSet_t *pAdvSet; + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + *pLevel = BbBleRfGetActualTxPower(pAdvSet->param.advTxPwr, FALSE); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get a list of active advertising handles. + * + * \param pHandles Table to store advertising handles. + * + * \return Number of active advertising handles. + */ +/*************************************************************************************************/ +uint8_t LctrGetAdvHandles(uint8_t pHandles[LL_MAX_ADV_SETS]) +{ + unsigned int numHandles = 0; + + unsigned int i; + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + lctrAdvSet_t *pAdvSet = &pLctrAdvSetTbl[i]; + + if (pAdvSet->enabled) + { + pHandles[numHandles++] = pAdvSet->handle; + } + } + + return numHandles; +} + +/*************************************************************************************************/ +/*! + * \brief Set advertising set random device address. + * + * \param handle Advertising handle. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Set the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtAdvSetRandAddr(uint8_t handle, const uint8_t *pAddr) +{ + lctrAdvSet_t *pAdvSet; + uint64_t bdAddr; + + WSF_CS_INIT(cs); + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) && + (pAdvSet->state != LCTR_EXT_ADV_STATE_DISABLED)) + { + LL_TRACE_WARN1("Cannot modify AdvSet's random address when connectable advertising, handle=%u", handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BSTREAM_TO_BDA64(bdAddr, pAddr); +#ifndef __CROSSWORKS + /* Check BD Random Address type. */ + switch (bdAddr & LL_RAND_ADDR_TYPE_MASK) + { + case LL_RAND_ADDR_TYPE_STATIC: + case LL_RAND_ADDR_TYPE_RPA: + case LL_RAND_ADDR_TYPE_NRPA: + /* Valid types. */ + break; + default: + LL_TRACE_WARN0("Invalid random address type"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } +#else + // Crossworks doesn't like the 64 bit switch value + if(((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_STATIC) && + ((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_RPA) && + ((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_NRPA)) { + + LL_TRACE_WARN0("Invalid random address type"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } +#endif + + WSF_CS_ENTER(cs); + pAdvSet->bdAddrRnd = bdAddr; + pAdvSet->bdAddrRndValid = TRUE; + pAdvSet->bdAddrRndMod = TRUE; + + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Choose Advertising Address for a advertising set. + * + * \param pPduHdr PDU header. + * \param pBle BLE operation data. + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrChooseSetAdvA(lctrAdvbPduHdr_t *pPduHdr, BbBleData_t * const pBle, lctrAdvSet_t *pAdvSet) +{ + /* TODO: Update with privacy implementation: Create context fields in pAdvSet instead of using lmgrSlvAdvCb. */ + + /* Choose advertiser's address type. */ + lmgrSlvAdvCb.ownAddrType = pAdvSet->param.ownAddrType & ~LL_ADDR_IDENTITY_BIT; /* Fallback to non-RPA. */ + lmgrSlvAdvCb.localRpa = 0; + + /* Fallback onto non-RPA if local IRK is zero or peer address is not in resolving list. */ + if ((lmgrSlvAdvCb.ownAddrType == LL_ADDR_RANDOM_BIT) && + (pAdvSet->bdAddrRndValid)) + { + pPduHdr->txAddrRnd = TRUE; + pAdvSet->advA = pAdvSet->bdAddrRnd; + pAdvSet->bdAddrRndMod = FALSE; + } + else + { + pPduHdr->txAddrRnd = FALSE; + pAdvSet->advA = lmgrPersistCb.bdAddr; + } + + /* Generate local RPA for advertisement. */ + if (lmgrCb.addrResEna && (pAdvSet->param.ownAddrType & LL_ADDR_IDENTITY_BIT)) + { + uint64_t localRpa; + + if (BbBleResListReadLocal(pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, &localRpa)) + { + /* Actually using RPA. Even though this is a RPA, any received local address will be strictly matched (never resolved). */ + pPduHdr->txAddrRnd = TRUE; + pAdvSet->advA = localRpa; + lmgrSlvAdvCb.ownAddrType = pAdvSet->param.ownAddrType; + lmgrSlvAdvCb.localRpa = localRpa; /* Save local RPA for connection complete event. */ + } + } + + /* Always match local address in PDU to advertiser's address. */ + pBle->pduFilt.localAddrMatch = pAdvSet->advA; + if (pPduHdr->txAddrRnd) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Sometimes match peer address, but always match to command parameters. */ + pBle->pduFilt.peerAddrMatch = pAdvSet->param.peerAddr; + if (pAdvSet->param.peerAddrType) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_RAND); + } +} + +/*************************************************************************************************/ +/*! + * \brief Choose target address for a advertising set. + * + * \param pPduHdr PDU header. + * \param pBle BLE data. + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrChooseSetPeerA(lctrAdvbPduHdr_t *pPduHdr, BbBleData_t * const pBle, lctrAdvSet_t *pAdvSet) +{ + pPduHdr->rxAddrRnd = pAdvSet->param.peerAddrType; + pAdvSet->tgtA = pAdvSet->param.peerAddr; + + if (lmgrCb.addrResEna) + { + /* Attempt to generate RPA for peer. */ + if (pAdvSet->param.ownAddrType & LL_ADDR_IDENTITY_BIT) + { + uint64_t peerRpa = 0; + + if (BbBleResListReadPeer(pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, &peerRpa) == FALSE) + { + BbBleResListGeneratePeer(pAdvSet->param.peerAddrType, pAdvSet->param.peerAddr, &peerRpa); + } + + if (peerRpa != 0) + { + pPduHdr->rxAddrRnd = TRUE; + pAdvSet->tgtA = peerRpa; + } + } + /* Resolve peer RPAs whether or not a RPA was generated for peer. */ + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + } +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising set random device address. + * + * \param handle Advertising handle. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Get the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LctrGetExtAdvSetRandAddr(uint8_t handle, uint8_t *pAddr) +{ + lctrAdvSet_t *pAdvSet; + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + BDA64_TO_BSTREAM(pAddr, pAdvSet->bdAddrRnd); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising parameters. + * + * \param handle Advertising handle. + * \param pExtAdvParam Extended advertising parameters. + * + * \return Status error code. + * + * Set extended advertising parameters. + * + * \note This function must only be called when advertising for this set is disabled. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtAdvParam(uint8_t handle, LlExtAdvParam_t *pExtAdvParam) +{ + lctrAdvSet_t *pAdvSet; + bool_t propUpdate = TRUE; + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + if ((pAdvSet = lctrAllocAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } + propUpdate = FALSE; + } + + if (pAdvSet->state != LCTR_EXT_ADV_STATE_DISABLED) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (propUpdate && (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT)) + { + /* Transition from legacy to extended advertising; copy from exclusive buffer. */ + pAdvSet->advData.len = pAdvSet->advData.alt.legacy.len; + memcpy(pAdvSet->advData.pBuf, pAdvSet->advData.alt.legacy.buf, pAdvSet->advData.alt.legacy.len); + pAdvSet->scanRspData.len = pAdvSet->scanRspData.alt.legacy.len; + memcpy(pAdvSet->scanRspData.pBuf, pAdvSet->scanRspData.alt.legacy.buf, pAdvSet->scanRspData.alt.legacy.len); + } + + if ((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) + { + if (pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) + { + if (pAdvSet->scanRspData.len) + { + LL_TRACE_WARN1("Invalid scan response data buffer set with connectable advertising, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + else if (pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) + { + if (pAdvSet->advData.len) + { + LL_TRACE_WARN1("Invalid advertising data buffer set with scannable advertising, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + else /* ((pExtAdvParam->advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)) == 0) */ + { + if (pAdvSet->scanRspData.len) + { + LL_TRACE_WARN1("Invalid scan response data buffer set with non-scannable and non-connectable advertising, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + } + else /* (pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) */ + { + if (propUpdate && ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0)) + { + /* Transition from extended to legacy. */ + if (pAdvSet->advData.len > LL_ADVBU_MAX_LEN) + { + LL_TRACE_WARN2("Invalid advertising data buffer length=%u, handle=%u", pAdvSet->advData.len, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (pAdvSet->scanRspData.len > LL_ADVBU_MAX_LEN) + { + LL_TRACE_WARN2("Invalid scan response data buffer length=%u, handle=%u", pAdvSet->scanRspData.len, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Copy to exclusive buffer. */ + pAdvSet->advData.alt.legacy.len = pAdvSet->advData.len; + memcpy(pAdvSet->advData.alt.legacy.buf, pAdvSet->advData.pBuf, pAdvSet->advData.len); + pAdvSet->scanRspData.alt.legacy.len = pAdvSet->scanRspData.len; + memcpy(pAdvSet->scanRspData.alt.legacy.buf, pAdvSet->scanRspData.pBuf, pAdvSet->scanRspData.len); + } + else + { + if (pAdvSet->advData.len > LL_ADVBU_MAX_LEN) + { + LL_TRACE_WARN2("Invalid advertising data buffer length=%u, handle=%u", pAdvSet->advData.len, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (pAdvSet->scanRspData.len > LL_ADVBU_MAX_LEN) + { + LL_TRACE_WARN2("Invalid scan response data buffer length=%u, handle=%u", pAdvSet->scanRspData.len, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + } + + pAdvSet->param.advEventProp = pExtAdvParam->advEventProp; + pAdvSet->param.priAdvInterMin = pExtAdvParam->priAdvInterMin; + pAdvSet->param.priAdvInterMax = pExtAdvParam->priAdvInterMax; + pAdvSet->param.priAdvChanMap = pExtAdvParam->priAdvChanMap; + pAdvSet->param.ownAddrType = pExtAdvParam->ownAddrType; + pAdvSet->param.peerAddrType = pExtAdvParam->peerAddrType; + pAdvSet->param.peerAddr = BstreamToBda64(pExtAdvParam->pPeerAddr); + pAdvSet->param.advFiltPolicy = pExtAdvParam->advFiltPolicy; + pAdvSet->param.advTxPwr = pExtAdvParam->advTxPwr; + pAdvSet->param.priAdvPhy = pExtAdvParam->priAdvPhy; + pAdvSet->param.secAdvMaxSkip = pExtAdvParam->secAdvMaxSkip; + pAdvSet->param.secAdvPhy = pExtAdvParam->secAdvPhy; + pAdvSet->param.advSID = pExtAdvParam->advSID; + pAdvSet->param.scanReqNotifEna = pExtAdvParam->scanReqNotifEna; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtAdvData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData) +{ + uint8_t result; + + lctrAdvSet_t *pAdvSet; + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) + { + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) + { + LL_TRACE_WARN1("Cannot add advertising data buffer with scannable advertising, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((len > 0) && (pAdvSet->scanRspData.len > 0)) + { + LL_TRACE_WARN1("Extended advertising data buffer already in use, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + result = lctrSetExtAdvDataSm(pAdvSet, &pAdvSet->advData, op, fragPref, len, pData); + } + else + { + if ((result = lctrSetLegacyAdvDataSm(pAdvSet, &pAdvSet->advData, op, len, pData)) == LL_SUCCESS) + { + pAdvSet->advData.fragPref = LL_ADV_DATA_FRAG_DISALLOW; + } + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising parameters. + * + * \param handle Advertising handle. + * \param pPerAdvParam Periodic advertising parameters. + * + * \return Status error code. + * + * Set periodic advertising parameters. + * + */ +/*************************************************************************************************/ +uint8_t LctrSetPeriodicAdvParam(uint8_t handle, LlPerAdvParam_t *pPerAdvParam) +{ + lctrAdvSet_t *pAdvSet; + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if (pAdvSet->perParam.perAdvEnabled == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Anonymous advertising is not allowed for periodic advertising. */ + if (pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_OMIT_AA_BIT) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + pAdvSet->perParam.advInterMin = BB_US_TO_BB_TICKS(LCTR_PER_INTER_TO_US(pPerAdvParam->perAdvInterMin)); /* Convert ms to bb ticks */ + pAdvSet->perParam.advInterMax = BB_US_TO_BB_TICKS(LCTR_PER_INTER_TO_US(pPerAdvParam->perAdvInterMax)); /* Convert ms to bb ticks */ + pAdvSet->perParam.advEventProp = pPerAdvParam->perAdvProp; + pAdvSet->perParam.advParamReady = TRUE; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param len Data buffer length. + * \param pData Periodic advertising data buffer. + * + * \return Status error code. + * + * Set periodic advertising data. + */ +/*************************************************************************************************/ +uint8_t LctrSetPeriodicAdvData(uint8_t handle, uint8_t op, uint8_t len, const uint8_t *pData) +{ + uint8_t result; + lctrAdvSet_t *pAdvSet; + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if ((pAdvSet->perParam.advParamReady == FALSE) || /* Adv set is not configured for periodic adv. */ + (pAdvSet->perParam.perAdvEnabled == TRUE && op != LL_ADV_DATA_OP_COMP) || /* When periodic adv is enabled, complete data shall be provided. Never gonna happen. */ + (len == 0 && op != LL_ADV_DATA_OP_COMP)) /* Existing data shall be deleted and no new data provided. */ + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((result = lctrSetPerAdvDataSm(pAdvSet, &pAdvSet->perAdvData, op, len, pData)) == LL_SUCCESS) + { + pAdvSet->perAdvData.fragPref = LL_ADV_DATA_FRAG_DISALLOW; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Enable/disable periodic advertising. + * + * \param handle Advertising handle. + * \param enable Set periodic advertising enabled/disabled. + * + * \return Status error code. + * + * Enable/disable periodic advertising. + */ +/*************************************************************************************************/ +void LctrSetPeriodicAdvEnable(uint8_t handle, bool_t enable) +{ + lctrAdvSet_t *pAdvSet; + LctrPerAdvEnableMsg_t *pMsg; + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + LmgrSendPeriodicAdvEnableCnf(handle, LL_ERROR_CODE_UNKNOWN_ADV_ID); + return; + } + + if (pAdvSet->perParam.advParamReady == FALSE || /* Periodic advertising parameters shall be set. */ + pAdvSet->perAdvData.ready == FALSE || /* Periodic advertising data shall be complete. */ + (pAdvSet->param.advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT | /* Only non-connectable and non-scannable is allowed. */ + LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | LL_ADV_EVT_PROP_OMIT_AA_BIT)))/* No high duty cycle, No anonymous advertising. */ + { + LmgrSendPeriodicAdvEnableCnf(handle, LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_PER_ADV; + pMsg->hdr.event = enable ? LCTR_PER_ADV_MSG_START : LCTR_PER_ADV_MSG_STOP; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set extended scan response data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return Status error code. + * + * Set extended scan response data. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtScanRespData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData) +{ + uint8_t result; + + lctrAdvSet_t *pAdvSet; + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if (op == LL_ADV_DATA_OP_UNCHANGED) + { + LL_TRACE_WARN2("Invalid operation=%u, handle=%u", op, pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) + { + if (((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) == 0) && + (len > 0)) + { + LL_TRACE_WARN1("Cannot add scan response data buffer with non-scannable advertising, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((len > 0) && (pAdvSet->advData.len > 0)) + { + LL_TRACE_WARN1("Extended advertising data buffer already in use, handle=%u", pAdvSet->handle); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + result = lctrSetExtAdvDataSm(pAdvSet, &pAdvSet->scanRspData, op, fragPref, len, pData); + } + else + { + if ((result = lctrSetLegacyAdvDataSm(pAdvSet, &pAdvSet->scanRspData, op, len, pData)) == LL_SUCCESS) + { + /* Fragmentation disabled for legacy. */ + pAdvSet->scanRspData.fragPref = LL_ADV_DATA_FRAG_DISALLOW; + } + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Remove advertising set. + * + * \param handle Advertising handle. + * + * \return Status error code. + * + * Removes the an advertising set from the LL. + */ +/*************************************************************************************************/ +uint8_t LctrRemoveAdvSet(uint8_t handle) +{ + lctrAdvSet_t *pAdvSet; + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if (pAdvSet->state != LCTR_EXT_ADV_STATE_DISABLED) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + lctrFreeAdvSet(pAdvSet); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets. + * + * \return Status error code. + * + * Remove all existing advertising sets from the LL. + */ +/*************************************************************************************************/ +uint8_t LctrClearAdvSets(void) +{ + unsigned int i; + + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + if (pLctrAdvSetTbl[i].state != LCTR_EXT_ADV_STATE_DISABLED) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + } + + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + if (pLctrAdvSetTbl[i].enabled) + { + lctrFreeAdvSet(&pLctrAdvSetTbl[i]); + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set auxiliary packet offset delay. + * + * \param handle Advertising handle. + * \param delayUsec Additional time in microseconds. "0" to disable. + * + * \return Status error code. + * + * Additional delay given to auxiliary packets specified by AuxPtr. Offset values are + * limited by the advertising interval. + */ +/*************************************************************************************************/ +uint8_t LctrSetAuxOffsetDelay(uint8_t handle, uint32_t delayUsec) +{ + lctrAdvSet_t *pAdvSet; + + WSF_CS_INIT(cs); + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + WSF_CS_ENTER(cs); + pAdvSet->auxDelayUsec = delayUsec; + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data fragmentation length. + * + * \param handle Advertising handle. + * \param fragLen Fragmentation length. + * + * \return Status error code. + * + * Fragmentation size for Advertising Data and Scan Response Data when selected by the host. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtAdvDataFragLen(uint8_t handle, uint8_t fragLen) +{ + lctrAdvSet_t *pAdvSet; + + WSF_CS_INIT(cs); + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + if ((fragLen < 1) || (fragLen > LL_EXT_ADVBU_MAX_LEN)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + WSF_CS_ENTER(cs); + pAdvSet->advDataFragLen = fragLen; + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising transmit PHY options. + * + * \param handle Advertising handle. + * \param priPhyOpts Primary advertising channel PHY options. + * \param secPhyOpts Secondary advertising channel PHY options. + * + * \return Status error code. + * + * PHY options for extended advertising transmissions. New values are applied dynamically. + */ +/*************************************************************************************************/ +uint8_t LctrSetExtAdvTxPhyOptions(uint8_t handle, uint8_t priPhyOpts, uint8_t secPhyOpts) +{ + lctrAdvSet_t *pAdvSet; + + WSF_CS_INIT(cs); + + if ((pAdvSet = lctrFindAdvSet(handle)) == NULL) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + WSF_CS_ENTER(cs); + pAdvSet->bleData.chan.tifsTxPhyOptions = priPhyOpts; + pAdvSet->auxBleData.chan.tifsTxPhyOptions = secPhyOpts; + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Send internal extended advertising subsystem message. + * + * \param pAdvSet Advertising set. + * \param event Extended advertising event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendAdvSetMsg(lctrAdvSet_t *pAdvSet, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = pAdvSet->handle; + pMsg->dispId = LCTR_DISP_EXT_ADV; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave periodic advertising message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvPeriodicAdvDisp(LctrPerAdvMsg_t *pMsg) +{ + lctrAdvSet_t *pAdvSet; + unsigned int i; + + pLctrSlvPerAdvMsg = pMsg; + + if (pMsg->hdr.dispId != LCTR_DISP_BCST) + { + if ((pAdvSet = lctrFindAdvSet(pMsg->hdr.handle)) != NULL) + { + lctrSlvPeriodicAdvExecuteSm(pAdvSet, pMsg->hdr.event); + } + } + else + { + for (i = 0; i < pLctrRtCfg->maxAdvSets; i++) + { + pAdvSet = &pLctrAdvSetTbl[i]; + if (pAdvSet->enabled) + { + lctrSlvPeriodicAdvExecuteSm(pAdvSet, pMsg->hdr.event); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send internal periodic advertising subsystem message. + * + * \param pAdvSet Advertising set. + * \param event Periodic advertising event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendPeriodicAdvSetMsg(lctrAdvSet_t *pAdvSet, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = pAdvSet->handle; + pMsg->dispId = LCTR_DISP_PER_ADV; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for periodic advertising slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvPeriodicAdvInit(void) +{ + /* Add periodic advertising reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_PER_ADV] = NULL; /* Not needed. */ + + /* Add extended advertising task message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_PER_ADV] = (LctrMsgDisp_t)lctrSlvPeriodicAdvDisp; + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_PER_ADV; + } + + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lctrGetPerOffsetsCback= lctrGetPerAdvOffsets; + } +} + +/*************************************************************************************************/ +/*! + * \brief Commit periodic operation. + * + * \param pAdvSet Advertising set. + * \param pOp Periodic BOD. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvPeriodicCommitOp(lctrAdvSet_t *pAdvSet, BbOpDesc_t * const pOp) +{ + uint32_t offsetUsec, anchorPoint; + uint16_t numIntervals; + + const uint32_t curTime = BbDrvGetCurrentTime(); + uint32_t rsvnOffs[SCH_RM_MAX_RSVN]; + + memset(&rsvnOffs[0], 0, sizeof(rsvnOffs)); + if (lctrGetConnOffsetsCback) + { + lctrGetConnOffsetsCback(rsvnOffs, curTime); + } + if (lctrGetPerOffsetsCback) + { + lctrGetPerOffsetsCback(&rsvnOffs[LL_MAX_CONN], curTime); + } + offsetUsec = SchRmGetOffsetUsec(rsvnOffs, BB_TICKS_TO_US(pAdvSet->perParam.perAdvInter), + LL_MAX_CONN + LCTR_GET_EXT_ADV_INDEX(pAdvSet)); /* RM is shared by connections and periodic advertising. */ + + pOp->due = curTime + BB_US_TO_BB_TICKS(offsetUsec); + + /*** Commit operation ***/ + anchorPoint = pOp->due; + numIntervals = 0; + + while (TRUE) + { + uint32_t perInterUsec, perInter; + int16_t dueOffsetUsec; + + if (SchInsertAtDueTime(pOp, NULL)) + { + break; + } + + LL_TRACE_WARN1("!!! Establish periodic advertising schedule conflict handle=%u", pAdvSet->handle); + + numIntervals += 1; + pAdvSet->perParam.perEventCounter += 1; + + perInterUsec = numIntervals * BB_TICKS_TO_US(pAdvSet->perParam.perAdvInter); + perInter = BB_US_TO_BB_TICKS(perInterUsec); + dueOffsetUsec = perInterUsec - BB_TICKS_TO_US(perInter); + + /* Advance to next interval. */ + pOp->due = anchorPoint + perInter; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + } + + LL_TRACE_INFO1("### ExtAdvEvent ### Periodic advertising enabled, due=%u", pOp->due); +} + +/*************************************************************************************************/ +/*! + * \brief Build periodic advertising operation. + * + * \param pAdvSet Advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +uint8_t lctrSlvPeriodicAdvBuildOp(lctrAdvSet_t *pAdvSet) +{ + uint32_t interMinUsec, interMaxUsec, durUsec, perInterUsec; + + BbOpDesc_t * const pOp = &pAdvSet->perParam.perAdvBod; + BbBleData_t * const pBle = &pAdvSet->perParam.perBleData; + BbBleSlvAuxAdvEvent_t * const pPerAdv = &pBle->op.slvPerAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_PERIODIC; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvPeriodicAdvEndOp; + pOp->abortCback = lctrSlvPeriodicAdvEndOp; + pOp->pCtx = pAdvSet; + + /*** BLE General Setup ***/ + pAdvSet->perParam.perChHopInc = lctrComputeHopInc(); + + pBle->chan.opType = BB_BLE_OP_SLV_PER_ADV_EVENT; + + pBle->chan.chanIdx = pAdvSet->perParam.perChIdx; + pBle->chan.txPower = pAdvSet->param.advTxPwr; + pBle->chan.accAddr = pAdvSet->perParam.perAccessAddr; + pBle->chan.crcInit = lctrComputeCrcInit(); + pBle->chan.txPhy = pAdvSet->param.secAdvPhy; + pBle->chan.rxPhy = pAdvSet->param.secAdvPhy; + + /* Set PHY options to default behavior for AUX_SYNC_IND. */ + pBle->chan.initTxPhyOptions = lmgrSlvAdvCb.defTxPhyOpts; + +#if (LL_ENABLE_TESTER == TRUE) + /* TODO If tester ability if necessary. */ + pBle->chan.accAddrRx = llTesterCb.auxAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.auxAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.auxCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.auxCrcInitTx ^ pBle->chan.crcInit; +#endif + + /*** BLE Advertising Setup: Tx advertising packet ***/ + + pPerAdv->txAuxSetupCback = lctrSlvTxSetupPeriodicAdvDataHandler; + + pAdvSet->perAdvData.txOffs = 0; + pPerAdv->txAuxAdvPdu[0].pBuf = pAdvSet->perAdvHdrBuf; + /* Auxiliary advertising buffer setup dynamically in lctrSlvTxSetupAuxAdvDataHandler(). */ + /* pAuxAdv->txAuxAdvPdu[1].pBuf = NULL; */ + /* pAuxAdv->txAuxAdvPdu[1].len = 0; */ + + /*** BLE Advertising Setup: Rx request packet ***/ + + /* pPerAdv->pRxAuxReqBuf = NULL; */ /* Cleared in alloc. */ + /* pPerAdv->rxAuxReqCback = NULL; */ /* Cleared in alloc. */ + + /*** BLE Advertising Setup: Tx chain indication packet ***/ + + pPerAdv->txAuxChainPdu[0].pBuf = pAdvSet->perAdvHdrBuf; + /* Chain buffer setup dynamically in lctrSlvTxSetupAuxAdvDataHandler(). */ + + /*** Commit operation ***/ + SchBleCalcAdvOpDuration(pOp); + interMinUsec = BB_TICKS_TO_US(pAdvSet->perParam.advInterMin); + interMaxUsec = BB_TICKS_TO_US(pAdvSet->perParam.advInterMax); + durUsec = pOp->minDurUsec; + + if (!SchRmAdd(LL_MAX_CONN + LCTR_GET_EXT_ADV_INDEX(pAdvSet), interMinUsec, interMaxUsec, durUsec, &perInterUsec)) + { + return LL_ERROR_CODE_LIMIT_REACHED; + } + + pAdvSet->perParam.perAdvInter = BB_US_TO_BB_TICKS(perInterUsec); + lctrSlvPeriodicCommitOp(pAdvSet, pOp); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get offsets of periodic advertising. + * + * \param rsvnOffs Storage for list of reservation offsets indexed by handle. + * \param refTime Starting reference time. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrGetPerAdvOffsets(uint32_t rsvnOffs[], uint32_t refTime) +{ + unsigned int perIndex; + + for (perIndex = 0; perIndex < pLctrRtCfg->maxAdvSets; perIndex++) + { + lctrAdvSet_t *pAdvSet = &pLctrAdvSetTbl[perIndex]; + + if (pAdvSet->perParam.perState == LCTR_PER_ADV_STATE_ENABLED) + { + if (pAdvSet->perParam.perAdvBod.due - refTime < LCTR_SCH_MAX_SPAN) /* due time has not passed */ + { + rsvnOffs[perIndex] = BB_TICKS_TO_US(pAdvSet->perParam.perAdvBod.due - refTime); + } + else + { + rsvnOffs[perIndex] = BB_TICKS_TO_US(pAdvSet->perParam.perAdvBod.due + pAdvSet->perParam.perAdvInter - refTime); + } + } + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..ab7c3894d48945231ded8730626a4a9eb9fe3030 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn.c @@ -0,0 +1,1622 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller data path implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_pdu_conn.h" +#include "lmgr_api_conn.h" +#include "ll_math.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Cipher block initialization handler. */ +lctrCipherBlkHdlr_t lctrInitCipherBlkHdlr = NULL; + +/*! \brief Packet encrypt handler. */ +lctrPktEncHdlr_t lctrPktEncryptHdlr = NULL; + +/*! \brief Packet decrypt handler. */ +lctrPktDecHdlr_t lctrPktDecryptHdlr = NULL; + +/*! \brief Set encrypt packet count handler. */ +lctrPktCntHdlr_t lctrSetEncryptPktCountHdlr = NULL; + +/*! \brief Set decrypt packet count handler. */ +lctrPktCntHdlr_t lctrSetDecryptPktCountHdlr = NULL; + +/*! \brief Pointer to connection context table. */ +lctrConnCtx_t *pLctrConnTbl; + +/*! \brief Common data storage used for decoding a received PDU. */ +lctrDataPdu_t lctrDataPdu; + +/*! \brief Common storage for task message data (parameter passing to action routines). */ +lctrConnMsg_t *pLctrConnMsg; + +/*! \brief Vendor specific PDU handlers. */ +const LctrVsHandlers_t *pLctrVsHdlrs = NULL; + +/*! \brief Control PDU handler. */ +lctrCtrlPduHdlr_t lctrCtrlPduHdlr = NULL; + +/*! \brief Build remap table handlers. */ +LctrChSelHdlr_t lctrChSelHdlr[LCTR_CH_SEL_MAX] = { 0 }; + +/*************************************************************************************************/ +/*! + * \brief Initialize the connection memory resources. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint16_t LctrInitConnMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + uint16_t memUsed; + + /*** Connection Context ***/ + + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & (uint32_t)~0x3) + sizeof(uint32_t)); + } + + /* Allocate memory. */ + LL_TRACE_INFO2(" RAM: %u x %u bytes -- connection context", pLctrRtCfg->maxConn, sizeof(lctrConnCtx_t)); + pLctrConnTbl = (lctrConnCtx_t *)pAvailMem; + pAvailMem += sizeof(lctrConnCtx_t) * pLctrRtCfg->maxConn; + + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + LL_TRACE_ERR2("LctrInitConnMem: failed to allocate connection context, need=%u available=%u", (pAvailMem - pFreeMem), freeMemSize); + WSF_ASSERT(FALSE); + return 0; + } + + /*** Tx Memory ***/ + + freeMemSize -= pAvailMem - pFreeMem; + memUsed = lctrTxInitMem(pAvailMem, freeMemSize); + if (memUsed == 0) + { + LL_TRACE_ERR2("LctrInitConnMem: failed to allocate descriptors, need=%u available=%u", (pAvailMem - pFreeMem), freeMemSize); + WSF_ASSERT(FALSE); + return 0; + } + + pAvailMem += memUsed; + + lmgrPersistCb.connCtxSize = sizeof(lctrConnCtx_t); + + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Assign vendor specific PDU handlers. + * + * \param pHdlrs Static definition for VS handlers. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrVsConnInit(const LctrVsHandlers_t *pHdlrs) +{ + pLctrVsHdlrs = pHdlrs; +} + +/*************************************************************************************************/ +/*! + * \brief Validate connection specification parameter range. + * + * \param pConnSpec New connection specification. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LctrValidateConnSpec(const LlConnSpec_t *pConnSpec) +{ + if ((pConnSpec->connIntervalMin < LL_MIN_CONN_INTERVAL) || + (pConnSpec->connIntervalMax > LL_MAX_CONN_INTERVAL) || + (pConnSpec->connIntervalMin > pConnSpec->connIntervalMax) || + /* (pConnSpec->connLatency < connLatencyMin) || */ + (pConnSpec->connLatency > LL_MAX_CONN_LATENCY) || + (pConnSpec->supTimeout < LL_MIN_SUP_TIMEOUT) || + (pConnSpec->supTimeout > LL_MAX_SUP_TIMEOUT) || + (pConnSpec->supTimeout <= ((1 + pConnSpec->connLatency) * pConnSpec->connIntervalMax >> 2))) + { + LL_TRACE_WARN0("LctrValidateConnSpec: invalid parameters"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether a procedure is already active or pended. + * + * \param handle Connection handle. + * \param event Event. + * + * \return TRUE if the procedure is already active or pended, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrIsProcActPended(uint16_t handle, uint8_t event) +{ + uint8_t proc; + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + if ((proc = lctrGetProcId(event)) == LCTR_PROC_INVALID) + { + return FALSE; + } + + if ((pCtx->llcpActiveProc == proc) || + (pCtx->llcpPendMask & (1 << proc))) + { + LL_TRACE_WARN1("The new procedure=%u is already active or pended.", pCtx->llcpActiveProc); + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode New encryption mode. + * + * \return None. + * + * Get the encryption mode used by a connection. + */ +/*************************************************************************************************/ +void LctrGetEncMode(uint16_t handle, LlEncMode_t *pMode) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + WSF_ASSERT(pMode); + + pMode->enaAuth = pCtx->bleData.chan.enc.enaAuth; +} + +/*************************************************************************************************/ +/*! + * \brief Set encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode Current encryption mode. + * + * \return TRUE if successful, FALSE otherwise. + * + * Set the encryption mode used by a connection. Must be called before encryption is started or + * when encryption is paused. + */ +/*************************************************************************************************/ +bool_t LctrSetEncMode(uint16_t handle, const LlEncMode_t *pMode) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + WSF_ASSERT(pMode); + + if (pCtx->pendEncMode) + { + /* Mode already pending. */ + return FALSE; + } + + pCtx->newEncMode = *pMode; + pCtx->pendEncMode = TRUE; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set connection operational mode flags. + * + * \param handle Connection handle. + * \param flags Flags. + * \param enable TRUE to set flags or FALSE to clear flags. + * + * \return None. + * + * Set mode flags governing LL operations of a given connection. + */ +/*************************************************************************************************/ +void LctrSetConnOpFlags(uint16_t handle, uint32_t flags, bool_t enable) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + if (enable) + { + pCtx->opModeFlags |= flags; + } + else + { + pCtx->opModeFlags &= ~flags; + } +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a connection context. + * + * \return Connection context. + */ +/*************************************************************************************************/ +lctrConnCtx_t *lctrAllocConnCtx(void) +{ + unsigned int connIdx; + + for (connIdx = 0; connIdx < pLctrRtCfg->maxConn; connIdx++) + { + if (!pLctrConnTbl[connIdx].enabled) + { + unsigned i; + lctrMsgHdr_t *pMsg; + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(connIdx); + + memset(&pLctrConnTbl[connIdx], 0, sizeof(lctrConnCtx_t)); + pCtx->enabled = TRUE; + + pCtx->opModeFlags = lmgrCb.opModeFlags; + + /* Assume all features are supported; if not supported remote sends unknown response. */ + pCtx->usedFeatSet = lmgrCb.features; + + /* Setup supervision timer. */ + pCtx->tmrSupTimeout.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pCtx->tmrSupTimeout.msg; + pMsg->handle = connIdx; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_TERM_SUP_TIMEOUT; + + /* Setup LLCP timer. */ + pCtx->tmrProcRsp.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pCtx->tmrProcRsp.msg; + pMsg->handle = connIdx; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_TMR_LLCP_RSP_EXP; + + /* LE Ping period timer. */ + pCtx->tmrPingTimeout.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pCtx->tmrPingTimeout.msg; + pMsg->handle = connIdx; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_TMR_PING_PERIOD_EXP; + + /* Setup authentication payload timer. */ + pCtx->tmrAuthTimeout.handlerId = lmgrPersistCb.handlerId; + pMsg = (lctrMsgHdr_t *)&pCtx->tmrAuthTimeout.msg; + pMsg->handle = connIdx; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_TMR_AUTH_PAYLOAD_EXP; + + /* Default packet lengths. */ + pCtx->localDataPdu.maxTxLen = lmgrConnCb.maxTxLen; + pCtx->localDataPdu.maxRxLen = WSF_MIN(LCTR_MAX_DATA_LEN_MAX, pLctrRtCfg->maxAclLen); + pCtx->localDataPdu.maxTxTime = lmgrConnCb.maxTxTime; + /* Limit with absolute time. lctrSendDataLengthPdu() limits time by PHY capability. */ + pCtx->localDataPdu.maxRxTime = LL_DATA_LEN_TO_TIME_CODED_S8(pCtx->localDataPdu.maxRxLen); + pCtx->effDataPdu.maxTxLen = LL_MAX_DATA_LEN_MIN; + pCtx->effDataPdu.maxRxLen = LL_MAX_DATA_LEN_MIN; + pCtx->effDataPdu.maxTxTime = LL_MAX_DATA_TIME_MIN; + pCtx->effDataPdu.maxRxTime = LL_MAX_DATA_TIME_MIN; + + /* Connection event duration (update once PHY is known). */ + pCtx->bleData.chan.txPhy = pCtx->bleData.chan.rxPhy = BB_PHY_BLE_1M; + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); + + /* Default PHY. */ + pCtx->allPhys = lmgrConnCb.allPhys; + pCtx->txPhys = lmgrConnCb.txPhys; + pCtx->rxPhys = lmgrConnCb.rxPhys; + + /* Set default minimum number of used channels. */ + for (i = 0; i < LL_MAX_PHYS; i++) + { + pCtx->peerMinUsedChan[i] = LL_MIN_NUM_CHAN_DATA; + } + + /* VS initialization. */ + if (pLctrVsHdlrs && pLctrVsHdlrs->connSetup) + { + pLctrVsHdlrs->connSetup(connIdx); + } + + LmgrIncResetRefCount(); + lmgrCb.numConnEnabled++; + + /* Enable BB. */ + BbStart(BB_PROT_BLE); + + return LCTR_GET_CONN_CTX(connIdx); + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Free a connection context. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrFreeConnCtx(lctrConnCtx_t *pCtx) +{ + uint8_t *pBuf; + uint8_t numRxBufs; + uint8_t numTxBufs; + uint16_t handle; + wsfHandlerId_t handlerId; + + /* Flush remaining receive packets. */ + numRxBufs = lctrRxConnClear(pCtx); + lctrDataRxIncAvailBuf(numRxBufs); + + /* Flush remaining transmit packets. */ + numTxBufs = lctrTxQueueClear(pCtx); + + /* Flush remaining transmit packets. */ + while ((pBuf = WsfMsgDeq(&pCtx->txLeuQ, &handlerId)) != NULL) + { + if (handlerId != LCTR_CTRL_DATA_HANDLE) + { + lctrDataTxIncAvailBuf(); + numTxBufs++; + } + + WsfMsgFree(pBuf); + } + + /* Cleanup timers. */ + WsfTimerStop(&pCtx->tmrSupTimeout); + WsfTimerStop(&pCtx->tmrProcRsp); + WsfTimerStop(&pCtx->tmrPingTimeout); + WsfTimerStop(&pCtx->tmrAuthTimeout); + + handle = LCTR_GET_CONN_HANDLE(pCtx); + + /* VS cleanup. */ + if (pLctrVsHdlrs && pLctrVsHdlrs->connCleanup) + { + pLctrVsHdlrs->connCleanup(handle); + } + + pCtx->enabled = FALSE; + + LmgrDecResetRefCount(); + lmgrCb.numConnEnabled--; + + /* Shutdown BB. */ + BbStop(BB_PROT_BLE); + + LL_TRACE_INFO1(" >>> Connection terminated, handle=%u <<<", handle); +} + +/*************************************************************************************************/ +/*! + * \brief Compute next data channel index. + * + * \param pCtx Connection context. + * \param numSkip Number of channels to skip. + * + * \return Next data channel index. + */ +/*************************************************************************************************/ +uint8_t lctrSelectNextDataChannel(lctrConnCtx_t *pCtx, uint16_t numSkip) +{ + /* unmappedChannel = (lastUnmappedChannel + hopIncrement) mod 37 */ + uint16_t unmapChan = pCtx->lastChanIdx + ((uint16_t)pCtx->hopInc * (numSkip + 1)); + if (unmapChan > LL_CHAN_DATA_MAX_IDX) + { + unmapChan = LL_MATH_MOD_37(unmapChan); + } + + pCtx->lastChanIdx = unmapChan; + + if (!((UINT64_C(1) << unmapChan) & pCtx->chanMask)) + { + /* remappingIndex = unmappedChannel mod numUsedChannels */ + + uint8_t remapIdx; + + /* Avoid division. */ + if (unmapChan < pCtx->numUsedChan) + { + remapIdx = unmapChan; + } + else if (pCtx->numUsedChan > 18) /* max is 37; no double rollovers */ + { + remapIdx = unmapChan - pCtx->numUsedChan; + } + else + { + /* Unlikely case where available channels <= 18, loop is required. */ + remapIdx = unmapChan; + while (remapIdx >= pCtx->numUsedChan) + { + remapIdx -= pCtx->numUsedChan; + } + } + + return pCtx->chanRemapTbl[remapIdx]; + } + + return unmapChan; +} + +/*************************************************************************************************/ +/*! + * \brief Build channel remapping table. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrBuildRemapTable(lctrConnCtx_t *pCtx) +{ + unsigned int chanIdx; + unsigned int numUsedChan = 0; + + for (chanIdx = 0; chanIdx < sizeof(pCtx->chanRemapTbl); chanIdx++) + { + if (pCtx->chanMask & (UINT64_C(1) << chanIdx)) + { + pCtx->chanRemapTbl[numUsedChan++] = chanIdx; + } + } + + WSF_ASSERT(numUsedChan); /* must have at least one channel */ + + pCtx->numUsedChan = numUsedChan; +} + +/*************************************************************************************************/ +/*! + * \brief Tx data completed task event handler. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrConnTxCompletedHandler(void) +{ + uint8_t numBufs[LL_MAX_CONN] = { 0 }; + unsigned int i = pLctrRtCfg->maxConn - 1; + WSF_CS_INIT(cs); + + /* Cache buffer count within single CS. */ + WSF_CS_ENTER(cs); + do + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(i); + + if (pCtx->enabled) + { + numBufs[i] = pCtx->numTxComp; + pCtx->numTxComp = 0; + } + } while (i--); + WSF_CS_EXIT(cs); + + /* Call completion callbacks. */ + i = pLctrRtCfg->maxConn - 1; + do + { + lctrConnCtx_t *pCtx; + if (numBufs[i]) + { + if (lmgrPersistCb.sendCompCback) + { + lmgrPersistCb.sendCompCback(i, numBufs[i]); + } + } + + pCtx = LCTR_GET_CONN_CTX(i); + + if (pCtx->pauseTxData && + WsfQueueEmpty(&pCtx->txArqQ)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_ARQ_Q_FLUSHED); + } + } while (i--); +} + +/*************************************************************************************************/ +/*! + * \brief Rx data pending task event handler. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrConnRxPendingHandler(void) +{ + uint16_t connHandle = 0; + uint8_t *pRxBuf; + uint8_t numBufs[LL_MAX_CONN]; + unsigned int i; + + /* Route and demux received Data PDUs. */ + + while ((pRxBuf = lctrRxDeq(&connHandle)) != NULL) + { + lctrConnCtx_t *pCtx; + lctrDataPduHdr_t rxHdr; + WSF_ASSERT(pRxBuf); + + WSF_ASSERT(connHandle < pLctrRtCfg->maxConn); + pCtx = LCTR_GET_CONN_CTX(connHandle); + + if (!pCtx->enabled) + { + LL_TRACE_ERR1("!!! Data received on terminated connHandle=%u", connHandle); + lctrRxPduFree(pRxBuf); + lctrDataRxIncAvailBuf(1); + continue; + } + + /* Disassemble PDU. */ + lctrUnpackDataPduHdr(&rxHdr, pRxBuf); + + /* Decrypt PDU. */ + if (lctrPktDecryptHdlr) + { + if (lctrPktDecryptHdlr(&pCtx->bleData.chan.enc, pRxBuf)) + { + if (pCtx->bleData.chan.enc.enaDecrypt) + { + /* Restart authentication timers. */ + WsfTimerStartMs(&pCtx->tmrAuthTimeout, pCtx->authTimeoutMs); + WsfTimerStartMs(&pCtx->tmrPingTimeout, pCtx->pingPeriodMs); + } + } + else + { + LL_TRACE_ERR1("!!! MIC verification failed on connHandle=%u", connHandle); + lctrRxPduFree(pRxBuf); + lctrDataRxIncAvailBuf(1); + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_MIC_FAILED); + continue; + } + } + + /* Demux PDU. */ + switch (rxHdr.llid) + { + case LL_LLID_CTRL_PDU: + { +#if (LL_ENABLE_TESTER) + if (llTesterCb.llcpForwardEnabled) + { + if (!llTesterCb.llcpLlcpIntercept) + { + if (lctrCtrlPduHdlr != NULL) + { + lctrCtrlPduHdlr(pCtx, pRxBuf); + } + } + pRxBuf[0] = LL_LLID_VS_PDU; /* buffer is treated like a VS buffer */ + lctrRxConnEnq(pCtx, pRxBuf); + /* lctrRxPduFree(pRxBuf); */ /* Freed in rxDataQ handler. */ + /* lctrDataRxIncAvailBuf(); */ /* Incremented in rxDataQ handler. */ + } + else +#endif + { + if (lctrCtrlPduHdlr != NULL) + { + lctrCtrlPduHdlr(pCtx, pRxBuf); + } + lctrRxPduFree(pRxBuf); + lctrDataRxIncAvailBuf(1); + } + break; + } + + case LL_LLID_START_PDU: + case LL_LLID_CONT_PDU: + if (pCtx->pauseRxData) + { + LL_TRACE_ERR1("!!! Data PDU received during data pause, connHandle=%u", connHandle); + lctrRxPduFree(pRxBuf); + lctrDataRxIncAvailBuf(1); + lctrSendConnMsg(pCtx, LCTR_CONN_TERM_MIC_FAILED); + } + else + { + lctrRxConnEnq(pCtx, pRxBuf); + /* lctrRxPduFree(pRxBuf); */ /* Freed in rxDataQ handler. */ + /* lctrDataRxIncAvailBuf(); */ /* Incremented in rxDataQ handler. */ + } + break; + + case LL_LLID_VS_PDU: + default: + if (pLctrVsHdlrs && pLctrVsHdlrs->dataRecv) + { + pLctrVsHdlrs->dataRecv(connHandle, pRxBuf); + } + else + { + lctrRxPduFree(pRxBuf); + lctrDataRxIncAvailBuf(1); + LL_TRACE_ERR1("!!! Invalid LLID; dropping Rx data PDU, connHandle=%u", connHandle); + } + break; + } + } + + /* Notify host of pending Rx data. */ + + WSF_CS_INIT(cs); + i = pLctrRtCfg->maxConn - 1; + + /* Cache buffer count within single CS. */ + WSF_CS_ENTER(cs); + do + { + numBufs[i] = pLctrConnTbl[i].numRxPend; + pLctrConnTbl[i].numRxPend = 0; + } while (i--); + WSF_CS_EXIT(cs); + + /* Call completion callbacks. */ + i = pLctrRtCfg->maxConn - 1; + do + { + if (numBufs[i] && lmgrPersistCb.recvPendCback) + { + lmgrPersistCb.recvPendCback(i, numBufs[i]); + } + } while (i--); +} + +/*************************************************************************************************/ +/*! + * \brief Transmit ACL data path. + * + * \param pAclBuf ACL buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrTxAcl(uint8_t *pAclBuf) +{ + lctrAclHdr_t aclHdr; + lctrConnCtx_t *pCtx; + + /*** Disassemble ACL packet. ***/ + + lctrUnpackAclHdr(&aclHdr, pAclBuf); + + /*** Assemble data PDU. ***/ + + if (aclHdr.connHandle >= pLctrRtCfg->maxConn) + { + LL_TRACE_ERR1("Invalid ACL header: connHandle=%u; dropping packet", aclHdr.connHandle); + WsfMsgFree(pAclBuf); + lmgrPersistCb.sendCompCback(aclHdr.connHandle, 1); + return; + } + + pCtx = LCTR_GET_CONN_CTX(aclHdr.connHandle); + + if (!pCtx->enabled) + { + LL_TRACE_ERR1("Invalid ACL header: connection disconnected for connHandle=%u; dropping packet", aclHdr.connHandle); + /* LL shall not inform host of the number of completed event */ + WsfMsgFree(pAclBuf); + return; + } + + if (pCtx->state == LCTR_CONN_STATE_TERMINATING) + { + LL_TRACE_ERR1("Invalid ACL header: connection terminated for connHandle=%u; dropping packet", aclHdr.connHandle); + WsfMsgFree(pAclBuf); + lmgrPersistCb.sendCompCback(aclHdr.connHandle, 1); + return; + } + + if (!pLctrVsHdlrs && (aclHdr.pktBound == LCTR_PB_VS_DATA)) + { + LL_TRACE_ERR1("Invalid ACL header: pktBound=%u not valid; dropping packet", aclHdr.pktBound); + WsfMsgFree(pAclBuf); + lmgrPersistCb.sendCompCback(aclHdr.connHandle, 1); + return; + } + + if (((aclHdr.pktBound != LCTR_PB_VS_DATA) && (aclHdr.len == 0)) || + (aclHdr.len > pLctrRtCfg->maxAclLen)) + { + LL_TRACE_ERR2("Invalid ACL header: invalid packet length, actLen=%u, maxLen=%u", aclHdr.len, pCtx->effDataPdu.maxTxLen); + WsfMsgFree(pAclBuf); + lmgrPersistCb.sendCompCback(aclHdr.connHandle, 1); + return; + } + + lctrDataTxDecAvailBuf(); + + if (!pCtx->pauseTxData) + { + uint16_t fragLen; + WSF_ASSERT(WsfQueueEmpty(&pCtx->txLeuQ)); + + /*** Queue for transmit. ***/ + + fragLen = lctrTxFragLen(pCtx); + lctrTxDataPduQueue(pCtx, fragLen, &aclHdr, pAclBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_TX_PENDING)); + } + else + { + /*** Pend in LE-U pause queue. ***/ + + WsfMsgEnq(&pCtx->txLeuQ, aclHdr.connHandle, pAclBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief Receive ACL data path. + * + * \return Received data PDU buffer or NULL if queue empty. + */ +/*************************************************************************************************/ +uint8_t *LctrRxAcl(void) +{ + unsigned int i = pLctrRtCfg->maxConn - 1; + uint8_t *pAclBuf = NULL; + + do + { + if ((pLctrConnTbl[i].enabled) && + ((pAclBuf = lctrRxConnDeqAcl(&pLctrConnTbl[i])) != NULL)) + { + break; + } + + } while (i--); + + return pAclBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Indicate that received ACL data buffer has been deallocated + * + * \param numBufs Number of completed packets. + * + * \return None. + * + * Indicate that received ACL data buffer has been deallocated. + */ +/*************************************************************************************************/ +void LctrRxAclComplete(uint8_t numBufs) +{ + lctrDataRxIncAvailBuf(numBufs); +} + +/*************************************************************************************************/ +/*! + * \brief Get enable state of a handle. + * + * \param handle Connection handle. + * + * \return TRUE if enabled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrIsConnHandleEnabled(uint16_t handle) +{ + return pLctrConnTbl[handle].enabled; +} + +/*************************************************************************************************/ +/*! + * \brief Get role of a connection. + * + * \param handle Connection handle. + * + * \return Role. + */ +/*************************************************************************************************/ +uint8_t LctrGetRole(uint16_t handle) +{ + return pLctrConnTbl[handle].role; +} + +/*************************************************************************************************/ +/*! + * \brief Get RSSI value of a connection. + * + * \param handle Connection handle. + * + * \return RSSI value. + */ +/*************************************************************************************************/ +int8_t LctrGetRssi(uint16_t handle) +{ + return pLctrConnTbl[handle].rssi; +} + +/*************************************************************************************************/ +/*! + * \brief Get the transmit power level of a connection. + * + * \param handle Connection handle. + * + * \return Transmit power level. + */ +/*************************************************************************************************/ +int8_t LctrGetTxPowerLevel(uint16_t handle) +{ + return pLctrConnTbl[handle].bleData.chan.txPower; +} + +/*************************************************************************************************/ +/*! + * \brief Set the transmit power level of a connection. + * + * \param handle Connection handle. + * \param level Transmit power level. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSetTxPowerLevel(uint16_t handle, int8_t level) +{ + pLctrConnTbl[handle].bleData.chan.txPower = level; +} + +/*************************************************************************************************/ +/*! + * \brief Get the channel map mask of a connection. + * + * \param handle Connection handle. + * + * \return Channel map mask. + */ +/*************************************************************************************************/ +uint64_t LctrGetChannelMap(uint16_t handle) +{ + return pLctrConnTbl[handle].chanMask; +} + +/*************************************************************************************************/ +/*! + * \brief Get the used feature set of a connection. + * + * \param handle Connection handle. + * + * \return Used feature set bitmask. + */ +/*************************************************************************************************/ +uint8_t LctrGetUsedFeatures(uint16_t handle) +{ + return pLctrConnTbl[handle].usedFeatSet; +} + +/*************************************************************************************************/ +/*! + * \brief Get transmitter PHY used by a connection. + * + * \param handle Connection handle. + * + * \return Transmitter PHY. + * + * Get transmitter PHY used by a connection. + */ +/*************************************************************************************************/ +uint8_t LctrGetTxPhy(uint16_t handle) +{ + return pLctrConnTbl[handle].bleData.chan.txPhy; +} + +/*************************************************************************************************/ +/*! + * \brief Get receiver PHY used by a connection. + * + * \param handle Connection handle. + * + * \return Receiver PHY. + * + * Get receiver PHY used by a connection. + */ +/*************************************************************************************************/ +uint8_t LctrGetRxPhy(uint16_t handle) +{ + return pLctrConnTbl[handle].bleData.chan.rxPhy; +} + +/*************************************************************************************************/ +/*! + * \brief Get peer minimum number of used channels. + * + * \param handle Connection handle. + * \param pPeerMinCh Peer minimum used channels. + * + * \return Peer minimum number of used channels. + * + * Get peer minimum number of used channels. + */ +/*************************************************************************************************/ +void LctrGetPeerMinUsedChan(uint16_t handle, uint8_t *pPeerMinCh) +{ + unsigned i; + for (i = 0; i < LL_MAX_PHYS; i++) + { + pPeerMinCh[i] = pLctrConnTbl[handle].peerMinUsedChan[i]; + } +} + +/*************************************************************************************************/ +/*! + * \brief Is current a connection context waiting for a host reply? + * + * \param handle Connection handle. + * \param reply Reply bitmask. + * + * \return TRUE if current connection context is waiting for host reply, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LctrIsWaitingForReply(uint16_t handle, uint8_t reply) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + return (pCtx->replyWaitingMsk & reply) ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Send internal connection subsystem message. + * + * \param pCtx Connection context. + * \param event Connection event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendConnMsg(lctrConnCtx_t *pCtx, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = LCTR_GET_CONN_HANDLE(pCtx); + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Compute the LE Ping period value. + * + * \param pCtx Connection context. + * \param authTimeoutMs Authentication timeout value in milliseconds. + * + * \return LE Ping period in milliseconds. + */ +/*************************************************************************************************/ +uint32_t lctrCalcPingPeriodMs(lctrConnCtx_t *pCtx, uint32_t authTimeoutMs) +{ + /* LE Ping attempts before the expiration of authentication payload timeout. */ + uint32_t pingAttemptsMs = LCTR_CONN_IND_MS((LCTR_LE_PING_ATTEMPTS + pCtx->maxLatency) * pCtx->connInterval); + uint32_t pingPeriodMs = authTimeoutMs; /* fallback */ + + if ((authTimeoutMs > pingAttemptsMs) && /* Timeout must be longer than time to attempt ping */ + (authTimeoutMs > WSF_MS_PER_TICK)) /* and longer than one tick. */ + { + pingPeriodMs = authTimeoutMs - pingAttemptsMs; + + if (pingPeriodMs < WSF_MS_PER_TICK) /* minimum */ + { + /* At least 1 timer tick. */ + pingPeriodMs = WSF_MS_PER_TICK; + } + } + + return pingPeriodMs; +} + +/*************************************************************************************************/ +/*! + * \brief Connection conflict resolution handler. + * + * \param pNewOp New BOD. + * \param pExistOp Existing BOD. + * + * \return Prioritized BOD. + * + * Prioritize BLE connection at most risk for termination. + */ +/*************************************************************************************************/ +BbOpDesc_t *lctrConnResolveConflict(BbOpDesc_t *pNewOp, BbOpDesc_t *pExistOp) +{ + lctrConnCtx_t *pNewCtx = pNewOp->pCtx; + lctrConnCtx_t *pExistCtx = pExistOp->pCtx; + + WSF_ASSERT(pNewOp->protId == BB_PROT_BLE); + WSF_ASSERT((pNewOp->prot.pBle->chan.opType == BB_BLE_OP_SLV_CONN_EVENT) || + (pNewOp->prot.pBle->chan.opType == BB_BLE_OP_MST_CONN_EVENT)); + + /* BLE connections. */ + if ((pExistOp->protId != BB_PROT_BLE) || + !((pExistOp->prot.pBle->chan.opType == BB_BLE_OP_SLV_CONN_EVENT) || + (pExistOp->prot.pBle->chan.opType == BB_BLE_OP_MST_CONN_EVENT))) + { + LL_TRACE_WARN1("!!! Scheduling conflict, BLE connections: incoming handle=%u prioritized over non-BLE operation", LCTR_GET_CONN_HANDLE(pNewCtx)); + return pNewOp; + } + + /* Established connections. */ + if (pNewCtx->state == LCTR_CONN_STATE_INITIALIZED) + { + LL_TRACE_WARN2("!!! Scheduling conflict, established connection: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; + } + + /* Supervision timeout is imminent (2 CE). */ + if ((pExistCtx->tmrSupTimeout.ticks * WSF_MS_PER_TICK * 1000) < (uint32_t)(LCTR_CONN_IND_US(pExistCtx->connInterval) << 1)) + { + LL_TRACE_WARN2("!!! Scheduling conflict, imminent SVT: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; + } + if ((pNewCtx->tmrSupTimeout.ticks * WSF_MS_PER_TICK * 1000) < (uint32_t)(LCTR_CONN_IND_US(pNewCtx->connInterval) << 1)) + { + LL_TRACE_WARN2("!!! Scheduling conflict, imminent SVT: incoming handle=%u prioritized over existing handle=%u", LCTR_GET_CONN_HANDLE(pNewCtx), LCTR_GET_CONN_HANDLE(pExistCtx)); + return pNewOp; + } + + /* Active LLCP is pending. */ + if (pExistCtx->llcpActiveProc != LCTR_PROC_INVALID) + { + LL_TRACE_WARN2("!!! Scheduling conflict, LLCP pending: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; + } + if (pNewCtx->llcpActiveProc != LCTR_PROC_INVALID) + { + LL_TRACE_WARN2("!!! Scheduling conflict, LLCP pending: incoming handle=%u prioritized over existing handle=%u", LCTR_GET_CONN_HANDLE(pNewCtx), LCTR_GET_CONN_HANDLE(pExistCtx)); + return pNewOp; + } + + /* Data is pending. */ + if (!WsfQueueEmpty(&pExistCtx->txArqQ)) + { + LL_TRACE_WARN2("!!! Scheduling conflict, data pending: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; + } + if (!WsfQueueEmpty(&pNewCtx->txArqQ)) + { + LL_TRACE_WARN2("!!! Scheduling conflict, data pending: incoming handle=%u prioritized over existing handle=%u", LCTR_GET_CONN_HANDLE(pNewCtx), LCTR_GET_CONN_HANDLE(pExistCtx)); + return pNewOp; + } + + /* Less frequent connInterval (4x). */ + if ((pExistCtx->connInterval >> 2) > pNewCtx->connInterval) + { + LL_TRACE_WARN2("!!! Scheduling conflict, CI frequency: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; + } + if ((pNewCtx->connInterval >> 2) > pExistCtx->connInterval) + { + LL_TRACE_WARN2("!!! Scheduling conflict, CI frequency: incoming handle=%u prioritized over existing handle=%u", LCTR_GET_CONN_HANDLE(pNewCtx), LCTR_GET_CONN_HANDLE(pExistCtx)); + return pNewOp; + } + + /* Default. */ + LL_TRACE_WARN2("!!! Scheduling conflict, default: existing handle=%u prioritized over incoming handle=%u", LCTR_GET_CONN_HANDLE(pExistCtx), LCTR_GET_CONN_HANDLE(pNewCtx)); + return pExistOp; +} + +/*************************************************************************************************/ +/*! + * \brief Compute the master clock accuracy index. + * + * \return SCA index. + */ +/*************************************************************************************************/ +uint8_t lctrComputeSca(void) +{ + const uint16_t clkPpm = BbGetClockAccuracy(); + + if (clkPpm <= 20) return 7; + else if (clkPpm <= 30) return 6; + else if (clkPpm <= 50) return 5; + else if (clkPpm <= 75) return 4; + else if (clkPpm <= 100) return 3; + else if (clkPpm <= 150) return 2; + else if (clkPpm <= 250) return 1; + else return 0; +} + +/*************************************************************************************************/ +/*! + * \brief Get offsets of connections and periodic advertising. + * + * \param rsvnOffs Storage for list of reservation offsets indexed by handle. + * \param refTime Starting reference time. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrGetConnOffsets(uint32_t rsvnOffs[], uint32_t refTime) +{ + unsigned int connIndex; + for (connIndex = 0; connIndex < pLctrRtCfg->maxConn; connIndex++) + { + lctrConnCtx_t *pCtx = &pLctrConnTbl[connIndex]; + + if (pCtx->enabled && + (pCtx->bleData.chan.opType == BB_BLE_OP_MST_CONN_EVENT)) + { + if (pCtx->connBod.due - refTime < LCTR_SCH_MAX_SPAN) /* due time has not passed */ + { + rsvnOffs[connIndex] = BB_TICKS_TO_US(pCtx->connBod.due - refTime); + } + else + { + rsvnOffs[connIndex] = BB_TICKS_TO_US(pCtx->connBod.due + BB_US_TO_BB_TICKS(LCTR_CONN_IND_US(pCtx->connInterval)) - refTime); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Check for a queue depth of 1 element. + * + * \param pArqQ Queue. + * + * \return TRUE if ARQ only has 1 element, FALSE otherwise. + * + * \note Checks without resource protection. This routine is only intended to be used in task + * context. + */ +/*************************************************************************************************/ +bool_t lctrIsQueueDepthOne(wsfQueue_t *pArqQ) +{ + return pArqQ->pHead == pArqQ->pTail; +} + +/*************************************************************************************************/ +/*! + * \brief Set flags for link termination. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrFlagLinkTerm(lctrConnCtx_t *pCtx) +{ + bool_t removeBod = (pCtx->state == LCTR_CONN_STATE_ESTABLISHED_READY); + + pCtx->state = LCTR_CONN_STATE_TERMINATING; /* signals ISR to terminate link */ + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; /* signals ISR do not wait to send TERMINATE_IND */ + + if (removeBod) + { + SchRemove(&pCtx->connBod); + } +} + +/*************************************************************************************************/ +/*! + * \brief Service the Control PDU ACK state after a successful reception. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrCheckControlPduAck(lctrConnCtx_t *pCtx) +{ + if (pCtx->rxHdr.llid == LL_LLID_CTRL_PDU) + { + /* Control PDU received; reset Tx ACK pending state. */ + pCtx->ackAfterCtrlPdu = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Service the Control PDU ACK state after a successful transmission. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetControlPduAck(lctrConnCtx_t *pCtx) +{ + /* Unconditionally set state upon Tx completion. */ + pCtx->ackAfterCtrlPdu = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set flags for link termination. + * + * \param pCtx Connection context. + * + * \return TRUE if connection is terminated, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrCheckForLinkTerm(lctrConnCtx_t *pCtx) +{ + if (pCtx->state == LCTR_CONN_STATE_TERMINATING) + { + /* Peer device is LL_TERMINATE_IND initiator. */ + if (pCtx->termAckReqd) /* Tx Ack required after Rx of LL_TERMINATE_IND */ + { + if (pCtx->ackAfterCtrlPdu) /* guarantee Ack Tx'ed */ + { + return TRUE; + } + } + /* Local device is LL_TERMINATE_IND initiator. */ + else if ((pCtx->llcpState == LCTR_LLCP_STATE_IDLE) || /* LL_TERMINATE_IND not pending */ + (pCtx->txArqQ.pHead == NULL)) /* guarantee LL_TERMINATE_IND is Ack'ed */ + /* i.e. "WsfQueueEmpty(&pCtx->txArqQ)" (optimized for ISR) */ + { + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Increment the Tx/encrypt packet counter. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrIncPacketCounterTx(lctrConnCtx_t *pCtx) +{ + if (lctrSetEncryptPktCountHdlr) + { + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + if ((pEnc->enaEncrypt) && + (pEnc->nonceMode == BB_NONCE_MODE_PKT_CNTR)) + { + pCtx->txPktCounter++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Increment the Rx/decrypt packet counter. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrIncPacketCounterRx(lctrConnCtx_t *pCtx) +{ + if (lctrSetEncryptPktCountHdlr) + { + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + if ((pEnc->enaEncrypt) && + (pEnc->nonceMode == BB_NONCE_MODE_PKT_CNTR)) + { + pCtx->rxPktCounter++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the transmit packet counter value in the BB. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetBbPacketCounterTx(lctrConnCtx_t *pCtx) +{ + if (lctrSetEncryptPktCountHdlr) + { + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + if (!pEnc->enaEncrypt) + { + return; + } + + switch (pEnc->nonceMode) + { + case BB_NONCE_MODE_PKT_CNTR: + lctrSetEncryptPktCountHdlr(pEnc, pCtx->txPktCounter); + break; + case BB_NONCE_MODE_EVT_CNTR: + lctrSetEncryptPktCountHdlr(pEnc, pCtx->eventCounter); + break; + default: + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the receive packet counter value in the BB. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetBbPacketCounterRx(lctrConnCtx_t *pCtx) +{ + if (lctrSetDecryptPktCountHdlr) + { + BbBleEnc_t * const pEnc = &pCtx->bleData.chan.enc; + + if (!pEnc->enaDecrypt) + { + return; + } + + switch (pEnc->nonceMode) + { + case BB_NONCE_MODE_PKT_CNTR: + lctrSetDecryptPktCountHdlr(pEnc, pCtx->rxPktCounter); + break; + case BB_NONCE_MODE_EVT_CNTR: + lctrSetDecryptPktCountHdlr(pEnc, pCtx->eventCounter); + break; + default: + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if procedure is active, if not pend the procedure. + * + * \param pCtx Connection context. + * \param proc Procedure ID to check/pend. + * + * \return TRUE if active procedure, FALSE if pended. + */ +/*************************************************************************************************/ +bool_t lctrCheckActiveOrPend(lctrConnCtx_t *pCtx, uint8_t proc) +{ + if (pCtx->llcpActiveProc == proc) + { + return TRUE; + } + else + { + pCtx->llcpPendMask |= 1 << proc; + return FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Store connection timeout termination reason. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrStoreConnTimeoutTerminateReason(lctrConnCtx_t *pCtx) +{ + if (pCtx->termReason == LL_ERROR_CODE_CONN_FAILED_TO_ESTABLISH) + { + pCtx->termReason = LL_ERROR_CODE_CONN_TIMEOUT; + } +} + +/*************************************************************************************************/ +/*! + * \brief Increment available Tx data buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataTxIncAvailBuf(void) +{ + WSF_CS_INIT(cs); + + WSF_CS_ENTER(cs); + lmgrConnCb.availTxBuf++; + WSF_CS_EXIT(cs); +} + +/*************************************************************************************************/ +/*! + * \brief Decrement available Tx data buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataTxDecAvailBuf(void) +{ + WSF_CS_INIT(cs); + + WSF_CS_ENTER(cs); + lmgrConnCb.availTxBuf--; + WSF_CS_EXIT(cs); +} + +/*************************************************************************************************/ +/*! + * \brief Increment available Rx data buffers. +* + * \param numBufs Number of completed packets. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrDataRxIncAvailBuf(uint8_t numBufs) +{ + WSF_CS_INIT(cs); + + WSF_CS_ENTER(cs); + lmgrConnCb.availRxBuf += numBufs; + WSF_CS_EXIT(cs); +} + +/*************************************************************************************************/ +/*! + * \brief Get connection operational mode flags. + * + * \param pCtx Connection context to get the flag. + * \param flag Flags. + * + * \return Status error code. + * + * Set mode flags governing LL operations of a given connection. + */ +/*************************************************************************************************/ +bool_t lctrGetConnOpFlag(lctrConnCtx_t *pCtx, uint32_t flag) +{ + return (pCtx->opModeFlags & flag) ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Convert PHYS bit to PHY. + * + * \param physBit PHYS bit. + * + * \return PHY. + */ +/*************************************************************************************************/ +uint8_t lctrPhysBitToPhy(uint8_t physBit) +{ + switch (physBit) + { + default: + case LL_PHYS_LE_1M_BIT: + return BB_PHY_BLE_1M; + case LL_PHYS_LE_2M_BIT: + return BB_PHY_BLE_2M; + case LL_PHYS_LE_CODED_BIT: + return BB_PHY_BLE_CODED; + } +} + +/*************************************************************************************************/ +/*! + * \brief Convert PHY to PHYS bit. + * + * \param phy PHY. + * + * \return PHYS bit. + */ +/*************************************************************************************************/ +uint8_t lctrPhyToPhysBit(uint8_t phy) +{ + switch (phy) + { + default: + case BB_PHY_BLE_1M: + return LL_PHYS_LE_1M_BIT; + case BB_PHY_BLE_2M: + return LL_PHYS_LE_2M_BIT; + case BB_PHY_BLE_CODED: + return LL_PHYS_LE_CODED_BIT; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get LLCP procedure ID. + * + * \param event Event. + * + * \return LLCP procedure event ID. + */ +/*************************************************************************************************/ +uint8_t lctrGetProcId(uint8_t event) +{ + switch (event) + { + case LCTR_CONN_MSG_API_CHAN_MAP_UPDATE: + return LCTR_PROC_CMN_CH_MAP_UPD; + + case LCTR_CONN_MSG_API_REMOTE_FEATURE: + return LCTR_PROC_CMN_FEAT_EXCH; + + case LCTR_CONN_MSG_API_SET_MIN_USED_CHAN: + return LCTR_PROC_CMN_SET_MIN_USED_CHAN; + + case LCTR_CONN_MSG_API_REMOTE_VERSION: + return LCTR_PROC_CMN_VER_EXCH; + + case LCTR_CONN_MSG_API_DISCONNECT: + return LCTR_PROC_CMN_TERM; + + case LCTR_CONN_MSG_API_DATA_LEN_CHANGE: + return LCTR_PROC_CMN_DATA_LEN_UPD; + + case LCTR_CONN_MSG_API_CONN_UPDATE: + return LCTR_PROC_CONN_UPD; + + case LCTR_CONN_MSG_API_PHY_UPDATE: + return LCTR_PROC_PHY_UPD; + + case LCTR_CONN_MSG_API_START_ENC: + return LCTR_PROC_ENCRYPT; + + default: + return LCTR_PROC_INVALID; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_cs2.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_cs2.c new file mode 100644 index 0000000000000000000000000000000000000000..1662157a41a37291f3f6f06ea30b0b38283e8d25 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_cs2.c @@ -0,0 +1,135 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller data path implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_conn_cs2.h" +#include "lctr_int_conn.h" + +/*************************************************************************************************/ +/*! + * \brief Calculate permutation. + * + * \param v Input value. + * + * \return Result of permutation calculation. + */ +/*************************************************************************************************/ +static uint32_t lctrCalcPerm(uint32_t v) +{ + uint32_t mask; + + /* abcd efgh ijkl mnop */ + mask = 0x0F0F0F0F; + v = ((v << 8) & mask) | (v & ~mask); + + /* efgh abcd mnop ijkl xxxx */ + mask = mask ^ (mask << 2); + v = ((v << 4) & mask) | (v & ~mask); + + /* gh efcd abop mnkl ijxx xxxx */ + mask = mask ^ (mask << 1); + v = ((v << 2) & mask) | (v & ~mask); + + /* hgf edcb apon mlkj ixxx xxxx */ + return v >> 7; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate MAM (Multiply, Add, Modulo). + * + * \param a Input value a. + * \param b Input value b. + * + * \return Result of MAM. + */ +/*************************************************************************************************/ +static uint16_t lctrCalcMAM(uint16_t a, uint16_t b) +{ + /* (17 x a + b) mod 2^16 */ + return ((17 * a) + b) & 0xFFFFF; +} + +/*************************************************************************************************/ +/*! + * \brief Compute next channel index, algorithm #2. + * + * \param pCtx Connection context. + * \param numSkip Number of channels to skip. + * + * \return Next data channel index. + */ +/*************************************************************************************************/ +uint8_t lctrSelectNextChannel2(lctrConnCtx_t *pCtx, uint16_t numSkip) +{ + unsigned int prn, prn_e; + uint16_t unmapChan; + + /* Ignore parameter since eventCounter is adjusted by client. */ + (void)numSkip; + + /* Pseudo random number */ + + prn = pCtx->eventCounter ^ pCtx->chIdentifier; + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pCtx->chIdentifier); + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pCtx->chIdentifier); + prn = lctrCalcPerm(prn); + prn = lctrCalcMAM(prn, pCtx->chIdentifier); + /* uint16_t prn_s = prn; */ + prn_e = prn ^ pCtx->chIdentifier; + + /* unmappedChannel */ + + unmapChan = LL_MATH_MOD_37(prn_e & 0xFFFF); + + pCtx->lastChanIdx = unmapChan; + + /* remappingIndex */ + + if (!((UINT64_C(1) << unmapChan) & pCtx->chanMask)) + { + /* remappingIndex = (N * prn_e) / 2^16 */ + uint8_t remapIdx = (pCtx->numUsedChan * prn_e) >> 16; + return pCtx->chanRemapTbl[remapIdx]; + } + + return unmapChan; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the channel selection 2 resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrChannelSelection2Init(void) +{ + lctrChSelHdlr[LL_CH_SEL_2] = lctrSelectNextChannel2; + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_CH_SEL_2; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_data.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_data.c new file mode 100644 index 0000000000000000000000000000000000000000..31fb8ae6329a8a66ac061b1cf692b0cc10e11944 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_data.c @@ -0,0 +1,1087 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller data path implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn_slave.h" +#include "lctr_int_conn.h" +#include "lctr_pdu_conn.h" +#include "lmgr_api_conn.h" +#include "ll_math.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "hci_defs.h" +#include "bb_drv.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#define LCTR_DATA_TX_PDU_START_OFFSET 0 /*!< Data PDU start offset in a buffer. */ + +#define LCTR_FRAG_HDR_MAX_LEN LL_DATA_HDR_LEN /*!< Fragment header maximum length. */ +#define LCTR_FRAG_TRL_MAX_LEN LL_DATA_MIC_LEN /*!< Fragment trailer maximum length. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +#ifdef LCTR_CONN_NO_TIFS_REASSEMBLY +/*! \brief Transmit buffer descriptor. */ +typedef struct +{ + uint16_t aclLen; /*!< ACL PDU length. */ + uint16_t fragLen; /*!< Fragmentation length. */ + uint8_t fragCnt; /*!< Current fragmentation Tx count. */ + uint32_t pad; /*!< Padding to guarantee alignment. */ + uint8_t data[]; /*!< Data fragments. */ +} lctrTxBufDesc_t; +#else +/*! \brief Transmit buffer descriptor. */ +typedef struct +{ + uint8_t *pAclPdu; /*!< ACL PDU. */ + uint16_t aclLen; /*!< ACL PDU length. */ + uint8_t fragLen; /*!< Fragmentation length. */ + uint8_t fragCnt; /*!< Current fragmentation Tx count. */ + struct + { + uint8_t hdrLen; /*!< Data PDU header length. */ + uint8_t trlLen; /*!< Data PDU trailer length. */ + uint8_t hdr[LCTR_FRAG_HDR_MAX_LEN]; /*!< Data PDU header. */ + uint8_t trl[LCTR_FRAG_TRL_MAX_LEN]; /*!< Data PDU trailer (i.e., MIC). */ + } frag[]; /*!< Fragmented Data PDU packet data. */ +} lctrTxBufDesc_t; +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Free list of Tx buffer descriptors. */ +static wsfQueue_t lctrTxBufDescQ; + +/*! \brief Completed transmit buffer. */ +static uint8_t *pLctrTxCompBuf; + +/*! \brief Completed transmit buffer handle ID. */ +static wsfHandlerId_t lctrTxCompBufHandlerId; + +/*************************************************************************************************/ +/*! + * \brief Check to see whether it is necessary to abort slave latency when slave + * latency is not zero and there is data to send. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrCheckAbortSlvLatency(lctrConnCtx_t *pCtx) +{ + if (pCtx->role == LL_ROLE_MASTER) + { + return; + } + + if (((pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) && (lctrSlvCheckConnUpdInstant(pCtx)) && (pCtx->llcpInstantComp == TRUE)) || + ((pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) && (pCtx->isSlvPhyUpdInstant == TRUE) && (pCtx->llcpInstantComp == TRUE)) || + ((pCtx->llcpActiveProc == LCTR_PROC_CMN_CH_MAP_UPD) && (pCtx->cmnState == LCTR_CMN_STATE_BUSY) && (pCtx->llcpInstantComp == TRUE))) + { + /* Don't abort slave latency between the last CE with old parameter and the first CE with new parameter. */ + return; + } + + if (pCtx->maxLatency) + { + const uint32_t curTime = BbDrvGetCurrentTime(); + uint32_t connInterval = BB_US_TO_BB_TICKS(LCTR_CONN_IND_US(pCtx->connInterval)); + BbOpDesc_t *pOp = &pCtx->connBod; + + if ((pOp->due - curTime) >= LCTR_SCH_MAX_SPAN) + { + /* Slave tries to exit latency while the current BoD is executing. */ + pCtx->data.slv.abortSlvLatency = TRUE; + } + else if (pOp->due - curTime > connInterval) /* Imply (pOp->due - curTime) < LCTR_SCH_MAX_SPAN */ + { + /* If the connection BOD is due in the future and after the next immediate anchor point, + * set the flag to adjust the connection BOD later. */ + pCtx->data.slv.abortSlvLatency = TRUE; + + /* Remove the connection BOD, it will be rescheduled in the end callback. */ + SchRemove(pOp); + } + } +} +/*************************************************************************************************/ +/*! + * \brief Initialize the transmit memory resources. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + */ +/*************************************************************************************************/ +uint16_t lctrTxInitMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + unsigned int i; + + const uint16_t maxNumFrag = LL_MATH_DIV_27(pLctrRtCfg->maxAclLen + (LL_MAX_DATA_LEN_MIN - 1)); +#ifdef LCTR_CONN_NO_TIFS_REASSEMBLY + const uint16_t fragAlign = 4; + const uint16_t descSize = sizeof(lctrTxBufDesc_t) + (maxNumFrag * (LCTR_FRAG_HDR_MAX_LEN + LCTR_FRAG_TRL_MAX_LEN + LL_MAX_DATA_LEN_MIN + fragAlign)); +#else + const uint16_t descSize = sizeof(lctrTxBufDesc_t) + (maxNumFrag * sizeof(((lctrTxBufDesc_t *)0)->frag[0])); +#endif + pLctrTxCompBuf = NULL; + + LL_TRACE_INFO2(" RAM: %u x %u bytes -- Tx buffer descriptors", pLctrRtCfg->numTxBufs, sizeof(void *) + descSize); + + lctrTxBufDescQ.pHead = NULL; + lctrTxBufDescQ.pTail = NULL; + + + for (i = 0; i < pLctrRtCfg->numTxBufs; i++) + { + lctrTxBufDesc_t *pDesc; + + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & ~3) + sizeof(uint32_t)); + } + + /* Allocate memory. */ + pDesc = (lctrTxBufDesc_t *)pAvailMem; + pAvailMem += (2 * sizeof(uint32_t)) + descSize; /* wsfMsg_t header is at most 2 words */ + + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + return 0; + } + + /* Add to free list. */ + WsfQueueEnq(&lctrTxBufDescQ, pDesc); + } + + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Number of bytes that can be transmitted within time on LE 1M PHY. + * + * \param timeUsec Time in microseconds. + * + * \return Number of bytes. + */ +/*************************************************************************************************/ +static uint16_t lctrMaxNumBytesWithinUsec1M(uint16_t timeUsec) +{ + if (timeUsec < (LL_MIN_PKT_TIME_US_1M + (LL_DATA_MIC_LEN << 3))) + { + return 0; + } + /* (timePayload / 8) - bytesMic */ + return ((timeUsec - LL_MIN_PKT_TIME_US_1M) >> 3) - LL_DATA_MIC_LEN; +} + +/*************************************************************************************************/ +/*! + * \brief Number of bytes that can be transmitted within time on LE 2M PHY. + * + * \param timeUsec Time in microseconds. + * + * \return Number of bytes. + */ +/*************************************************************************************************/ +static uint16_t lctrMaxNumBytesWithinUsec2M(uint16_t timeUsec) +{ + if (timeUsec < (LL_MIN_PKT_TIME_US_2M + (LL_DATA_MIC_LEN << 2))) + { + return 0; + } + /* (timePayload / 4) - bytesMic */ + + return ((timeUsec - LL_MIN_PKT_TIME_US_2M) >> 2) - LL_DATA_MIC_LEN; +} + +/*************************************************************************************************/ +/*! + * \brief Number of bytes that can be transmitted within time on LE Coded PHY. + * + * \param timeUsec Time in microseconds. + * + * \return Number of bytes. + */ +/*************************************************************************************************/ +static uint16_t lctrMaxNumBytesWithinUsecCoded(uint16_t timeUsec) +{ + if (timeUsec < (LL_MIN_PKT_TIME_US_CODED_S8 + (LL_DATA_MIC_LEN << 6))) + { + return 0; + } + /* (timePayload / 64) - bytesMic */ + return ((timeUsec - LL_MIN_PKT_TIME_US_CODED_S8) >> 6) - LL_DATA_MIC_LEN; +} + +/*************************************************************************************************/ +/*! + * \brief Set packet time restriction. + * + * \param pCtx Connection context. + * \param txPhys Transmit PHYs for PHY update in progress. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSetPacketTimeRestriction(lctrConnCtx_t *pCtx, uint8_t txPhys) +{ + pCtx->txPhysPending = txPhys; +} +/*************************************************************************************************/ +/*! + * \brief Remove packet time restriction. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrRemovePacketTimeRestriction(lctrConnCtx_t *pCtx) +{ + pCtx->txPhysPending = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Get maximum connection duration. + * + * \param phy Transmitter or Receiver PHY. + * \param maxLen Maximum transmit or receive length. + * \param maxTime Maximum transmit or receive time. + * + * \return Maximum connection duration in microseconds. + */ +/*************************************************************************************************/ +static uint16_t lctrGetMaxConnDurationUsec(uint8_t phy, uint16_t maxLen, uint16_t maxTime) +{ + uint16_t maxDur; + + switch (phy) + { + default: + case BB_PHY_BLE_1M: + maxDur = WSF_MIN(LL_DATA_LEN_TO_TIME_1M(maxLen), maxTime); + break; + case BB_PHY_BLE_2M: + maxDur = WSF_MIN(LL_DATA_LEN_TO_TIME_2M(maxLen), maxTime); + break; + case BB_PHY_BLE_CODED: + /* maximum time may be less than minimum packet for coded PHY */ + maxDur = WSF_MIN(LL_DATA_LEN_TO_TIME_CODED_S8(maxLen), + WSF_MAX(maxTime, + LL_DATA_LEN_TO_TIME_CODED_S8(LL_MAX_DATA_LEN_MIN))); + break; + } + + return maxDur; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate connection duration. + * + * \param pCtx Connection context. + * \param pDataLen Data lengths. + * + * \return Connection duration in microseconds. + */ +/*************************************************************************************************/ +uint16_t lctrCalcConnDurationUsec(lctrConnCtx_t *pCtx, const lctrDataLen_t *pDataLen) +{ + uint16_t connDur = LL_BLE_TIFS_US + + lctrGetMaxConnDurationUsec(pCtx->bleData.chan.txPhy, pDataLen->maxTxLen, pDataLen->maxTxTime) + + lctrGetMaxConnDurationUsec(pCtx->bleData.chan.rxPhy, pDataLen->maxRxLen, pDataLen->maxRxTime); + + return connDur; +} + +/*************************************************************************************************/ +/*! + * \brief Tx fragment length for connection. + * + * \param pCtx Connection context. + * + * \return Tx fragment length for connection. + */ +/*************************************************************************************************/ +uint16_t lctrTxFragLen(lctrConnCtx_t *pCtx) +{ + uint8_t txPhy = pCtx->bleData.chan.txPhy; + uint16_t numBytes; + + if (pCtx->txPhysPending != 0) + { + switch (txPhy) + { + case BB_PHY_BLE_2M: + if (pCtx->txPhysPending & LL_PHYS_LE_1M_BIT) + { + txPhy = BB_PHY_BLE_1M; + } + /* no break */ + case BB_PHY_BLE_1M: + if (pCtx->txPhysPending & LL_PHYS_LE_CODED_BIT) + { + txPhy = BB_PHY_BLE_CODED; + } + /* no break */ + case BB_PHY_BLE_CODED: + /* no slower PHYs */ + break; + default: + break; + } + } + + switch (txPhy) + { + default: + case BB_PHY_BLE_1M: + numBytes = lctrMaxNumBytesWithinUsec1M(pCtx->effDataPdu.maxTxTime); + break; + case BB_PHY_BLE_2M: + numBytes = lctrMaxNumBytesWithinUsec2M(pCtx->effDataPdu.maxTxTime); + break; + case BB_PHY_BLE_CODED: + numBytes = lctrMaxNumBytesWithinUsecCoded(pCtx->effDataPdu.maxTxTime); + break; + } + return WSF_MIN(pCtx->effDataPdu.maxTxLen, WSF_MAX(LL_MAX_DATA_LEN_MIN, numBytes)); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a Tx buffer descriptor. + * + * \return A Tx buffer descriptor, NULL if allocation fails. + */ +/*************************************************************************************************/ +static lctrTxBufDesc_t *lctrAllocTxBufDesc(void) +{ + uint8_t *pElem; + + if ((pElem = WsfQueueDeq(&lctrTxBufDescQ)) == NULL) + { + return NULL; + } + + pElem += (2 * sizeof(uint32_t)); /* hide header */ + + return (lctrTxBufDesc_t *)pElem; +} + +/*************************************************************************************************/ +/*! + * \brief Free a Tx buffer descriptor. + * + * \param pDesc Pointer to a Tx buffer descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrFreeTxBufDesc(lctrTxBufDesc_t *pDesc) +{ + uint8_t *pElem = (uint8_t *)pDesc; + pElem -= (2 * sizeof(uint32_t)); /* recover header */ + + WsfQueueEnq(&lctrTxBufDescQ, pElem); +} + +/*************************************************************************************************/ +/*! + * \brief Assemble data PDU. + * + * \param pAclHdr ACL header. + * \param pBuf Buffer to pack the Data PDU header. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrAssembleDataPdu(lctrAclHdr_t *pAclHdr, uint8_t *pBuf) +{ + /* All additional fields must be zero'ed since flow control bits will be or'ed in at transmit. */ + lctrDataPduHdr_t dataHdr = { 0 }; + + /* Assemble data PDU. */ + switch (pAclHdr->pktBound) + { + case LCTR_PB_START_NON_AUTO_FLUSH: + dataHdr.llid = LL_LLID_START_PDU; + break; + case LCTR_PB_CONT_FRAG: + dataHdr.llid = LL_LLID_CONT_PDU; + break; + case LCTR_PB_VS_DATA: + default: + dataHdr.llid = LL_LLID_VS_PDU; + break; + } + + dataHdr.len = pAclHdr->len; + + lctrPackDataPduHdr(pBuf, &dataHdr); +} + +/*************************************************************************************************/ +/*! + * \brief Queue data PDU onto ARQ queue. + * + * \param pCtx Connection context. + * \param fragLen Fragment length. + * \param pAclHdr ACL header. + * \param pAclBuf ACL buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrTxDataPduQueue(lctrConnCtx_t *pCtx, uint16_t fragLen, lctrAclHdr_t *pAclHdr, uint8_t *pAclBuf) +{ + uint16_t fragOffset = 0; + uint16_t aclLen = pAclHdr->len; + uint8_t *pData; + uint8_t *pAclBufStart; + + lctrTxBufDesc_t *pDesc; + + if ((pDesc = lctrAllocTxBufDesc()) == NULL) + { + LL_TRACE_ERR1("Failed to allocate transmit buffer descriptor: connHandle=%u", pAclHdr->connHandle); + WsfMsgFree(pAclBuf); + lmgrPersistCb.sendCompCback(pAclHdr->connHandle, 1); + lctrDataTxIncAvailBuf(); + + lctrNotifyHostHwErrInd(LL_ERROR_CODE_MEM_CAP_EXCEEDED); + return; + } + + if (fragLen >= pAclHdr->len) + { + fragLen = pAclHdr->len; + } + + pDesc->aclLen = pAclHdr->len; + pDesc->fragLen = fragLen; + pDesc->fragCnt = 0; + +#ifdef LCTR_CONN_NO_TIFS_REASSEMBLY + if (pDesc->fragLen != pAclHdr->len) + { + /* Adjust fragment length for alignment. */ + const uint16_t fragAlign = 4; + const uint16_t fragOff = ((LL_DATA_HDR_LEN + fragLen) % fragAlign); + if (fragOff != 0) + { + fragLen -= fragOff; + pDesc->fragLen = fragLen; + } + } + + pAclBuf += HCI_ACL_HDR_LEN; + + pData = &pDesc->data[LL_DATA_HDR_LEN]; + pAclBufStart = pAclBuf; + pDesc->aclLen = 0; + + while (fragOffset < aclLen) + { + const uint16_t dataRem = aclLen - fragOffset; + const uint16_t fragSize = WSF_MIN(dataRem, fragLen); + uint8_t *pHdr = pData - LL_DATA_HDR_LEN; + uint8_t *pMic = pData + fragSize; + + memcpy(pData, pAclBuf, fragSize); + + pAclHdr->len = fragSize; + lctrAssembleDataPdu(pAclHdr, pHdr); + + if (lctrPktEncryptHdlr && lctrPktEncryptHdlr(&pCtx->bleData.chan.enc, pHdr, pData, pMic)) + { + pData += LL_DATA_HDR_LEN + fragSize + LL_DATA_MIC_LEN; + pDesc->fragLen = LL_DATA_HDR_LEN + fragLen + LL_DATA_MIC_LEN; + pDesc->aclLen += LL_DATA_HDR_LEN + fragSize + LL_DATA_MIC_LEN; + +#if (LL_ENABLE_TESTER) + pMic[0] ^= (llTesterCb.pktMic >> 0) & 0xFF; + pMic[1] ^= (llTesterCb.pktMic >> 8) & 0xFF; + pMic[2] ^= (llTesterCb.pktMic >> 16) & 0xFF; + pMic[3] ^= (llTesterCb.pktMic >> 24) & 0xFF; +#endif + } + else + { + pData += LL_DATA_HDR_LEN + fragSize; + pDesc->fragLen = LL_DATA_HDR_LEN + fragLen; + pDesc->aclLen += LL_DATA_HDR_LEN + fragSize; + } + + pAclHdr->pktBound = LCTR_PB_CONT_FRAG; /* modify for remaining fragments. */ + + fragOffset += fragSize; + pAclBuf += fragSize; + } + + WsfMsgFree(pAclBufStart - HCI_ACL_HDR_LEN); +#else + + pAclBuf += HCI_ACL_HDR_LEN; + + uint8_t fragCnt = 0; + pDesc->pAclPdu = pAclBuf; + + while (fragOffset < aclLen) + { + const uint16_t dataRem = aclLen - fragOffset; + const uint16_t fragSize = WSF_MIN(dataRem, fragLen); + + pAclHdr->len = fragSize; + lctrAssembleDataPdu(pAclHdr, pDesc->frag[fragCnt].hdr); + pDesc->frag[fragCnt].hdrLen = LL_DATA_HDR_LEN; + + if (lctrPktEncryptHdlr && lctrPktEncryptHdlr(&pCtx->bleData.chan.enc, pDesc->frag[fragCnt].hdr, pAclBuf, pDesc->frag[fragCnt].trl)) + { + pDesc->frag[fragCnt].trlLen = LL_DATA_MIC_LEN; + +#if (LL_ENABLE_TESTER) + pDesc->frag[fragCnt].trl[0] ^= (llTesterCb.pktMic >> 0) & 0xFF; + pDesc->frag[fragCnt].trl[1] ^= (llTesterCb.pktMic >> 8) & 0xFF; + pDesc->frag[fragCnt].trl[2] ^= (llTesterCb.pktMic >> 16) & 0xFF; + pDesc->frag[fragCnt].trl[3] ^= (llTesterCb.pktMic >> 24) & 0xFF; +#endif + } + else + { + pDesc->frag[fragCnt].trlLen = 0; + } + + pAclHdr->pktBound = LCTR_PB_CONT_FRAG; /* modify for remaining fragments. */ + + fragOffset += fragSize; + pAclBuf += fragSize; + fragCnt++; + } +#endif + + WsfMsgEnq(&pCtx->txArqQ, pAclHdr->connHandle, (uint8_t *)pDesc); + + lctrCheckAbortSlvLatency(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Queue control PDU onto ARQ queue. + * + * \param pCtx Connection context. + * \param pBuf Data PDU buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrTxCtrlPduQueue(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ +#if (LL_ENABLE_TESTER) + uint8_t opcode; + uint16_t connHandle = LCTR_GET_CONN_HANDLE(pCtx); +#endif + + pBuf -= (LCTR_DATA_TX_PDU_START_OFFSET + LL_DATA_HDR_LEN); + +#if (LL_ENABLE_TESTER) + opcode = pBuf[LCTR_DATA_TX_PDU_START_OFFSET + LL_DATA_HDR_LEN]; + + if (llTesterCb.dataTriggerEnabled && + (llTesterCb.dataTriggerPdu == opcode) && + !llTesterCb.dataTriggerAfter) + { + lctrForceTxData(connHandle); + } + + if ((opcode < 32) && ((llTesterCb.txLlcpFilter & (1 << opcode)) != 0)) + { + WsfMsgFree(pBuf); + return; + } +#endif + + if (lctrPktEncryptHdlr) + { + uint8_t *pHdr = pBuf + LCTR_DATA_TX_PDU_START_OFFSET; + uint8_t *pData = pHdr + LL_DATA_HDR_LEN; + uint8_t *pMic = pData + pHdr[LCTR_DATA_PDU_LEN_OFFSET]; + lctrPktEncryptHdlr(&pCtx->bleData.chan.enc, pHdr, pData, pMic); + } + + WsfMsgEnq(&pCtx->txArqQ, LCTR_CTRL_DATA_HANDLE, pBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_TX_PENDING)); + + lctrCheckAbortSlvLatency(pCtx); + +#if (LL_ENABLE_TESTER) + if (llTesterCb.dataTriggerEnabled && + (llTesterCb.dataTriggerPdu == opcode) && + llTesterCb.dataTriggerAfter) + { + lctrForceTxData(connHandle); + } +#endif +} + +/*************************************************************************************************/ +/*! + * \brief Assemble control PDU. + * + * \param pBuf Buffer to pack the data PDU header. + * \param len Length of buffer. + * + * \return Data PDU header length. + */ +/*************************************************************************************************/ +static uint8_t lctrAssembleCtrlPdu(uint8_t *pBuf, uint8_t len) +{ + /* All additional fields must be zero'ed since flow control bits will be or'ed in at transmit. */ + lctrDataPduHdr_t dataHdr; + dataHdr.llid = LL_LLID_CTRL_PDU; + dataHdr.len = len; + + return lctrPackDataPduHdr(pBuf, &dataHdr); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a transmit LLCP PDU buffer. + * + * \param pduLen Length of the PDU to allocate. + * + * \return Pointer to the start of the PDU data buffer. + */ +/*************************************************************************************************/ +uint8_t *lctrTxCtrlPduAlloc(uint8_t pduLen) +{ + uint8_t *pPdu; + + if ((pPdu = WsfMsgAlloc(LCTR_DATA_TX_PDU_START_OFFSET + LCTR_DATA_PDU_LEN(pduLen))) != NULL) + { + pPdu += LCTR_DATA_TX_PDU_START_OFFSET; + pPdu += lctrAssembleCtrlPdu(pPdu, pduLen); + } + + return pPdu; +} + +/*************************************************************************************************/ +/*! + * \brief Get top element in Tx queue. + * + * \param pCtx Connection context. + * \param descs Storage for BB descriptors. + * \param pMd Storage for MD (TRUE if top element is not only element). + * + * \return Number of BB descriptors. + */ +/*************************************************************************************************/ +uint8_t lctrTxQueuePeek(lctrConnCtx_t *pCtx, BbBleDrvTxBufDesc_t *descs, bool_t *pMd) +{ + wsfHandlerId_t handlerId; + uint8_t *pTxBuf; + uint8_t descCnt = 0; + bool_t md = FALSE; + + /* Do not remove from ARQ until acknowledged by peer. */ + pTxBuf = WsfMsgPeek(&pCtx->txArqQ, &handlerId); + if (pTxBuf != NULL) + { + md = !lctrIsQueueDepthOne(&pCtx->txArqQ); + + /*** Send Data PDU ***/ + + if (handlerId != LCTR_CTRL_DATA_HANDLE) + { + lctrTxBufDesc_t *pDesc = (lctrTxBufDesc_t *)pTxBuf; + uint8_t fragCnt = pDesc->fragCnt; + uint16_t fragSize = pDesc->fragLen; + uint16_t fragOff = fragSize * fragCnt; + + if (fragOff + fragSize > pDesc->aclLen) + { + fragSize = pDesc->aclLen - fragOff; + } +#ifdef LCTR_CONN_NO_TIFS_REASSEMBLY + descs[0].len = fragSize; + descs[0].pBuf = &pDesc->data[fragOff]; + descCnt = 1; +#else + descs[0].len = pDesc->frag[fragCnt].hdrLen; + descs[0].pBuf = pDesc->frag[fragCnt].hdr; + descs[1].len = fragSize; + descs[1].pBuf = pDesc->pAclPdu + fragOff; + descCnt = 2; + if (pDesc->frag[fragCnt].trlLen) + { + descs[2].len = pDesc->frag[fragCnt].trlLen; + descs[2].pBuf = pDesc->frag[fragCnt].trl; + descCnt = 3; + } +#endif + md = md || ((fragOff + fragSize) < pDesc->aclLen); + } + else + { + /* Adjust message buffer to the start of the data PDU. */ + pTxBuf += LCTR_DATA_TX_PDU_START_OFFSET; + + descs[0].len = LL_DATA_HDR_LEN + pTxBuf[LCTR_DATA_PDU_LEN_OFFSET]; + descs[0].pBuf = pTxBuf; + descCnt = 1; + } + } + + *pMd = md; + return descCnt; +} + +/*************************************************************************************************/ +/*! + * \brief Pop top element from Tx queue. + * + * \param pCtx Connection context. + * + * \return TRUE if element popped. + */ +/*************************************************************************************************/ +bool_t lctrTxQueuePop(lctrConnCtx_t *pCtx) +{ + wsfHandlerId_t handlerId; + uint8_t *pBuf; + + WSF_ASSERT(pLctrTxCompBuf == NULL); + + /* Remove last transmitted PDU. */ + if ((pBuf = WsfMsgPeek(&pCtx->txArqQ, &handlerId)) != NULL) + { + if (handlerId != LCTR_CTRL_DATA_HANDLE) + { + lctrTxBufDesc_t *pDesc = (lctrTxBufDesc_t *)pBuf; + uint16_t fragSize = pDesc->fragLen; + + if ((fragSize * (pDesc->fragCnt + 1)) >= pDesc->aclLen) /* last fragment */ + { + /* Store buffer for post setup cleanup. */ + pLctrTxCompBuf = pBuf; + lctrTxCompBufHandlerId = handlerId; + + WsfMsgDeq(&pCtx->txArqQ, &handlerId); + } + else + { + /* Move to next fragment. */ + pDesc->fragCnt++; + } + } + else + { + /* Store buffer for post setup cleanup. */ + pLctrTxCompBuf = pBuf; + lctrTxCompBufHandlerId = handlerId; + + WsfMsgDeq(&pCtx->txArqQ, &handlerId); + } + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Pop top element from Tx queue. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrTxQueuePopCleanup(lctrConnCtx_t *pCtx) +{ + if (pLctrTxCompBuf) + { + if (lctrTxCompBufHandlerId != LCTR_CTRL_DATA_HANDLE) + { + lctrTxBufDesc_t *pDesc = (lctrTxBufDesc_t *)pLctrTxCompBuf; + +#ifndef LCTR_CONN_NO_TIFS_REASSEMBLY + WsfMsgFree(pDesc->pAclPdu - HCI_ACL_HDR_LEN); +#endif + lctrFreeTxBufDesc(pDesc); + lctrDataTxIncAvailBuf(); + pCtx->numTxComp++; + } + else + { + WsfMsgFree(pLctrTxCompBuf); + } + + pLctrTxCompBuf = NULL; + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_TX_COMPLETE)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear Tx queue. + * + * \param pCtx Connection context. + * + * \return Number of freed buffers. + */ +/*************************************************************************************************/ +uint8_t lctrTxQueueClear(lctrConnCtx_t *pCtx) +{ + uint8_t *pBuf; + uint8_t numTxBufs = 0; + wsfHandlerId_t handlerId; + + while ((pBuf = WsfMsgDeq(&pCtx->txArqQ, &handlerId)) != NULL) + { + if (handlerId != LCTR_CTRL_DATA_HANDLE) + { + lctrTxBufDesc_t *pDesc = (lctrTxBufDesc_t *)pBuf; + +#ifndef LCTR_CONN_NO_TIFS_REASSEMBLY + WsfMsgFree(pDesc->pAclPdu - HCI_ACL_HDR_LEN); +#endif + lctrFreeTxBufDesc(pDesc); + + lctrDataTxIncAvailBuf(); + numTxBufs++; + } + else + { + WsfMsgFree(pBuf); + } + } + + return numTxBufs; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a receive data PDU buffer. + * + * \param maxRxLen Maximum receive length. + * + * \return Pointer to the start of the PDU data buffer. + */ +/*************************************************************************************************/ +uint8_t *lctrRxPduAlloc(uint16_t maxRxLen) +{ + /* LCTR_DATA_PDU_MAX_LEN includes LL_DATA_MIC_LEN if required. */ + const uint16_t allocLen = WSF_MAX(BB_FIXED_DATA_PKT_LEN, LCTR_DATA_PDU_LEN(maxRxLen)) + LCTR_DATA_PDU_START_OFFSET; + + uint8_t *pBuf; + + /* Include ACL header headroom. */ + if ((pBuf = WsfMsgAlloc(HCI_ACL_HDR_LEN + allocLen)) != NULL) + { + /* Return start of data PDU. */ + pBuf += LCTR_DATA_PDU_START_OFFSET; + } + + return pBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Free a receive data PDU buffer. + * + * \param pBuf PDU data buffer to free. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrRxPduFree(uint8_t *pBuf) +{ + /* Recover headroom, assume buffer starts at the beginning of the data PDU. */ + pBuf -= LCTR_DATA_PDU_START_OFFSET; + + WsfMsgFree(pBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Enqueue a receive data PDU buffer. + * + * \param pBuf PDU data buffer to queue. + * \param eventCounter Event counter. + * \param connHandle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrRxEnq(uint8_t *pBuf, uint16_t eventCounter, uint16_t connHandle) +{ + /* Stamp packet with event counter. */ + pBuf -= LCTR_DATA_PDU_START_OFFSET; + UINT16_TO_BUF(pBuf, eventCounter); + + /* Queue LE Data PDU. */ + WsfMsgEnq(&lmgrConnCb.rxDataQ, connHandle, pBuf); + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_RX_PENDING)); +} + +/*************************************************************************************************/ +/*! + * \brief Dequeue a receive data PDU buffer. + * + * \param pConnHandle Storage for connection handle. + * + * \return Pointer to the start of the PDU data buffer. + */ +/*************************************************************************************************/ +uint8_t *lctrRxDeq(uint16_t *pConnHandle) +{ + uint8_t *pBuf; + wsfHandlerId_t handlerId; + + if ((pBuf = WsfMsgDeq(&lmgrConnCb.rxDataQ, &handlerId)) != NULL) + { + /* Return start of data PDU. */ + pBuf += LCTR_DATA_PDU_START_OFFSET; + + *pConnHandle = (uint16_t)handlerId; + } + return pBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Enqueue a receive data PDU buffer for a connection. + * + * \param pCtx Connection context; + * \param pBuf PDU data buffer to queue. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrRxConnEnq(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ + WsfMsgEnq(&pCtx->rxDataQ, LCTR_GET_CONN_HANDLE(pCtx), pBuf - LCTR_DATA_PDU_START_OFFSET); + pCtx->numRxPend++; +} + +/*************************************************************************************************/ +/*! + * \brief Dequeue a receive data PDU buffer for a connection as a ACL message. + * + * \param pCtx Connection context; + * + * \return Pointer to the start of the ACL message. + * + * \note Returned pointer will be freed with WsfMsgFree(). + */ +/*************************************************************************************************/ +uint8_t *lctrRxConnDeqAcl(lctrConnCtx_t *pCtx) +{ + uint8_t *pAclBuf; + wsfHandlerId_t connHandle; + + if ((pAclBuf = WsfMsgDeq(&pCtx->rxDataQ, &connHandle)) != NULL) + { + /* lctrRxPduFree(pRxBuf); */ /* Freed in LHCI, etc. */ + /* lctrDataRxIncAvailBuf(); */ /* in LctrRxComplete(). */ + + uint8_t * const pDataBuf = pAclBuf + LCTR_DATA_PDU_START_OFFSET; + lctrAclHdr_t aclHdr; + uint8_t llid = pDataBuf[LCTR_DATA_PDU_FC_OFFSET] & LL_DATA_HDR_LLID_MSK; + + /*** Assemble ACL packet. ***/ + + aclHdr.connHandle = connHandle; + aclHdr.len = pDataBuf[LCTR_DATA_PDU_LEN_OFFSET]; + + switch (llid) + { + case LL_LLID_START_PDU: + aclHdr.pktBound = LCTR_PB_START_AUTO_FLUSH; + break; + case LL_LLID_CONT_PDU: + aclHdr.pktBound = LCTR_PB_CONT_FRAG; + break; + case LL_LLID_VS_PDU: + default: + aclHdr.pktBound = LCTR_PB_VS_DATA; + break; + } + + lctrPackAclHdr(pAclBuf, &aclHdr); + + /* Move ACL data beside the header if necessary. */ + if (LCTR_DATA_PDU_START_OFFSET + LL_DATA_HDR_LEN > HCI_ACL_HDR_LEN) + { + memmove(pAclBuf + HCI_ACL_HDR_LEN, pAclBuf + LCTR_DATA_PDU_START_OFFSET + LL_DATA_HDR_LEN, aclHdr.len); + } + } + + return pAclBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Clear receive queue for a connection. + * + * \param pCtx Connection context; + * + * \return Number of freed buffers. + */ +/*************************************************************************************************/ +uint8_t lctrRxConnClear(lctrConnCtx_t *pCtx) +{ + uint8_t *pBuf; + uint8_t numRxBufs = 0; + wsfHandlerId_t handlerId; + + /* Flush remaining receive packets. */ + while ((pBuf = WsfMsgDeq(&pCtx->rxDataQ, &handlerId)) != NULL) + { + WsfMsgFree(pBuf); + numRxBufs++; + } + + return numRxBufs; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..e4d0bdd68bf01f8c88fb3cbebf6a82a7d6e63e4f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_master.c @@ -0,0 +1,485 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_adv_master.h" +#include "lmgr_api_conn.h" +#include "sch_api.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_trace.h" +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ +/*! \brief Get connection offsets callback. */ +LctrRmCback_t lctrGetConnOffsetsCback = NULL; + +/*! \brief Get periodic advertising offsets callback. */ +LctrRmCback_t lctrGetPerOffsetsCback = NULL; + +/*************************************************************************************************/ +/*! + * \brief Process a received data channel PDU in master role. + * + * \param pCtx Connection context. + * \param pBuf PDU buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstProcessDataPdu(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ + if (pCtx->enabled) + { + uint8_t result = lctrDecodeCtrlPdu(&lctrDataPdu, pBuf, pCtx->role); + + switch (result) + { + case LL_SUCCESS: +#if (LL_ENABLE_TESTER) + if ((llTesterCb.rxLlcpFilter & (1 << lctrDataPdu.opcode)) != 0) + { + return; + } +#endif + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + } + break; + case LL_ERROR_CODE_INVALID_LMP_PARAMS: + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + } + break; + default: + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + } + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Master Tx data pending task event handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstConnTxPendingHandler(void) +{ + unsigned int i; + + for (i = 0; i < pLctrRtCfg->maxConn; i++) + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(i); + if ((pCtx->enabled) && + !WsfQueueEmpty(&pCtx->txArqQ)) + { + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_DATA_PENDING); + } + else + { + /* Event is not used by the slave. */ + /* lctrSlvConnExecuteSm(pCtx, LCTR_CONN_DATA_PENDING); */ + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Master connection reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstConnResetHandler(void) +{ + BbBleConnSlaveInit(); + BbBleConnMasterInit(); + SchRmInit(); + lctrConnDefaults(); + LmgrConnInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Execute master state machine. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstConnExecute(lctrConnMsg_t *pMsg) +{ + lctrConnCtx_t *pCtx; + pCtx = LCTR_GET_CONN_CTX(pMsg->hdr.handle); + + if (pCtx->enabled) + { + pLctrConnMsg = pMsg; + + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, pMsg->hdr.event); + } + else + { + lctrSlvConnExecuteSm(pCtx, pMsg->hdr.event); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Master connection message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstConnDisp(lctrConnMsg_t *pMsg) +{ + if (pMsg->hdr.dispId != LCTR_DISP_BCST) + { + WSF_ASSERT(pMsg->hdr.handle < pLctrRtCfg->maxConn); + lctrMstConnExecute(pMsg); + } + else + { + for (pMsg->hdr.handle = 0; pMsg->hdr.handle < pLctrRtCfg->maxConn; pMsg->hdr.handle++) + { + lctrMstConnExecute(pMsg); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Build a connection operation. + * + * \param pCtx Connection context. + * \param pConnInd Connection indication. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnBuildOp(lctrConnCtx_t *pCtx, lctrConnInd_t *pConnInd) +{ + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pCtx->connBod; + BbBleData_t * const pBle = &pCtx->bleData; + BbBleMstConnEvent_t * const pConn = &pBle->op.mstConn; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + memset(pConn, 0, sizeof(BbBleMstConnEvent_t)); + + /*** Connection context setup ***/ + + /* pCtx->lastChanIdx = 0; */ /* cleared in lctrMstConnAdjustOpStart() */ + /* pCtx->eventCounter = 0; */ /* cleared in lctrMstConnAdjustOpStart() */ + pCtx->chanMask = pConnInd->chanMask; + pCtx->hopInc = pConnInd->hopInc; + pCtx->connInterval = pConnInd->interval; + /* pCtx->txHdr.sn = 0; */ /* cleared in alloc */ + /* pCtx->txHdr.nesn = 0; */ /* cleared in alloc */ + pCtx->maxLatency = pConnInd->latency; + pCtx->supTimeoutMs = LCTR_CONN_IND_TO_MS(pConnInd->timeout); + pCtx->authTimeoutMs = LL_DEF_AUTH_TO_MS; + pCtx->pingPeriodMs = lctrCalcPingPeriodMs(pCtx, LL_DEF_AUTH_TO_MS); + /* pCtx->llcpState = LCTR_LLCP_STATE_IDLE; */ + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + lctrBuildRemapTable(pCtx); + pCtx->chIdentifier = (pConnInd->accessAddr >> 16) ^ + (pConnInd->accessAddr >> 0); + + /*** BLE general setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_CONN_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* deferred assignment */ + pBle->chan.txPower = pLctrRtCfg->defTxPwrLvl; + pBle->chan.accAddr = pConnInd->accessAddr; + pBle->chan.crcInit = pConnInd->crcInit; + pBle->chan.txPhy = BB_PHY_BLE_1M; /* same PHY as CONNECT_REQ */ + pBle->chan.rxPhy = BB_PHY_BLE_1M; /* same PHY as CONNECT_REQ */ + + /* Set PHY options to default behavior for connection. */ + pBle->chan.initTxPhyOptions = BB_PHY_OPTIONS_BLE_S8; /* TODO: Change to scanned PHY options from extended advertiser. */ + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = pConnInd->accessAddr ^ llTesterCb.dataAccessAddrRx; + pBle->chan.accAddrTx = pConnInd->accessAddr ^ llTesterCb.dataAccessAddrTx; + pBle->chan.crcInitRx = pConnInd->crcInit ^ llTesterCb.dataCrcInitRx; + pBle->chan.crcInitTx = pConnInd->crcInit ^ llTesterCb.dataCrcInitTx; +#endif + + /* pBle->chan.enc.enaEncrypt = FALSE; */ /* cleared in alloc */ + /* pBle->chan.enc.enaDecrypt = FALSE; */ + pBle->chan.enc.enaAuth = TRUE; + /* pBle->chan.enc.nonceMode = BB_NONCE_MODE_PKT_CNTR; */ /* cleared in alloc */ + + pCtx->txHdr.llid = ~LL_LLID_VS_PDU; /* reset last PDU LLID */ + + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); /* actual PHY */ + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); /* actual PHY */ + + /*** General setup ***/ + + /* pOp->dueOffsetUsec = 0; */ /* cleared in alloc */ + pOp->minDurUsec = pCtx->localConnDurUsec; + pOp->maxDurUsec = LCTR_CONN_IND_US(pCtx->connInterval); + + /* pOp->due = scanRefTime + BB_US_TO_BB_TICKS(maxOffsetUsec); */ /* set in lctrMstConnAdjustOpStart() */ + pOp->reschPolicy = BB_RESCH_FIXED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstConnEndOp; + pOp->abortCback = lctrMstConnAbortOp; + pOp->pCtx = pCtx; + + /*** BLE connection setup ***/ + + pConn->execCback = lctrMstConnBeginOp; + pConn->cancelCback = lctrMstConnCleanupOp; + pConn->txDataCback = lctrMstConnTxCompletion; + pConn->rxDataCback = lctrMstConnRxCompletion; + + /*** Commit operation ***/ + + /* Postponed in lctrMstConnAdjustOpStart() when scan operation begins. */ +} + +/*************************************************************************************************/ +/*! + * \brief Set the establish connection state. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstSetEstablishConn(lctrConnCtx_t *pCtx) +{ + lctrConnInd_t * const pConnInd = &pLctrConnMsg->connEstablish.connInd; + + const uint16_t txWinOffsetCnt = pConnInd->txWinOffset + LCTR_DATA_CHAN_DLY; + + /* Initially use fast termination. */ + uint32_t fastTermCnt = txWinOffsetCnt + pConnInd->txWinSize + + (LCTR_FAST_TERM_CNT * pConnInd->interval); + WsfTimerStartMs(&pCtx->tmrSupTimeout, LCTR_CONN_IND_MS(fastTermCnt)); + + /* Set initial channel. */ + pCtx->usedChSel = pLctrConnMsg->connEstablish.usedChSel; + pCtx->bleData.chan.txPhy = pCtx->bleData.chan.rxPhy = pLctrConnMsg->connEstablish.phy; + pCtx->bleData.chan.chanIdx = lctrChSelHdlr[pCtx->usedChSel](pCtx, 0); + /* Update BOD using new channel selection algorithm. */ + SchReload(&pCtx->connBod); + + LL_TRACE_INFO1(" >>> Connection established, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); + LL_TRACE_INFO1(" connIntervalUsec=%u", LCTR_CONN_IND_US(pCtx->connInterval)); + LL_TRACE_INFO1(" due=%u", pCtx->connBod.due); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for connectable master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstConnInit(void) +{ + /* Add reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_CONN] = lctrMstConnResetHandler; + + /* Add connection message dispatcher. */ + lctrMsgDispTbl[LCTR_DISP_CONN] = (LctrMsgDisp_t)lctrMstConnDisp; + + /* Add connection event handlers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_PENDING] = lctrConnRxPendingHandler; + lctrEventHdlrTbl[LCTR_EVENT_TX_PENDING] = lctrMstConnTxPendingHandler; + lctrEventHdlrTbl[LCTR_EVENT_TX_COMPLETE] = lctrConnTxCompletedHandler; + + /* Add LLCP SM handler. */ + lctrMstLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD] = lctrMstLlcpExecuteConnUpdSm; + lctrMstLlcpSmTbl[LCTR_LLCP_SM_CMN] = lctrLlcpExecuteCommonSm; + + /* Add control PDU handler. */ + lctrCtrlPduHdlr = lctrMstProcessDataPdu; + + /* Add channel selection handler. */ + lctrChSelHdlr[LL_CH_SEL_1] = lctrSelectNextDataChannel; + + lctrConnDefaults(); + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_1) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_CONN_PARAM_REQ_PROC | + LL_FEAT_EXT_REJECT_IND | + LL_FEAT_SLV_INIT_FEAT_EXCH; + } + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_2) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_DATA_LEN_EXT; + } + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_MIN_NUM_USED_CHAN; + } + + lctrGetConnOffsetsCback = lctrGetConnOffsets; +} + +/*************************************************************************************************/ +/*! + * \brief Compute new CRC init. + * + * \return New CRC init value. + */ +/*************************************************************************************************/ +uint32_t lctrComputeCrcInit(void) +{ + return LlMathRandNum() & 0xFFFFFF; +} + +/*************************************************************************************************/ +/*! + * \brief Compute hop increment value. + * + * \return Hop increment value. + */ +/*************************************************************************************************/ +uint8_t lctrComputeHopInc(void) +{ + uint32_t randNum = LlMathRandNum(); + + /* Valid value range is 5 to 16. */ + return (((randNum >> 0) & 7) + ((randNum >> 8) & 3) + ((randNum >> 16) & 1)) + 5; +} + +/*************************************************************************************************/ +/*! + * \brief Adjust the start time of a pre-established connection BOD. + * + * \param pCtx Connection context. + * \param scanRefTime Scan BOD reference time. + * \param pConnInd Connection indication. + * + * \return First CE due time. + */ +/*************************************************************************************************/ +uint32_t lctrMstConnAdjustOpStart(lctrConnCtx_t *pCtx, uint32_t scanRefTime, lctrConnInd_t *pConnInd) +{ + uint32_t rsvnOffs[SCH_RM_MAX_RSVN]; + uint32_t firstCeDue, anchorPoint, maxOffsetUsec, connInterUsec, connInter; + uint16_t numIntervals = 0; + uint16_t dueOffsetUsec; + + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pCtx->connBod; + + /*** Connection context setup ***/ + + pCtx->lastChanIdx = 0; + pCtx->eventCounter = 0; + + /*** General setup ***/ + + memset(&rsvnOffs[0], 0, sizeof(rsvnOffs)); + if (lctrGetConnOffsetsCback) + { + lctrGetConnOffsetsCback(rsvnOffs, scanRefTime); + } + if (lctrGetPerOffsetsCback) + { + lctrGetPerOffsetsCback(&rsvnOffs[LL_MAX_CONN], scanRefTime); + } + /* Use maximum txWindowOffset (i.e. connInterval) to maximize scan opportunity. */ + maxOffsetUsec = SchRmGetOffsetUsec(rsvnOffs, LCTR_CONN_IND_US(pConnInd->interval), LCTR_GET_CONN_HANDLE(pCtx)); + + pOp->due = scanRefTime + BB_US_TO_BB_TICKS(maxOffsetUsec); + + /*** Commit operation ***/ + + WSF_ASSERT(pCtx->connInterval); + + firstCeDue = pOp->due; + anchorPoint = pOp->due; + + while (TRUE) + { + if (SchInsertAtDueTime(pOp, lctrConnResolveConflict)) + { + break; + } + + LL_TRACE_WARN1("!!! Establish CE schedule conflict handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + + numIntervals += 1; + pCtx->eventCounter += 1; + + connInterUsec = LCTR_CONN_IND_US(numIntervals * pCtx->connInterval); + connInter = BB_US_TO_BB_TICKS(connInterUsec); + dueOffsetUsec = connInterUsec - BB_TICKS_TO_US(connInter); + + /* Advance to next interval. */ + pOp->due = anchorPoint + connInter; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + } + + return firstCeDue; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..34c5ea232b55e3d8f41949d30ef59e3f6707781d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_conn_slave.c @@ -0,0 +1,482 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave connection operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "ll_defs.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_adv_slave.h" +#include "lmgr_api_conn.h" +#include "sch_api.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Process a received connection indication PDU in slave role. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvProcessConnInd(lctrConnMsg_t *pMsg) +{ + lctrConnEstablish_t *pConnEst = &pMsg->connEstablish; + lctrConnCtx_t *pCtx; + + if ((pCtx = lctrAllocConnCtx()) != NULL) + { + pLctrConnMsg = pMsg; + pCtx->role = LL_ROLE_SLAVE; + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_CONNECT_IND); + } + else + { + lctrNotifyHostConnectInd(0, LL_ROLE_SLAVE, &pConnEst->connInd, pConnEst->peerIdAddrType, + pConnEst->peerIdAddr, pConnEst->peerRpa, pConnEst->localRpa, + LL_ERROR_CODE_CONN_LIMIT_EXCEEDED, 0); + } + + /* Advertising has stopped. */ + BbStop(BB_PROT_BLE); + if (pConnEst->sendAdvSetTerm) + { + LmgrSendAdvSetTermInd(pConnEst->hdr.handle, LL_SUCCESS, LCTR_GET_CONN_HANDLE(pCtx), pConnEst->numExtAdvEvents); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a received data channel PDU in slave role. + * + * \param pCtx Connection context. + * \param pBuf PDU buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvProcessDataPdu(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ + uint8_t result; + + if (pCtx->enabled) + { + result = lctrDecodeCtrlPdu(&lctrDataPdu, pBuf, pCtx->role); + + switch (result) + { + case LL_SUCCESS: +#if (LL_ENABLE_TESTER) + if ((llTesterCb.rxLlcpFilter & (1 << lctrDataPdu.opcode)) != 0) + { + return; + } +#endif + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + break; + case LL_ERROR_CODE_INVALID_LMP_PARAMS: + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + break; + default: + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave connection reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvConnResetHandler(void) +{ + BbBleConnSlaveInit(); + lctrConnDefaults(); + LmgrConnInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Execute slave state machine. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvConnExecute(lctrConnMsg_t *pMsg) +{ + lctrConnCtx_t *pCtx; + pCtx = LCTR_GET_CONN_CTX(pMsg->hdr.handle); + + if (pCtx->enabled) + { + pLctrConnMsg = pMsg; + + lctrSlvConnExecuteSm(pCtx, pMsg->hdr.event); + } +} + +/*************************************************************************************************/ +/*! + * \brief Slave connection message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvConnDisp(lctrConnMsg_t *pMsg) +{ + if (pMsg->hdr.dispId != LCTR_DISP_BCST) + { + WSF_ASSERT(pMsg->hdr.handle < pLctrRtCfg->maxConn); + lctrSlvConnExecute(pMsg); +} + else + { + for (pMsg->hdr.handle = 0; pMsg->hdr.handle < pLctrRtCfg->maxConn; pMsg->hdr.handle++) + { + lctrSlvConnExecute(pMsg); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Compute the total clock accuracy. + * + * \param mstScaIdx Master sleep clock accuracy index. + * + * \return Combined sleep clock inaccuracy. + */ +/*************************************************************************************************/ +uint16_t lctrCalcTotalAccuracy(uint8_t mstScaIdx) +{ + const uint16_t mstScaTbl[] = + { + 500, /* LL_MCA_500_PPM */ + 250, /* LL_MCA_250_PPM */ + 150, /* LL_MCA_150_PPM */ + 100, /* LL_MCA_100_PPM */ + 75, /* LL_MCA_75_PPM */ + 50, /* LL_MCA_50_PPM */ + 30, /* LL_MCA_30_PPM */ + 20 /* LL_MCA_20_PPM */ + }; + + const uint16_t clkPpm = BbGetClockAccuracy(); + + if (mstScaIdx >= (sizeof(mstScaTbl) / sizeof(mstScaTbl[0]))) + { + /* Cap to highest index. */ + mstScaIdx = LL_MCA_20_PPM; + } + + return mstScaTbl[mstScaIdx] + clkPpm; +} + +/*************************************************************************************************/ +/*! + * \brief Compute the connection interval window widening delay in microseconds. + * + * \param pCtx Connection context. + * \param unsyncTimeUsec Unsynchronized time in microseconds. + * + * \return Window widening delay in microseconds. + */ +/*************************************************************************************************/ +uint32_t lctrCalcIntervalWindowWideningUsec(lctrConnCtx_t *pCtx, uint32_t unsyncTimeUsec) +{ + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_WW)) + { + /* Largest unsynchronized time is 1,996 seconds (interval=4s and latency=499) and + * largest total accuracy is 1000 ppm. */ + /* coverity[overflow_before_widen] */ + uint32_t wwDlyUsec = LL_MATH_DIV_10E6(((uint64_t)unsyncTimeUsec * pCtx->data.slv.totalAcc) + + 999999); /* round up */ + + /* Reduce to 32-bits and always round up to a sleep clock tick. */ + return wwDlyUsec + pLctrRtCfg->ceJitterUsec + LL_MAX_CE_DEVIATION_USEC; + } + else + { + return 0; + } +} + +/*************************************************************************************************/ +/*! + * \brief Build a connection operation. + * + * \param pCtx Connection context. + * + * \return None. + * + * This routine is called in response to a received CONNECTION_REQ PDU. The PDU must already + * be decoded in the lctrPduSlvAdvb variable prior to this call. + */ +/*************************************************************************************************/ +void lctrSlvConnBuildOp(lctrConnCtx_t *pCtx) +{ + /* Pre-resolve common structures for efficient access. */ + uint16_t txWinDelay, txWinOffsetCnt, dueOffsetUsec; + uint32_t fastTermCnt, txWinOffsetUsec, txWinOffset, txWinSizeUsec, wwOffsetUsec, + wwOffset, ceDurUsec, ceSyncDlyUsec, unsyncTimeUsec, unsyncTime, + wwTotalUsec, wwTotal; + + BbOpDesc_t * const pOp = &pCtx->connBod; + BbBleData_t * const pBle = &pCtx->bleData; + BbBleSlvConnEvent_t * const pConn = &pBle->op.slvConn; + lctrConnInd_t * const pConnInd = &pLctrConnMsg->connEstablish.connInd; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + memset(pConn, 0, sizeof(BbBleSlvConnEvent_t)); + + /*** Connection context setup ***/ + if (pLctrConnMsg->connEstablish.isAuxConnReq) + { + switch (pLctrConnMsg->connEstablish.phy) + { + case BB_PHY_BLE_1M: + case BB_PHY_BLE_2M: + default: + txWinDelay = LCTR_DATA_CHAN_DLY_AUX_UNCODED; + break; + case BB_PHY_BLE_CODED: + txWinDelay = LCTR_DATA_CHAN_DLY_AUX_CODED; + break; + } + } + else + { + txWinDelay = LCTR_DATA_CHAN_DLY; + } + + txWinOffsetCnt = pConnInd->txWinOffset + txWinDelay; + + /* pCtx->lastChanIdx = 0; */ /* cleared in alloc */ + /* pCtx->eventCounter = 0; */ /* cleared in alloc */ + pCtx->data.slv.lastActiveEvent = 1; /* guarantee execution of first connection event. */ + + pCtx->usedChSel = pLctrConnMsg->connEstablish.usedChSel; + + pCtx->chanMask = pConnInd->chanMask; + pCtx->hopInc = pConnInd->hopInc; + pCtx->connInterval = pConnInd->interval; + /* pCtx->txHdr.sn = 0; */ /* cleared in alloc */ + /* pCtx->txHdr.nesn = 0; */ /* cleared in alloc */ + pCtx->data.slv.totalAcc = lctrCalcTotalAccuracy(pConnInd->masterSca); + pCtx->maxLatency = pConnInd->latency; + pCtx->supTimeoutMs = LCTR_CONN_IND_TO_MS(pConnInd->timeout); + pCtx->authTimeoutMs = LL_DEF_AUTH_TO_MS; + pCtx->pingPeriodMs = lctrCalcPingPeriodMs(pCtx, LL_DEF_AUTH_TO_MS); + /* pCtx->llcpState = LCTR_LLCP_STATE_IDLE; */ + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + /* Initially use fast termination. */ + fastTermCnt = txWinOffsetCnt + pConnInd->txWinSize + + (LCTR_FAST_TERM_CNT * pConnInd->interval); + WsfTimerStartMs(&pCtx->tmrSupTimeout, LCTR_CONN_IND_MS(fastTermCnt)); + + lctrBuildRemapTable(pCtx); + pCtx->chIdentifier = (pConnInd->accessAddr >> 16) ^ + (pConnInd->accessAddr >> 0); + + /*** BLE general setup ***/ + + pBle->chan.opType = BB_BLE_OP_SLV_CONN_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* deferred assignment */ + pBle->chan.txPower = pLctrRtCfg->defTxPwrLvl; + pBle->chan.accAddr = pConnInd->accessAddr; + pBle->chan.crcInit = pConnInd->crcInit; + pBle->chan.txPhy = pBle->chan.rxPhy = pLctrConnMsg->connEstablish.phy; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = pConnInd->accessAddr ^ llTesterCb.dataAccessAddrRx; + pBle->chan.accAddrTx = pConnInd->accessAddr ^ llTesterCb.dataAccessAddrTx; + pBle->chan.crcInitRx = pConnInd->crcInit ^ llTesterCb.dataCrcInitRx; + pBle->chan.crcInitTx = pConnInd->crcInit ^ llTesterCb.dataCrcInitTx; +#endif + + /* pBle->chan.enc.enaEncrypt = FALSE; */ /* cleared in alloc */ + /* pBle->chan.enc.enaDecrypt = FALSE; */ + pBle->chan.enc.enaAuth = TRUE; + /* pBle->chan.enc.nonceMode = BB_NONCE_MODE_PKT_CNTR; */ /* cleared in alloc */ + + pCtx->txHdr.llid = ~LL_LLID_VS_PDU; /* reset last PDU LLID */ + + pCtx->effConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->effDataPdu); /* actual PHY */ + pCtx->localConnDurUsec = lctrCalcConnDurationUsec(pCtx, &pCtx->localDataPdu); /* actual PHY */ + + /*** General setup ***/ + + txWinOffsetUsec = LCTR_CONN_IND_US(txWinOffsetCnt); + txWinOffset = BB_US_TO_BB_TICKS(txWinOffsetUsec); + txWinSizeUsec = LCTR_CONN_IND_US(pConnInd->txWinSize); + wwOffsetUsec = lctrCalcIntervalWindowWideningUsec(pCtx, txWinOffsetUsec); + wwOffset = BB_US_TO_BB_TICKS(wwOffsetUsec); + dueOffsetUsec = (txWinOffsetUsec - wwOffsetUsec) - BB_TICKS_TO_US(txWinOffset - wwOffset); + + pCtx->data.slv.anchorPoint = pLctrConnMsg->connEstablish.connIndEndTs + txWinOffset; /* estimated initial anchor point */ + pCtx->data.slv.txWinSizeUsec = txWinSizeUsec; + + pOp->due = pCtx->data.slv.anchorPoint - wwOffset; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + pOp->minDurUsec = txWinSizeUsec + pCtx->localConnDurUsec + (wwOffsetUsec << 1); + /* pOp->maxDurUsec = 0; */ /* cleared in alloc */ + + pOp->reschPolicy = BB_RESCH_FIXED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrSlvConnEndOp; + pOp->abortCback = lctrSlvConnEndOp; + pOp->pCtx = pCtx; + + /*** BLE connection setup ***/ + + pConn->rxSyncDelayUsec = txWinSizeUsec + (wwOffsetUsec << 1) + + BB_TICKS_TO_US(1); /* rounding compensation when computing reqEndTs */ + pConn->execCback = lctrSlvConnBeginOp; + pConn->cancelCback = lctrSlvConnCleanupOp; + pConn->txDataCback = lctrSlvConnTxCompletion; + pConn->rxDataCback = lctrSlvConnRxCompletion; + + /*** Commit operation ***/ + + ceDurUsec = pOp->minDurUsec; + ceSyncDlyUsec = pConn->rxSyncDelayUsec; + + while (TRUE) + { + pBle->chan.chanIdx = lctrChSelHdlr[pCtx->usedChSel](pCtx, 0); + + if (SchInsertAtDueTime(pOp, lctrConnResolveConflict)) + { + LL_TRACE_INFO1(" >>> Connection established, handle=%u <<<", LCTR_GET_CONN_HANDLE(pCtx)); + LL_TRACE_INFO1(" connIntervalUsec=%u", LCTR_CONN_IND_US(pCtx->connInterval)); + LL_TRACE_INFO1(" due=%u", pOp->due); + LL_TRACE_INFO1(" offsetUsec=%u", pOp->dueOffsetUsec); + + break; + } + + LL_TRACE_WARN1("!!! Establish CE schedule conflict handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + + pCtx->eventCounter += 1; + + /* Initial eventCounter starts at 0; equivalent to unsynchronized intervals. */ + unsyncTimeUsec = LCTR_CONN_IND_US(pCtx->connInterval * pCtx->eventCounter); + unsyncTime = BB_US_TO_BB_TICKS(unsyncTimeUsec); + wwTotalUsec = lctrCalcIntervalWindowWideningUsec(pCtx, unsyncTimeUsec); + wwTotal = BB_US_TO_BB_TICKS(wwTotalUsec); + dueOffsetUsec = (unsyncTimeUsec - wwTotalUsec) - BB_TICKS_TO_US(unsyncTime - wwTotal); + + /* Advance to next interval. */ + pOp->due = pCtx->data.slv.anchorPoint + unsyncTime - wwTotal; + pOp->dueOffsetUsec = WSF_MAX(dueOffsetUsec, 0); + pOp->minDurUsec = ceDurUsec + wwTotalUsec; + pConn->rxSyncDelayUsec = ceSyncDlyUsec + (wwTotalUsec << 1); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for connectable slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvConnInit(void) +{ + /* Add reset handler (values set by master prevails). */ + lctrResetHdlrTbl[LCTR_DISP_CONN] = lctrSlvConnResetHandler; + + /* Add connection message dispatchers (values set by master prevails). */ + lctrMsgDispTbl[LCTR_DISP_CONN_IND] = (LctrMsgDisp_t)lctrSlvProcessConnInd; + if (!lctrMsgDispTbl[LCTR_DISP_CONN]) + { + lctrMsgDispTbl[LCTR_DISP_CONN] = (LctrMsgDisp_t)lctrSlvConnDisp; + } + + /* Add connection event handlers. */ + lctrEventHdlrTbl[LCTR_EVENT_RX_PENDING] = lctrConnRxPendingHandler; + /* lctrEventHdlrTbl[LCTR_EVENT_TX_PENDING] = lctrSlvConnTxPendingHandler; */ /* not used by slave */ + lctrEventHdlrTbl[LCTR_EVENT_TX_COMPLETE] = lctrConnTxCompletedHandler; + + /* Add LLCP SM handler. */ + lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD] = lctrSlvLlcpExecuteConnUpdSm; + lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CMN] = lctrLlcpExecuteCommonSm; + + /* Add control PDU handler. */ + if (!lctrCtrlPduHdlr) + { + lctrCtrlPduHdlr = lctrSlvProcessDataPdu; + } + + /* Add channel selection handler. */ + lctrChSelHdlr[LL_CH_SEL_1] = lctrSelectNextDataChannel; + + lctrConnDefaults(); + + /* Set supported features. */ + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_1) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_CONN_PARAM_REQ_PROC | + LL_FEAT_EXT_REJECT_IND | + LL_FEAT_SLV_INIT_FEAT_EXCH; + } + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_2) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_DATA_LEN_EXT; + } + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_MIN_NUM_USED_CHAN; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for connection. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrConnDefaults(void) +{ + memset(pLctrConnTbl, 0, (sizeof(lctrConnCtx_t) * pLctrRtCfg->maxConn)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..6a2355870eb8fec9eef6a86e4faa4c2a21c6fab6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_master.c @@ -0,0 +1,128 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master encryption implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_enc_master.h" +#include "lctr_int_enc_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Process a received data channel PDU in master role. + * + * \param pCtx Connection context. + * \param pBuf PDU buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstEncProcessDataPdu(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ + if (pCtx->enabled) + { + uint8_t ctrlResult, encResult; + + if (((ctrlResult = lctrDecodeCtrlPdu(&lctrDataPdu, pBuf, pCtx->role)) == LL_SUCCESS) || + ((encResult = lctrDecodeEncPdu(&lctrDataPdu, pBuf, pCtx->role)) == LL_SUCCESS)) + { +#if (LL_ENABLE_TESTER) + if ((llTesterCb.rxLlcpFilter & (1 << lctrDataPdu.opcode)) != 0) + { + return; + } +#endif + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + } + } + else if ((ctrlResult == LL_ERROR_CODE_INVALID_LMP_PARAMS) || + (encResult == LL_ERROR_CODE_INVALID_LMP_PARAMS)) + { + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + } + } + else + { + if (pCtx->role == LL_ROLE_MASTER) + { + lctrMstConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for connectable encrypted master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstConnEncInit(void) +{ + LctrMstConnInit(); + + /* Add LLCP SM handler. */ + lctrMstLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT] = lctrMstExecuteEncryptSm; + lctrMstLlcpSmTbl[LCTR_LLCP_SM_PING] = lctrExecutePingSm; + + /* Add control PDU handler. */ + lctrCtrlPduHdlr = lctrMstEncProcessDataPdu; + + /* Add packet encryption handlers. */ + lctrInitCipherBlkHdlr = BbBleDrvAesInitCipherBlock; +#if (!BB_ENABLE_INLINE_ENC_TX) + lctrPktEncryptHdlr = BbBleDrvAesCcmEncrypt; +#else + lctrSetEncryptPktCountHdlr = BbBleDrvSetEncryptPacketCount; +#endif +#if (!BB_ENABLE_INLINE_DEC_RX) + lctrPktDecryptHdlr = BbBleDrvAesCcmDecrypt; +#else + lctrSetDecryptPktCountHdlr = BbBleDrvSetDecryptPacketCount; +#endif + + /* Set supported features. */ + lmgrPersistCb.featuresDefault |= LL_FEAT_ENCRYPTION; + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_1) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_PING; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..245dc2d66771a16221123f21dfab008995985cb7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_enc_slave.c @@ -0,0 +1,163 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave encryption implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_enc_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Process a received data channel PDU in slave role. + * + * \param pCtx Connection context. + * \param pBuf PDU buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSlvEncProcessDataPdu(lctrConnCtx_t *pCtx, uint8_t *pBuf) +{ + if (pCtx->enabled) + { + uint8_t ctrlResult, encResult; + + if (((ctrlResult = lctrDecodeCtrlPdu(&lctrDataPdu, pBuf, pCtx->role)) == LL_SUCCESS) || + ((encResult = lctrDecodeEncPdu(&lctrDataPdu, pBuf, pCtx->role)) == LL_SUCCESS)) + { +#if (LL_ENABLE_TESTER) + if ((llTesterCb.rxLlcpFilter & (1 << lctrDataPdu.opcode)) != 0) + { + return; + } +#endif + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP); + } + else if ((ctrlResult == LL_ERROR_CODE_INVALID_LMP_PARAMS) || + (encResult == LL_ERROR_CODE_INVALID_LMP_PARAMS)) + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM); + } + else + { + lctrSlvConnExecuteSm(pCtx, LCTR_CONN_MSG_RX_LLCP_UNKNOWN); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for connectable encrypted slave. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvConnEncInit(void) +{ + /* Add LLCP SM handler. */ + lctrSlvLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT] = lctrSlvExecuteEncryptSm; + lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PING] = lctrExecutePingSm; + + /* Add control PDU handler. */ + if (!lctrCtrlPduHdlr) + { + lctrCtrlPduHdlr = lctrSlvEncProcessDataPdu; + } + + /* Add packet encryption handlers. */ + lctrInitCipherBlkHdlr = BbBleDrvAesInitCipherBlock; +#if (!BB_ENABLE_INLINE_ENC_TX) + lctrPktEncryptHdlr = BbBleDrvAesCcmEncrypt; +#else + lctrSetEncryptPktCountHdlr = BbBleDrvSetEncryptPacketCount; +#endif +#if (!BB_ENABLE_INLINE_DEC_RX) + lctrPktDecryptHdlr = BbBleDrvAesCcmDecrypt; +#else + lctrSetDecryptPktCountHdlr = BbBleDrvSetDecryptPacketCount; +#endif + + /* Set supported features. */ + lmgrPersistCb.featuresDefault |= LL_FEAT_ENCRYPTION; + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_1) + { + lmgrPersistCb.featuresDefault |= LL_FEAT_LE_PING; + } + + LctrSlvConnInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Set a new authentication payload timeout. + * + * \param handle Connection handle. + * + * \return Timeout value in milliseconds. + */ +/*************************************************************************************************/ +uint32_t LctrGetAuthPayloadTimeout(uint16_t handle) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + return pCtx->authTimeoutMs; +} + +/*************************************************************************************************/ +/*! + * \brief Set a new authentication payload timeout. + * + * \param handle Connection handle. + * \param timeoutMs New timeout value in milliseconds. + * + * \return None. + */ +/*************************************************************************************************/ +bool_t LctrSetAuthPayloadTimeout(uint16_t handle, uint32_t timeoutMs) +{ + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(handle); + + uint32_t pingPeriodMs = lctrCalcPingPeriodMs(pCtx, timeoutMs); + + /* Check parameters. */ + if (pingPeriodMs == timeoutMs) + { + LL_TRACE_WARN1("!!! Impractical authentication payload timeoutMs=%u for given connection interval", timeoutMs); + return FALSE; + } + + /* Modify operating parameters. */ + pCtx->authTimeoutMs = timeoutMs; + pCtx->pingPeriodMs = pingPeriodMs; + + /* Encryption started? */ + if (pCtx->bleData.chan.enc.enaDecrypt) + { + /* Reset authentication payload timer. */ + WsfTimerStartMs(&pCtx->tmrAuthTimeout, pCtx->authTimeoutMs); + WsfTimerStartMs(&pCtx->tmrPingTimeout, pCtx->pingPeriodMs); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master.c new file mode 100644 index 0000000000000000000000000000000000000000..bd5d94a8b39cdde3be26474c3cb8b1a66c62f3c4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master.c @@ -0,0 +1,301 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scanning operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master.h" +#include "lctr_int_init_master.h" +#include "lctr_int.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> +#include <stddef.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ +/*! \brief Initiate operational context. */ +lctrMstScanCtx_t lctrMstInit; + +/*************************************************************************************************/ +/*! + * \brief Master initiate reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstInitResetHandler(void) +{ + LctrMstInitDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Master initiate message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstInitDisp(lctrMsgHdr_t *pMsg) +{ + lctrMstInitExecuteSm(pMsg->event); +} + +/*************************************************************************************************/ +/*! + * \brief Handler for pre-initiate scan execution. + * + * \param pOp BB operation descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstPreInitiateExecHandler(BbOpDesc_t *pOp) +{ + /* Setup connection's initial CE now that RM is synchronized BB. This step must be performed + * before initiate's scan operation sets up its executing duration (i.e. "pre-execute"). */ + lctrMstInit.data.init.firstCeDue = lctrMstConnAdjustOpStart(LCTR_GET_CONN_CTX(lctrMstInit.data.init.connHandle), + pOp->due, + &lctrMstInit.data.init.connInd); + lctrMstInit.data.init.connBodLoaded = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Build initiate connection operation. + * + * \param pConnSpec Connection spec. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstInitiateBuildOp(LlConnSpec_t *pConnSpec, uint8_t peerAddrType, uint64_t peerAddr) +{ + uint8_t *pBuf; + lctrConnInd_t *pConnInd; + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &lctrMstInit.scanBod; + BbBleData_t * const pBle = &lctrMstInit.bleData; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstInitiateEndOp; + pOp->abortCback = lctrMstInitiateEndOp; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_ADV_EVENT; + + pBle->chan.chanIdx = lctrScanChanSelectInit(lmgrMstScanCb.scanChanMap); + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + pBle->chan.rxPhy = BB_PHY_BLE_1M; + pBle->chan.txPhy = BB_PHY_BLE_1M; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_ADV_IND) | + (1 << LL_PDU_ADV_DIRECT_IND); + if (lctrMstInit.scanParam.scanFiltPolicy != LL_SCAN_FILTER_NONE) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + + /*** BLE Scan Setup: Rx packets ***/ + + pScan->scanChMap = lmgrMstScanCb.scanChanMap; + + pScan->preExecCback = lctrMstPreInitiateExecHandler; + pScan->rxAdvCback = lctrMstInitiateAdvPktHandler; + + if ((pScan->pRxAdvBuf = WsfMsgAlloc(LCTR_ADVB_BUF_SIZE)) == NULL) + { + /* Attempt to obtain buffer on next advertising operation. */ + LL_TRACE_ERR0("Could not allocate advertising buffer"); + // TODO need OOM recovery + WSF_ASSERT(FALSE); + } + + /*** BLE Scan Setup: Tx connect indication packet ***/ + + pScan->txReqCback = lctrMstConnIndTxCompHandler; + + pConnInd = &lctrMstInit.data.init.connInd; + + pConnInd->accessAddr = lctrComputeAccessAddr(); + pConnInd->crcInit = lctrComputeCrcInit(); + pConnInd->txWinSize = LL_MIN_TX_WIN_SIZE; /* minimum size */ + /* pConnInd->txWinOffset = 0; */ /* Updated in ISR immediately prior to Tx LL_CONN_IND. */ + pConnInd->interval = lctrMstInit.data.init.connInterval; + pConnInd->latency = pConnSpec->connLatency; + pConnInd->timeout = pConnSpec->supTimeout; + pConnInd->chanMask = lmgrMstScanCb.chanClass; + pConnInd->hopInc = lctrComputeHopInc(); + pConnInd->masterSca = lctrComputeSca(); + +#if (LL_ENABLE_TESTER) + if (llTesterCb.connIndEnabled) + { + memcpy(&pConnInd->accessAddr, + &llTesterCb.connInd.accessAddr, + sizeof(lctrConnInd_t) - offsetof(lctrConnInd_t, accessAddr)); + + llTesterCb.connIndEnabled = FALSE; + } +#endif + + lctrMstInit.reqPduHdr.pduType = LL_PDU_CONNECT_IND; + lctrMstInit.reqPduHdr.len = LL_CONN_IND_PDU_LEN; + + if (lmgrCb.features & LL_FEAT_CH_SEL_2) + { + lctrMstInit.reqPduHdr.chSel = LL_CH_SEL_2; + } + else + { + lctrMstInit.reqPduHdr.chSel = LL_CH_SEL_1; + } + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (lctrMstInit.scanParam.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + /* Choose initiator's address. */ + lctrMstInit.reqPduHdr.txAddrRnd = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + pConnInd->initAddr = pBle->pduFilt.localAddrMatch; + + /* peerAddrType and pPeerAddr only valid when filter policy is set to none */ + if (lctrMstInit.scanParam.scanFiltPolicy == LL_SCAN_FILTER_NONE) + { + /* Set advertiser's address. */ + lctrMstInit.reqPduHdr.rxAddrRnd = peerAddrType & LL_ADDR_RANDOM_BIT; + pConnInd->advAddr = peerAddr; + + pBle->pduFilt.peerAddrMatch = peerAddr; + if (peerAddrType & LL_ADDR_RANDOM_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_RAND); + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_ENA); + } + + pBuf = lctrMstInit.reqBuf; + pBuf += lctrPackAdvbPduHdr(pBuf, &lctrMstInit.reqPduHdr); + /* pBuf += */ lctrPackConnIndPdu(pBuf, pConnInd); + + pScan->pTxReqBuf = lctrMstInit.reqBuf; + pScan->txReqLen = LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN; + + /*** Commit operation ***/ + + /* Postponed in lctrMstInitiateOpCommit() until after connBod is built. */ +} + +/*************************************************************************************************/ +/*! + * \brief Commit initiate connection operation. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstInitiateOpCommit(void) +{ + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &lctrMstInit.scanBod; + + /*** Commit operation ***/ + + pOp->minDurUsec = LCTR_MIN_SCAN_USEC; + pOp->maxDurUsec = LCTR_BLE_TO_US(lctrMstInit.scanParam.scanWindow); + + lctrMstInit.selfTerm = FALSE; + lctrMstInit.shutdown = FALSE; + + SchInsertNextAvailable(pOp); + lctrMstInit.scanWinStart = pOp->due; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for initiating master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstInitInit(void) +{ + /* Add initiate reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_INIT] = lctrMstInitResetHandler; + + /* Add initiate message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_INIT] = (LctrMsgDisp_t)lctrMstInitDisp; + + LctrMstInitDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstInitDefaults(void) +{ + memset(&lctrMstInit, 0, sizeof(lctrMstScan)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..83ad7ad8f4b3030bd058681f103cc6942b7241e5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_init_master_ae.c @@ -0,0 +1,676 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scanning operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_init_master_ae.h" +#include "lctr_int.h" +#include "sch_api_ble.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> +#include <stddef.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ +/*! \brief Initiate operational context. */ +/*! \brief Extended scan operational context. */ +lctrExtScanCtx_t lctrMstExtInitTbl[LCTR_SCAN_PHY_TOTAL]; + +/*! \brief Extended scan control block. */ +lctrExtInitCtrlBlk_t lctrMstExtInit; + +/*************************************************************************************************/ +/*! + * \brief Master initiate reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtInitResetHandler(void) +{ + LctrMstExtInitDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Execute common master initiate state machine. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtInitExecuteCommonSm(LctrExtScanMsg_t *pMsg) +{ + unsigned i; + + /* Subsystem event handling. */ + switch (pMsg->hdr.event) + { + case LCTR_EXT_INIT_MSG_TERMINATE: + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtInit.enaPhys & (1 << i)) + { + if ((lctrMstExtInit.estConnPhys & (1 << i)) == 0) + { + if (lctrMstExtInit.initTermByHost) + { + lctrConnCtx_t *pCtx = LCTR_GET_CONN_CTX(lctrMstExtInitTbl[i].data.init.connHandle); + + if (pCtx->enabled == TRUE) + { + /* Cleanup unused initiate PHY connection context. */ + SchRmRemove(lctrMstExtInitTbl[i].data.init.connHandle); + lctrFreeConnCtx(pCtx); + } + } + } + } + } + break; + + case LCTR_EXT_INIT_MSG_INITIATE: + { + lctrExtInitiateMsg_t *pExtInitMsg = (lctrExtInitiateMsg_t *)pLctrMsg; + uint8_t status = 0; + + LL_TRACE_INFO1("lctrMstExtInitExecuteCommonSm: scanMode=%u, event=INITIATE", lmgrCb.scanMode); + + /* Check worst case connSpec among all PHYs. */ + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtInit.enaPhys & (1 << i)) + { + /* TODO: pre-check all connSpec with RM. */ + } + } + + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtInit.enaPhys & (1 << i)) + { + if ((status = lctrExtInitSetupInitiate(&lctrMstExtInitTbl[i], pExtInitMsg->peerAddrType, pExtInitMsg->peerAddr, + pExtInitMsg->filterPolicy, pExtInitMsg->ownAddrType)) != LL_SUCCESS) + { + // TODO for multiple scanners, cleanup upon failure + break; + } + } + } + + if (status != LL_SUCCESS) + { + lctrScanNotifyHostInitiateError(status, pExtInitMsg->peerAddrType, pExtInitMsg->peerAddr); + lctrSendExtInitMsg(NULL, LCTR_EXT_INIT_MSG_INITIATE_CANCEL); + break; + } + + lctrMstExtInit.estConnPhys = 0; + lctrMstExtInit.peerAddr = pExtInitMsg->peerAddr; + lctrMstExtInit.peerAddrType = pExtInitMsg->peerAddrType; + + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtInit.enaPhys & (1 << i)) + { + lctrMstConnBuildOp(LCTR_GET_CONN_CTX(lctrMstExtInitTbl[i].data.init.connHandle), + &lctrMstExtInitTbl[i].data.init.connInd); + lctrMstExtInitiateOpCommit(&lctrMstExtInitTbl[i]); + } + } + break; + } + + case LCTR_EXT_INIT_MSG_INITIATE_CANCEL: + LL_TRACE_INFO1("lctrMstExtInitExecuteCommonSm: scanMode=%u, event=INITIATE_CANCEL", lmgrCb.scanMode); + break; + + case LCTR_EXT_INIT_MSG_RESET: + LL_TRACE_INFO1("lctrMstExtInitExecuteCommonSm: scanMode=%u, event=RESET", lmgrCb.scanMode); + break; + + default: + LL_TRACE_ERR2("lctrMstExtInitExecuteCommonSm: scanMode=%u, event=%u -- unknown event", lmgrCb.scanMode, pMsg->hdr.event); + /* No action required. */ + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Master initiate message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrMstExtInitDisp(LctrExtScanMsg_t *pMsg) +{ + lctrExtScanCtx_t *pExtInitCtx; + uint8_t event = pMsg->hdr.event; + + bool_t isBcstMsg = FALSE; + + if (pMsg->hdr.dispId == LCTR_DISP_BCST) + { + /* Global broadcast message. */ + isBcstMsg = TRUE; + } + + /* Set message property. */ + switch (event) + { + case LCTR_EXT_INIT_MSG_INITIATE_CANCEL: + lctrMstExtInit.initTermByHost = TRUE; + break; + default: + break; + } + + /* Broadcast message. */ + switch (event) + { + case LCTR_EXT_INIT_MSG_INITIATE: + case LCTR_EXT_INIT_MSG_INITIATE_CANCEL: + isBcstMsg = TRUE; + break; + default: + break; + } + if (pMsg->hdr.handle == LCTR_SCAN_PHY_ALL) + { + isBcstMsg = TRUE; + } + + /* Route message to SM. */ + if (!isBcstMsg) + { + WSF_ASSERT(pMsg->hdr.handle < LCTR_SCAN_PHY_TOTAL); + if (lctrMstExtInit.enaPhys & (1 << pMsg->hdr.handle)) + { + pExtInitCtx = &lctrMstExtInitTbl[pMsg->hdr.handle]; + lctrMstExtInitExecuteSm(pExtInitCtx, event); + } + } + else + { + unsigned int i; + for (i = 0; i < LCTR_SCAN_PHY_TOTAL; i++) + { + if (lctrMstExtInit.enaPhys & (1 << i)) + { + pExtInitCtx = &lctrMstExtInitTbl[i]; + lctrMstExtInitExecuteSm(pExtInitCtx, event); + } + } + } + + lctrMstExtInitExecuteCommonSm(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Build extended initiate operation. + * + * \param pExtInitCtx Extended initiate context. + * \param pConnSpec Connection spec. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrMstExtInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType) +{ + BbOpDesc_t * const pOp = &pExtInitCtx->scanBod; + BbBleData_t * const pBle = &pExtInitCtx->scanBleData; + BbBleMstAdvEvent_t * const pScan = &pBle->op.mstAdv; + lctrConnInd_t *pConnInd; + uint8_t *pBuf; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstExtInitiateEndOp; + pOp->abortCback = lctrMstExtInitiateEndOp; + pOp->pCtx = pExtInitCtx; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_ADV_EVENT; + + pBle->chan.chanIdx = lctrScanChanSelectInit(lmgrMstScanCb.scanChanMap); + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + switch (LCTR_GET_EXT_INIT_HANDLE(pExtInitCtx)) + { + case LCTR_SCAN_PHY_1M: + default: + pBle->chan.txPhy = pBle->chan.rxPhy = BB_PHY_BLE_1M; + break; + case LCTR_SCAN_PHY_CODED: + pBle->chan.txPhy = pBle->chan.rxPhy = BB_PHY_BLE_CODED; + break; + } + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_ADV_IND) | + (1 << LL_PDU_ADV_DIRECT_IND) | + (1 << LL_PDU_ADV_EXT_IND); + if (pExtInitCtx->data.init.filtPolicy & LL_SCAN_FILTER_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + + /*** BLE Scan Setup: Rx advertising packet ***/ + + pScan->scanChMap = lmgrMstScanCb.scanChanMap; + + pScan->preExecCback = lctrMstExtPreInitiateExecHandler; + pScan->rxAdvCback = lctrMstInitiateRxExtAdvPktHandler; + pScan->rxAdvPostCback = lctrMstInitiateRxExtAdvPktPostProcessHandler; + + if ((pScan->pRxAdvBuf = WsfMsgAlloc(LL_ADV_HDR_LEN + LL_EXT_ADV_HDR_MAX_LEN)) == NULL) + { + LL_TRACE_ERR0("Could not allocate advertising buffer"); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + /*** BLE Scan Setup: Tx connect indication packet ***/ + + pScan->txReqCback = lctrMstExtConnIndTxCompHandler; + + // TODO move to common/shared init + pConnInd = &pExtInitCtx->data.init.connInd; + + pConnInd->accessAddr = lctrComputeAccessAddr(); + pConnInd->crcInit = lctrComputeCrcInit(); + pConnInd->txWinSize = LL_MIN_TX_WIN_SIZE; /* minimum size */ + /* pConnInd->txWinOffset = 0; */ /* Updated in ISR immediately prior to Tx LL_CONN_IND. */ + pConnInd->interval = pExtInitCtx->data.init.connInterval; + pConnInd->latency = pConnSpec->connLatency; + pConnInd->timeout = pConnSpec->supTimeout; + pConnInd->chanMask = lmgrMstScanCb.chanClass; + pConnInd->hopInc = lctrComputeHopInc(); + pConnInd->masterSca = lctrComputeSca(); + +#if (LL_ENABLE_TESTER) + if (llTesterCb.connIndEnabled) + { + memcpy(&pConnInd->accessAddr, + &llTesterCb.connInd.accessAddr, + sizeof(lctrConnInd_t) - offsetof(lctrConnInd_t, accessAddr)); + + llTesterCb.connIndEnabled = FALSE; + } +#endif + + pExtInitCtx->reqPduHdr.pduType = LL_PDU_CONNECT_IND; + pExtInitCtx->reqPduHdr.len = LL_CONN_IND_PDU_LEN; + + if (lmgrCb.features & LL_FEAT_CH_SEL_2) + { + pExtInitCtx->reqPduHdr.chSel = LL_CH_SEL_2; + } + else + { + pExtInitCtx->reqPduHdr.chSel = LL_CH_SEL_1; + } + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (pExtInitCtx->data.init.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + /* Choose initiator's address. */ + pExtInitCtx->reqPduHdr.txAddrRnd = BB_BLE_PDU_FILT_FLAG_IS_SET(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + pConnInd->initAddr = pBle->pduFilt.localAddrMatch; + + /* peerAddrType and pPeerAddr only valid when filter policy is set to none */ + if (pExtInitCtx->data.init.filtPolicy == LL_SCAN_FILTER_NONE) + { + /* Set advertiser's address. */ + pExtInitCtx->reqPduHdr.rxAddrRnd = peerAddrType & LL_ADDR_RANDOM_BIT; + pConnInd->advAddr = peerAddr; + + pBle->pduFilt.peerAddrMatch = peerAddr; + if (peerAddrType & LL_ADDR_RANDOM_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_RAND); + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_ENA); + } + + pBuf = pExtInitCtx->reqBuf; + pBuf += lctrPackAdvbPduHdr(pBuf, &pExtInitCtx->reqPduHdr); + /* pBuf += */ lctrPackConnIndPdu(pBuf, pConnInd); + + pScan->pTxReqBuf = pExtInitCtx->reqBuf; + pScan->txReqLen = LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN; + + /*** Commit operation ***/ + + /* Postponed in lctrMstExtInitiateOpCommit() until after connBod is built. */ + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Commit initiate connection operation. + * + * \param pExtInitCtx Extended scan context of the initiator. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtInitiateOpCommit(lctrExtScanCtx_t *pExtInitCtx) +{ + BbOpDesc_t * const pOp = &pExtInitCtx->scanBod; + + /*** Commit operation ***/ + + /* Postponed in lctrMstInitiateOpCommit() until after connBod is built. */ + + pOp->minDurUsec = LCTR_MIN_SCAN_USEC; + pOp->maxDurUsec = LCTR_BLE_TO_US(pExtInitCtx->data.init.param.scanWindow); + + pExtInitCtx->selfTerm = FALSE; + pExtInitCtx->shutdown = FALSE; + + SchInsertNextAvailable(pOp); + pExtInitCtx->data.init.scanWinStart = pOp->due; +} + +/*************************************************************************************************/ +/*! + * \brief Build auxiliary scan discovery operation. + * + * \param pExtInitCtx Extended scan context of the initiator. + * \param pConnSpec Connection spec. + * \param peerAddrType Peer address type. + * \param peerAddr Peer address. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t lctrMstAuxInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType) +{ + /* Pre-resolve common structures for efficient access. */ + BbOpDesc_t * const pOp = &pExtInitCtx->auxScanBod; + BbBleData_t * const pBle = &pExtInitCtx->auxBleData; + BbBleMstAuxAdvEvent_t * const pAuxScan = &pBle->op.mstAuxAdv; + + memset(pOp, 0, sizeof(BbOpDesc_t)); + memset(pBle, 0, sizeof(BbBleData_t)); + + /*** General Setup ***/ + + pOp->reschPolicy = BB_RESCH_MOVEABLE_PREFERRED; + pOp->protId = BB_PROT_BLE; + pOp->prot.pBle = pBle; + pOp->endCback = lctrMstAuxInitiateEndOp; + pOp->abortCback = lctrMstAuxInitiateEndOp; + pOp->pCtx = pExtInitCtx; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_MST_AUX_ADV_EVENT; + + /* pBle->chan.chanIdx = 0; */ /* write after ADV_EXT_IND is received */ + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.accAddr = LL_ADV_ACCESS_ADDR; + pBle->chan.crcInit = LL_ADV_CRC_INIT; + /* pBle->chan.txPhy = 0; */ /* write after ADV_EXT_IND is received */ + /* pBle->chan.rxPhy = 0; */ /* write after ADV_EXT_IND is received */ + /* pBle->chan.phyOptions = 0; */ /* write after ADV_EXT_IND is received */ + +#if (LL_ENABLE_TESTER == TRUE) + pBle->chan.accAddrRx = llTesterCb.advAccessAddrRx ^ pBle->chan.accAddr; + pBle->chan.accAddrTx = llTesterCb.advAccessAddrTx ^ pBle->chan.accAddr; + pBle->chan.crcInitRx = llTesterCb.advCrcInitRx ^ pBle->chan.crcInit; + pBle->chan.crcInitTx = llTesterCb.advCrcInitTx ^ pBle->chan.crcInit; +#endif + + pBle->pduFilt.pduTypeFilt = (1 << LL_PDU_AUX_ADV_IND) | + (1 << LL_PDU_AUX_CONNECT_RSP); + if (pExtInitCtx->data.init.filtPolicy & LL_SCAN_FILTER_WL_BIT) + { + pBle->pduFilt.wlPduTypeFilt = pBle->pduFilt.pduTypeFilt; + } + + /*** BLE Scan Setup: Rx packets ***/ + pAuxScan->isInit = TRUE; + pAuxScan->rxAuxAdvCback = lctrMstInitiateRxAuxAdvPktHandler; + + /*** BLE Scan Setup: Tx connect request packet ***/ + + /* Always match local address in PDU to initiator's address (in directed advertisements). */ + if (pExtInitCtx->data.init.ownAddrType & LL_ADDR_RANDOM_BIT) + { + WSF_ASSERT(lmgrCb.bdAddrRndValid); /* No further verification after scan starts. */ + pBle->pduFilt.localAddrMatch = lmgrCb.bdAddrRnd; + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_RAND); + } + else + { + pBle->pduFilt.localAddrMatch = lmgrPersistCb.bdAddr; + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_MATCH_ENA); + + /* Potentially resolve peer & local addresses. */ + if (lmgrCb.addrResEna) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_RES_ENA); + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, LOCAL_ADDR_RES_ENA); + } + + /* peerAddrType and pPeerAddr only valid when filter policy is set to none */ + if (pExtInitCtx->data.init.filtPolicy == LL_SCAN_FILTER_NONE) + { + pBle->pduFilt.peerAddrMatch = peerAddr; + if (peerAddrType & LL_ADDR_RANDOM_BIT) + { + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_RAND); + } + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_ENA); + } + + /* Use primary channel's CONNECT_REQ PDU. */ + pAuxScan->pTxAuxReqBuf = pExtInitCtx->reqBuf; + pAuxScan->txAuxReqLen = LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN; + +#if (LL_ENABLE_TESTER) + if (llTesterCb.auxReq.len) + { + memcpy(pAuxScan->pTxAuxReqBuf, llTesterCb.auxReq.buf, llTesterCb.auxReq.len); + pAuxScan->txAuxReqLen = llTesterCb.auxReq.len; + } +#endif + + /*** BLE Scan Setup: Rx auxiliary connection response packet ***/ + + pAuxScan->rxAuxRspCback = lctrMstInitiateRxAuxConnRspHandler; + + /*** BLE Scan Setup: Rx chain packet ***/ + + /* pAuxScan->rxAuxChainCback = NULL; */ /* No CHAIN_IND when inititating. */ + + /*** Commit operation ***/ + + /* pOp->minDurUsec = 0; */ /* Defer assignment until AuxPtr is received. */ + /* pOp->maxDurUsec = 0; */ /* Not used for aux scan. */ + + pExtInitCtx->selfTerm = FALSE; + pExtInitCtx->shutdown = FALSE; + pExtInitCtx->auxOpPending = FALSE; + + /* Defer scheduling until AuxPtr is received. */ + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for initiating master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtInitInit(void) +{ + /* Add initiate reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_INIT] = lctrMstExtInitResetHandler; + + /* Add initiate message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_EXT_INIT] = (LctrMsgDisp_t)lctrMstExtInitDisp; + + LctrMstExtInitDefaults(); +} + +/*************************************************************************************************/ +/*! + * \brief Set default values for scanning master. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtInitDefaults(void) +{ + memset(&lctrMstExtInitTbl, 0, sizeof(lctrMstExtInitTbl)); + memset(&lctrMstExtInit, 0, sizeof(lctrMstExtInit)); + + lmgrCb.numExtScanPhys = 1; + lctrMstExtInit.enaPhys = 1 << LCTR_SCAN_PHY_1M; +} + +/*************************************************************************************************/ +/*! + * \brief Set enabled initiate scanning PHY. + * + * \param scanPhy Enabled scanning PHY. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtInitSetScanPhy(uint8_t scanPhy) +{ + WSF_ASSERT(scanPhy < LCTR_SCAN_PHY_TOTAL); + + lctrMstExtInit.enaPhys |= 1 << scanPhy; +} + +/*************************************************************************************************/ +/*! + * \brief Clear (disable) scanning PHY. + * + * \param scanPhy Disabled scanning PHY. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtInitClearScanPhy(uint8_t scanPhy) +{ + WSF_ASSERT(scanPhy < LCTR_SCAN_PHY_TOTAL); + + lctrMstExtInit.enaPhys &= ~(1 << scanPhy); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended initiate parameters. + * + * \param initPhy Extended initiating PHY. + * \param pScanParam Extended initiating scan parameters. + * \param pConnSpec Connection specification. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstExtInitParam(uint8_t initPhy, const LlExtInitScanParam_t *pScanParam, const LlConnSpec_t *pConnSpec) +{ + WSF_ASSERT(initPhy < LCTR_SCAN_PHY_TOTAL); + + if (pScanParam) + { + lctrMstExtInitTbl[initPhy].data.init.param = *pScanParam; + } + lctrMstExtInitTbl[initPhy].data.init.connSpec = *pConnSpec; +} + +/*************************************************************************************************/ +/*! + * \brief Send internal extended initiate subsystem message. + * + * \param pExtInitCtx Extended initiate context. + * \param event Extended scan event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSendExtInitMsg(lctrExtScanCtx_t *pExtInitCtx, uint8_t event) +{ + lctrMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(lctrMsgHdr_t))) != NULL) + { + pMsg->handle = (pExtInitCtx) ? LCTR_GET_EXT_INIT_HANDLE(pExtInitCtx) : LCTR_SCAN_PHY_ALL; + pMsg->dispId = LCTR_DISP_EXT_INIT; + pMsg->event = event; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_master_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_master_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..03ee724c7387bad2248a944e08c721c9d2beea52 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_master_phy.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller PHY features (master) implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_master_phy.h" +#include "lctr_api_phy.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for PHY features (master). + * + * \return None. + */ +/*************************************************************************************************/ +void LctrMstPhyConnInit(void) +{ + /* Add LLCP SM handler. */ + lctrMstLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD] = lctrMstLlcpExecutePhyUpdateSm; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..7de62248df92706dc505ffc383c682e1f7169d9b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_priv.c @@ -0,0 +1,192 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller privacy implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int.h" +#include "lctr_int_priv.h" +#include "lctr_api_priv.h" +#include "bb_ble_api_reslist.h" +#include "sch_api.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_cs.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +/*! \brief Privacy context. */ +lctrPrivCtx_t lctrPriv; + +/*************************************************************************************************/ +/*! + * \brief Restart resolvable private address timer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrRestartResPrivAddrTimer(void) +{ + lctrPriv.tmrResPrivAddrTimeout.handlerId = lmgrPersistCb.handlerId; + WsfTimerStartSec(&lctrPriv.tmrResPrivAddrTimeout, lmgrPrivCb.resPrivAddrTimeout); +} + +/*************************************************************************************************/ +/*! + * \brief Privacy message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrPrivDisp(LctrPrivMsg_t *pMsg) +{ + WSF_CS_INIT(cs); + + switch (pMsg->hdr.event) + { + case LCTR_PRIV_MSG_RES_PRIV_ADDR_TIMEOUT: + { + BbBleResListHandleTimeout(); + lctrRestartResPrivAddrTimer(); + break; + } + + case LCTR_PRIV_MSG_ADDR_RES_NEEDED: + { + lctrAddrResNeededMsg_t *pAddrResNeededMsg = (lctrAddrResNeededMsg_t *)pMsg; + + if (pAddrResNeededMsg->peer) + { + (void) BbBleResListResolvePeer(pAddrResNeededMsg->rpa, &pAddrResNeededMsg->peerAddrType, + &pAddrResNeededMsg->peerIdentityAddr); + } + else + { + (void) BbBleResListResolveLocal(pAddrResNeededMsg->rpa, &pAddrResNeededMsg->peerAddrType, + &pAddrResNeededMsg->peerIdentityAddr); + } + + WSF_CS_ENTER(cs); + lmgrPrivCb.numPendingAddrRes--; + WSF_CS_EXIT(cs); + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Pend address resolution. + * + * \param rpa Resolvable private address. + * \param peer TRUE if this is a peer RPA. + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrPrivPendAddrRes(uint64_t rpa, bool_t peer, uint8_t peerAddrType, uint64_t peerIdentityAddr) +{ + const uint8_t maxNumPendingAddrRes = 4; + uint8_t numPendingAddrRes; + lctrAddrResNeededMsg_t *pMsg; + + WSF_CS_INIT(cs); + + /* Check whether we can resolve another address now. */ + WSF_CS_ENTER(cs); + numPendingAddrRes = lmgrPrivCb.numPendingAddrRes; + WSF_CS_EXIT(cs); + if (numPendingAddrRes >= maxNumPendingAddrRes) + { + return; + } + + /* Send message to resolve the address. */ + + if ((pMsg = (lctrAddrResNeededMsg_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_PRIV; + pMsg->hdr.event = LCTR_PRIV_MSG_ADDR_RES_NEEDED; + + pMsg->rpa = rpa; + pMsg->peer = peer; + pMsg->peerAddrType = peerAddrType; + pMsg->peerIdentityAddr = peerIdentityAddr; + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + + WSF_CS_ENTER(cs); + lmgrPrivCb.numPendingAddrRes++; + WSF_CS_EXIT(cs); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set resolvable private address timeout. + * + * \param timeout Timeout in seconds. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrPrivSetResPrivAddrTimeout(uint32_t timeout) +{ + lmgrPrivCb.resPrivAddrTimeout = timeout; + lctrRestartResPrivAddrTimer(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for privacy. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrPrivInit(void) +{ + lctrMsgHdr_t *pMsg; + lctrMsgDispTbl[LCTR_DISP_PRIV] = (LctrMsgDisp_t)lctrPrivDisp; + + memset(&lctrPriv, 0, sizeof(lctrPriv)); + + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_4_2) + { + lmgrPersistCb.featuresDefault |= + LL_FEAT_PRIVACY; + } + + /* Set callback for task-level address resolution. */ + BbBleResListSetAddrResNeededCback(lctrPrivPendAddrRes); + + /* Set up timer for address resolution timeout. */ + pMsg = (lctrMsgHdr_t *)&lctrPriv.tmrResPrivAddrTimeout.msg; + /* pMsg->handle = 0; */ /* not used */ + pMsg->dispId = LCTR_DISP_PRIV; + pMsg->event = LCTR_PRIV_MSG_RES_PRIV_ADDR_TIMEOUT; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..fb466634cf6aeb5fd0b6a3f7766f4e73f96f9725 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_sc.c @@ -0,0 +1,227 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller secure connections implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int.h" +#include "lctr_api.h" +#include "lctr_api_sc.h" +#include "lmgr_api.h" +#include "lmgr_api_sc.h" +#include "wsf_assert.h" +#include "ll_math.h" +#include "wsf_trace.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Notify host of key generation. + * + * \param pPubKey Public key. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyReadLocalP256PubKeyInd(const uint8_t *pPubKey) +{ + LlReadLocalP256PubKeyInd_t evt; + evt.hdr.param = 0; + evt.hdr.event = LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND; + evt.hdr.status = LL_SUCCESS; + evt.status = LL_SUCCESS; + memcpy(evt.pubKey_x, pPubKey, sizeof(evt.pubKey_x)); + memcpy(evt.pubKey_y, pPubKey + LL_ECC_KEY_LEN, sizeof(evt.pubKey_y)); + + LL_TRACE_INFO0("### LlEvent ### LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND, status=LL_SUCCESS"); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of key generation. + * + * \param pDhKey Diffie-Hellman key. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyGenerateDhKeyInd(const uint8_t *pDhKey) +{ + LlGenerateDhKeyInd_t evt; + evt.hdr.param = 0; + evt.hdr.event = LL_GENERATE_DHKEY_CMPL_IND; + evt.hdr.status = LL_SUCCESS; + + evt.status = LL_SUCCESS; + memcpy(evt.dhKey, pDhKey, sizeof(evt.dhKey)); + + LL_TRACE_INFO0("### LlEvent ### LL_GENERATE_DHKEY_CMPL_IND, status=LL_SUCCESS"); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief P-256 key pair generation. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrScGenerateP256KeyPairContinue(void) +{ + if (LlMathEccGenerateP256KeyPairContinue()) + { + uint8_t pubKey[LL_ECC_KEY_LEN * 2]; + + /* Set the newly-generated private key as the local key. */ + LlMathEccGenerateP256KeyPairComplete(pubKey, lmgrScCb.privKey); + + /* Notify host that the key was generated. */ + lctrNotifyReadLocalP256PubKeyInd(pubKey); + + lmgrScCb.eccOpActive = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief DH Key generation. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrScGenerateDhKeyContinue(void) +{ + if (LlMathEccGenerateDhKeyContinue()) + { + uint8_t dhKey[LL_ECC_KEY_LEN]; + + LlMathEccGenerateDhKeyComplete(dhKey); + + /* Notify host that the key was generated. */ + lctrNotifyGenerateDhKeyInd(dhKey); + + lmgrScCb.eccOpActive = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Baseband driver ECC service callback. + * + * \param op Operation to service. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrScBbDrvEccServiceCback(uint8_t op) +{ + switch (op) + { + case LL_MATH_ECC_OP_GENERATE_P256_KEY_PAIR: + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_SC_GENERATE_P256_KEY_PAIR)); + break; + + case LL_MATH_ECC_OP_GENERATE_DH_KEY: + WsfSetEvent(lmgrPersistCb.handlerId, (1 << LCTR_EVENT_SC_GENERATE_DHKEY)); + break; + + default: + WSF_ASSERT(FALSE); + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Generate a P-256 public/private key pair. + * + * \return Status error code. + * + * Generate a P-256 public/private key pair. If another ECC operation (P-256 key pair generation + * or Diffie-Hellman key generation) is ongoing, an error will be returned. + */ +/*************************************************************************************************/ +uint8_t LctrGenerateP256KeyPair(void) +{ + /* Allow only one key pair generation at a time. */ + if (lmgrScCb.eccOpActive) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Start operation. */ + lmgrScCb.eccOpActive = TRUE; + if (lmgrScCb.privKeySet) + { + LlMathEccGenerateP256PublicKeyStart(lmgrScCb.privKey); + } + else + { + LlMathEccGenerateP256KeyPairStart(); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Generate a Diffie-Hellman key. + * + * \param pPubKey Public key. + * \param pPrivKey Private key. + * + * \return Status error code. + * + * Generate a Diffie-Hellman key from a remote public key and the local private key. If another + * ECC operation (P-256 key pair generation or Diffie-Hellman key generation) is ongoing, an error + * will be returned. + */ +/*************************************************************************************************/ +uint8_t LctrGenerateDhKey(const uint8_t *pPubKey, const uint8_t *pPrivKey) +{ + /* Allow only one key pair generation at a time. */ + if (lmgrScCb.eccOpActive) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Start operation. */ + lmgrScCb.eccOpActive = TRUE; + LlMathEccGenerateDhKeyStart(pPubKey, pPrivKey); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for secure connections. + * + * \return None. + */ +/*************************************************************************************************/ +void LctrScInit(void) +{ + lctrEventHdlrTbl[LCTR_EVENT_SC_GENERATE_P256_KEY_PAIR] = lctrScGenerateP256KeyPairContinue; + lctrEventHdlrTbl[LCTR_EVENT_SC_GENERATE_DHKEY] = lctrScGenerateDhKeyContinue; + + LlMathEccSetServiceCback(lctrScBbDrvEccServiceCback); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_slave_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_slave_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..74566c1ce0c04621abbe6c99d448edeaeac11d59 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_slave_phy.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller PHY features (slave) implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_slave_phy.h" +#include "lctr_api_phy.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for PHY features (slave). + * + * \return None. + */ +/*************************************************************************************************/ +void LctrSlvPhyConnInit(void) +{ + /* Add LLCP SM handler. */ + lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD] = lctrSlvLlcpExecutePhyUpdateSm; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_tester.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_tester.c new file mode 100644 index 0000000000000000000000000000000000000000..60501af141aba8a31fa154603663b60f719e4bc2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_main_tester.c @@ -0,0 +1,63 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave PHY update state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_tester.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/************************************************************************************************** + Global Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Force transmission of a data PDU. + * + * \param connHandle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrForceTxData(uint16_t connHandle) +{ + uint8_t *pAclBuf; + + if ((pAclBuf = WsfMsgAlloc(4 + 4 + 1)) != NULL) + { + pAclBuf[0] = connHandle & 0xFF; + pAclBuf[1] = connHandle >> 8; + pAclBuf[2] = 0x05; + pAclBuf[3] = 0x00; + pAclBuf[4] = 0x01; + pAclBuf[5] = 0x00; + pAclBuf[6] = 0x40; + pAclBuf[7] = 0x00; + pAclBuf[8] = 0xFF; + LctrForceTxAcl(pAclBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv.h new file mode 100644 index 0000000000000000000000000000000000000000..bcf0dfb09d30bdaabb6778070219dbce3ab46715 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller advertising channel packet interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_PDU_ADV_H +#define LCTR_PDU_ADV_H + +#include "lmgr_api_adv_slave.h" +#include "lctr_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#define LCTR_ADV_HDR_PDU_TYPE_SHIFT 0 /*!< ADV header PDU type field shift. */ +#define LCTR_ADV_HDR_CH_SEL_SHIFT 5 /*!< ADV header channel selection field shift. */ +#define LCTR_ADV_HDR_TX_ADD_SHIFT 6 /*!< ADV header Tx Address type field shift. */ +#define LCTR_ADV_HDR_RX_ADD_SHIFT 7 /*!< ADV header Rx Address type field shift. */ +#define LCTR_ADV_HDR_LEN_SHIFT 8 /*!< ADV header length field shift. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Advertising channel PDU header. */ +typedef struct +{ + uint8_t pduType; /*!< PDU type. */ + uint8_t chSel; /*!< Channel selection. */ + bool_t txAddrRnd; /*!< Tx address type is random. */ + bool_t rxAddrRnd; /*!< Rx address type is random. */ + uint8_t len; /*!< Payload length. */ +} lctrAdvbPduHdr_t; + +/*! \brief Scan request PDU. */ +typedef struct +{ + uint64_t scanAddr; /*!< Scanner's address. */ + uint64_t advAddr; /*!< Advertiser's address. */ +} lctrScanReq_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Pack */ +uint8_t lctrPackAdvbPduHdr(uint8_t *pBuf, const lctrAdvbPduHdr_t *pHdr); +uint8_t lctrPackAdvPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pAdvData); +uint8_t lctrPackConnDirectIndAdvPdu(uint8_t *pBuf, uint64_t advA, uint64_t initA); +uint8_t lctrPackScanReqPdu(uint8_t *pBuf, const lctrScanReq_t *pPdu); +uint8_t lctrPackScanRspPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pRspData); +uint8_t lctrPackConnIndPduAddr(uint8_t *pBuf, const lctrConnInd_t *pPdu); +uint8_t lctrPackConnIndPdu(uint8_t *pBuf, const lctrConnInd_t *pPdu); + +/* Unpack */ +uint8_t lctrUnpackAdvbPduHdr(lctrAdvbPduHdr_t *pHdr, const uint8_t *pBuf); +uint8_t lctrUnpackScanReqPdu(lctrScanReq_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackConnIndPdu(lctrConnInd_t *pPdu, const uint8_t *pBuf); + +/* Validate */ +bool_t lctrValidateConnIndPdu(lctrConnInd_t *pPdu); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_PDU_ADV_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_ae.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_ae.h new file mode 100644 index 0000000000000000000000000000000000000000..a4941ddb70b353d38d679e05c88a28b14242bf99 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_ae.h @@ -0,0 +1,130 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller extended advertising channel packet interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_PDU_ADV_AE_H +#define LCTR_PDU_ADV_AE_H + +#include "lctr_pdu_adv.h" +#include "lctr_int_adv_slave_ae.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Advertising mode. */ +enum +{ + LCTR_ADV_MODE_CONN_BIT = (1 << 0), /*!< Connectable bit. */ + LCTR_ADV_MODE_SCAN_BIT = (1 << 1) /*!< Scannable bit. */ +}; + +/*! \brief Clock accuracy. */ +enum +{ + LCTR_CLK_ACC_51_500_PPM = 0, /*!< Clock accuracy is between 51 and 500 PPM. */ + LCTR_CLK_ACC_0_50_PPM = 1 /*!< Clock accuracy is between 0 and 51 PPM. */ +}; + +/*! \brief Channel offset units. */ +enum +{ + LCTR_OFFS_UNITS_30_USEC = 0, /*!< Unit is 30 microseconds. */ + LCTR_OFFS_UNITS_300_USEC = 1 /*!< Unit is 300 microseconds. */ +}; + +#define LCTR_AUX_PTR_LEN 3 /*!< Size of AuxPtr field. */ +#define LCTR_TX_POWER_LEN 1 /*!< Size of TxPower field. */ +#define LCTR_SYNC_INFO_LEN 18 /*!< Size of SyncInfo field. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended advertising channel PDU header. */ +typedef struct +{ + uint8_t extHdrLen; /*!< Extended header length. */ + uint8_t advMode; /*!< Advertising mode. */ + uint8_t extHdrFlags; /*!< Extended header flags. */ + uint64_t advAddr; /*!< Advertiser's address. */ + uint64_t tgtAddr; /*!< Target address. */ + uint16_t did; /*!< Advertising data ID in ADI. */ + uint8_t sid; /*!< Advertising set ID in ADI. */ + int8_t txPwr; /*!< Tx Power. */ + uint8_t acadLen; /*!< ACAD length. */ + const uint8_t *pAcad; /*!< Buffer pointer to ACAD. */ + const uint8_t *pAuxPtr; /*!< Buffer pointer to AuxPtr field. */ + const uint8_t *pSyncInfo; /*!< Buffer pointer to SyncInfo field. */ +} lctrExtAdvHdr_t; + +/*! \brief Auxiliary Pointer. */ +typedef struct +{ + uint8_t auxChIdx; /*!< Auxiliary channel index. */ + uint8_t ca; /*!< Advertiser's clock accuracy. */ + uint8_t offsetUnits; /*!< Offset units. */ + uint16_t auxOffset; /*!< Auxiliary offset. */ + uint8_t auxPhy; /*!< Auxiliary PHY. */ +} lctrAuxPtr_t; + +/*! \brief Sync info. */ +typedef struct +{ + uint16_t syncOffset; /*!< Sync packet offset. */ + uint8_t offsetUnits; /*!< Offset units. */ + uint16_t syncInter; /*!< Sync interval. */ + uint64_t chanMap; /*!< Secondary channel map. */ + uint8_t sca; /*!< Sleep clock accuracy. */ + uint32_t accAddr; /*!< Access address. */ + uint32_t crcInit; /*!< CRC initialization value. */ + uint16_t eventCounter; /*!< Event counter. */ +} lctrSyncInfo_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Pack */ +uint8_t lctrPackAdvExtIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic); +uint8_t lctrPackAuxAdvIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic); +uint8_t lctrPackAuxScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic); +uint8_t lctrPackAuxChainIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic); +uint8_t lctrPackAuxConnRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic); +void lctrPackAuxPtr(lctrAdvSet_t const *pAdvSet, uint32_t offsUsec, uint8_t chIdx, uint8_t *pAuxPtr); +uint8_t lctrPackLegacyAdvPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf); +uint8_t lctrPackLegacyScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf); +uint8_t lctrPackSyncIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic); + +/* Unpack */ +uint8_t lctrUnpackExtAdvHeader(lctrExtAdvHdr_t *pPdu, uint8_t *pNewFlags, const uint8_t *pBuf); +void lctrUnpackAuxPtr(lctrAuxPtr_t *pAuxPtr, const uint8_t *pBuf); +void lctrUnpackSyncInfo(lctrSyncInfo_t *pSyncInfo, const uint8_t *pBuf); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_PDU_ADV_AE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..7e81aba53b05c2315f52d18b9b1c0a5974258f53 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c @@ -0,0 +1,172 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave extended advertising operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_pdu_adv_ae.h" +#include "lctr_pdu_adv.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Unpack Extended Advertising Header. + * + * \param pPdu Unpacked extended advertising header. + * \param pNewFlags New extended header flags. + * \param pBuf Packed extended advertising buffer. + * + * \return Extended advertising header length. + * + * \note This routine does not clear unused field values to allow the client to have + * default values in pExtAdvHdr. Newer values will be updated. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackExtAdvHeader(lctrExtAdvHdr_t *pPdu, uint8_t *pNewFlags, const uint8_t *pBuf) +{ + const uint8_t *pStartBuf = pBuf; + uint8_t field8; + + *pNewFlags = 0; + + BSTREAM_TO_UINT8(field8, pBuf); + + pPdu->extHdrLen = field8 & 0x3F; + pPdu->advMode = field8 >> 6; + + /* Extended Header Flags only present if length >= 1. */ + if (pPdu->extHdrLen) + { + uint8_t extHdrFlags; + BSTREAM_TO_UINT8(extHdrFlags, pBuf); + *pNewFlags = extHdrFlags; + pPdu->extHdrFlags |= extHdrFlags; + + if (extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) + { + BSTREAM_TO_BDA64(pPdu->advAddr, pBuf); + } + + if (extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) + { + BSTREAM_TO_BDA64(pPdu->tgtAddr, pBuf); + } + + if (extHdrFlags & LL_EXT_HDR_SUPP_INFO_BIT) + { + /* Skip unsupported byte. */ + pBuf++; + } + + if (extHdrFlags & LL_EXT_HDR_ADI_BIT) + { + uint16_t adi; + BSTREAM_TO_UINT16(adi, pBuf); + pPdu->did = (adi >> 0) & 0x0FFF; + pPdu->sid = (adi >> 12) & 0x000F; + } + + if (extHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) + { + pPdu->pAuxPtr = pBuf; + pBuf += 3; + } + + if (extHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) + { + pPdu->pSyncInfo = pBuf; + pBuf += 18; + } + + if (extHdrFlags & LL_EXT_HDR_TX_PWR_BIT) + { + BSTREAM_TO_UINT8(pPdu->txPwr, pBuf); + } + + if ((pPdu->extHdrLen + 1) > (pBuf - pStartBuf)) + { + pPdu->pAcad = pBuf; + pPdu->acadLen = (pPdu->extHdrLen + 1) - (pBuf - pStartBuf); + pBuf += pPdu->acadLen; + } + else + { + pPdu->pAcad = NULL; + pPdu->acadLen = 0; + } + } + return pBuf - pStartBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack AuxPtr fields. + * + * \param pAuxPtr Unpacked AuxPtr data. + * \param pBuf Packed AuxPtr data. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrUnpackAuxPtr(lctrAuxPtr_t *pAuxPtr, const uint8_t *pBuf) +{ + uint16_t field16; + pAuxPtr->auxChIdx = (pBuf[0] >> 0) & 0x3F; + pAuxPtr->ca = (pBuf[0] >> 6) & 0x01; + pAuxPtr->offsetUnits = (pBuf[0] >> 7) & 0x01; + pBuf++; + + BYTES_TO_UINT16(field16, pBuf); + pAuxPtr->auxOffset = (field16 >> 0) & 0x1FFF; + pAuxPtr->auxPhy = (field16 >> 13) & 0x0007; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack SyncInfo fields. + * + * \param pSyncInfo Sync info. + * \param pBuf Buffer pointer to SyncInfo field. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrUnpackSyncInfo(lctrSyncInfo_t *pSyncInfo, const uint8_t *pBuf) +{ + uint16_t field16; + uint64_t field64; + + BYTES_TO_UINT16(field16, pBuf); + pSyncInfo->syncOffset = (field16 >> 0) & 0x1FFF; + pSyncInfo->offsetUnits = (field16 >> 13) & 0x1; + pBuf += 2; + + BSTREAM_TO_UINT16(pSyncInfo->syncInter, pBuf); + + BYTES_TO_UINT40(field64, pBuf); + pSyncInfo->chanMap = (field64 >> 0) & LL_CHAN_DATA_ALL; + pSyncInfo->sca = (field64 >> 37) & 0x07; + pBuf+=5; + + BSTREAM_TO_UINT32(pSyncInfo->accAddr, pBuf); + + BSTREAM_TO_UINT24(pSyncInfo->crcInit, pBuf); + + BSTREAM_TO_UINT16(pSyncInfo->eventCounter, pBuf); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..d25d60a825ce39310af2cdd85947d63f749b998b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave.c @@ -0,0 +1,347 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising channel packet implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave.h" +#include "util/bstream.h" +#include "wsf_trace.h" +#include <string.h> +#include <stdint.h> + +/*************************************************************************************************/ +/*! + * \brief Pack an advertising PDU header. + * + * \param pBuf Packed packet buffer. + * \param pHdr Unpacked PDU header. + * + * \return PDU header length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAdvbPduHdr(uint8_t *pBuf, const lctrAdvbPduHdr_t *pHdr) +{ + const uint8_t len = LL_ADV_HDR_LEN; + + uint16_t hdr = 0; + + hdr |= pHdr->pduType << LCTR_ADV_HDR_PDU_TYPE_SHIFT; + hdr |= pHdr->chSel << LCTR_ADV_HDR_CH_SEL_SHIFT; + hdr |= pHdr->txAddrRnd << LCTR_ADV_HDR_TX_ADD_SHIFT; + hdr |= pHdr->rxAddrRnd << LCTR_ADV_HDR_RX_ADD_SHIFT; + hdr |= pHdr->len << LCTR_ADV_HDR_LEN_SHIFT; + + UINT16_TO_BSTREAM(pBuf, hdr); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a generic advertising PDU. + * + * \param pBuf Packed packet buffer. + * \param advA AdvA (local device address). + * \param pAdvData Advertising data buffer (ADVB-U). + * + * \return PDU payload length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAdvPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pAdvData) +{ + const uint8_t len = BDA_ADDR_LEN + pAdvData->len; + + BDA64_TO_BSTREAM(pBuf, advA); /* AdvA */ + memcpy(pBuf, pAdvData->buf, pAdvData->len); /* AdvData */ + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connectable direct advertising indication PDU. + * + * \param pBuf Packed packet buffer. + * \param advA AdvA (local device address). + * \param initA InitA. + * + * \return PDU payload length. + */ +/*************************************************************************************************/ +uint8_t lctrPackConnDirectIndAdvPdu(uint8_t *pBuf, uint64_t advA, uint64_t initA) +{ + const uint8_t len = BDA_ADDR_LEN + BDA_ADDR_LEN; + + BDA64_TO_BSTREAM(pBuf, advA); /* AdvA */ + BDA64_TO_BSTREAM(pBuf, initA); /* InitA */ + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a scan request PDU. + * + * \param pBuf Packed packet buffer. + * \param pPdu Unpacked packet. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrPackScanReqPdu(uint8_t *pBuf, const lctrScanReq_t *pPdu) +{ + const uint8_t len = LL_SCAN_REQ_PDU_LEN; + + BDA64_TO_BSTREAM(pBuf, pPdu->scanAddr); + BDA64_TO_BSTREAM(pBuf, pPdu->advAddr); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a scan response PDU. + * + * \param pBuf Packed packet buffer. + * \param advA AdvA (local device address). + * \param pRspData Scan response data buffer (ADVB-U). + * + * \return PDU payload length. + */ +/*************************************************************************************************/ +uint8_t lctrPackScanRspPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pRspData) +{ + /* Same as advertising PDU. */ + return lctrPackAdvPdu(pBuf, advA, pRspData); +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connect indication PDU, addresses only. + * + * \param pBuf Packed packet buffer. + * \param pPdu Unpacked packet. + * + * \return PDU payload length. + */ +/*************************************************************************************************/ +uint8_t lctrPackConnIndPduAddr(uint8_t *pBuf, const lctrConnInd_t *pPdu) +{ + const uint8_t len = 2 * sizeof(bdAddr_t); + + BDA64_TO_BSTREAM(pBuf, pPdu->initAddr); + BDA64_TO_BSTREAM(pBuf, pPdu->advAddr); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connect indication PDU. + * + * \param pBuf Packed packet buffer. + * \param pPdu Unpacked packet. + * + * \return PDU payload length. + */ +/*************************************************************************************************/ +uint8_t lctrPackConnIndPdu(uint8_t *pBuf, const lctrConnInd_t *pPdu) +{ + const uint8_t len = LL_CONN_IND_PDU_LEN; + + uint8_t field8; + + pBuf += lctrPackConnIndPduAddr(pBuf, pPdu); + + /* LLData */ + UINT32_TO_BSTREAM(pBuf, pPdu->accessAddr); + UINT24_TO_BSTREAM(pBuf, pPdu->crcInit); + UINT8_TO_BSTREAM (pBuf, pPdu->txWinSize); + UINT16_TO_BSTREAM(pBuf, pPdu->txWinOffset); + UINT16_TO_BSTREAM(pBuf, pPdu->interval); + UINT16_TO_BSTREAM(pBuf, pPdu->latency); + UINT16_TO_BSTREAM(pBuf, pPdu->timeout); + UINT40_TO_BSTREAM(pBuf, pPdu->chanMask); + + field8 = (pPdu->hopInc << 0) | + (pPdu->masterSca << 5); + UINT8_TO_BSTREAM(pBuf, field8); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack an advertising channel PDU header. + * + * \param pHdr Unpacked header. + * \param pBuf Packed packet buffer. + * + * \return PDU header length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackAdvbPduHdr(lctrAdvbPduHdr_t *pHdr, const uint8_t *pBuf) +{ + const uint8_t len = LL_ADV_HDR_LEN; + + uint16_t hdr; + + BSTREAM_TO_UINT16(hdr, pBuf); + + pHdr->pduType = (hdr >> LCTR_ADV_HDR_PDU_TYPE_SHIFT) & 0x000F; + pHdr->chSel = (hdr >> LCTR_ADV_HDR_CH_SEL_SHIFT) & 0x0001; + pHdr->txAddrRnd = (hdr >> LCTR_ADV_HDR_TX_ADD_SHIFT) & 0x0001; + pHdr->rxAddrRnd = (hdr >> LCTR_ADV_HDR_RX_ADD_SHIFT) & 0x0001; + if (pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) + { + pHdr->len = (hdr >> LCTR_ADV_HDR_LEN_SHIFT) & LL_ADV_EXT_HDR_LEN_MSK; + } + else + { + pHdr->len = (hdr >> LCTR_ADV_HDR_LEN_SHIFT) & LL_ADV_HDR_LEN_MSK; + } + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a scan request PDU. + * + * \param pPdu Unpacked packet. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackScanReqPdu(lctrScanReq_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = 2 * sizeof(bdAddr_t); + + BSTREAM_TO_BDA64(pPdu->scanAddr, pBuf); + BSTREAM_TO_BDA64(pPdu->advAddr, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a connect indication PDU. + * + * \param pPdu Unpacked packet. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackConnIndPdu(lctrConnInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_CONN_IND_PDU_LEN; + + uint8_t field8; + + BSTREAM_TO_BDA64(pPdu->initAddr, pBuf); + BSTREAM_TO_BDA64(pPdu->advAddr, pBuf); + + /* LLData */ + BSTREAM_TO_UINT32(pPdu->accessAddr, pBuf); + BSTREAM_TO_UINT24(pPdu->crcInit, pBuf); + BSTREAM_TO_UINT8 (pPdu->txWinSize, pBuf); + BSTREAM_TO_UINT16(pPdu->txWinOffset, pBuf); + BSTREAM_TO_UINT16(pPdu->interval, pBuf); + BSTREAM_TO_UINT16(pPdu->latency, pBuf); + BSTREAM_TO_UINT16(pPdu->timeout, pBuf); + BSTREAM_TO_UINT40(pPdu->chanMask, pBuf); + + BSTREAM_TO_UINT8(field8, pBuf); + pPdu->hopInc = (field8 >> 0) & 0x1F; + pPdu->masterSca = (field8 >> 5) & 0x07; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Validate range of a connect indication PDU. + * + * \param pPdu Unpacked packet. + * + * \return PDU length. + * + * Validation is limited to malfunction of receiving device. Some out of spec values are allowed + * to allow if safe operation of the system is possible. + */ +/*************************************************************************************************/ +bool_t lctrValidateConnIndPdu(lctrConnInd_t *pPdu) +{ + bool_t result = TRUE; + + /* pPdu->initAddr Allow all values */ + /* pPdu->advAddr Allow all values */ + /* pPdu->accessAddr Allow all values */ + /* pPdu->crcInit Allow all values */ + + /* connInterval: 7.5ms to 4.0s */ + if ((pPdu->interval < 6) || (pPdu->interval > 3200)) + { + LL_TRACE_WARN1("Invalid CONN_IND field value interval=%u", pPdu->interval); + result = FALSE; + } + + /* transmitWindowSize: 1.25ms to 10ms */ + if (pPdu->txWinSize > 8) + { + LL_TRACE_WARN1("Invalid CONN_IND field value txWinSize=%u", pPdu->txWinSize); + result = FALSE; + } + + /* transmitWindowOffset: 0ms to connInterval */ + if (pPdu->txWinOffset > pPdu->interval) + { + LL_TRACE_WARN1("Invalid CONN_IND field value txWinOffset=%u", pPdu->txWinOffset); + result = FALSE; + } + + /* connSupervisionTimeout: range of 100 ms to 32.0s */ + if ((pPdu->timeout < 10) || (pPdu->timeout > 3200)) + { + LL_TRACE_WARN1("Invalid CONN_IND field value timeout=%u", pPdu->timeout); + result = FALSE; + } + + /* ChM */ + if ((pPdu->chanMask & (UINT64_C(7) << LL_CHAN_ADV_MIN_IDX)) || (pPdu->chanMask == 0)) + { + LL_TRACE_WARN0("Invalid CONN_IND field value chanMask"); + result = FALSE; + } + + /* hopIncrement: 5 to 16 */ + if ((pPdu->hopInc < 5) || (pPdu->hopInc > 16)) + { + LL_TRACE_WARN1("Invalid CONN_IND field value hopInc=%u", pPdu->hopInc); + result = FALSE; + } + + /* pPdu->latency Allow all values */ + /* pPdu->masterSca All 3 bits are valid */ + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..e32359dafd08c34ed8871cde3c77bebbd23d586d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c @@ -0,0 +1,874 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave extended advertising operation builder implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_pdu_adv_ae.h" +#include "lctr_pdu_adv.h" +#include "lctr_int_adv_slave.h" +#include "lctr_int_conn_master.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Maximum value for 30usec offset unit. */ +#define LCTR_30_USEC_OFFS_MAX_USEC 245730 + +/*! \brief Assert minimum advertising payload length can contain a legacy length payload. */ +WSF_CT_ASSERT(BB_ADV_PLD_MAX_LEN > (LL_EXT_ADV_HDR_MAX_LEN + LL_ADVBU_MAX_LEN)); + +/*************************************************************************************************/ +/*! + * \brief Pack Sync info field. + * + * \param pAdvSet Advertising set. + * \param pSyncInfo Packed SyncInfo field. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrPackSyncInfo(lctrAdvSet_t *pAdvSet, uint8_t *pSyncInfo) +{ + uint8_t offsUnits; + uint16_t offs; + uint32_t offsUsec, tempDue; + uint64_t temp; + BbOpDesc_t *pAuxOp = &pAdvSet->auxAdvBod; + BbOpDesc_t *pPerOp = &pAdvSet->perParam.perAdvBod; + BbBleData_t *pBle = &pAdvSet->perParam.perBleData; + + tempDue = pPerOp->due; + + while (TRUE) + { + /* If sync PDU is due in the future and at least MAFS apart, update offset. */ + if ((tempDue > pAuxOp->due) && ((BB_TICKS_TO_US(tempDue - pAuxOp->due)) > LL_BLE_MAFS_US)) + { + offsUsec = BB_TICKS_TO_US(tempDue - pAuxOp->due); + break; + } + + tempDue += pAdvSet->perParam.perAdvInter; + } + + if (offsUsec <= LCTR_30_USEC_OFFS_MAX_USEC) + { + offsUnits = LCTR_OFFS_UNITS_30_USEC; + offs = LL_MATH_DIV_30(offsUsec); + } + else + { + offsUnits = LCTR_OFFS_UNITS_300_USEC; + offs = LL_MATH_DIV_300(offsUsec); + } + + UINT16_TO_BUF(pSyncInfo, offs | /* Sync packet offset. */ + (offsUnits << 13)); /* Offset units. */ + UINT16_TO_BUF(&pSyncInfo[2], /* Interval. */ + LCTR_PER_INTER_TO_MS(BB_TICKS_TO_US(pAdvSet->perParam.perAdvInter))); + temp = (LL_CHAN_DATA_ALL | /* All secondary channels are used. */ + ((uint64_t)lctrComputeSca() << 37)); /* SCA. */ + UINT40_TO_BUF(&pSyncInfo[4], temp); + UINT32_TO_BUF(&pSyncInfo[9], pBle->chan.accAddr); /* Access address. */ + UINT24_TO_BUF(&pSyncInfo[13], pBle->chan.crcInit); /* CRCInit. */ + UINT16_TO_BUF(&pSyncInfo[16], pAdvSet->perParam.perEventCounter); /* Event counter. */ +} + +/*************************************************************************************************/ +/*! + * \brief Pack Advertising Header and Extended Advertising Headers. + * + * \param pAdvSet Advertising set. + * \param manExtHdrFlags Mandatory extended header flags. + * \param optExtHdrFlags Optional extended header flags. + * \param advMode advMode field. + * \param pPduHdr Unpacked PDU header. + * \param pDataBuf Advertising data buffer descriptor (ignored if NULL). + * \param pPduBuf Buffer to store packed header. + * \param commExtAdvPdu Common extended advertising PDU type. + * \param isPeriodic This header is part of periodic PDUs or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +static uint8_t lctrPackExtAdvHeader(lctrAdvSet_t *pAdvSet, uint8_t manExtHdrFlags, uint8_t optExtHdrFlags, + uint8_t advMode, lctrAdvbPduHdr_t *pPduHdr, lctrAdvDataBuf_t *pDataBuf, + uint8_t *pPduBuf, uint8_t commExtAdvPdu, bool_t isPeriodic) +{ + uint8_t extHdrFlags = 0; + uint8_t *pAuxPtr = NULL; + uint8_t *pBuf = pPduBuf + LL_ADV_HDR_LEN + LCTR_EXT_HDR_CMN_LEN + LCTR_EXT_HDR_FLAG_LEN; + unsigned int availDataLen; + bool_t syncInfoNeeded = FALSE; + bool_t txPwrNeeded = FALSE; + unsigned int remDataLen = 0; + uint8_t advDataLen = 0; + uint16_t extHdrLen; + + pPduHdr->len = 0; + + /* Determine the superior PDU. */ + if (commExtAdvPdu == LCTR_PDU_AUX_CHAIN_IND) + { + if (isPeriodic) + { + commExtAdvPdu = LCTR_PDU_AUX_SYNC_IND; + } + else + { + commExtAdvPdu = LCTR_PDU_AUX_ADV_IND; + } + } + + if ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_OMIT_AA_BIT) == 0) + { + if ((manExtHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) || + ((optExtHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT) && (!(pAdvSet->extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)))) + { + /* Pack AdvA */ + extHdrFlags |= LL_EXT_HDR_ADV_ADDR_BIT; + BDA64_TO_BSTREAM(pBuf, pAdvSet->advA); +#if (LL_ENABLE_TESTER == TRUE) + if ((llTesterCb.extHdr.pduMatchMask & (1 << pPduHdr->pduType)) && + (llTesterCb.extHdr.modifyMask & LL_EXT_HDR_ADV_ADDR_BIT)) + { + Bda64ToBstream(pBuf - BDA_ADDR_LEN, llTesterCb.extHdr.AdvA); + } +#endif + } + } + + if ((manExtHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) || + ((optExtHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) && (!(pAdvSet->extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT)))) + { + /* Pack TargetA */ + extHdrFlags |= LL_EXT_HDR_TGT_ADDR_BIT; + BDA64_TO_BSTREAM(pBuf, pAdvSet->tgtA); + +#if (LL_ENABLE_TESTER == TRUE) + if ((llTesterCb.extHdr.pduMatchMask & (1 << pPduHdr->pduType)) && + (llTesterCb.extHdr.modifyMask & LL_EXT_HDR_TGT_ADDR_BIT)) + { + Bda64ToBstream(pBuf - BDA_ADDR_LEN, llTesterCb.extHdr.TargetA); + } +#endif + } + + if ((manExtHdrFlags & LL_EXT_HDR_ADI_BIT) || + ((optExtHdrFlags & LL_EXT_HDR_ADI_BIT) && (!(pAdvSet->extHdrFlags & LL_EXT_HDR_ADI_BIT)))) + { + /* Pack AdvDataInfo */ + extHdrFlags |= LL_EXT_HDR_ADI_BIT; + UINT16_TO_BSTREAM(pBuf, (pAdvSet->param.advSID << 12) | ((pAdvSet->advData.did & 0x0FFF) << 0)); + +#if (LL_ENABLE_TESTER == TRUE) + if ((llTesterCb.extHdr.pduMatchMask & (1 << pPduHdr->pduType)) && + (llTesterCb.extHdr.modifyMask & LL_EXT_HDR_ADI_BIT)) + { + UINT16_TO_BUF(pBuf - sizeof(uint16_t), llTesterCb.extHdr.ADI); + } +#endif + } + + availDataLen = LL_EXT_ADVB_MAX_LEN - (pBuf - pPduBuf); + + if ((manExtHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) || + ((optExtHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT) && (!(pAdvSet->extHdrFlags & LL_EXT_HDR_SYNC_INFO_BIT)))) + { + syncInfoNeeded = TRUE; + /* Reserve packet space now, pack later. */ + availDataLen -= LCTR_SYNC_INFO_LEN; + } + + /* Tx Power field is never mandatory; skip check. */ + if ((optExtHdrFlags & LL_EXT_HDR_TX_PWR_BIT) && + (((commExtAdvPdu == LCTR_PDU_AUX_SYNC_IND) && (pAdvSet->perParam.advEventProp & LL_EXT_HDR_TX_PWR_BIT)) || + ((commExtAdvPdu != LCTR_PDU_AUX_SYNC_IND) && (pAdvSet->param.advEventProp & LL_EXT_HDR_TX_PWR_BIT)))) + { + txPwrNeeded = TRUE; + /* Reserve packet space now, pack later. */ + availDataLen -= LCTR_TX_POWER_LEN; + } + + if (pDataBuf) + { + remDataLen = pDataBuf->len - pDataBuf->txOffs; + if (pDataBuf->fragPref == LL_ADV_DATA_FRAG_ALLOW) + { + /* Adjust to fragment size. */ + availDataLen = WSF_MIN(pAdvSet->advDataFragLen, availDataLen); + } + } + + if ((manExtHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) || + ((optExtHdrFlags & LL_EXT_HDR_AUX_PTR_BIT) && (remDataLen > availDataLen))) + { + /* Pack AuxPtr. */ + extHdrFlags |= LL_EXT_HDR_AUX_PTR_BIT; + pAuxPtr = pBuf; + + /* Skip AuxPtr field; contents filled when values are known. */ + pBuf += LCTR_AUX_PTR_LEN; + } + + if (syncInfoNeeded) + { + uint8_t *pSyncInfo = pBuf; + /* Pack SyncInfo */ + extHdrFlags |= LL_EXT_HDR_SYNC_INFO_BIT; + lctrPackSyncInfo(pAdvSet, pSyncInfo); + pBuf += LCTR_SYNC_INFO_LEN; + } + + if (txPwrNeeded) + { + int8_t actTxPwr; + /* Pack TxPower */ + extHdrFlags |= LL_EXT_HDR_TX_PWR_BIT; + actTxPwr = BbBleRfGetActualTxPower(pAdvSet->bleData.chan.txPower, TRUE); +#if (LL_ENABLE_TESTER == TRUE) + if ((llTesterCb.extHdr.pduMatchMask & (1 << pPduHdr->pduType)) && + (llTesterCb.extHdr.modifyMask & LL_EXT_HDR_TX_PWR_BIT)) + { + actTxPwr = llTesterCb.extHdr.TxPower; + } +#endif + UINT8_TO_BSTREAM(pBuf, (uint8_t)actTxPwr); + } + + if (remDataLen) + { + const unsigned int maxAvailDataLen = LL_EXT_ADVB_MAX_LEN - (pBuf - pPduBuf); + availDataLen = WSF_MIN(maxAvailDataLen, availDataLen); /* Limit to maximum packet size. */ + advDataLen = WSF_MIN(remDataLen, availDataLen); /* Reduce to remaining data. */ + pDataBuf->txOffs += advDataLen; + } + + if (extHdrFlags == 0) + { + /* Extended Header Flags only present if bits set. */ + pBuf = pPduBuf + LL_ADV_HDR_LEN + LCTR_EXT_HDR_CMN_LEN; + } + + /* Pack Advertising Header now that Extended Advertising Header length is known. */ + extHdrLen = pBuf - pPduBuf - LL_ADV_HDR_LEN - LCTR_EXT_HDR_CMN_LEN; + pPduHdr->len = pBuf - pPduBuf - LL_ADV_HDR_LEN + advDataLen; + + lctrPackAdvbPduHdr(pPduBuf, pPduHdr); + + /* Pack Extended Advertising header. */ + pPduBuf[LL_ADV_HDR_LEN + 0] = extHdrLen | /* Extended Header Length */ + (advMode << 6); /* AdvMode */ + pPduBuf[LL_ADV_HDR_LEN + 1] = extHdrFlags; /* Extended Header Flags */ + + switch(commExtAdvPdu) + { + case LCTR_PDU_ADV_EXT_IND: + pAdvSet->auxOffsUsec = 0; + pAdvSet->extHdrFlags = extHdrFlags; + /* AUX Offset field set dynamically in lctrSlvTxSetupExtAdvHandler() after AuxBod is scheduled. */ + pAdvSet->pExtAdvAuxPtr = pAuxPtr; + break; + + case LCTR_PDU_AUX_ADV_IND: + /* Compute auxiliary PDU AuxPtr fields (PDU is an auxiliary PDU). */ + pAdvSet->auxOffsUsec = 0; + if (pAuxPtr) + { + BbBleData_t * const pBle = &pAdvSet->auxBleData; + /* Now the PDU length/duration is known, complete AuxPtr fields for next CHAIN_IND. */ + pAdvSet->auxOffsUsec = SchBleCalcAuxPktDurationUsec(pBle->chan.txPhy, pBle->chan.initTxPhyOptions, LL_ADV_HDR_LEN + pPduHdr->len) + + WSF_MAX(pAdvSet->auxDelayUsec, pLctrRtCfg->auxDelayUsec); + pAdvSet->auxOffsUsec = WSF_MIN(pAdvSet->auxOffsUsec, LL_AUX_PTR_MAX_USEC); + + lctrPackAuxPtr(pAdvSet, pAdvSet->auxOffsUsec, pAdvSet->auxChIdx, pAuxPtr); + } + break; + + case LCTR_PDU_AUX_SCAN_RSP: + case LCTR_PDU_AUX_CONNECT_RSP: + pAdvSet->auxOffsUsec = 0; + /* Compute auxiliary PDU AuxPtr fields (PDU is an auxiliary PDU). */ + if (pAuxPtr) + { + BbBleData_t * const pBle = &pAdvSet->auxBleData; + + /* Now the PDU length/duration is known, complete AuxPtr fields for next CHAIN_IND. */ + pAdvSet->auxOffsUsec = SchBleCalcAuxPktDurationUsec(pBle->chan.txPhy, (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) ? pBle->chan.tifsTxPhyOptions : pBle->op.slvAuxAdv.auxRxPhyOptions, LL_ADV_HDR_LEN + pPduHdr->len) + + WSF_MAX(pAdvSet->auxDelayUsec, pLctrRtCfg->auxDelayUsec); + pAdvSet->auxOffsUsec = WSF_MIN(pAdvSet->auxOffsUsec, LL_AUX_PTR_MAX_USEC); + + lctrPackAuxPtr(pAdvSet, pAdvSet->auxOffsUsec, pAdvSet->auxChIdx, pAuxPtr); + } + break; + + case LCTR_PDU_AUX_SYNC_IND: + pAdvSet->perParam.perOffsUsec = 0; + /* Compute auxiliary PDU AuxPtr fields (PDU is an auxiliary PDU). */ + if (pAuxPtr) + { + BbBleData_t * const pBle = &pAdvSet->auxBleData; + + /* Now the PDU length/duration is known, complete AuxPtr fields for next CHAIN_IND. */ + pAdvSet->perParam.perOffsUsec = SchBleCalcAuxPktDurationUsec(pBle->chan.txPhy, pBle->chan.initTxPhyOptions, LL_ADV_HDR_LEN + pPduHdr->len) + + WSF_MAX(pAdvSet->auxDelayUsec, pLctrRtCfg->auxDelayUsec); + pAdvSet->perParam.perOffsUsec = WSF_MIN(pAdvSet->perParam.perOffsUsec, LL_AUX_PTR_MAX_USEC); + + lctrPackAuxPtr(pAdvSet, pAdvSet->perParam.perOffsUsec, pAdvSet->perParam.perChIdx, pAuxPtr); + } + break; + } + + return pBuf - pPduBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an ADV_EXT_IND PDU + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param isPeriodic This header is part of periodic advertising or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAdvExtIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic) +{ + uint8_t manExtHdrFlags = 0; + uint8_t optExtHdrFlags = 0; + uint16_t prop; + uint8_t advMode; + + BbBleData_t * const pBle = &pAdvSet->bleData; + + lctrAdvbPduHdr_t pduHdr = { 0 }; + pduHdr.pduType = LL_PDU_ADV_EXT_IND; + + prop = pAdvSet->param.advEventProp & + (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT | LL_ADV_EVT_PROP_DIRECT_ADV_BIT); + + /*** Specification defined behavior ***/ + + switch (prop) + { + /* Non-Connectable / Non-Scannable */ + case ( /* ------------------- */ 0 | /* ------------------- */ 0 | /* ------------------ */ 0 ): + manExtHdrFlags = ((pAdvSet->advData.len > 0) ? LL_EXT_HDR_ADI_BIT : 0) | + ((pAdvSet->advData.len > 0) ? LL_EXT_HDR_AUX_PTR_BIT : 0); + optExtHdrFlags = ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_ADV_ADDR_BIT : 0) | + ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_TX_PWR_BIT : 0) | + ((pAdvSet->advData.len == 0) ? LL_EXT_HDR_TX_PWR_BIT : 0); + + /* Pack aux pointer and ADI if periodic advertising is enabled. */ + if (pAdvSet->perParam.perAdvEnabled == TRUE) + { + manExtHdrFlags |= LL_EXT_HDR_ADI_BIT; + manExtHdrFlags |= LL_EXT_HDR_AUX_PTR_BIT; + } + + if (!(manExtHdrFlags & LL_EXT_HDR_AUX_PTR_BIT)) + { + /* Advertising address is mandatory if auxiliary pointer is NULL. */ + manExtHdrFlags |= LL_EXT_HDR_ADV_ADDR_BIT; + } + break; + + case ( /* ------------------- */ 0 | /* ------------------- */ 0 | LL_ADV_EVT_PROP_DIRECT_ADV_BIT ): + manExtHdrFlags = ((pAdvSet->advData.len > 0) ? LL_EXT_HDR_ADI_BIT : 0) | + ((pAdvSet->advData.len > 0) ? LL_EXT_HDR_AUX_PTR_BIT : 0); + optExtHdrFlags = ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_ADV_ADDR_BIT : 0) | + ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_TGT_ADDR_BIT : 0) | + ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_TX_PWR_BIT : 0) | + ((pAdvSet->advData.len == 0) ? LL_EXT_HDR_TX_PWR_BIT : 0); + /* Pack aux pointer and ADI if periodic advertising is enabled. */ + if (pAdvSet->perParam.perAdvEnabled == TRUE) + { + manExtHdrFlags |= LL_EXT_HDR_ADI_BIT; + manExtHdrFlags |= LL_EXT_HDR_AUX_PTR_BIT; + } + + if (!(manExtHdrFlags & LL_EXT_HDR_AUX_PTR_BIT)) + { + /* Advertising address and target address are mandatory if auxiliary pointer is NULL. */ + manExtHdrFlags |= LL_EXT_HDR_ADV_ADDR_BIT; + manExtHdrFlags |= LL_EXT_HDR_TGT_ADDR_BIT; + } + break; + + /* Connectable */ + case (LL_ADV_EVT_PROP_CONN_ADV_BIT | /* ------------------- */ 0 | /* ------------------ */ 0): + case (LL_ADV_EVT_PROP_CONN_ADV_BIT | /* ------------------- */ 0 | LL_ADV_EVT_PROP_DIRECT_ADV_BIT): + manExtHdrFlags = LL_EXT_HDR_ADI_BIT | + LL_EXT_HDR_AUX_PTR_BIT; + optExtHdrFlags = ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_TX_PWR_BIT : 0); + break; + + /* Scannable */ + case (/* ------------------- */ 0 | LL_ADV_EVT_PROP_SCAN_ADV_BIT | /* ------------------ */ 0): + case (/* ------------------- */ 0 | LL_ADV_EVT_PROP_SCAN_ADV_BIT | LL_ADV_EVT_PROP_DIRECT_ADV_BIT): + manExtHdrFlags = LL_EXT_HDR_ADI_BIT | + LL_EXT_HDR_AUX_PTR_BIT; + optExtHdrFlags = ((pAdvSet->param.priAdvPhy == LL_PHY_LE_1M) ? LL_EXT_HDR_TX_PWR_BIT : 0); + break; + + default: + manExtHdrFlags = 0; + break; + } + + /*** Host allowed options ***/ + lctrChooseSetAdvA(&pduHdr, pBle, pAdvSet); + lctrChooseSetPeerA(&pduHdr, pBle, pAdvSet); + + advMode = ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) ? LCTR_ADV_MODE_CONN_BIT : 0) | + ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) ? LCTR_ADV_MODE_SCAN_BIT : 0); + + pAdvSet->extHdrFlags = 0; + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, optExtHdrFlags, + advMode, &pduHdr, NULL, + pPduBuf, LCTR_PDU_ADV_EXT_IND, isPeriodic); +} + +/*************************************************************************************************/ +/*! + * \brief Pack an AUX_ADV_IND PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param pAdvData Advertising data or scan response data descriptor. + * \param isPeriodic This header is part of periodic advertising or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAuxAdvIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, + bool_t isPeriodic) +{ + uint8_t manExtHdrFlags = 0; + uint8_t optExtHdrFlags = 0; + uint16_t prop; + uint8_t advMode; + + BbBleData_t * const pBle = &pAdvSet->auxBleData; + lctrAdvbPduHdr_t pduHdr = { 0 }; + pduHdr.pduType = LL_PDU_AUX_ADV_IND; + + prop = pAdvSet->param.advEventProp & + (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT | LL_ADV_EVT_PROP_DIRECT_ADV_BIT); + + /*** Specification defined behavior ***/ + + switch (prop) + { + /* Non-Connectable / Non-Scannable */ + case ( /* ------------------- */ 0 | /* ------------------- */ 0 | /* ------------------ */ 0): + manExtHdrFlags = LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = ((!(pAdvSet->extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)) ? LL_EXT_HDR_ADV_ADDR_BIT : 0) | + LL_EXT_HDR_AUX_PTR_BIT | + LL_EXT_HDR_TX_PWR_BIT; + /* Pack aux pointer if periodic adv is enabled. */ + if (pAdvSet->perParam.perAdvEnabled == TRUE) + { + optExtHdrFlags |= LL_EXT_HDR_SYNC_INFO_BIT; + } + break; + case ( /* ------------------- */ 0 | /* ------------------- */ 0 | LL_ADV_EVT_PROP_DIRECT_ADV_BIT): + manExtHdrFlags = ((!(pAdvSet->extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT)) ? LL_EXT_HDR_TGT_ADDR_BIT : 0) | + LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = ((!(pAdvSet->extHdrFlags & LL_EXT_HDR_ADV_ADDR_BIT)) ? LL_EXT_HDR_ADV_ADDR_BIT : 0) | + LL_EXT_HDR_AUX_PTR_BIT | + LL_EXT_HDR_TX_PWR_BIT; + /* Pack aux pointer if periodic adv is enabled. */ + if (pAdvSet->perParam.perAdvEnabled == TRUE) + { + optExtHdrFlags |= LL_EXT_HDR_SYNC_INFO_BIT; + } + break; + + /* Connectable */ + case (LL_ADV_EVT_PROP_CONN_ADV_BIT | /* ------------------- */ 0 | /* ------------------ */ 0): + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT | + LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = LL_EXT_HDR_TX_PWR_BIT; + break; + case (LL_ADV_EVT_PROP_CONN_ADV_BIT | /* ------------------- */ 0 | LL_ADV_EVT_PROP_DIRECT_ADV_BIT): + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT | + LL_EXT_HDR_TGT_ADDR_BIT | + LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = LL_EXT_HDR_TX_PWR_BIT; + break; + + /* Scannable */ + case (/* ------------------- */ 0 | LL_ADV_EVT_PROP_SCAN_ADV_BIT | /* ------------------ */ 0): + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT | + LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = LL_EXT_HDR_TX_PWR_BIT; + break; + case (/* ------------------- */ 0 | LL_ADV_EVT_PROP_SCAN_ADV_BIT | LL_ADV_EVT_PROP_DIRECT_ADV_BIT): + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT | + LL_EXT_HDR_TGT_ADDR_BIT | + LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = LL_EXT_HDR_ADI_BIT | + LL_EXT_HDR_TX_PWR_BIT; + break; + + default: + manExtHdrFlags = 0; + break; + } + + /*** Host allowed options ***/ + lctrChooseSetAdvA(&pduHdr, pBle, pAdvSet); + lctrChooseSetPeerA(&pduHdr, pBle, pAdvSet); + + advMode = ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_CONN_ADV_BIT) ? LCTR_ADV_MODE_CONN_BIT : 0) | + ((pAdvSet->param.advEventProp & LL_ADV_EVT_PROP_SCAN_ADV_BIT) ? LCTR_ADV_MODE_SCAN_BIT : 0); + + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, optExtHdrFlags, + advMode, &pduHdr, pAdvData, + pPduBuf, LCTR_PDU_AUX_ADV_IND, isPeriodic); +} + +/*************************************************************************************************/ +/*! + * \brief Pack an AUX_SCAN_RSP PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param isPeriodic This header is part of periodic advertising or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAuxScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic) +{ + uint8_t manExtHdrFlags, optExtHdrFlags; + + BbBleData_t * const pBle = &pAdvSet->auxBleData; + lctrAdvbPduHdr_t pduHdr = { 0 }; + pduHdr.pduType = LL_PDU_AUX_SCAN_RSP; + + /*** Specification defined behavior ***/ + + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT; + optExtHdrFlags = LL_EXT_HDR_AUX_PTR_BIT | LL_EXT_HDR_TX_PWR_BIT; + + lctrChooseSetAdvA(&pduHdr, pBle, pAdvSet); + lctrChooseSetPeerA(&pduHdr, pBle, pAdvSet); + + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, optExtHdrFlags, + 0, &pduHdr, &pAdvSet->scanRspData, + pPduBuf, LCTR_PDU_AUX_SCAN_RSP, isPeriodic); +} + +/*************************************************************************************************/ +/*! + * \brief Pack an AUX_CHAIN_IND PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param pAdvData Advertising or Scan Response data. + * \param isPeriodic This header is part of periodic advertising or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAuxChainIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, + bool_t isPeriodic) +{ + uint8_t manExtHdrFlags, optExtHdrFlags; + + lctrAdvbPduHdr_t pduHdr = { 0 }; + pduHdr.pduType = LL_PDU_AUX_CHAIN_IND; + + /*** Specification defined behavior ***/ + + manExtHdrFlags = LL_EXT_HDR_ADI_BIT; + optExtHdrFlags = LL_EXT_HDR_AUX_PTR_BIT | LL_ADV_EVT_PROP_TX_PWR_BIT; + + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, optExtHdrFlags, + 0, &pduHdr, pAdvData, + pPduBuf, LCTR_PDU_AUX_CHAIN_IND, isPeriodic); +} + +/*************************************************************************************************/ +/*! + * \brief Pack an AUX_CONNECT_RSP PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param isPeriodic This header is part of periodic advertising or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAuxConnRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic) +{ + uint8_t manExtHdrFlags; + + BbBleData_t * const pBle = &pAdvSet->auxBleData; + + pAdvSet->rspPduHdr.pduType = LL_PDU_AUX_CONNECT_RSP; + + /*** Specification defined behavior ***/ + + manExtHdrFlags = LL_EXT_HDR_ADV_ADDR_BIT | LL_EXT_HDR_TGT_ADDR_BIT; + + lctrChooseSetAdvA(&pAdvSet->rspPduHdr, pBle, pAdvSet); + lctrChooseSetPeerA(&pAdvSet->rspPduHdr, pBle, pAdvSet); + + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, 0, + 0, &pAdvSet->rspPduHdr, NULL, + pPduBuf, LCTR_PDU_AUX_CONNECT_RSP, isPeriodic); +} + +/*************************************************************************************************/ +/*! + * \brief Pack AuxPtr field. + * + * \param pAdvSet Advertising set. + * \param offsUsec Auxiliary offset in microseconds. + * \param chIdx Channel index. + * \param pAuxPtr Packed AuxPtr buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrPackAuxPtr(lctrAdvSet_t const *pAdvSet, uint32_t offsUsec, uint8_t chIdx, uint8_t *pAuxPtr) +{ + uint8_t ca = (BbGetClockAccuracy() <= 50) ? LCTR_CLK_ACC_0_50_PPM : LCTR_CLK_ACC_51_500_PPM; + uint8_t offsUnits; + uint16_t auxOffset; + uint8_t usedPhy; + + if (offsUsec <= LCTR_30_USEC_OFFS_MAX_USEC) + { + offsUnits = LCTR_OFFS_UNITS_30_USEC; + auxOffset = LL_MATH_DIV_30(offsUsec); + } + else + { + offsUnits = LCTR_OFFS_UNITS_300_USEC; + auxOffset = LL_MATH_DIV_300(offsUsec); + } + + pAuxPtr[0] = chIdx | /* LL Channel */ + (ca << 6) | /* CA */ + (offsUnits << 7); /* Offset Units */ + + /* Map used PHY. */ + switch (pAdvSet->param.secAdvPhy) + { + case LL_PHY_LE_2M: + usedPhy = 1; + break; + case LL_PHY_LE_CODED: + usedPhy = 2; + break; + default: + case LL_PHY_LE_1M: + usedPhy = 0; + break; + } + + UINT16_TO_BUF(&pAuxPtr[1], auxOffset | (usedPhy << LCTR_AUX_OFFS_USED_PHY_SHIFT)); +} + +/*************************************************************************************************/ +/*! + * \brief Pack a legacy Advertising PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackLegacyAdvPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf) +{ + uint16_t prop; + uint8_t advDataLen; + uint8_t *pBuf = pPduBuf + LL_ADV_HDR_LEN; + lctrAdvbPduHdr_t pduHdr = { 0 }; + + BbBleData_t * const pBle = &pAdvSet->bleData; + + lctrChooseSetAdvA(&pduHdr, pBle, pAdvSet); + lctrChooseSetPeerA(&pduHdr, pBle, pAdvSet); + + prop = pAdvSet->param.advEventProp & + (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT | LL_ADV_EVT_PROP_DIRECT_ADV_BIT); + + switch (prop) + { + case ( LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT | /* ------------------ */ 0 ): + pduHdr.pduType = LL_PDU_ADV_IND; + break; + case ( LL_ADV_EVT_PROP_CONN_ADV_BIT | /* -------------------- */ 0 | LL_ADV_EVT_PROP_DIRECT_ADV_BIT ): + pduHdr.pduType = LL_PDU_ADV_DIRECT_IND; + break; + case ( /* -------------------- */ 0 | LL_ADV_EVT_PROP_SCAN_ADV_BIT | /* ------------------ */ 0 ): + pduHdr.pduType = LL_PDU_ADV_SCAN_IND; + break; + case ( /* -------------------- */ 0 | /* -------------------- */ 0 | /* ------------------ */ 0 ): + default: + pduHdr.pduType = LL_PDU_ADV_NONCONN_IND; + break; + } + + /* Pack AdvA */ + BDA64_TO_BSTREAM(pBuf, pAdvSet->advA); + + /* Pack TargetA. */ + switch (pduHdr.pduType) + { + case LL_PDU_ADV_DIRECT_IND: + { + /* Always match peer address in PDU to initiator's address for directed advertising. */ + BB_BLE_PDU_FILT_SET_FLAG(&pBle->pduFilt, PEER_ADDR_MATCH_ENA); + BDA64_TO_BSTREAM(pBuf, pAdvSet->tgtA); + break; + } + case LL_PDU_ADV_IND: + case LL_PDU_ADV_NONCONN_IND: + case LL_PDU_ADV_SCAN_IND: + default: + break; + } + + /* Pack AdvData. */ + advDataLen = pAdvSet->advData.alt.legacy.len; + switch (pduHdr.pduType) + { + case LL_PDU_ADV_IND: + case LL_PDU_ADV_NONCONN_IND: + case LL_PDU_ADV_SCAN_IND: + if (pAdvSet->advData.alt.legacy.len > 0) + { + /* Legacy buffers always stored in cache (exclusive buffer). */ + memcpy(pBuf, pAdvSet->advData.alt.legacy.buf, WSF_MIN(pAdvSet->advData.alt.legacy.len, LL_ADVBU_MAX_LEN)); + } + break; + case LL_PDU_ADV_DIRECT_IND: + default: + /* Not allowed. */ + advDataLen = 0; + break; + } + + /* Pack header. */ + if ((lmgrCb.features & LL_FEAT_CH_SEL_2) && + ((pduHdr.pduType == LL_PDU_ADV_IND) || (pduHdr.pduType == LL_PDU_ADV_DIRECT_IND))) + { + pduHdr.chSel = LL_CH_SEL_2; + } + /* else use LL_CH_SEL_1 */ + pduHdr.len = pBuf - (pPduBuf + LL_ADV_HDR_LEN) + advDataLen; + lctrPackAdvbPduHdr(pPduBuf, &pduHdr); + + return LL_ADV_HDR_LEN + pduHdr.len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack legacy SCAN_RSP PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackLegacyScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf) +{ + uint8_t *pBuf = pPduBuf; + lctrAdvbPduHdr_t pduHdr = { 0 }; + + pduHdr.pduType = LL_PDU_SCAN_RSP; + + switch (pAdvSet->param.ownAddrType) + { + case LL_ADDR_RANDOM: + case LL_ADDR_RANDOM_IDENTITY: + pduHdr.txAddrRnd = LL_ADDR_RANDOM; + break; + case LL_ADDR_PUBLIC_IDENTITY: + if (BDA64_ADDR_IS_RPA(pAdvSet->advA)) + { + pduHdr.txAddrRnd = LL_ADDR_RANDOM; + } + else + { + pduHdr.txAddrRnd = LL_ADDR_PUBLIC; + } + break; + case LL_ADDR_PUBLIC: + default: + pduHdr.txAddrRnd = LL_ADDR_PUBLIC; + break; + } + pduHdr.len = LL_SCAN_PREFIX_LEN + pAdvSet->scanRspData.alt.legacy.len; + + pBuf += lctrPackAdvbPduHdr(pBuf, &pduHdr); + BDA64_TO_BSTREAM(pBuf, pAdvSet->advA); + if (pAdvSet->scanRspData.alt.legacy.len > 0) + { + /* Legacy buffers always stored in cache (exclusive buffer). */ + memcpy(pBuf, pAdvSet->scanRspData.alt.legacy.buf, WSF_MIN(pAdvSet->scanRspData.alt.legacy.len, LL_ADVBU_MAX_LEN)); + } + + return LL_ADV_HDR_LEN + pduHdr.len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an AUX_SYNC_IND PDU. + * + * \param pAdvSet Advertising set. + * \param pPduBuf Buffer to store packed PDU. + * \param pAdvData Advertising or Scan Response data. + * \param isPeriodic This header is part of periodic PDUs or not. + * + * \return PDU header buffer length. + */ +/*************************************************************************************************/ +uint8_t lctrPackSyncIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic) +{ + uint8_t manExtHdrFlags, optExtHdrFlags; + lctrAdvbPduHdr_t pduHdr = { 0 }; + pduHdr.pduType = LL_PDU_AUX_SYNC_IND; + + /*** Specification defined behavior ***/ + + manExtHdrFlags = 0; + optExtHdrFlags = LL_EXT_HDR_AUX_PTR_BIT | + ((pAdvSet->perParam.advEventProp & LL_EXT_HDR_TX_PWR_BIT) ? LL_EXT_HDR_TX_PWR_BIT : 0); + + return lctrPackExtAdvHeader(pAdvSet, manExtHdrFlags, optExtHdrFlags, + 0, &pduHdr, pAdvData, + pPduBuf, LCTR_PDU_AUX_SYNC_IND, isPeriodic); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..a391ec5176de77a5e60c562cfa591fd5e3811590 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.c @@ -0,0 +1,737 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave data channel packet implementation file. + */ +/*************************************************************************************************/ + +#include "ll_math.h" +#include "lctr_int_conn.h" +#include "util/bstream.h" +#include "hci_defs.h" +#include "wsf_math.h" +#include <string.h> +#include <stdint.h> + +/*************************************************************************************************/ +/*! + * \brief Check whether the channel map mask is valid. + * + * \param chanMask Channel map mask. + * + * \return TRUE if channel map is valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrIsChanMaskValid(uint64_t chanMask) +{ + /* Valid channels are between bit 0 and bit 36. */ + if (chanMask & (~LL_CHAN_DATA_ALL)) + { + return FALSE; + } + + /* The minimum number of used channels shall be 2. */ + if (LlMathGetNumBitsSet(chanMask) < LL_MIN_NUM_CHAN_DATA) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether the connection update indication parameters are valid. + * + * \param pParam Connection update parameter. + * + * \return TRUE if parameters are valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrIsConnUpdateParamValid(lctrConnUpdInd_t *pParam) +{ + /* In the range of 7.5ms to 4s. */ + if ((pParam->interval < LL_MIN_CONN_INTERVAL) || (pParam->interval > LL_MAX_CONN_INTERVAL)) + { + return FALSE; + } + + /* In the range of 1.25ms to the lesser of 10ms and (connInterval - 1.25ms). */ + if ((pParam->txWinSize < LL_MIN_TX_WIN_SIZE) || + (pParam->txWinSize > WSF_MIN(LL_MAX_TX_WIN_SIZE, (pParam->interval - 1)))) + { + return FALSE; + } + + /* In the range of 0ms to the connInterval. */ + if (pParam->txWinOffset > (pParam->interval)) + { + return FALSE; + } + + /* In the range of 100ms to 32000ms. And it shall be larger than (1 + connSlaveLatency) * connInterval * 2. */ + if ((pParam->timeout < LL_MIN_SUP_TIMEOUT) || (pParam->timeout > LL_MAX_SUP_TIMEOUT) || + ((pParam->timeout << 2) <= ((1 + pParam->latency) * pParam->interval))) + { + return FALSE; + } + + /* In the range of 0 to the ((connSupervisionTimeout / (connInterval*2)) - 1), checked above already. + * And it shall be less than 500. */ + if (pParam->latency > LL_MAX_CONN_LATENCY) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether the set minimum number of used channels parameters are valid. + * + * \param pParam Set minimum number of used channels parameter. + * + * \return TRUE if parameters are valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrIsSetMinUsedChanParamValid(lctrMinUsedChanInd_t *pParam) +{ + /* At least one bit shall be set. */ + if (pParam->phys == 0) + { + return FALSE; + } + + /* The minimum number of used channels shall be between 2 - 37. */ + if ((pParam->minUsedChan < LL_MIN_NUM_CHAN_DATA) || + (pParam->minUsedChan > LL_MAX_NUM_CHAN_DATA)) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an ACL header. + * + * \param pBuf Packed packet buffer. + * \param pHdr Unpacked packet header. + * + * \return Header length. + */ +/*************************************************************************************************/ +uint8_t lctrPackAclHdr(uint8_t *pBuf, const lctrAclHdr_t *pHdr) +{ + const uint8_t len = sizeof(uint32_t); + + uint16_t flags = 0; + + flags |= (pHdr->connHandle) << 0; + flags |= (pHdr->pktBound ) << 12; + UINT16_TO_BSTREAM(pBuf, flags); + + UINT16_TO_BSTREAM(pBuf, pHdr->len); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an data channel PDU header. + * + * \param pBuf Packed packet buffer. + * \param pHdr Unpacked PDU header. + * + * \return Header length. + */ +/*************************************************************************************************/ +uint8_t lctrPackDataPduHdr(uint8_t *pBuf, const lctrDataPduHdr_t *pHdr) +{ + const uint8_t len = LL_DATA_HDR_LEN; + + uint16_t hdr = 0; + + hdr |= (pHdr->llid ) << 0; + hdr |= (pHdr->nesn & 1) << 2; + hdr |= (pHdr->sn & 1) << 3; + hdr |= (pHdr->md & 1) << 4; + hdr |= (pHdr->len ) << 8; + UINT16_TO_BSTREAM(pBuf, hdr); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connection update request PDU. + * + * \param pBuf Packed packet buffer. + * \param pPdu Unpacked control data PDU. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrPackConnUpdInd(uint8_t *pBuf, const lctrConnUpdInd_t *pPdu) +{ + const uint8_t len = LL_CONN_UPD_IND_PDU_LEN; + + UINT8_TO_BSTREAM (pBuf, LL_PDU_CONN_UPDATE_IND); + UINT8_TO_BSTREAM (pBuf, pPdu->txWinSize); + UINT16_TO_BSTREAM(pBuf, pPdu->txWinOffset); + UINT16_TO_BSTREAM(pBuf, pPdu->interval); + UINT16_TO_BSTREAM(pBuf, pPdu->latency); + UINT16_TO_BSTREAM(pBuf, pPdu->timeout); + UINT16_TO_BSTREAM(pBuf, pPdu->instant); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack an ACL header. + * + * \param pHdr Unpacked packet header. + * \param pBuf Packed packet buffer. + * + * \return Header length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackAclHdr(lctrAclHdr_t *pHdr, const uint8_t *pBuf) +{ + const uint8_t len = HCI_ACL_HDR_LEN; + + uint16_t flags; + + BSTREAM_TO_UINT16(flags, pBuf); + pHdr->connHandle = (flags >> 0) & 0x0FFF; + pHdr->pktBound = (flags >> 12) & 0x0003; + + BSTREAM_TO_UINT16(pHdr->len, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a data channel PDU header. + * + * \param pHdr Unpacked header. + * \param pBuf Packed packet buffer. + * + * \return Header length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackDataPduHdr(lctrDataPduHdr_t *pHdr, const uint8_t *pBuf) +{ + const uint8_t len = LL_DATA_HDR_LEN; + + uint16_t hdr; + + BSTREAM_TO_UINT16(hdr, pBuf); + + pHdr->llid = (hdr >> 0) & LL_DATA_HDR_LLID_MSK; + pHdr->nesn = (hdr >> 2) & 0x0001; + pHdr->sn = (hdr >> 3) & 0x0001; + pHdr->md = (hdr >> 4) & 0x0001; + pHdr->len = (hdr >> 8) & LL_DATA_HDR_LEN_MSK; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a connection update request PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackConnUpdateIndPdu(lctrConnUpdInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_CONN_UPD_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8 (pPdu->txWinSize, pBuf); + BSTREAM_TO_UINT16(pPdu->txWinOffset, pBuf); + BSTREAM_TO_UINT16(pPdu->interval, pBuf); + BSTREAM_TO_UINT16(pPdu->latency, pBuf); + BSTREAM_TO_UINT16(pPdu->timeout, pBuf); + BSTREAM_TO_UINT16(pPdu->instant, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a connection update request PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackChanMapIndPdu(lctrChanMapInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_CHAN_MAP_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT40(pPdu->chanMask, pBuf); + BSTREAM_TO_UINT16(pPdu->instant, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a terminate indication PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackTerminateIndPdu(lctrTermInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_TERMINATE_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(pPdu->errorCode, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a unknown response PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackUnknownRspPdu(lctrUnknownRsp_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_UNKNOWN_RSP_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(pPdu->unknownType, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a feature request or response PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackFeaturePdu(lctrFeat_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_FEATURE_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT64(pPdu->featSet, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a reject indication PDU. + * + * \param pReason Reason code. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackRejectIndPdu(uint8_t *pReason, const uint8_t *pBuf) +{ + const uint8_t len = LL_REJECT_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(*pReason, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a version indication PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackVersionIndPdu(lctrVerInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_VERSION_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(pPdu->versNr, pBuf); + BSTREAM_TO_UINT16(pPdu->compId, pBuf); + BSTREAM_TO_UINT16(pPdu->subVersNr, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack an extended reject indication PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackRejectExtIndPdu(lctrRejInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_REJECT_EXT_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(pPdu->opcode, pBuf); + BSTREAM_TO_UINT8(pPdu->reason, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a data length request or response PDU. + * + * \param pPdu Unpacked data length PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackDataLengthPdu(lctrDataLen_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_DATA_LEN_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT16(pPdu->maxRxLen, pBuf); + BSTREAM_TO_UINT16(pPdu->maxRxTime, pBuf); + BSTREAM_TO_UINT16(pPdu->maxTxLen, pBuf); + BSTREAM_TO_UINT16(pPdu->maxTxTime, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a connection parameter request or response PDU. + * + * \param pConnParam Connection parameter request/response values. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackConnParamPdu(lctrConnParam_t *pConnParam, const uint8_t *pBuf) +{ + const uint8_t len = LL_CONN_PARAM_PDU_LEN; + + unsigned int i; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT16(pConnParam->connIntervalMin, pBuf); + BSTREAM_TO_UINT16(pConnParam->connIntervalMax, pBuf); + BSTREAM_TO_UINT16(pConnParam->connLatency, pBuf); + BSTREAM_TO_UINT16(pConnParam->supTimeout, pBuf); + + BSTREAM_TO_UINT8 (pConnParam->prefPeriod, pBuf); + BSTREAM_TO_UINT16(pConnParam->refConnEvtCnt, pBuf); + + for (i = 0; i < LCTR_OFFSET_COUNT; i++) + { + BSTREAM_TO_UINT16(pConnParam->offset[i], pBuf); + } + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a PHY request or response PDU. + * + * \param pPdu Unpacked PHY PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackPhyPdu(lctrPhy_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_PHY_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8(pPdu->txPhys, pBuf); + BSTREAM_TO_UINT8(pPdu->rxPhys, pBuf); + + /* Mask out the RFU bits for PHYs. */ + pPdu->txPhys &= LL_ALL_PHYS_MSK; + pPdu->rxPhys &= LL_ALL_PHYS_MSK; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a PHY update indication PDU. + * + * \param pPdu Unpacked PHY update indication PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackPhyUpdateIndPdu(lctrPhyUpdInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_PHY_UPD_IND_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8 (pPdu->masterToSlavePhy, pBuf); + BSTREAM_TO_UINT8 (pPdu->slaveToMasterPhy, pBuf); + BSTREAM_TO_UINT16(pPdu->instant, pBuf); + + /* Mask out the RFU bits for PHYs. */ + pPdu->masterToSlavePhy &= LL_ALL_PHYS_MSK; + pPdu->slaveToMasterPhy &= LL_ALL_PHYS_MSK; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack a set minimum number of used channels indication PDU. + * + * \param pPdu Unpack a set minimum number of used channels indication PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +uint8_t lctrUnpackMinUsedChanIndPdu(lctrMinUsedChanInd_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_MIN_USED_CHAN_PDU_LEN; + + pBuf += 1; /* skip opcode */ + BSTREAM_TO_UINT8 (pPdu->phys, pBuf); + BSTREAM_TO_UINT8 (pPdu->minUsedChan, pBuf); + + /* Mask out the RFU bits for PHYs. */ + pPdu->phys &= LL_ALL_PHYS_MSK; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Decode an LE-C channel buffer. + * + * \param pPdu Destination unpacked PDU. + * \param pBuf Source packed packet buffer. + * \param role Role. + * + * \return LL error code or success. + */ +/*************************************************************************************************/ +uint8_t lctrDecodeCtrlPdu(lctrDataPdu_t *pPdu, const uint8_t *pBuf, uint8_t role) +{ + uint8_t result = LL_SUCCESS; + + pBuf += lctrUnpackDataPduHdr(&pPdu->hdr, pBuf); + pPdu->opcode = *pBuf; + + switch (pPdu->opcode) + { + case LL_PDU_CONN_UPDATE_IND: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lctrUnpackConnUpdateIndPdu(&pPdu->pld.connUpdInd, pBuf) != pPdu->hdr.len) || + (lctrIsConnUpdateParamValid(&pPdu->pld.connUpdInd) == FALSE)) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_CONN_PARAM_RSP: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + /* no break */ + case LL_PDU_CONN_PARAM_REQ: + if ((lmgrCb.features & LL_FEAT_CONN_PARAM_REQ_PROC) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackConnParamPdu(&pPdu->pld.connParamReqRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_CHANNEL_MAP_IND: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lctrUnpackChanMapIndPdu(&pPdu->pld.chanMapInd, pBuf) != pPdu->hdr.len) || + (lctrIsChanMaskValid(pPdu->pld.chanMapInd.chanMask) == FALSE)) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_LENGTH_REQ: + case LL_PDU_LENGTH_RSP: + if (lctrUnpackDataLengthPdu(&pPdu->pld.lenRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_TERMINATE_IND: + if (lctrUnpackTerminateIndPdu(&pPdu->pld.termInd, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_UNKNOWN_RSP: + if (lctrUnpackUnknownRspPdu(&pPdu->pld.unknownRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_FEATURE_REQ: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + /* no break */ + case LL_PDU_FEATURE_RSP: + if (lctrUnpackFeaturePdu(&pPdu->pld.featReqRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_SLV_FEATURE_REQ: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lmgrCb.features & LL_FEAT_SLV_INIT_FEAT_EXCH) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackFeaturePdu(&pPdu->pld.featReqRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_VERSION_IND: + if (lctrUnpackVersionIndPdu(&pPdu->pld.verInd, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_REJECT_IND: + pPdu->pld.rejInd.opcode = LL_PDU_UNSPECIFIED; + if (lctrUnpackRejectIndPdu(&pPdu->pld.rejInd.reason, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_REJECT_EXT_IND: + if ((lmgrCb.features & LL_FEAT_EXT_REJECT_IND) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackRejectExtIndPdu(&pPdu->pld.rejInd, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_PHY_RSP: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + /* no break */ + case LL_PDU_PHY_REQ: + if ((lmgrCb.features & (LL_FEAT_LE_2M_PHY | LL_FEAT_LE_CODED_PHY)) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackPhyPdu(&pPdu->pld.phyReq, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_PHY_UPDATE_IND: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lmgrCb.features & (LL_FEAT_LE_2M_PHY | LL_FEAT_LE_CODED_PHY)) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackPhyUpdateIndPdu(&pPdu->pld.phyUpdInd, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_MIN_USED_CHAN_IND: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lmgrCb.features & LL_FEAT_MIN_NUM_USED_CHAN) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ((lctrUnpackMinUsedChanIndPdu(&pPdu->pld.minUsedChanInd, pBuf) != pPdu->hdr.len) || + (lctrIsSetMinUsedChanParamValid(&pPdu->pld.minUsedChanInd) == FALSE)) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + + default: + result = LL_ERROR_CODE_UNKNOWN_LMP_PDU; + break; + } + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.h new file mode 100644 index 0000000000000000000000000000000000000000..c71595cc18e623b873fa6e146230c5e955cf593f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_conn.h @@ -0,0 +1,244 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller data channel packet interface file. + */ +/*************************************************************************************************/ + +#ifndef LCTR_PDU_CONN_SLAVE_H +#define LCTR_PDU_CONN_SLAVE_H + +#include "wsf_types.h" +#include "bb_ble_api.h" +#include "ll_defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +#define LCTR_OFFSET_COUNT 6 /*!< Number of offsets in a connection parameter request. */ + +/*! \brief Packet boundary flags. */ +enum +{ + LCTR_PB_START_NON_AUTO_FLUSH = 0, /*!< Start of a non-automatically flushable L2CAP PDU. */ + LCTR_PB_CONT_FRAG = 1, /*!< Continuing fragment of Higher Layer Message. */ + LCTR_PB_START_AUTO_FLUSH = 2, /*!< Start of an automatically flushable L2CAP PDU. */ + /* N.B. next two enumerations intentionally use identical values. */ + LCTR_PB_COMPLETE_AUTO_FLUSH = 3, /*!< A complete L2CAP PDU automatically flushable (not allowed for LE-U). */ + LCTR_PB_VS_DATA = 3 /*!< Vendor specific data. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief ACL header. */ +typedef struct +{ + uint16_t connHandle; /*!< Connection handle. */ + uint8_t pktBound; /*!< Packet boundary flag. */ + uint16_t len; /*!< Data length. */ +} lctrAclHdr_t; + +/*! \brief Data channel PDU header. */ +typedef struct +{ + uint8_t llid; /*!< PDU type. */ + uint8_t nesn; /*!< Next Expected Sequence Number. */ + uint8_t sn; /*!< Sequence Number. */ + uint8_t md; /*!< More Data. */ + uint8_t len; /*!< Payload length. */ +} lctrDataPduHdr_t; + +/*! \brief Connection update indication PDU. */ +typedef struct +{ + uint8_t txWinSize; /*!< transmitWindowSize value. */ + uint16_t txWinOffset; /*!< transmitWindowOffset value. */ + uint16_t interval; /*!< connInterval value. */ + uint16_t latency; /*!< connSlaveLatency value. */ + uint16_t timeout; /*!< connSupervisionTimeout value. */ + uint16_t instant; /*!< connInstant value. */ +} lctrConnUpdInd_t; + +/*! \brief Connection update indication PDU. */ +typedef struct +{ + uint64_t chanMask; /*!< Channel mask. */ + uint16_t instant; /*!< connInstant value. */ +} lctrChanMapInd_t; + +/*! \brief Terminate indication control PDU. */ +typedef struct +{ + uint8_t errorCode; /*!< Error code. */ +} lctrTermInd_t; + +/*! \brief Encryption request control PDU. */ +typedef struct +{ + uint8_t rand[LL_RAND_LEN]; /*!< Random number. */ + uint16_t ediv; /*!< Encrypted diversifier. */ + uint8_t skd_m[LL_SKD_LEN/2];/*!< Master's session key diversifier. */ + uint8_t iv_m[LL_IV_LEN/2]; /*!< Master's initialization vector. */ +} lctrEncReq_t; + +/*! \brief Encryption response control PDU. */ +typedef struct +{ + uint8_t skd_s[LL_SKD_LEN/2];/*!< Slave's session key diversifier. */ + uint8_t iv_s[LL_IV_LEN/2]; /*!< Slave's initialization vector. */ +} lctrEncRsp_t; + +/*! \brief Unknown response control PDU. */ +typedef struct +{ + uint8_t unknownType; /*!< Unknown type. */ +} lctrUnknownRsp_t; + +/*! \brief Feature request or response control PDU. */ +typedef struct +{ + uint64_t featSet; /*!< Feature set. */ +} lctrFeat_t; + +/*! \brief Connection parameter request/response values. */ +typedef struct +{ + uint16_t connIntervalMin; /*!< Minimum connection interval. */ + uint16_t connIntervalMax; /*!< Maximum connection interval. */ + uint16_t connLatency; /*!< Connection latency. */ + uint16_t supTimeout; /*!< Supervision timeout. */ + uint8_t prefPeriod; /*!< Preferred periodicity. */ + uint16_t refConnEvtCnt; /*!< Reference connection event count. */ + uint16_t offset[LCTR_OFFSET_COUNT]; /*!< Anchor point offset from \a refConnEvtCnt, first preference. */ +} lctrConnParam_t; + +/*! \brief Version indication control PDU. */ +typedef struct +{ + uint8_t versNr; /*!< Bluetooth controller specification version. */ + uint16_t compId; /*!< Company identifier. */ + uint16_t subVersNr; /*!< Sub-Version number. */ +} lctrVerInd_t; + +/*! \brief Reject indication control PDU. */ +typedef struct +{ + uint8_t opcode; /*!< Reject opcode. */ + uint8_t reason; /*!< Reject reason code. */ +} lctrRejInd_t; + +/*! \brief Data length request or response PDU. */ +typedef struct +{ + uint16_t maxRxLen; /*!< Maximum receive length. */ + uint16_t maxRxTime; /*!< Maximum receive time. */ + uint16_t maxTxLen; /*!< Maximum transmit length. */ + uint16_t maxTxTime; /*!< Maximum transmit time. */ +} lctrDataLen_t; + +/*! \brief PHY request or response PDU. */ +typedef struct +{ + uint8_t txPhys; /*!< Transmitter PHYs. */ + uint8_t rxPhys; /*!< Receiver PHYs. */ +} lctrPhy_t; + +/*! \brief PHY update indication PDU. */ +typedef struct +{ + uint8_t masterToSlavePhy; /*!< Master-to-slave PHY. */ + uint8_t slaveToMasterPhy; /*!< Slave-to-master PHY. */ + uint16_t instant; /*!< Instant. */ +} lctrPhyUpdInd_t; + +/*! \brief Minimum number of used channels indication PDU. */ +typedef struct +{ + uint8_t phys; /*!< Bitmask for the affected PHYs. */ + uint8_t minUsedChan; /*!< Minimum number of used channels. */ +} lctrMinUsedChanInd_t; + +/*! \brief Data channel control PDU. */ +typedef struct +{ + lctrDataPduHdr_t hdr; /*!< Unpacked PDU header. */ + uint8_t opcode; /*!< Control PDU opcode. */ + + union + { + lctrConnUpdInd_t connUpdInd; /*!< Connection update indication. */ + lctrChanMapInd_t chanMapInd; /*!< Channel map request. */ + lctrTermInd_t termInd; /*!< Terminate indication. */ + lctrEncReq_t encReq; /*!< Encryption request. */ + lctrEncRsp_t encRsp; /*!< Encryption response. */ + lctrUnknownRsp_t unknownRsp; /*!< Unknown response. */ + lctrFeat_t featReqRsp; /*!< Feature request or response or slave feature request. */ + lctrVerInd_t verInd; /*!< Version indication. */ + lctrConnParam_t connParamReqRsp; /*!< Connection parameter request or response. */ + lctrRejInd_t rejInd; /*!< Reject indication. */ + lctrDataLen_t lenReq; /*!< Data length request. */ + lctrDataLen_t lenRsp; /*!< Data length response. */ + lctrPhy_t phyReq; /*!< PHY request. */ + lctrPhy_t phyRsp; /*!< PHY response. */ + lctrPhyUpdInd_t phyUpdInd; /*!< PHY update indication. */ + lctrMinUsedChanInd_t minUsedChanInd;/*!< Minimum number of used channels indication. */ + } pld; /*!< Unpacked PDU payload. */ +} lctrDataPdu_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Pack */ +uint8_t lctrPackAclHdr(uint8_t *pBuf, const lctrAclHdr_t *pHdr); +uint8_t lctrPackDataPduHdr(uint8_t *pBuf, const lctrDataPduHdr_t *pHdr); +uint8_t lctrPackConnUpdInd(uint8_t *pBuf, const lctrConnUpdInd_t *pPdu); + +/* Unpack */ +uint8_t lctrUnpackAclHdr(lctrAclHdr_t *pHdr, const uint8_t *pBuf); +uint8_t lctrUnpackDataPduHdr(lctrDataPduHdr_t *pHdr, const uint8_t *pBuf); +uint8_t lctrUnpackConnUpdateIndPdu(lctrConnUpdInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackChanMapIndPdu(lctrChanMapInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackTerminateIndPdu(lctrTermInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackUnknownRspPdu(lctrUnknownRsp_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackFeaturePdu(lctrFeat_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackRejectIndPdu(uint8_t *pReason, const uint8_t *pBuf); +uint8_t lctrUnpackVersionIndPdu(lctrVerInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackConnParamPdu(lctrConnParam_t *pConnParam, const uint8_t *pBuf); +uint8_t lctrUnpackRejectExtIndPdu(lctrRejInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackDataLengthPdu(lctrDataLen_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackPhyPdu(lctrPhy_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackPhyUpdateIndPdu(lctrPhyUpdInd_t *pPdu, const uint8_t *pBuf); +uint8_t lctrUnpackMinUsedChanIndPdu(lctrMinUsedChanInd_t *pPdu, const uint8_t *pBuf); + +/* Decode */ +uint8_t lctrDecodeCtrlPdu(lctrDataPdu_t *pPdu, const uint8_t *pBuf, uint8_t role); +uint8_t lctrDecodeEncPdu(lctrDataPdu_t *pPdu, const uint8_t *pBuf, uint8_t role); + +#ifdef __cplusplus +}; +#endif + +#endif /* LCTR_PDU_CONN_SLAVE_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_enc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_enc.c new file mode 100644 index 0000000000000000000000000000000000000000..cf62df32edbb6147ecdb07d1a7c2bc0263e52688 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_pdu_enc.c @@ -0,0 +1,166 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master encryption packet implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Unpack an encrypted request PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +static uint8_t lctrUnpackEncReqPdu(lctrEncReq_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_ENC_REQ_LEN; + + pBuf += 1; /* skip opcode */ + + memcpy(pPdu->rand, pBuf, sizeof(pPdu->rand)); + pBuf += sizeof(pPdu->rand); + + BSTREAM_TO_UINT16(pPdu->ediv, pBuf); + + memcpy(pPdu->skd_m, pBuf, sizeof(pPdu->skd_m)); + pBuf += sizeof(pPdu->skd_m); + + memcpy(pPdu->iv_m, pBuf, sizeof(pPdu->iv_m)); + /* pBuf += sizeof(pPdu->iv_m); */ + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Unpack an encrypted response PDU. + * + * \param pPdu Unpacked control data PDU. + * \param pBuf Packed packet buffer. + * + * \return PDU length. + */ +/*************************************************************************************************/ +static uint8_t lctrUnpackEncRspPdu(lctrEncRsp_t *pPdu, const uint8_t *pBuf) +{ + const uint8_t len = LL_ENC_RSP_LEN; + + pBuf += 1; /* skip opcode */ + memcpy(pPdu, pBuf, sizeof(*pPdu)); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Decode a LE-C channel buffer. + * + * \param pPdu Destination unpacked PDU. + * \param pBuf Source packed packet buffer. + * \param role Role. + * + * \return LL error code or success. + */ +/*************************************************************************************************/ +uint8_t lctrDecodeEncPdu(lctrDataPdu_t *pPdu, const uint8_t *pBuf, uint8_t role) +{ + uint8_t result = LL_SUCCESS; + + pBuf += lctrUnpackDataPduHdr(&pPdu->hdr, pBuf); + pPdu->opcode = *pBuf; + + switch (pPdu->opcode) + { + case LL_PDU_ENC_REQ: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackEncReqPdu(&pPdu->pld.encReq, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_ENC_RSP: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if (lctrUnpackEncRspPdu(&pPdu->pld.encRsp, pBuf) != pPdu->hdr.len) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_START_ENC_REQ: + if (role == LL_ROLE_SLAVE) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ( pPdu->hdr.len != LL_START_ENC_LEN) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_PAUSE_ENC_REQ: + if (role == LL_ROLE_MASTER) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ( pPdu->hdr.len != LL_PAUSE_ENC_LEN) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_START_ENC_RSP: + if ( pPdu->hdr.len != LL_START_ENC_LEN) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_PAUSE_ENC_RSP: + if ( pPdu->hdr.len != LL_PAUSE_ENC_LEN) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + case LL_PDU_PING_REQ: + case LL_PDU_PING_RSP: + if ((lmgrCb.features & LL_FEAT_LE_PING) == 0) + { + return LL_ERROR_CODE_UNKNOWN_LMP_PDU; + } + if ( pPdu->hdr.len != LL_PING_PDU_LEN) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + break; + default: + result = LL_ERROR_CODE_UNKNOWN_LMP_PDU; + break; + } + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..35075ebee83cfea0611b226a5d4ebe2eecfc856c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master.c @@ -0,0 +1,125 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scan state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(void); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Scan state machine action table. + */ +static const lctrActFn_t lctrScanActionTbl[LCTR_SCAN_STATE_TOTAL][LCTR_SCAN_MSG_TOTAL] = +{ + { /* LCTR_SCAN_STATE_DISABLED */ + NULL, /* LCTR_SCAN_MSG_RESET */ + lctrScanActDiscover, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + lctrScanActScanCnf, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + NULL, /* LCTR_SCAN_MSG_TERMINATE */ + lctrScanActUpdateScanParam /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_DISCOVER */ + lctrScanActShutdown, /* LCTR_SCAN_MSG_RESET */ + lctrScanActUpdateScanFilt, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + lctrScanActShutdown, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + lctrScanActSelfTerm, /* LCTR_SCAN_MSG_TERMINATE */ + NULL /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_SHUTDOWN */ + NULL, /* LCTR_SCAN_MSG_RESET */ + lctrScanActDisallowScan, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + lctrScanActDisallowScan, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + lctrScanActScanTerm, /* LCTR_SCAN_MSG_TERMINATE */ + lctrScanActUpdateScanParam /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_RESET */ + NULL, /* LCTR_SCAN_MSG_RESET */ + lctrScanActDisallowScan, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + lctrScanActDisallowScan, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + lctrScanActResetTerm, /* LCTR_SCAN_MSG_TERMINATE */ + lctrScanActUpdateScanParam /* LCTR_SCAN_MSG_PARAM_UPD */ + } +}; + +/*! \brief Scan state machine next state table. */ +static const uint8_t lctrScanNextStateTbl[LCTR_SCAN_STATE_TOTAL][LCTR_SCAN_MSG_TOTAL] = +{ + { /* LCTR_SCAN_STATE_DISABLED */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_RESET */ + LCTR_SCAN_STATE_DISCOVER, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_TERMINATE */ + LCTR_SCAN_STATE_DISABLED /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_DISCOVER */ + LCTR_SCAN_STATE_RESET, /* LCTR_SCAN_MSG_RESET */ + LCTR_SCAN_STATE_DISCOVER, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_SCAN_STATE_SHUTDOWN, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_TERMINATE */ + LCTR_SCAN_STATE_DISCOVER /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_SHUTDOWN */ + LCTR_SCAN_STATE_RESET, /* LCTR_SCAN_MSG_RESET */ + LCTR_SCAN_STATE_SHUTDOWN, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_SCAN_STATE_SHUTDOWN, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_TERMINATE */ + LCTR_SCAN_STATE_SHUTDOWN /* LCTR_SCAN_MSG_PARAM_UPD */ + }, + { /* LCTR_SCAN_STATE_RESET */ + LCTR_SCAN_STATE_RESET, /* LCTR_SCAN_MSG_RESET */ + LCTR_SCAN_STATE_RESET, /* LCTR_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_SCAN_STATE_RESET, /* LCTR_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_SCAN_STATE_DISABLED, /* LCTR_SCAN_MSG_TERMINATE */ + LCTR_SCAN_STATE_RESET /* LCTR_SCAN_MSG_PARAM_UPD */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute master scan state machine. + * + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstScanExecuteSm(uint8_t event) +{ + LL_TRACE_INFO2("lctrMstScanExecuteSm: state=%u, event=%u", lctrMstScan.state, event); + + if (lctrScanActionTbl[lctrMstScan.state][event]) + { + lctrScanActionTbl[lctrMstScan.state][event](); + } + + lctrMstScan.state = lctrScanNextStateTbl[lctrMstScan.state][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..c54854780153d6df00be283e305abf75d102f4a4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c @@ -0,0 +1,301 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master scan state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_master_ae.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrExtScanCtx_t *pExtScanCtx); + +/*! \brief Create sync action function call signature. */ +typedef void (*lctrCreateSyncActFn_t)(void); + +/*! \brief Create sync action function call signature. */ +typedef void (*lctrPerScanActFn_t)(lctrPerScanCtx_t *pPerScanCtx); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. + */ +static const lctrActFn_t lctrExtScanActionTbl[LCTR_EXT_SCAN_STATE_TOTAL][LCTR_EXT_SCAN_MSG_TOTAL] = +{ + { /* LCTR_EXT_SCAN_STATE_DISABLED */ + NULL, /* LCTR_EXT_SCAN_MSG_RESET */ + lctrExtScanActDiscover, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + lctrExtScanActScanCnf, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + NULL /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_DISCOVER */ + lctrExtScanActShutdown, /* LCTR_EXT_SCAN_MSG_RESET */ + lctrExtScanActUpdateDiscover, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + lctrExtScanActShutdown, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + NULL /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_SHUTDOWN */ + NULL, /* LCTR_EXT_SCAN_MSG_RESET */ + lctrExtScanActDisallowScan, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + lctrExtScanActDisallowScan, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + lctrExtScanActScanTerm /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_RESET */ + NULL, /* LCTR_EXT_SCAN_MSG_RESET */ + lctrExtScanActDisallowScan, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + lctrExtScanActDisallowScan, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + lctrExtScanActScanTerm /* LCTR_EXT_SCAN_MSG_TERMINATE */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrExtScanNextStateTbl[LCTR_EXT_SCAN_STATE_TOTAL][LCTR_EXT_SCAN_MSG_TOTAL] = +{ + { /* LCTR_EXT_SCAN_STATE_DISABLED */ + LCTR_EXT_SCAN_STATE_DISABLED, /* LCTR_EXT_SCAN_MSG_RESET */ + LCTR_EXT_SCAN_STATE_DISCOVER, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_EXT_SCAN_STATE_DISABLED, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_EXT_SCAN_STATE_DISABLED /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_DISCOVER */ + LCTR_EXT_SCAN_STATE_RESET, /* LCTR_EXT_SCAN_MSG_RESET */ + LCTR_EXT_SCAN_STATE_DISCOVER, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_EXT_SCAN_STATE_SHUTDOWN, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_EXT_SCAN_STATE_DISABLED /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_SHUTDOWN */ + LCTR_EXT_SCAN_STATE_RESET, /* LCTR_EXT_SCAN_MSG_RESET */ + LCTR_EXT_SCAN_STATE_SHUTDOWN, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_EXT_SCAN_STATE_SHUTDOWN, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_EXT_SCAN_STATE_DISABLED /* LCTR_EXT_SCAN_MSG_TERMINATE */ + }, + { /* LCTR_EXT_SCAN_STATE_RESET */ + LCTR_EXT_SCAN_STATE_RESET, /* LCTR_EXT_SCAN_MSG_RESET */ + LCTR_EXT_SCAN_STATE_RESET, /* LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE */ + LCTR_EXT_SCAN_STATE_RESET, /* LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE */ + LCTR_EXT_SCAN_STATE_DISABLED /* LCTR_EXT_SCAN_MSG_TERMINATE */ + } +}; + +/*! \brief Create sync state machine action table. */ +static const lctrCreateSyncActFn_t lctrCreateSyncActionTbl[LCTR_CREATE_SYNC_STATE_TOTAL][LCTR_CREATE_SYNC_MSG_TOTAL] = +{ + { /* LCTR_CREATE_SYNC_STATE_DISABLED */ + NULL, /* LCTR_CREATE_SYNC_MSG_RESET */ + lctrCreateSyncActCreate, /* LCTR_CREATE_SYNC_MSG_CREATE */ + NULL, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + NULL, /* LCTR_CREATE_SYNC_MSG_DONE */ + NULL /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + { /* LCTR_CREATE_SYNC_STATE_DISCOVER */ + lctrCreateSyncActCancel, /* LCTR_CREATE_SYNC_MSG_RESET */ + NULL, /* LCTR_CREATE_SYNC_MSG_CREATE */ /* Handled by API. */ + lctrCreateSyncActCancel, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + lctrCreateSyncActDone, /* LCTR_CREATE_SYNC_MSG_DONE */ + NULL /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + { /* LCTR_CREATE_SYNC_STATE_SHUTDOWN */ + NULL, /* LCTR_CREATE_SYNC_MSG_RESET */ + NULL, /* LCTR_CREATE_SYNC_MSG_CREATE */ /* Handled by API. */ + NULL, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + NULL, /* LCTR_CREATE_SYNC_MSG_DONE */ + lctrCreateSyncActTerminate /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + { /* LCTR_CREATE_SYNC_STATE_RESET */ + NULL, /* LCTR_CREATE_SYNC_MSG_RESET */ + NULL, /* LCTR_CREATE_SYNC_MSG_CREATE */ /* Handled by API. */ + NULL, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + NULL, /* LCTR_CREATE_SYNC_MSG_DONE */ + lctrCreateSyncActTerminate /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + } +}; + +/*! \brief Create sync state machine next state table. */ +static const uint8_t lctrCreateSyncNextStateTbl[LCTR_CREATE_SYNC_STATE_TOTAL][LCTR_CREATE_SYNC_MSG_TOTAL] = +{ + { /* LCTR_CREATE_SYNC_STATE_DISABLED */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_RESET */ + LCTR_CREATE_SYNC_STATE_DISCOVER, /* LCTR_CREATE_SYNC_MSG_CREATE */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_DONE */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + { /* LCTR_CREATE_SYNC_STATE_DISCOVER */ + LCTR_CREATE_SYNC_STATE_RESET, /* LCTR_CREATE_SYNC_MSG_RESET */ + LCTR_CREATE_SYNC_STATE_DISCOVER, /* LCTR_CREATE_SYNC_MSG_CREATE */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_DONE */ + LCTR_CREATE_SYNC_STATE_DISCOVER /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + { /* LCTR_CREATE_SYNC_STATE_SHUTDOWN */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /* LCTR_CREATE_SYNC_MSG_RESET */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /* LCTR_CREATE_SYNC_MSG_CREATE */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + LCTR_CREATE_SYNC_STATE_SHUTDOWN, /* LCTR_CREATE_SYNC_MSG_DONE */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + }, + + { /* LCTR_CREATE_SYNC_STATE_RESET */ + LCTR_CREATE_SYNC_STATE_RESET, /* LCTR_CREATE_SYNC_MSG_RESET */ + LCTR_CREATE_SYNC_STATE_RESET, /* LCTR_CREATE_SYNC_MSG_CREATE */ + LCTR_CREATE_SYNC_STATE_RESET, /* LCTR_CREATE_SYNC_MSG_CANCEL */ + LCTR_CREATE_SYNC_STATE_DISABLED, /* LCTR_CREATE_SYNC_MSG_DONE */ + LCTR_CREATE_SYNC_STATE_DISABLED /* LCTR_CREATE_SYNC_MSG_TERMINATE */ + } +}; + +/*! \brief Periodic advertising state machine action table. */ +static const lctrPerScanActFn_t lctrPerScanActionTbl[LCTR_PER_SCAN_STATE_TOTAL][LCTR_PER_SCAN_MSG_TOTAL] = +{ + { /* LCTR_PER_SCAN_STATE_DISABLE */ + NULL, /* LCTR_PER_SCAN_MSG_RESET */ + lctrPerScanActSyncEstd, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + NULL, /* LCTR_PER_SCAN_MSG_TERMINATE */ + NULL, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + NULL /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + { /* LCTR_PER_SCAN_STATE_SYNC_ESTD */ + lctrPerScanActSyncTerminate, /* LCTR_PER_SCAN_MSG_RESET */ + NULL, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + lctrPerScanActSyncTerminate, /* LCTR_PER_SCAN_MSG_TERMINATE */ + NULL, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + lctrPerScanActSyncTimeout /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + { /* LCTR_PER_SCAN_STATE_SYNC_TERMINATE */ + NULL, /* LCTR_PER_SCAN_MSG_RESET */ + NULL, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + NULL, /* LCTR_PER_SCAN_MSG_TERMINATE */ + lctrPerScanActSyncTerminateDone,/* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + NULL /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + { /* LCTR_PER_SCAN_STATE_RESET */ + NULL, /* LCTR_PER_SCAN_MSG_RESET */ + NULL, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + NULL, /* LCTR_PER_SCAN_MSG_TERMINATE */ + lctrPerScanActSyncTerminateDone,/* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + NULL /* LCTR_PER_SCAN_SUP_TIMEOUT */ + } +}; + +/*! \brief Periodic advertising state machine next state table. */ +static const uint8_t lctrPerScanNextStateTbl[LCTR_PER_SCAN_STATE_TOTAL][LCTR_PER_SCAN_MSG_TOTAL] = +{ + { /* LCTR_PER_SCAN_STATE_DISABLE */ + LCTR_PER_SCAN_STATE_DISABLE, /* LCTR_PER_SCAN_MSG_RESET */ + LCTR_PER_SCAN_STATE_SYNC_ESTD, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + LCTR_PER_SCAN_STATE_DISABLE, /* LCTR_PER_SCAN_MSG_TERMINATE */ + LCTR_PER_SCAN_STATE_DISABLE, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + LCTR_PER_SCAN_STATE_DISABLE /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + { /* LCTR_PER_SCAN_STATE_SYNC_ESTD */ + LCTR_PER_SCAN_STATE_RESET, /* LCTR_PER_SCAN_MSG_RESET */ + LCTR_PER_SCAN_STATE_SYNC_ESTD, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE, /* LCTR_PER_SCAN_MSG_TERMINATE */ + LCTR_PER_SCAN_STATE_SYNC_ESTD, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + { /* LCTR_PER_SCAN_STATE_SYNC_TERMINATE */ + LCTR_PER_SCAN_STATE_RESET, /* LCTR_PER_SCAN_MSG_RESET */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE, /* LCTR_PER_SCAN_MSG_TERMINATE */ + LCTR_PER_SCAN_STATE_DISABLE, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + LCTR_PER_SCAN_STATE_SYNC_TERMINATE /* LCTR_PER_SCAN_SUP_TIMEOUT */ + }, + + { /* LCTR_PER_SCAN_STATE_RESET */ + LCTR_PER_SCAN_STATE_RESET, /* LCTR_PER_SCAN_MSG_RESET */ + LCTR_PER_SCAN_STATE_RESET, /* LCTR_PER_SCAN_MSG_SYNC_ESTD */ + LCTR_PER_SCAN_STATE_RESET, /* LCTR_PER_SCAN_MSG_TERMINATE */ + LCTR_PER_SCAN_STATE_DISABLE, /* LCTR_PER_SCAN_MSG_TERMINATE_DONE */ + LCTR_PER_SCAN_STATE_RESET /* LCTR_PER_SCAN_SUP_TIMEOUT */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute master scan state machine. + * + * \param pExtScanCtx Extended scan context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtScanExecuteSm(lctrExtScanCtx_t *pExtScanCtx, uint8_t event) +{ + LL_TRACE_INFO3("lctrMstExtScanExecuteSm: phy=%u, state=%u, event=%u", LCTR_GET_EXT_SCAN_HANDLE(pExtScanCtx), pExtScanCtx->state, event); + + if (lctrExtScanActionTbl[pExtScanCtx->state][event]) + { + lctrExtScanActionTbl[pExtScanCtx->state][event](pExtScanCtx); + } + + pExtScanCtx->state = lctrExtScanNextStateTbl[pExtScanCtx->state][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Execute master create sync state machine. + * + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstCreateSyncExecuteSm(uint8_t event) +{ + LL_TRACE_INFO2("lctrMstCreateSyncExecuteSm: state=%u, event=%u", lctrPerCreateSync.state, event); + + if (lctrCreateSyncActionTbl[lctrPerCreateSync.state][event]) + { + lctrCreateSyncActionTbl[lctrPerCreateSync.state][event](); + } + + lctrPerCreateSync.state = lctrCreateSyncNextStateTbl[lctrPerCreateSync.state][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Execute master periodic scanning state machine. + * + * \param pPerScanCtx Periodic scanning context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstPerScanExecuteSm(lctrPerScanCtx_t *pPerScanCtx, uint8_t event) +{ + LL_TRACE_INFO2("lctrMstPerScanExecuteSm: state=%u, event=%u", pPerScanCtx->state, event); + + if (lctrPerScanActionTbl[pPerScanCtx->state][event]) + { + lctrPerScanActionTbl[pPerScanCtx->state][event](pPerScanCtx); + } + + pPerScanCtx->state = lctrPerScanNextStateTbl[pPerScanCtx->state][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..ac62b23c711c62c1b4f4c8f15c19040774e6c388 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave.c @@ -0,0 +1,132 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(void); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrAdvActionTbl[LCTR_ADV_STATE_TOTAL][LCTR_ADV_MSG_TOTAL] = +{ + { /* LCTR_ADV_STATE_DISABLED */ + NULL, /* LCTR_ADV_MSG_RESET */ + lctrAdvActStart, /* LCTR_ADV_MSG_START */ + lctrAdvActAdvCnf, /* LCTR_ADV_MSG_STOP */ + lctrAdvActSelfStart, /* LCTR_ADV_MSG_INT_START */ + NULL, /* LCTR_ADV_MSG_TERMINATE */ + lctrAdvActUpdateAdvParam /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_ENABLED */ + lctrAdvActShutdown, /* LCTR_ADV_MSG_RESET */ + lctrAdvActAdvCnf, /* LCTR_ADV_MSG_START */ + lctrAdvActShutdown, /* LCTR_ADV_MSG_STOP */ + NULL, /* LCTR_ADV_MSG_INT_START */ + lctrAdvActSelfTerm, /* LCTR_ADV_MSG_TERMINATE */ + NULL /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_SHUTDOWN */ + NULL, /* LCTR_ADV_MSG_RESET */ + lctrAdvActDisallowAdvCnf, /* LCTR_ADV_MSG_START */ + lctrAdvActDisallowAdvCnf, /* LCTR_ADV_MSG_STOP */ + NULL, /* LCTR_ADV_MSG_INT_START */ + lctrAdvActAdvTerm, /* LCTR_ADV_MSG_TERMINATE */ + lctrAdvActUpdateAdvParam /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_RESET */ + NULL, /* LCTR_ADV_MSG_RESET */ + lctrAdvActDisallowAdvCnf, /* LCTR_ADV_MSG_START */ + lctrAdvActDisallowAdvCnf, /* LCTR_ADV_MSG_STOP */ + NULL, /* LCTR_ADV_MSG_INT_START */ + lctrAdvActResetTerm, /* LCTR_ADV_MSG_TERMINATE */ + lctrAdvActUpdateAdvParam /* LCTR_ADV_MSG_PARAM_UPD */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrAdvNextStateTbl[LCTR_ADV_STATE_TOTAL][LCTR_ADV_MSG_TOTAL] = +{ + { /* LCTR_ADV_STATE_DISABLED */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_RESET */ + LCTR_ADV_STATE_ENABLED, /* LCTR_ADV_MSG_START */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_STOP */ + LCTR_ADV_STATE_ENABLED, /* LCTR_ADV_MSG_INT_START */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_TERMINATE */ + LCTR_ADV_STATE_DISABLED /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_ENABLED */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_RESET */ + LCTR_ADV_STATE_ENABLED, /* LCTR_ADV_MSG_START */ + LCTR_ADV_STATE_SHUTDOWN, /* LCTR_ADV_MSG_STOP */ + LCTR_ADV_STATE_ENABLED, /* LCTR_ADV_MSG_INT_START */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_TERMINATE */ + LCTR_ADV_STATE_ENABLED /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_SHUTDOWN */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_RESET */ + LCTR_ADV_STATE_SHUTDOWN, /* LCTR_ADV_MSG_START */ + LCTR_ADV_STATE_SHUTDOWN, /* LCTR_ADV_MSG_STOP */ + LCTR_ADV_STATE_SHUTDOWN, /* LCTR_ADV_MSG_INT_START */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_TERMINATE */ + LCTR_ADV_STATE_SHUTDOWN /* LCTR_ADV_MSG_PARAM_UPD */ + }, + { /* LCTR_ADV_STATE_RESET */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_RESET */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_START */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_STOP */ + LCTR_ADV_STATE_RESET, /* LCTR_ADV_MSG_INT_START */ + LCTR_ADV_STATE_DISABLED, /* LCTR_ADV_MSG_TERMINATE */ + LCTR_ADV_STATE_RESET /* LCTR_ADV_MSG_PARAM_UPD */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute slave advertising state machine. + * + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvAdvExecuteSm(uint8_t event) +{ + LL_TRACE_INFO2("lctrSlvAdvExecuteSm: state=%u, event=%u", lctrSlvAdv.state, event); + + if (lctrAdvActionTbl[lctrSlvAdv.state][event]) + { + lctrAdvActionTbl[lctrSlvAdv.state][event](); + } + + lctrSlvAdv.state = lctrAdvNextStateTbl[lctrSlvAdv.state][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..81da5ce0385e43e68dcb65ec04c5d47dad3da750 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c @@ -0,0 +1,214 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave advertising state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_adv_slave_ae.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Extended action function call signature. */ +typedef void (*lctrExtActFn_t)(lctrAdvSet_t *pAdvSet); + +/*! \brief Periodic action function call signature. */ +typedef void (*lctrPerActFn_t)(lctrAdvSet_t *pAdvSet); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Extended advertising state machine action table. */ +static const lctrExtActFn_t lctrExtAdvActionTbl[LCTR_EXT_ADV_STATE_TOTAL][LCTR_EXT_ADV_MSG_TOTAL] = +{ + { /* LCTR_EXT_ADV_STATE_DISABLED */ + lctrExtAdvActReset, /* LCTR_EXT_ADV_MSG_RESET */ + lctrExtAdvActStart, /* LCTR_EXT_ADV_MSG_START */ + lctrExtAdvActAdvCnf, /* LCTR_EXT_ADV_MSG_STOP */ + NULL, /* LCTR_EXT_ADV_MSG_INT_START */ + NULL, /* LCTR_EXT_ADV_MSG_TERMINATE */ + NULL, /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_ENABLED */ + lctrExtAdvActShutdown, /* LCTR_EXT_ADV_MSG_RESET */ + lctrExtAdvActRestart, /* LCTR_EXT_ADV_MSG_START */ + lctrExtAdvActShutdown, /* LCTR_EXT_ADV_MSG_STOP */ + NULL, /* LCTR_EXT_ADV_MSG_INT_START */ + lctrExtAdvActSelfTerm, /* LCTR_EXT_ADV_MSG_TERMINATE */ + lctrExtAdvActDurationExpired, /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_SHUTDOWN */ + NULL, /* LCTR_EXT_ADV_MSG_RESET */ + lctrExtAdvActDisallowAdvCnf, /* LCTR_EXT_ADV_MSG_START */ + lctrExtAdvActDisallowAdvCnf, /* LCTR_EXT_ADV_MSG_STOP */ + NULL, /* LCTR_EXT_ADV_MSG_INT_START */ + lctrExtAdvActAdvTerm, /* LCTR_EXT_ADV_MSG_TERMINATE */ + NULL, /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_RESET */ + NULL, /* LCTR_EXT_ADV_MSG_RESET */ + lctrExtAdvActDisallowAdvCnf, /* LCTR_EXT_ADV_MSG_START */ + lctrExtAdvActDisallowAdvCnf, /* LCTR_EXT_ADV_MSG_STOP */ + NULL, /* LCTR_EXT_ADV_MSG_INT_START */ + lctrExtAdvActResetTerm, /* LCTR_EXT_ADV_MSG_TERMINATE */ + NULL, /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + } +}; + +/*! \brief Extended advertising state machine next state table. */ +static const uint8_t lctrExtAdvNextStateTbl[LCTR_EXT_ADV_STATE_TOTAL][LCTR_EXT_ADV_MSG_TOTAL] = +{ + { /* LCTR_EXT_ADV_STATE_DISABLED */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_RESET */ + LCTR_EXT_ADV_STATE_ENABLED, /* LCTR_EXT_ADV_MSG_START */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_STOP */ + LCTR_EXT_ADV_STATE_ENABLED, /* LCTR_EXT_ADV_MSG_INT_START */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_TERMINATE */ + LCTR_EXT_ADV_STATE_DISABLED /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_ENABLED */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_RESET */ + LCTR_EXT_ADV_STATE_ENABLED, /* LCTR_EXT_ADV_MSG_START */ + LCTR_EXT_ADV_STATE_SHUTDOWN, /* LCTR_EXT_ADV_MSG_STOP */ + LCTR_EXT_ADV_STATE_ENABLED, /* LCTR_EXT_ADV_MSG_INT_START */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_TERMINATE */ + LCTR_EXT_ADV_STATE_ENABLED /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_SHUTDOWN */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_RESET */ + LCTR_EXT_ADV_STATE_SHUTDOWN, /* LCTR_EXT_ADV_MSG_START */ + LCTR_EXT_ADV_STATE_SHUTDOWN, /* LCTR_EXT_ADV_MSG_STOP */ + LCTR_EXT_ADV_STATE_SHUTDOWN, /* LCTR_EXT_ADV_MSG_INT_START */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_TERMINATE */ + LCTR_EXT_ADV_STATE_SHUTDOWN /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + }, + { /* LCTR_EXT_ADV_STATE_RESET */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_RESET */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_START */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_STOP */ + LCTR_EXT_ADV_STATE_RESET, /* LCTR_EXT_ADV_MSG_INT_START */ + LCTR_EXT_ADV_STATE_DISABLED, /* LCTR_EXT_ADV_MSG_TERMINATE */ + LCTR_EXT_ADV_STATE_RESET /* LCTR_EXT_ADV_MSG_TMR_DUR_EXP */ + } +}; + +/*! \brief Periodic advertising state machine action table. */ +static const lctrPerActFn_t lctrPerAdvActionTbl[LCTR_PER_ADV_STATE_TOTAL][LCTR_PER_ADV_MSG_TOTAL] = +{ + { /* LCTR_PER_ADV_STATE_DISABLED */ + NULL, /* LCTR_PER_ADV_MSG_RESET */ + lctrPeriodicAdvActStart, /* LCTR_PER_ADV_MSG_START */ + NULL, /* LCTR_PER_ADV_MSG_STOP */ + NULL /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_ENABLED */ + lctrPeriodicAdvActShutdown, /* LCTR_PER_ADV_MSG_RESET */ + lctrPeriodicAdvActUpdate, /* LCTR_PER_ADV_MSG_START */ + lctrPeriodicAdvActShutdown, /* LCTR_PER_ADV_MSG_STOP */ + NULL, /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_SHUTDOWN */ + NULL, /* LCTR_PER_ADV_MSG_RESET */ + lctrPeriodicAdvActDisallowAdvCnf,/* LCTR_PER_ADV_MSG_START */ + lctrPeriodicAdvActDisallowAdvCnf,/* LCTR_PER_ADV_MSG_STOP */ + lctrPeriodicAdvActAdvTerm /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_RESET */ + NULL, /* LCTR_PER_ADV_MSG_RESET */ + lctrPeriodicAdvActDisallowAdvCnf,/* LCTR_PER_ADV_MSG_START */ + lctrPeriodicAdvActDisallowAdvCnf,/* LCTR_PER_ADV_MSG_STOP */ + lctrPeriodicAdvActResetTerm /* LCTR_PER_ADV_MSG_TERMINATE */ + } +}; + +/*! \brief Periodic advertising state machine next state table. */ +static const uint8_t lctrPerAdvNextStateTbl[LCTR_PER_ADV_STATE_TOTAL][LCTR_PER_ADV_MSG_TOTAL] = +{ + { /* LCTR_PER_ADV_STATE_DISABLED */ + LCTR_PER_ADV_STATE_DISABLED, /* LCTR_PER_ADV_MSG_RESET */ + LCTR_PER_ADV_STATE_ENABLED, /* LCTR_PER_ADV_MSG_START */ + LCTR_PER_ADV_STATE_DISABLED, /* LCTR_PER_ADV_MSG_STOP */ + LCTR_PER_ADV_STATE_DISABLED /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_ENABLED */ + LCTR_PER_ADV_STATE_RESET, /* LCTR_PER_ADV_MSG_RESET */ + LCTR_PER_ADV_STATE_ENABLED, /* LCTR_PER_ADV_MSG_START */ + LCTR_PER_ADV_STATE_SHUTDOWN, /* LCTR_PER_ADV_MSG_STOP */ + LCTR_PER_ADV_STATE_DISABLED /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_SHUTDOWN */ + LCTR_PER_ADV_STATE_RESET, /* LCTR_PER_ADV_MSG_RESET */ + LCTR_PER_ADV_STATE_SHUTDOWN, /* LCTR_PER_ADV_MSG_START */ + LCTR_PER_ADV_STATE_SHUTDOWN, /* LCTR_PER_ADV_MSG_STOP */ + LCTR_PER_ADV_STATE_DISABLED /* LCTR_PER_ADV_MSG_TERMINATE */ + }, + { /* LCTR_PER_ADV_STATE_RESET */ + LCTR_PER_ADV_STATE_RESET, /* LCTR_PER_ADV_MSG_RESET */ + LCTR_PER_ADV_STATE_RESET, /* LCTR_PER_ADV_MSG_START */ + LCTR_PER_ADV_STATE_RESET, /* LCTR_PER_ADV_MSG_STOP */ + LCTR_PER_ADV_STATE_DISABLED /* LCTR_PER_ADV_MSG_TERMINATE */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute slave extended advertising state machine. + * + * \param pAdvSet Advertising set. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvExtAdvExecuteSm(lctrAdvSet_t *pAdvSet, uint8_t event) +{ + LL_TRACE_INFO3("lctrSlvExtAdvExecuteSm: handle=%u, state=%u, event=%u", pAdvSet->handle, pAdvSet->state, event); + + if (lctrExtAdvActionTbl[pAdvSet->state][event]) + { + lctrExtAdvActionTbl[pAdvSet->state][event](pAdvSet); + } + + pAdvSet->state = lctrExtAdvNextStateTbl[pAdvSet->state][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Execute slave periodic advertising state machine. + * + * \param pAdvSet Advertising set. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvPeriodicAdvExecuteSm(lctrAdvSet_t *pAdvSet, uint8_t event) +{ + LL_TRACE_INFO3("lctrSlvPeriodicAdvExecuteSm: handle=%u, state=%u, event=%u", pAdvSet->handle, pAdvSet->perParam.perState, event); + + if (lctrPerAdvActionTbl[pAdvSet->perParam.perState][event]) + { + lctrPerAdvActionTbl[pAdvSet->perParam.perState][event](pAdvSet); + } + + pAdvSet->perParam.perState = lctrPerAdvNextStateTbl[pAdvSet->perParam.perState][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..232030bd04203ee26479a7e4fca890326b6495c5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_master.c @@ -0,0 +1,138 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_adv_master.h" +#include "lmgr_api_conn.h" +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Execute master connection state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstConnExecuteSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (pCtx->state) + { + case LCTR_CONN_STATE_ESTABLISHED_READY: + switch (event) + { + case LCTR_CONN_DATA_PENDING: + lctrMstReloadDataPdu(pCtx); + break; + case LCTR_CONN_MST_ESTABLISH: + case LCTR_CONN_TERM_SUP_TIMEOUT: + case LCTR_CONN_TERM_MIC_FAILED: + /* Data path related events. */ + break; + default: + /* Invoke LLCP child state machine */ + lctrMstLlcpExecuteSm(pCtx, event); + break; + } + break; + + case LCTR_CONN_STATE_INITIALIZED: + switch (event) + { + case LCTR_CONN_MST_ESTABLISH: + LL_TRACE_INFO2("lctrMstConnExecuteSm: handle=%u, state=%u, event=MST_ESTABLISH", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + + lctrMstSetEstablishConn(pCtx); + lctrStoreConnFailEstablishTerminateReason(pCtx); /* default termination reason */ + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP)) + { + /* Queue version exchange. */ + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_VERSION_EXCH); + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP)) + { + /* Queue feature exchange. */ + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_FEATURE_EXCH); + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP)) + { + /* Only send initial length feature if the default is an extended length. */ + if ((pCtx->localDataPdu.maxTxLen > LL_MAX_DATA_LEN_MIN) || + (pCtx->localDataPdu.maxTxTime > LL_MAX_DATA_TIME_MIN)) + { + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_LENGTH_EXCH); + } + } + + lctrNotifyHostConnectInd(LCTR_GET_CONN_HANDLE(pCtx), LL_ROLE_MASTER, + &pLctrConnMsg->connEstablish.connInd, pLctrConnMsg->connEstablish.peerIdAddrType, + pLctrConnMsg->connEstablish.peerIdAddr, pLctrConnMsg->connEstablish.peerRpa, + pLctrConnMsg->connEstablish.localRpa, LL_SUCCESS, pCtx->usedChSel); + + pCtx->state = LCTR_CONN_STATE_ESTABLISHED_READY; + break; + + default: + break; + } + break; + + case LCTR_CONN_STATE_TERMINATING: + switch (event) + { + case LCTR_CONN_TMR_LLCP_RSP_EXP: + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CMN_TERM); + lctrStoreLlcpTimeoutTerminateReason(pCtx); + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; /* Stop waiting to send TERMINATE_IND. */ + break; + default: + break; + } + break; + + default: + break; + } + + /* State-less events. */ + switch (event) + { + case LCTR_CONN_TERMINATED: + LL_TRACE_INFO2("lctrMstConnExecuteSm: handle=%u, state=%u, event=TERMINATED", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + SchRmRemove(LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostDisconnectInd(pCtx); + lctrFreeConnCtx(pCtx); + break; + default: + lctrConnStatelessEventHandler(pCtx, event); + break; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..55cb910926fee6db1c93233b664882a11cebe5dc --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_conn_slave.c @@ -0,0 +1,241 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lctr_int_adv_slave.h" +#include "lmgr_api_conn.h" +#include "sch_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Execute slave connection state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvConnExecuteSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + /* State-specific events. */ + switch (pCtx->state) + { + case LCTR_CONN_STATE_ESTABLISHED_READY: + switch (event) + { + case LCTR_CONN_DATA_PENDING: + case LCTR_CONN_TERM_SUP_TIMEOUT: + case LCTR_CONN_TERM_MIC_FAILED: + /* Data path related events. */ + break; + default: + /* Invoke LLCP child state machine */ + lctrSlvLlcpExecuteSm(pCtx, event); + break; + } + break; + + case LCTR_CONN_STATE_INITIALIZED: + switch (event) + { + case LCTR_CONN_MSG_RX_CONNECT_IND: + LL_TRACE_INFO1("lctrSlvConnExecuteSm: handle=%u, state=INITIALIZED, event=RX_CONNECT_IND", LCTR_GET_CONN_HANDLE(pCtx)); + + lctrSlvConnBuildOp(pCtx); + lctrStoreConnFailEstablishTerminateReason(pCtx); /* default termination reason */ + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP)) + { + /* The following LLCP startup procedures continue when receiving the first non-control PDU from the master. */ + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP)) + { + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_VER_EXCH; + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP)) + { + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_FEAT_EXCH; + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP)) + { + /* Only send initial length feature if the default is an extended length. */ + if ((pCtx->localDataPdu.maxTxLen > LL_MAX_DATA_LEN_MIN) || + (pCtx->localDataPdu.maxTxTime > LL_MAX_DATA_TIME_MIN)) + { + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_DATA_LEN_UPD; + } + } + pCtx->state = LCTR_CONN_STATE_ESTABLISHED_STARTUP; + } + else + { + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP)) + { + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_VERSION_EXCH); + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP)) + { + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_FEATURE_EXCH); + } + + if (lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP)) + { + /* Only send initial length feature if the default is an extended length. */ + if ((pCtx->localDataPdu.maxTxLen > LL_MAX_DATA_LEN_MIN) || + (pCtx->localDataPdu.maxTxTime > LL_MAX_DATA_TIME_MIN)) + { + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_LENGTH_EXCH); + } + } + pCtx->state = LCTR_CONN_STATE_ESTABLISHED_READY; + } + + lctrNotifyHostConnectInd(LCTR_GET_CONN_HANDLE(pCtx), LL_ROLE_SLAVE, + &pLctrConnMsg->connEstablish.connInd, pLctrConnMsg->connEstablish.peerIdAddrType, + pLctrConnMsg->connEstablish.peerIdAddr, pLctrConnMsg->connEstablish.peerRpa, + pLctrConnMsg->connEstablish.localRpa, LL_SUCCESS, pCtx->usedChSel); + break; + + default: + break; + } + break; + + case LCTR_CONN_STATE_ESTABLISHED_STARTUP: + LL_TRACE_INFO1("lctrSlvConnExecuteSm: state=ESTABLISHED_STARTUP, event=%u", event); + switch(event) + { + case LCTR_CONN_SLV_INIT_STARTUP_LLCP: + pCtx->state = LCTR_CONN_STATE_ESTABLISHED_READY; + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_START_PENDING); + break; + + /* Data path related events. */ + case LCTR_CONN_DATA_PENDING: + case LCTR_CONN_TERM_SUP_TIMEOUT: + case LCTR_CONN_TERM_MIC_FAILED: + + break; + + /* The following events are master only. + * case LCTR_CONN_MSG_API_CHAN_MAP_UPDATE: + * case LCTR_CONN_MSG_API_START_ENC: + */ + + /* The following events will be pended. */ + case LCTR_CONN_MSG_API_CONN_UPDATE: + pCtx->llcpPendMask |= 1 << LCTR_PROC_CONN_UPD; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CONN_UPD; + break; + case LCTR_CONN_MSG_API_REMOTE_FEATURE: + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_FEAT_EXCH; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CMN_FEAT_EXCH; + break; + case LCTR_CONN_MSG_API_REMOTE_VERSION: + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_VER_EXCH; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CMN_VER_EXCH; + break; + case LCTR_CONN_MSG_API_DATA_LEN_CHANGE: + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_DATA_LEN_UPD; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CMN_DATA_LEN_UPD; + break; + case LCTR_CONN_MSG_API_PHY_UPDATE: + pCtx->llcpPendMask |= 1 << LCTR_PROC_PHY_UPD; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + break; + case LCTR_CONN_MSG_API_SET_MIN_USED_CHAN: + pCtx->llcpPendMask |= 1 << LCTR_PROC_CMN_SET_MIN_USED_CHAN; + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CMN_SET_MIN_USED_CHAN; + break; + + default: + /* Invoke LLCP child state machine */ + lctrSlvLlcpExecuteSm(pCtx, event); + break; + } + break; + + case LCTR_CONN_STATE_TERMINATING: + switch (event) + { + case LCTR_CONN_TMR_LLCP_RSP_EXP: + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CMN_TERM); + lctrStoreLlcpTimeoutTerminateReason(pCtx); + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; /* Stop waiting to send TERMINATE_IND. */ + break; + default: + break; + } + break; + + default: + break; + } + + /* State-less events. */ + lctrConnStatelessEventHandler(pCtx, event); +} + +/*************************************************************************************************/ +/*! + * \brief Execute stateless connection event handler. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrConnStatelessEventHandler(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CONN_TERMINATED: + LL_TRACE_INFO2("lctrConnStatelessEventHandler: handle=%u, state=%u, event=TERMINATED", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + lctrNotifyHostDisconnectInd(pCtx); + lctrFreeConnCtx(pCtx); + break; + case LCTR_CONN_TERM_SUP_TIMEOUT: + LL_TRACE_WARN2("lctrConnStatelessEventHandler: handle=%u, state=%u, event=SUP_TIMEOUT", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + /* lctrStoreConnFailEstablishTerminateReason or lctrStoreConnTimeoutTerminateReason */ /* already set as termination reason */ + lctrFlagLinkTerm(pCtx); + break; + case LCTR_CONN_TERM_MIC_FAILED: + LL_TRACE_WARN2("lctrConnStatelessEventHandler: handle=%u, state=%u, event=MIC_FAILED", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + lctrStoreMicFailedTerminateReason(pCtx); + lctrFlagLinkTerm(pCtx); + break; + case LCTR_CONN_MSG_RESET: + LL_TRACE_INFO2("lctrConnStatelessEventHandler: handle=%u, state=%u, event=RESET", LCTR_GET_CONN_HANDLE(pCtx), pCtx->state); + lctrStoreResetTerminateReason(pCtx); + lctrFlagLinkTerm(pCtx); + break; + default: + break; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master.c new file mode 100644 index 0000000000000000000000000000000000000000..b7177f2970386b8eb20984ca90a475197d2df643 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master.c @@ -0,0 +1,116 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master initiate state machine implementation file. + */ +/*************************************************************************************************/ + +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "lctr_int_init_master.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(void); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ +/*! \brief Initiate state machine action table. + */ +static const lctrActFn_t lctrInitActionTbl[LCTR_INIT_STATE_TOTAL][LCTR_INIT_MSG_TOTAL] = +{ + { /* LCTR_INIT_STATE_DISABLED */ + NULL, /* LCTR_INIT_MSG_RESET */ + lctrInitActInitiate, /* LCTR_INIT_MSG_INITIATE */ + lctrInitActDisallowCancel, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + NULL, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_ENABLED */ + lctrInitActShutdown, /* LCTR_INIT_MSG_RESET */ + lctrInitActDisallowInitiate,/* LCTR_INIT_MSG_INITIATE */ + lctrInitActShutdown, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + lctrInitActConnect, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_SHUTDOWN */ + NULL, /* LCTR_INIT_MSG_RESET */ + lctrInitActDisallowInitiate,/* LCTR_INIT_MSG_INITIATE */ + NULL, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + lctrInitActScanTerm, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_RESET */ + NULL, /* LCTR_INIT_MSG_RESET */ + lctrInitActDisallowInitiate,/* LCTR_INIT_MSG_INITIATE */ + lctrInitActDisallowCancel, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + lctrInitActResetTerm, /* LCTR_INIT_MSG_TERMINATE */ + } +}; + +/*! \brief Initiation state machine next state table. */ +static const uint8_t lctrInitNextStateTbl[LCTR_INIT_STATE_TOTAL][LCTR_INIT_MSG_TOTAL] = +{ + { /* LCTR_INIT_STATE_DISABLED */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_RESET */ + LCTR_INIT_STATE_ENABLED, /* LCTR_INIT_MSG_INITIATE */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_ENABLED */ + LCTR_INIT_STATE_RESET, /* LCTR_INIT_MSG_RESET */ + LCTR_INIT_STATE_ENABLED, /* LCTR_INIT_MSG_INITIATE */ + LCTR_INIT_STATE_SHUTDOWN, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_SHUTDOWN */ + LCTR_INIT_STATE_RESET, /* LCTR_INIT_MSG_RESET */ + LCTR_INIT_STATE_SHUTDOWN, /* LCTR_INIT_MSG_INITIATE */ + LCTR_INIT_STATE_SHUTDOWN, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_TERMINATE */ + }, + { /* LCTR_INIT_STATE_RESET */ + LCTR_INIT_STATE_RESET, /* LCTR_INIT_MSG_RESET */ + LCTR_INIT_STATE_RESET, /* LCTR_INIT_MSG_INITIATE */ + LCTR_INIT_STATE_RESET, /* LCTR_INIT_MSG_INITIATE_CANCEL */ + LCTR_INIT_STATE_DISABLED, /* LCTR_INIT_MSG_TERMINATE */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute master scan and initiate state machine. + * + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstInitExecuteSm(uint8_t event) +{ + LL_TRACE_INFO2("lctrMstInitExecuteSm: state=%u, event=%u", lctrMstInit.state, event); + + if (lctrInitActionTbl[lctrMstInit.state][event]) + { + lctrInitActionTbl[lctrMstInit.state][event](); + } + + lctrMstInit.state = lctrInitNextStateTbl[lctrMstInit.state][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..fac7af0cac7fc34310a3f052e49d71d07f54ec63 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_init_master_ae.c @@ -0,0 +1,118 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master initiate state machine implementation file. + */ +/*************************************************************************************************/ + +#include "sch_api_ble.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "lctr_int_init_master_ae.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrExtScanCtx_t *pExtInitCtx); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ +/*! \brief Initiate state machine action table. + */ +static const lctrActFn_t lctrExtInitActionTbl[LCTR_EXT_INIT_STATE_TOTAL][LCTR_EXT_INIT_MSG_TOTAL] = +{ + { /* LCTR_EXT_INIT_STATE_DISABLED */ + NULL, /* LCTR_EXT_INIT_MSG_RESET */ + NULL, /* LCTR_EXT_INIT_MSG_INITIATE */ /* Handled by lctrMstExtInitExecuteCommonSm. */ + lctrExtInitActDisallowCancel, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + NULL, /* LCTR_EXT_INIT_MSG_TERMINATE */ + }, + { /* LCTR_EXT_INIT_STATE_ENABLED */ + lctrExtInitActShutdown, /* LCTR_EXT_INIT_MSG_RESET */ + lctrExtInitActDisallowInitiate, /* LCTR_EXT_INIT_MSG_INITIATE */ + lctrExtInitActShutdown, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + lctrExtInitActConnect, /* LCTR_EXT_INIT_MSG_TERMINATE */ + }, + { /* LCTR_EXT_INIT_STATE_SHUTDOWN */ + NULL, /* LCTR_EXT_INIT_MSG_RESET */ + lctrExtInitActDisallowInitiate, /* LCTR_EXT_INIT_MSG_INITIATE */ + NULL, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + lctrExtInitActScanTerm, /* LCTR_EXT_INIT_MSG_TERMINATE */ + + }, + { /* LCTR_EXT_INIT_STATE_RESET */ + NULL, /* LCTR_EXT_INIT_MSG_RESET */ + lctrExtInitActDisallowInitiate, /* LCTR_EXT_INIT_MSG_INITIATE */ + lctrExtInitActDisallowCancel, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + lctrExtInitActScanTerm, /* LCTR_EXT_INIT_MSG_TERMINATE */ + } +}; + +/*! \brief Initiation state machine next state table. */ +static const uint8_t lctrExtInitNextStateTbl[LCTR_EXT_INIT_STATE_TOTAL][LCTR_EXT_INIT_MSG_TOTAL] = +{ + { /* LCTR_EXT_INIT_STATE_DISABLED */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_RESET */ + LCTR_EXT_INIT_STATE_ENABLED, /* LCTR_EXT_INIT_MSG_INITIATE */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_TERMINATE */ + }, + { /* LCTR_EXT_INIT_STATE_ENABLED */ + LCTR_EXT_INIT_STATE_RESET, /* LCTR_EXT_INIT_MSG_RESET */ + LCTR_EXT_INIT_STATE_ENABLED, /* LCTR_EXT_INIT_MSG_INITIATE */ + LCTR_EXT_INIT_STATE_SHUTDOWN, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_TERMINATE */ + }, + { /* LCTR_EXT_INIT_STATE_SHUTDOWN */ + LCTR_EXT_INIT_STATE_RESET, /* LCTR_EXT_INIT_MSG_RESET */ + LCTR_EXT_INIT_STATE_SHUTDOWN, /* LCTR_EXT_INIT_MSG_INITIATE */ + LCTR_EXT_INIT_STATE_SHUTDOWN, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_TERMINATE */ + }, + { /* LCTR_EXT_INIT_STATE_RESET */ + LCTR_EXT_INIT_STATE_RESET, /* LCTR_EXT_INIT_MSG_RESET */ + LCTR_EXT_INIT_STATE_RESET, /* LCTR_EXT_INIT_MSG_INITIATE */ + LCTR_EXT_INIT_STATE_RESET, /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL */ + LCTR_EXT_INIT_STATE_DISABLED, /* LCTR_EXT_INIT_MSG_TERMINATE */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute master scan and initiate state machine. + * + * \param pExtInitCtx Extended scanning context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstExtInitExecuteSm(lctrExtScanCtx_t *pExtInitCtx, uint8_t event) +{ + LL_TRACE_INFO2("lctrMstExtInitExecuteSm: state=%u, event=%u", pExtInitCtx->state, event); + + if (lctrExtInitActionTbl[pExtInitCtx->state][event]) + { + lctrExtInitActionTbl[pExtInitCtx->state][event](pExtInitCtx); + } + + pExtInitCtx->state = lctrExtInitNextStateTbl[pExtInitCtx->state][event]; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..322eeda63c4a0a11cc66389c778ca41c8bb9bea8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn.c @@ -0,0 +1,874 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LLCP state machine implementation file. + */ +/*************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * This state machine combines several functionally common LLCP procedures into a single state + * machine for the purpose of optimizing code size and provide common code path for for similar + * procedures. + * + * Both master and slave operations are handled. Common state behavior is defined in + * lctrLlcpExecuteCommonSm() which is typically a host initiated procedure, request exchange, + * response exchange and host completion notification. + * + * Actions for each common procedure is defined in tables. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lmgr_api.h" +#include "util/bstream.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Common LLCP events. */ +enum +{ + LCTR_PROC_CMN_EVT_HOST_START, /*!< Host initiated start procedure event. */ + LCTR_PROC_CMN_EVT_INT_START, /*!< LL initiated start procedure event. */ + LCTR_PROC_CMN_EVT_INT_INCOMP, /*!< Complete an interrupted procedure event. */ + LCTR_PROC_CMN_EVT_RECV_IND, /*!< Receive indication event. */ + LCTR_PROC_CMN_EVT_RECV_REQ, /*!< Receive request event. */ + LCTR_PROC_CMN_EVT_RECV_RSP, /*!< Receive response event. */ + LCTR_PROC_CMN_EVT_PROC_COMP, /*!< Procedure completed event. */ + LCTR_PROC_CMN_EVT_REJECT, /*!< Procedure rejected event. */ + LCTR_PROC_CMN_EVT_TOTAL, /*!< Total common procedure events. */ + LCTR_PROC_CMN_EVT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/*! \brief Common LLCP actions. */ +enum +{ + LCTR_PROC_CMN_ACT_API_PARAM, /*!< Store host API parameter action. */ + LCTR_PROC_CMN_ACT_SEND_REQ, /*!< Send request action. */ + LCTR_PROC_CMN_ACT_RECV_REQ, /*!< Receive request action. */ + LCTR_PROC_CMN_ACT_SEND_RSP, /*!< Send response action. */ + LCTR_PROC_CMN_ACT_RECV_RSP, /*!< Receive response action. */ + LCTR_PROC_CMN_ACT_TOTAL /*!< Total common procedure actions. */ +}; + +/*! \brief Call signature of an action handler. */ +typedef void (*lctrLlcpEh_t)(lctrConnCtx_t *pCtx); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Common procedure state machine action table. */ +const lctrLlcpEh_t lctrCmnProcTbl[LCTR_PROC_CMN_TOTAL][LCTR_PROC_CMN_ACT_TOTAL] = +{ + /* LCTR_PROC_CMN_TERM */ + { + lctrStoreDisconnectReason, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendTerminateInd, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreTerminateReason, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + NULL, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + NULL /* LCTR_PROC_CMN_ACT_RECV_RSP */ + }, + /* LCTR_PROC_CMN_CH_MAP_UPD */ + { + lctrStoreChanMapUpdate, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendChanMapUpdateInd, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreChanMap, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + NULL, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + NULL /* LCTR_PROC_CMN_ACT_RECV_RSP */ + }, + /* LCTR_PROC_CMN_FEAT_EXCH */ + { + NULL, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendFeatureReq, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreUsedFeatures, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + lctrSendFeatureRsp, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + lctrStoreUsedFeatures /* LCTR_PROC_CMN_ACT_RECV_RSP */ + }, + /* LCTR_PROC_CMN_VER_EXCH */ + { + NULL, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendVersionInd, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreRemoteVer, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + lctrSendVersionInd, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + lctrStoreRemoteVer /* LCTR_PROC_CMN_ACT_RECV_RSP */ + }, + /* LCTR_PROC_CMN_DATA_LEN_UPD */ + { + lctrStoreLocalDataLength, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendDataLengthReq, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreRemoteDataLength, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + lctrSendDataLengthRsp, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + lctrStoreRemoteDataLength /* LCTR_PROC_CMN_ACT_RECV_RSP */ + }, + /* LCTR_PROC_CMN_SET_MIN_USED_CHAN */ + { + NULL, /* LCTR_PROC_CMN_ACT_API_PARAM */ + lctrSendSetMinUsedChanInd, /* LCTR_PROC_CMN_ACT_SEND_REQ */ + lctrStoreSetMinUsedChan, /* LCTR_PROC_CMN_ACT_RECV_REQ */ + NULL, /* LCTR_PROC_CMN_ACT_SEND_RSP */ + NULL /* LCTR_PROC_CMN_ACT_RECV_RSP */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute action function. + * + * \param pCtx Connection context. + * \param proc Procedure ID. + * \param act Action ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExecAction(lctrConnCtx_t *pCtx, uint8_t proc, uint8_t act) +{ + if (lctrCmnProcTbl[proc][act]) + { + lctrCmnProcTbl[proc][act](pCtx); + } +} + +/*************************************************************************************************/ +/*! + * \brief Get next pending procedure. + * + * \param pCtx Connection context. + * + * \return Next procedure ID or LCTR_PROC_INVALID if none pending. + */ +/*************************************************************************************************/ +static uint8_t lctrGetNextPendingProc(lctrConnCtx_t *pCtx) +{ + uint8_t proc; + + if (pCtx->state == LCTR_CONN_STATE_TERMINATING) + { + /* Do not start any new procedures when terminating. */ + return LCTR_PROC_INVALID; + } + + /* Only start termination procedure when termination pending. */ + if (pCtx->llcpIncompMask & (1 << LCTR_PROC_CMN_TERM)) + { + pCtx->llcpIncompMask &= ~(1 << LCTR_PROC_CMN_TERM); + return LCTR_PROC_CMN_TERM; + } + if (pCtx->llcpPendMask & (1 << LCTR_PROC_CMN_TERM)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_CMN_TERM); + return LCTR_PROC_CMN_TERM; + } + + /* First, complete incomplete procedures. */ + proc = 0; + do + { + if (pCtx->llcpIncompMask & (1 << proc)) + { + pCtx->llcpIncompMask &= ~(1 << proc); + return proc; + } + } while (++proc < LCTR_PROC_CMN_TOTAL); + + /* Next, complete pending procedures. */ + proc = 0; + do + { + if (pCtx->llcpPendMask & (1 << proc)) + { + pCtx->llcpPendMask &= ~(1 << proc); + /* Restore the states and continue the previous procedure. */ + if (pCtx->llcpIsOverridden == TRUE) + { + pCtx->llcpIsOverridden = FALSE; + if (pCtx->cmnState != LCTR_CMN_STATE_IDLE) + { + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + pCtx->llcpActiveProc = proc; + } + return proc; + } + } while (++proc < LCTR_PROC_CMN_TOTAL); + + return LCTR_PROC_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Get common LLCP procedure ID. + * + * \param pCtx Connection context. + * \param event Event. + * + * \return LLCP procedure event ID. + */ +/*************************************************************************************************/ +static uint8_t lctrGetCmnProcId(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CONN_MSG_API_CHAN_MAP_UPDATE: + return LCTR_PROC_CMN_CH_MAP_UPD; + + case LCTR_CONN_MSG_API_REMOTE_FEATURE: + case LCTR_CONN_LLCP_FEATURE_EXCH: + return LCTR_PROC_CMN_FEAT_EXCH; + + case LCTR_CONN_MSG_API_SET_MIN_USED_CHAN: + return LCTR_PROC_CMN_SET_MIN_USED_CHAN; + + case LCTR_CONN_MSG_API_REMOTE_VERSION: + case LCTR_CONN_LLCP_VERSION_EXCH: + return LCTR_PROC_CMN_VER_EXCH; + + case LCTR_CONN_LLCP_TERM: + case LCTR_CONN_MSG_API_DISCONNECT: + return LCTR_PROC_CMN_TERM; + + case LCTR_CONN_MSG_API_DATA_LEN_CHANGE: + case LCTR_CONN_LLCP_LENGTH_EXCH: + return LCTR_PROC_CMN_DATA_LEN_UPD; + + case LCTR_CONN_LLCP_PROC_CMPL: + return pCtx->llcpActiveProc; + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_CHANNEL_MAP_IND: + return LCTR_PROC_CMN_CH_MAP_UPD; + + case LL_PDU_FEATURE_REQ: + case LL_PDU_FEATURE_RSP: + case LL_PDU_SLV_FEATURE_REQ: + return LCTR_PROC_CMN_FEAT_EXCH; + + case LL_PDU_VERSION_IND: + return LCTR_PROC_CMN_VER_EXCH; + + case LL_PDU_TERMINATE_IND: + return LCTR_PROC_CMN_TERM; + + case LL_PDU_LENGTH_REQ: + case LL_PDU_LENGTH_RSP: + return LCTR_PROC_CMN_DATA_LEN_UPD; + + case LL_PDU_MIN_USED_CHAN_IND: + return LCTR_PROC_CMN_SET_MIN_USED_CHAN; + + case LL_PDU_UNKNOWN_RSP: + switch (lctrDataPdu.pld.unknownRsp.unknownType) + { + case LL_PDU_CHANNEL_MAP_IND: + return LCTR_PROC_CMN_CH_MAP_UPD; + + case LL_PDU_FEATURE_REQ: + case LL_PDU_FEATURE_RSP: + case LL_PDU_SLV_FEATURE_REQ: + return LCTR_PROC_CMN_FEAT_EXCH; + + case LL_PDU_VERSION_IND: + return LCTR_PROC_CMN_VER_EXCH; + + case LL_PDU_TERMINATE_IND: + return LCTR_PROC_CMN_TERM; + + case LL_PDU_LENGTH_REQ: + case LL_PDU_LENGTH_RSP: + return LCTR_PROC_CMN_DATA_LEN_UPD; + + default: + break; + } + break; + + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + return pCtx->llcpActiveProc; + + default: + break; + } + + break; + + case LCTR_CONN_LLCP_START_PENDING: + return lctrGetNextPendingProc(pCtx); + + default: + break; + } + + return LCTR_PROC_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped common LLCP procedure event. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return Common LLCP procedure action ID. + * + * This routine remaps events for the common LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrRemapCmnProcEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CONN_MSG_API_CHAN_MAP_UPDATE: + case LCTR_CONN_MSG_API_REMOTE_FEATURE: + case LCTR_CONN_MSG_API_REMOTE_VERSION: + case LCTR_CONN_MSG_API_DISCONNECT: + case LCTR_CONN_MSG_API_DATA_LEN_CHANGE: + case LCTR_CONN_MSG_API_SET_MIN_USED_CHAN: + return LCTR_PROC_CMN_EVT_HOST_START; + + case LCTR_CONN_LLCP_FEATURE_EXCH: + case LCTR_CONN_LLCP_VERSION_EXCH: + case LCTR_CONN_LLCP_LENGTH_EXCH: + case LCTR_CONN_LLCP_TERM: + return LCTR_PROC_CMN_EVT_INT_START; + + case LCTR_CONN_LLCP_PROC_CMPL: + return LCTR_PROC_CMN_EVT_PROC_COMP; + + case LCTR_CONN_MSG_RX_LLCP_UNKNOWN: + return LCTR_PROC_CMN_EVT_RECV_REQ; + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_CHANNEL_MAP_IND: + case LL_PDU_FEATURE_REQ: + case LL_PDU_SLV_FEATURE_REQ: + case LL_PDU_LENGTH_REQ: + return LCTR_PROC_CMN_EVT_RECV_REQ; + + case LL_PDU_MIN_USED_CHAN_IND: + return LCTR_PROC_CMN_EVT_RECV_IND; + + case LL_PDU_TERMINATE_IND: + case LL_PDU_VERSION_IND: + return LCTR_PROC_CMN_EVT_RECV_IND; + + case LL_PDU_FEATURE_RSP: + case LL_PDU_LENGTH_RSP: + return LCTR_PROC_CMN_EVT_RECV_RSP; + + case LL_PDU_UNKNOWN_RSP: + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + return LCTR_PROC_CMN_EVT_REJECT; + + default: + return LCTR_PROC_CMN_EVT_INVALID; + } + + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpIncompMask) + { + return LCTR_PROC_CMN_EVT_INT_INCOMP; + } + else + { + return LCTR_PROC_CMN_EVT_INT_START; + } + + default: + break; + } + + return LCTR_PROC_CMN_EVT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Check for feature availability. + * + * \param pCtx Connection context. + * \param proc Requesting procedure. + * \param event Event. + * + * \return TRUE if available, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrFeatureAvail(lctrConnCtx_t *pCtx, uint8_t proc, uint8_t event) +{ + bool_t result = TRUE; + + switch (proc) + { + case LCTR_PROC_CMN_VER_EXCH: + if (event == LCTR_PROC_CMN_EVT_INT_INCOMP) + { + result = (pCtx->numSentVerInd == 0) ? TRUE : FALSE; + } + else + { + result = !pCtx->remoteVerValid; + } + break; + case LCTR_PROC_CMN_FEAT_EXCH: + if ((pCtx->role == LL_ROLE_SLAVE) && + (event == LCTR_PROC_CMN_EVT_HOST_START) && + ((pCtx->usedFeatSet & LL_FEAT_SLV_INIT_FEAT_EXCH) == 0)) + { + LL_TRACE_WARN1("Requested LL_FEAT_SLV_INIT_FEAT_EXCH not available, usedFeatSet=0x%08x", pCtx->usedFeatSet); + result = FALSE; + } + break; + case LCTR_PROC_CMN_DATA_LEN_UPD: + if ((pCtx->usedFeatSet & LL_FEAT_DATA_LEN_EXT) == 0) + { + LL_TRACE_WARN1("Requested LCTR_PROC_CMN_DATA_LEN_UPD not available, usedFeatSet=0x%08x", pCtx->usedFeatSet); + result = FALSE; + } + break; + case LCTR_PROC_CMN_CH_MAP_UPD: + if (pCtx->role == LL_ROLE_SLAVE) + { + if (event == LCTR_PROC_CMN_EVT_HOST_START) + { + LL_TRACE_WARN1("Slave cannot initiate LLCP proc=%u", proc); + result = FALSE; + } + } + else + { + if (event == LCTR_PROC_CMN_EVT_RECV_REQ) + { + LL_TRACE_WARN1("Master can only initiate LLCP proc=%u", proc); + result = FALSE; + } + } + break; + case LCTR_PROC_CMN_SET_MIN_USED_CHAN: + if (pCtx->role == LL_ROLE_MASTER) + { + if (event == LCTR_PROC_CMN_EVT_HOST_START) + { + LL_TRACE_WARN1("Master cannot initiate this LLCP proc=%u", proc); + result = FALSE; + } + } + else + { + if (event == LCTR_PROC_CMN_EVT_RECV_REQ) + { + LL_TRACE_WARN1("Slave cannot receive this LLCP proc=%u", proc); + result = FALSE; + } + else if ((event == LCTR_PROC_CMN_EVT_HOST_START) && + (pCtx->usedFeatSet & LL_FEAT_MIN_NUM_USED_CHAN) == 0) + { + LL_TRACE_WARN1("Requested LCTR_PROC_CMN_SET_MIN_USED_CHAN not available, usedFeatSet=0x%08x", pCtx->usedFeatSet); + result = FALSE; + } + } + break; + case LCTR_PROC_CMN_TERM: + default: + break; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of read remote feature confirm. + * + * \param pCtx Connection context. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyHostReadRemoteFeatCnf(lctrConnCtx_t *pCtx, uint8_t status) +{ + LlReadRemoteFeatCnf_t evt; + uint8_t *pBuf; + + const uint16_t handle = LCTR_GET_CONN_HANDLE(pCtx); + + evt.hdr.param = handle; + evt.hdr.event = LL_READ_REMOTE_FEAT_CNF; + evt.hdr.status = status; + + evt.handle = handle; + evt.status = status; + + pBuf = evt.features; + UINT64_TO_BSTREAM(pBuf, pCtx->usedFeatSet); + + LL_TRACE_INFO2("### LlEvent ### LL_READ_REMOTE_FEAT_CNF, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of successful procedure. + * + * \param pCtx Connection context. + * \param proc Completed procedure. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyHostSuccess(lctrConnCtx_t *pCtx, uint8_t proc) +{ + if ((pCtx->llcpNotifyMask & (1 << proc)) == 0) + { + return; + } + + pCtx->llcpNotifyMask &= ~(1 << proc); + + switch (proc) + { + case LCTR_PROC_CMN_FEAT_EXCH: + lctrNotifyHostReadRemoteFeatCnf(pCtx, LL_SUCCESS); + break; + case LCTR_PROC_CMN_VER_EXCH: + lctrNotifyHostReadRemoteVerCnf(pCtx); + break; + case LCTR_PROC_CMN_DATA_LEN_UPD: + /* We have already notified the host if the effective lengths changed. */ + break; + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of failed procedure. + * + * \param pCtx Connection context. + * \param proc Complete procedure. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrNotifyHostReject(lctrConnCtx_t *pCtx, uint8_t proc) +{ + uint8_t reason; + + if ((pCtx->llcpNotifyMask & (1 << proc)) == 0) + { + return; + } + + pCtx->llcpNotifyMask &= ~(1 << proc); + + reason = LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE; + + switch (lctrDataPdu.opcode) + { + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + reason = lctrDataPdu.pld.rejInd.reason; + break; + case LL_PDU_UNKNOWN_RSP: + /* Do not transmit another length request if the peer does not recognize it. */ + if (proc == LCTR_PROC_CMN_DATA_LEN_UPD) + { + pCtx->usedFeatSet &= ~LL_FEAT_DATA_LEN_EXT; + } + break; + default: + break; + } + + switch (proc) + { + case LCTR_PROC_CMN_FEAT_EXCH: + lctrNotifyHostReadRemoteFeatCnf(pCtx, reason); + break; + case LCTR_PROC_CMN_DATA_LEN_UPD: + /* Do not notify host; the event has no status parameter. */ + break; + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute common LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if handled by this SM, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrLlcpExecuteCommonSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + uint8_t proc; + uint8_t llEvent = event; + + if ((event = lctrRemapCmnProcEvent(pCtx, event)) == LCTR_PROC_CMN_EVT_INVALID) + { + return FALSE; + } + + if ((proc = lctrGetCmnProcId(pCtx, llEvent)) == LCTR_PROC_INVALID) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrLlcpExecuteCommonSm: handle=%u, proc=%u, state=IDLE, event=%u", LCTR_GET_CONN_HANDLE(pCtx), proc, event); + + switch (event) + { + case LCTR_PROC_CMN_EVT_HOST_START: + pCtx->llcpNotifyMask |= 1 << proc; + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_API_PARAM); + /* no break */ + case LCTR_PROC_CMN_EVT_INT_START: + if (lctrFeatureAvail(pCtx, proc, event)) + { + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_SEND_REQ); + lctrStartLlcpTimer(pCtx); + pCtx->llcpActiveProc = proc; + pCtx->cmnState = LCTR_CMN_STATE_BUSY; + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + else + { + lctrNotifyHostReject(pCtx, proc); + } + break; + + case LCTR_PROC_CMN_EVT_INT_INCOMP: + case LCTR_PROC_CMN_EVT_RECV_IND: + case LCTR_PROC_CMN_EVT_RECV_REQ: + if (lctrFeatureAvail(pCtx, proc, event)) + { + if (event != LCTR_PROC_CMN_EVT_INT_INCOMP) + { + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_RECV_REQ); + } + + if (lctrCmnProcTbl[proc][LCTR_PROC_CMN_ACT_SEND_RSP]) + { + /* Procedure completes; no transition to BUSY. */ + lctrCmnProcTbl[proc][LCTR_PROC_CMN_ACT_SEND_RSP](pCtx); + } + else + { + /* No response; procedure completes at CE instant. */ + pCtx->llcpActiveProc = proc; + pCtx->llcpInstantComp = FALSE; + pCtx->cmnState = LCTR_CMN_STATE_BUSY; + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + } + else + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE, FALSE); + } + break; + + case LCTR_PROC_CMN_EVT_RECV_RSP: + case LCTR_PROC_CMN_EVT_PROC_COMP: + case LCTR_PROC_CMN_EVT_REJECT: + default: + /* No action required. */ + break; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrLlcpExecuteCommonSm: handle=%u, proc=%u, state=BUSY, event=%u", LCTR_GET_CONN_HANDLE(pCtx), proc, event); + + switch (event) + { + case LCTR_PROC_CMN_EVT_HOST_START: + case LCTR_PROC_CMN_EVT_INT_START: + if (lctrFeatureAvail(pCtx, proc, event)) + { + if (event == LCTR_PROC_CMN_EVT_HOST_START) + { + pCtx->llcpNotifyMask |= 1 << proc; + } + + if (pCtx->llcpActiveProc != proc) + { + LL_TRACE_INFO1("Pending procedure in progress: activeProc=%u", pCtx->llcpActiveProc); + pCtx->llcpPendMask |= 1 << proc; + } + if (event == LCTR_PROC_CMN_EVT_HOST_START) + { + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_API_PARAM); + } + if (proc == LCTR_PROC_CMN_TERM) + { + pCtx->llcpPendMask &= ~(1 << proc); + pCtx->llcpIncompMask |= 1 << proc; + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_SEND_REQ); + } + } + else + { + lctrNotifyHostReject(pCtx, proc); + } + break; + + case LCTR_PROC_CMN_EVT_RECV_IND: /* Completion from message */ + if (proc != pCtx->llcpActiveProc) + { + if (lctrFeatureAvail(pCtx, proc, event)) + { + LL_TRACE_WARN1("Procedure collision; pending incomplete request, activeProc=%u", pCtx->llcpActiveProc); + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_RECV_REQ); + pCtx->llcpIncompMask |= 1 << proc; + } + break; + } + /* no break */ + case LCTR_PROC_CMN_EVT_RECV_RSP: + if (proc == pCtx->llcpActiveProc) + { + /* Incoming procedure matches the active one. */ + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_RECV_RSP); + } + else if (pCtx->llcpPendMask & (1 << proc)) + { + /* Incoming procedure matches one of the pended one. */ + pCtx->llcpPendMask &= ~(1 << proc); + if (pCtx->llcpIsOverridden == TRUE) + { + pCtx->llcpIsOverridden = FALSE; + } + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_RECV_RSP); + lctrNotifyHostSuccess(pCtx, proc); + break; + } + else + { + LL_TRACE_ERR1("Unexpected response packet, expected llcpActiveProc=%u", pCtx->llcpActiveProc); + break; + } + /* no break */ + case LCTR_PROC_CMN_EVT_PROC_COMP: /* Completion from CE */ + case LCTR_PROC_CMN_EVT_REJECT: /* Failed completion */ + if (event == LCTR_PROC_CMN_EVT_REJECT) + { + lctrNotifyHostReject(pCtx, proc); + } + else + { + lctrNotifyHostSuccess(pCtx, proc); + } + + lctrStopLlcpTimer(pCtx); + + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + pCtx->cmnState = LCTR_CMN_STATE_IDLE; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + + lctrStartPendingLlcp(pCtx); + break; + + case LCTR_PROC_CMN_EVT_RECV_REQ: + LL_TRACE_WARN1("Procedure collision; pending incomplete request, activeProc=%u", pCtx->llcpActiveProc); + lctrExecAction(pCtx, proc, LCTR_PROC_CMN_ACT_RECV_REQ); + if ((pCtx->llcpActiveProc != LCTR_PROC_ENCRYPT) && + lctrCmnProcTbl[proc][LCTR_PROC_CMN_ACT_SEND_RSP]) + { + if (lctrFeatureAvail(pCtx, proc, event)) + { + lctrCmnProcTbl[proc][LCTR_PROC_CMN_ACT_SEND_RSP](pCtx); + } + else + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE, FALSE); + } + } + else + { + pCtx->llcpIncompMask |= 1 << proc; + } + break; + + default: + /* No action. */ + break; + } + break; + + default: + break; + } + + /* Enter terminating state if and only if TERMINATE_IND has been Rx'd or queued for Tx. */ + if (proc == LCTR_PROC_CMN_TERM) + { + if ((pCtx->llcpActiveProc == LCTR_PROC_CMN_TERM) || (pCtx->llcpIncompMask & (1 << LCTR_PROC_CMN_TERM))) + { + pCtx->state = LCTR_CONN_STATE_TERMINATING; /* update parent state */ + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Check if encryption can override common procedures. + * + * \param pCtx Connection context. + * + * \return TRUE if override possible, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvCheckEncOverrideCommonParam(lctrConnCtx_t *pCtx) +{ + bool_t result = FALSE; + + switch (pCtx->llcpActiveProc) + { + case LCTR_PROC_CMN_FEAT_EXCH: + case LCTR_PROC_CMN_VER_EXCH: + case LCTR_PROC_CMN_DATA_LEN_UPD: + result = TRUE; + break; + + default: + break; + } + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..6b3396a200ca6f413328095dc489ae8853dd49dc --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c @@ -0,0 +1,670 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "wsf_trace.h" + +#include <string.h> + +/************************************************************************************************** + Type Definitions +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief Connection parameter/update states. */ +enum +{ + LCTR_CU_STATE_IDLE, /*!< Idle state. */ + LCTR_CU_STATE_HOST_REPLY, /*!< Wait for host reply state. */ + LCTR_CU_STATE_CONN_PARAM_RSP, /*!< Wait for LL_CONN_PARAM_RSP state. */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /*!< Wait for connection update instant state. */ + LCTR_CU_STATE_TOTAL /*!< Total connection parameter/update states. */ +}; + +/*! \brief Connection parameter/update events. */ +enum +{ + LCTR_CU_EVENT_HOST_CONN_UPD, /*!< Received host connection update command. */ + LCTR_CU_EVENT_HOST_REPLY, /*!< Received host connection parameter reply. */ + LCTR_CU_EVENT_HOST_NEG_REPLY, /*!< Received host connection parameter negative reply. */ + LCTR_CU_EVENT_PEER_CONN_PARAM_REQ, /*!< Received peer LL_CONN_PARAM_REQ. */ + LCTR_CU_EVENT_PEER_CONN_PARAM_RSP, /*!< Received peer LL_CONN_PARAM_RSP. */ + LCTR_CU_EVENT_PEER_REJECT, /*!< Received peer LL_REJECT_IND OR LL_UNKNOWN_RSP. */ + LCTR_CU_EVENT_INT_PROC_COMP, /*!< Procedure completion event. */ + LCTR_CU_EVENT_INT_SKIP_CONN_PARAM, /*!< Skip connection parameter procedure. */ + LCTR_CU_EVENT_INT_START_CONN_UPD, /*!< Start pending host connection update procedure. */ + LCTR_CU_EVENT_INT_START_CONN_PARAM, /*!< Start pending peer connection parameter procedure. */ + LCTR_CU_EVENT_INT_REJECT_CONN_UPD, /*!< Reject connection update procedure. */ + LCTR_CU_EVENT_TOTAL, /*!< Total connection parameter/update states. */ + LCTR_CU_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Master LLCP state machine table. */ +LctrLlcpHdlr_t lctrMstLlcpSmTbl[LCTR_LLCP_SM_TOTAL]; + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start connection update. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartConnUpd(lctrConnCtx_t *pCtx) +{ +#if (LL_ENABLE_TESTER) + if (llTesterCb.connUpdIndEnabled) + { + /* Transition SM to send LL_CONN_UPD_IND. */ + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_SKIP_CONN_PARAM); + return; + } +#endif + + /* Zero values to ignore connParamReq fields if bypassed. */ + memset(&pCtx->connParam, 0, sizeof(pCtx->connParam)); + + if (pCtx->usedFeatSet & LL_FEAT_CONN_PARAM_REQ_PROC) + { + lctrSendConnParamReq(pCtx); + lctrStartLlcpTimer(pCtx); + } + else + { + /* Transition SM to send LL_CONN_UPD_IND. */ + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_SKIP_CONN_PARAM); + } +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host connection update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostConnUpd(lctrConnCtx_t *pCtx) +{ + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CONN_UPD; + lctrStoreConnUpdateSpec(pCtx); + lctrActStartConnUpd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host connection update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerConnParam(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk |= LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrStoreConnParamReq(pCtx); + lctrNotifyHostConnParamInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start connection parameter command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartConnParam(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk |= LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrNotifyHostConnParamInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for host reply command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostReply(lctrConnCtx_t *pCtx) +{ + pCtx->peerReplyWaiting = TRUE; + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrStopLlcpTimer(pCtx); + lctrStoreConnParamSpec(pCtx); + lctrSendConnUpdateInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_CONN_PARAM_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerConnParamRsp(lctrConnCtx_t *pCtx) +{ + pCtx->peerReplyWaiting = TRUE; + lctrStopLlcpTimer(pCtx); + lctrStoreConnParamRsp(pCtx); + lctrSendConnUpdateInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for skipping peer LL_CONN_PARAM_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActSkipConnParamRsp(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + lctrSendConnUpdateInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connection update with disallowed status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActConnUpdDisallow(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested connection update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostConnUpdateInd(pCtx, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Send peer LL_REJECT_IND due to pending operation. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActRejectCollision(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Peer requested connection parameter/update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION, TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of local rejected connection parameter procedure. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActLocalRejectConnParam(lctrConnCtx_t *pCtx) +{ + if (pCtx->llcpNotifyMask &= (1 << LCTR_PROC_CONN_UPD)) + { + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CONN_UPD); + lctrNotifyHostConnUpdateInd(pCtx, LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL); + } + + if (pCtx->peerReplyWaiting) + { + pCtx->peerReplyWaiting = FALSE; + lctrSendRejectInd(pCtx, LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL, TRUE); + } +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrMstConnUpdActionTbl[LCTR_CU_STATE_TOTAL][LCTR_CU_EVENT_TOTAL] = +{ + { /* LCTR_CU_STATE_IDLE */ + lctrActHostConnUpd, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActPeerConnParam, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + NULL, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + NULL, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + NULL, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + lctrActStartConnUpd, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + lctrActStartConnParam, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + NULL /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_HOST_REPLY */ + lctrActHostConnUpd, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + lctrActHostReply, /* LCTR_CU_EVENT_HOST_REPLY */ + lctrActHostNegReply, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + NULL, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + NULL, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + NULL, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + NULL, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + NULL /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_PARAM_RSP */ + lctrActConnUpdDisallow, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + lctrActPeerConnParamRsp, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + lctrActPeerRejectConnParam, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + lctrActSkipConnParamRsp, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + NULL /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_INSTANT */ + lctrActConnUpdDisallow, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + NULL, /* LCTR_CU_EVENT_PEER_REJECT */ + lctrActNotifyHostConnUpdSuccess, /* LCTR_CU_EVENT_INT_PROC_COMP */ + NULL, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + NULL, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + lctrActLocalRejectConnParam /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrMstConnUpdNextStateTbl[LCTR_CU_STATE_TOTAL][LCTR_CU_EVENT_TOTAL] = +{ + { /* LCTR_CU_STATE_IDLE */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + LCTR_CU_STATE_IDLE /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_HOST_REPLY */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + LCTR_CU_STATE_HOST_REPLY /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_PARAM_RSP */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + LCTR_CU_STATE_CONN_PARAM_RSP, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + LCTR_CU_STATE_CONN_PARAM_RSP /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_INSTANT */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_PARAM_RSP */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_INT_SKIP_CONN_PARAM */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_INT_START_CONN_PARAM */ + LCTR_CU_STATE_IDLE /* LCTR_CU_EVENT_INT_REJECT_CONN_UPD */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute action function. + * + * \param pCtx Connection context. + * \param event Event ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExecAction(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (lctrMstConnUpdActionTbl[pCtx->connUpdState][event]) + { + lctrMstConnUpdActionTbl[pCtx->connUpdState][event](pCtx); + } + + pCtx->connUpdState = lctrMstConnUpdNextStateTbl[pCtx->connUpdState][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped connection update/parameter LLCP procedure event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Connection update/parameter LLCP procedure event ID. + * + * This routine remaps events for the connection update LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrMstConnUpdRemapEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_CONN_PARAM_REQ: + return LCTR_CU_EVENT_PEER_CONN_PARAM_REQ; + case LL_PDU_CONN_PARAM_RSP: + return LCTR_CU_EVENT_PEER_CONN_PARAM_RSP; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType == LL_PDU_CONN_PARAM_REQ) + { + return LCTR_CU_EVENT_INT_SKIP_CONN_PARAM; + } + /* Not for this SM. */ + break; + case LL_PDU_REJECT_IND: + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + return LCTR_CU_EVENT_INT_SKIP_CONN_PARAM; + } + /* Probably not for this SM. */ + break; + case LL_PDU_REJECT_EXT_IND: + if (lctrDataPdu.pld.rejInd.opcode == LL_PDU_CONN_PARAM_REQ) + { + return LCTR_CU_EVENT_INT_SKIP_CONN_PARAM; + } + /* Not for this SM. */ + break; + + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_CONN_UPDATE: + return LCTR_CU_EVENT_HOST_CONN_UPD; + case LCTR_CONN_MSG_API_CONN_PARAM_REPLY: + return LCTR_CU_EVENT_HOST_REPLY; + case LCTR_CONN_MSG_API_CONN_PARAM_NEG_REPLY: + return LCTR_CU_EVENT_HOST_NEG_REPLY; + + /*** Internal messages ***/ + + case LCTR_CONN_LLCP_PROC_CMPL: + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + return LCTR_CU_EVENT_INT_PROC_COMP; + } + break; + case LCTR_CONN_LLCP_SKIP_CONN_PARAM: + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + return LCTR_CU_EVENT_INT_SKIP_CONN_PARAM; + } + break; + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask == (1 << LCTR_PROC_CONN_UPD)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_CONN_UPD); + return LCTR_CU_EVENT_INT_START_CONN_UPD; + } + if (pCtx->llcpPendMask == (1 << LCTR_PROC_CONN_PARAM)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_CONN_PARAM); + return LCTR_CU_EVENT_INT_START_CONN_PARAM; + } + break; + case LCTR_CONN_LLCP_REJECT_CONN_UPD: + return LCTR_CU_EVENT_INT_REJECT_CONN_UPD; + default: + break; + } + + return LCTR_CU_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve procedure collision. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrResolveCollision(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CU_EVENT_PEER_CONN_PARAM_REQ: + if (pCtx->llcpActiveProc == LCTR_PROC_ENCRYPT) + { + lctrStoreConnParamReq(pCtx); + pCtx->llcpPendMask |= 1 << LCTR_PROC_CONN_PARAM; + LL_TRACE_INFO2("Pending CONN_PARAM=%u procedure: activeProc=%u", LCTR_PROC_CONN_PARAM, pCtx->llcpActiveProc); + } + else + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION, TRUE); + } + break; + + case LCTR_CU_EVENT_HOST_CONN_UPD: + lctrStoreConnUpdateSpec(pCtx); + pCtx->llcpPendMask |= 1 << LCTR_PROC_CONN_UPD; + LL_TRACE_INFO2("Pending CONN_UPD=%u procedure: activeProc=%u", LCTR_PROC_CONN_UPD, pCtx->llcpActiveProc); + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if active procedure can be overridden with connection update procedure. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return None. + * + * This routine will pend the active procedure and allow the connection update procedure to + * override it. + */ +/*************************************************************************************************/ +static void lctrMstCheckProcOverride(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CU_EVENT_PEER_CONN_PARAM_REQ: + /* Only the procedure without instant fields can be overridden. */ + switch (pCtx->llcpActiveProc) + { + case LCTR_PROC_CMN_VER_EXCH: + case LCTR_PROC_CMN_FEAT_EXCH: + case LCTR_PROC_CMN_DATA_LEN_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_CONN_UPD; + pCtx->llcpIsOverridden = TRUE; + break; + + default: + break; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute master connection update LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstLlcpExecuteConnUpdSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if ((event = lctrMstConnUpdRemapEvent(pCtx, event)) == LCTR_CU_EVENT_INVALID) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrMstLlcpExecuteConnUpdSm: handle=%u, llcpState=IDLE, connUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->connUpdState, event); + + lctrExecAction(pCtx, event); + + if (pCtx->connUpdState != LCTR_CU_STATE_IDLE) + { + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + pCtx->llcpActiveProc = LCTR_PROC_CONN_UPD; + pCtx->llcpInstantComp = FALSE; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrMstLlcpExecuteConnUpdSm: handle=%u, llcpState=BUSY, connUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->connUpdState, event); + + lctrMstCheckProcOverride(pCtx, event); + + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + lctrExecAction(pCtx, event); + + if (pCtx->connUpdState == LCTR_CU_STATE_IDLE) + { + lctrStopLlcpTimer(pCtx); + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_CONN_PARAM_REQ; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + lctrResolveCollision(pCtx, event); + } + + break; + + default: + break; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Execute master LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrMstLlcpExecuteSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + /* Override state machine */ + switch (event) + { + case LCTR_CONN_MSG_API_REMOTE_VERSION: + if (pCtx->remoteVerValid) + { + /* Use cached remote version data. */ + lctrNotifyHostReadRemoteVerCnf(pCtx); + return; + } + break; + default: + break; + } + + if (!(lctrMstLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT] && lctrMstLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT](pCtx, event)) && + !(lctrMstLlcpSmTbl[LCTR_LLCP_SM_PING] && lctrMstLlcpSmTbl[LCTR_LLCP_SM_PING](pCtx, event)) && + !(lctrMstLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD] && lctrMstLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD](pCtx, event)) && + !(lctrMstLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD] && lctrMstLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD](pCtx, event)) && + !(lctrMstLlcpSmTbl[LCTR_LLCP_SM_CMN] && lctrMstLlcpSmTbl[LCTR_LLCP_SM_CMN](pCtx, event))) + { + lctrLlcpStatelessEventHandler(pCtx, event); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..14babe9fda47c03973884f0fa824bc114986a133 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c @@ -0,0 +1,739 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_conn_slave.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Type Definitions +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief Slave connection parameter/update states. */ +enum +{ + LCTR_CU_STATE_IDLE, /*!< Idle state. */ + LCTR_CU_STATE_HOST_REPLY, /*!< Wait for host reply state. */ + LCTR_CU_STATE_CONN_UPD_IND, /*!< Wait for LL_CONN_PARAM_REQ state. */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /*!< Wait for connection update instant state. */ + LCTR_CU_STATE_TOTAL /*!< Total connection parameter/update states. */ +}; + +/*! \brief Connection parameter/update events. */ +enum +{ + LCTR_CU_EVENT_HOST_CONN_UPD, /*!< Received host connection update command. */ + LCTR_CU_EVENT_PEER_CONN_PARAM_REQ, /*!< Received peer LL_CONN_PARAM_REQ. */ + LCTR_CU_EVENT_HOST_REPLY, /*!< Received host connection parameter reply. */ + LCTR_CU_EVENT_HOST_NEG_REPLY, /*!< Received host connection parameter negative reply. */ + LCTR_CU_EVENT_PEER_CONN_UPD_IND, /*!< Received peer LL_CONN_UPD_IND. */ + LCTR_CU_EVENT_PEER_REJECT, /*!< Received peer LL_REJECT_IND OR LL_UNKNOWN_RSP. */ + LCTR_CU_EVENT_INT_PROC_COMP, /*!< Procedure completion event. */ + LCTR_CU_EVENT_INT_START_CONN_UPD, /*!< Start pending connection update procedure. */ + LCTR_CU_EVENT_TOTAL, /*!< Total connection parameter/update states. */ + LCTR_CU_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Slave LLCP state machine table. */ +LctrLlcpHdlr_t lctrSlvLlcpSmTbl[LCTR_LLCP_SM_TOTAL]; + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start connection update. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartConnUpd(lctrConnCtx_t *pCtx) +{ + if (pCtx->usedFeatSet & LL_FEAT_CONN_PARAM_REQ_PROC) + { + lctrSendConnParamReq(pCtx); + lctrStartLlcpTimer(pCtx); + } + else + { + lctrNotifyHostConnUpdateInd(pCtx, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE); + LL_TRACE_WARN1("Connection parameter request feature not supported by connection, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host connection update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostConnUpd(lctrConnCtx_t *pCtx) +{ + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_CONN_UPD; + lctrStoreConnUpdateSpec(pCtx); + lctrActStartConnUpd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host connection update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerConnParam(lctrConnCtx_t *pCtx) +{ + lctrStoreConnParamReq(pCtx); + + pCtx->replyWaitingMsk |= LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrNotifyHostConnParamInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host connection update command with collision. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerConnParamWithCollision(lctrConnCtx_t *pCtx) +{ + lctrActPeerConnParam(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_CONN_IND. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerConnInd(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + lctrStoreConnUpdate(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for host reply command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostReply(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrSendConnParamRsp(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for host negative reply command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActHostNegReply(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_CONN_PARAM_REQ; + lctrSendRejectInd(pCtx, pLctrConnMsg->connParamNegReply.reason, TRUE); + lctrStopLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of peer rejected connection parameter procedure. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActPeerRejectConnParam(lctrConnCtx_t *pCtx) +{ + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CONN_UPD); + + switch (lctrDataPdu.opcode) + { + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + LL_TRACE_WARN2("Peer rejected connection parameter request, handle=%u, reason=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.pld.rejInd.reason); + lctrNotifyHostConnUpdateInd(pCtx, lctrDataPdu.pld.rejInd.reason); + break; + case LL_PDU_UNKNOWN_RSP: + LL_TRACE_WARN1("Peer rejected connection parameter request, handle=%u, reason=UNSUPPORTED_REMOTE_FEATURE", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostConnUpdateInd(pCtx, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE); + break; + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connection update with success status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActNotifyHostConnUpdSuccess(lctrConnCtx_t *pCtx) +{ + if (pCtx->llcpNotifyMask & (1 << LCTR_PROC_CONN_UPD)) + { + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_CONN_UPD); + lctrNotifyHostConnUpdateInd(pCtx, LL_SUCCESS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host connection completed due to colliding connection parameter from peer. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActNotifyHostColliding(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested connection update collided with peer, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostConnUpdateInd(pCtx, lctrDataPdu.pld.rejInd.reason); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connection update with disallowed status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActConnUpdDisallow(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested connection update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostConnUpdateInd(pCtx, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Send peer LL_REJECT_IND due to pending operation. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActRejectCollision(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Peer requested connection parameter/update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION, TRUE); +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrSlvConnUpdActionTbl[LCTR_CU_STATE_TOTAL][LCTR_CU_EVENT_TOTAL] = +{ + { /* LCTR_CU_STATE_IDLE */ + lctrActHostConnUpd, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + lctrActPeerConnParam, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActPeerConnInd, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + NULL, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + lctrActStartConnUpd /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_HOST_REPLY */ + lctrActConnUpdDisallow, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + lctrActHostReply, /* LCTR_CU_EVENT_HOST_REPLY */ + lctrActHostNegReply, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + lctrActNotifyHostColliding, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + lctrActStartConnUpd /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_IND */ + lctrActConnUpdDisallow, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + lctrActPeerConnParamWithCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActPeerConnInd, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + lctrActPeerRejectConnParam, /* LCTR_CU_EVENT_PEER_REJECT */ + NULL, /* LCTR_CU_EVENT_INT_PROC_COMP */ + NULL /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_INSTANT */ + lctrActConnUpdDisallow, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + NULL, /* LCTR_CU_EVENT_HOST_REPLY */ + NULL, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + lctrActRejectCollision, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + NULL, /* LCTR_CU_EVENT_PEER_REJECT */ + lctrActNotifyHostConnUpdSuccess, /* LCTR_CU_EVENT_INT_PROC_COMP */ + NULL /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrSlvConnUpdNextStateTbl[LCTR_CU_STATE_TOTAL][LCTR_CU_EVENT_TOTAL] = +{ + { /* LCTR_CU_STATE_IDLE */ + LCTR_CU_STATE_CONN_UPD_IND, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_IDLE /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_HOST_REPLY */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_CONN_UPD_IND, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_HOST_REPLY /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_IND */ + LCTR_CU_STATE_CONN_UPD_IND, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_HOST_REPLY, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_CONN_UPD_IND, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_CONN_UPD_IND, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_CONN_UPD_IND /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + }, + { /* LCTR_CU_STATE_CONN_UPD_INSTANT */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_CONN_UPD */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_PARAM_REQ */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_HOST_NEG_REPLY */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_CONN_UPD_IND */ + LCTR_CU_STATE_CONN_UPD_INSTANT, /* LCTR_CU_EVENT_PEER_REJECT */ + LCTR_CU_STATE_IDLE, /* LCTR_CU_EVENT_INT_PROC_COMP */ + LCTR_CU_STATE_CONN_UPD_INSTANT /* LCTR_CU_EVENT_INT_START_CONN_UPD */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute action function. + * + * \param pCtx Connection context. + * \param event Event ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExecAction(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (lctrSlvConnUpdActionTbl[pCtx->connUpdState][event]) + { + lctrSlvConnUpdActionTbl[pCtx->connUpdState][event](pCtx); + } + + pCtx->connUpdState = lctrSlvConnUpdNextStateTbl[pCtx->connUpdState][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped connection update/parameter LLCP procedure event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Connection update/parameter LLCP procedure event ID. + * + * This routine remaps events for the connection update LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrSlvConnUpdRemapEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_CONN_UPDATE_IND: + return LCTR_CU_EVENT_PEER_CONN_UPD_IND; + case LL_PDU_CONN_PARAM_REQ: + return LCTR_CU_EVENT_PEER_CONN_PARAM_REQ; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType == LL_PDU_CONN_PARAM_REQ) + { + return LCTR_CU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + case LL_PDU_REJECT_IND: + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + return LCTR_CU_EVENT_PEER_REJECT; + } + /* Probably not for this SM. */ + break; + case LL_PDU_REJECT_EXT_IND: + if (lctrDataPdu.pld.rejInd.opcode == LL_PDU_CONN_PARAM_REQ) + { + return LCTR_CU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_CONN_UPDATE: + return LCTR_CU_EVENT_HOST_CONN_UPD; + case LCTR_CONN_MSG_API_CONN_PARAM_REPLY: + return LCTR_CU_EVENT_HOST_REPLY; + case LCTR_CONN_MSG_API_CONN_PARAM_NEG_REPLY: + return LCTR_CU_EVENT_HOST_NEG_REPLY; + + /*** Internal messages ***/ + + case LCTR_CONN_LLCP_PROC_CMPL: + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + return LCTR_CU_EVENT_INT_PROC_COMP; + } + break; + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask == (1 << LCTR_PROC_CONN_UPD)) + { + /* Connection update SM is pending; continue the procedure. */ + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_CONN_UPD); + return LCTR_CU_EVENT_INT_START_CONN_UPD; + } + break; + + default: + break; + } + + return LCTR_CU_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve procedure collision. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrResolveCollision(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CU_EVENT_PEER_CONN_UPD_IND: + LL_TRACE_WARN2("Rejecting CONN_UPD=%u procedure: activeProc=%u, reason=DIFFERENT_TRANSACTION_COLLISION", LCTR_PROC_CONN_UPD, pCtx->llcpActiveProc); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION, FALSE); + break; + + case LCTR_CU_EVENT_PEER_CONN_PARAM_REQ: + LL_TRACE_WARN2("Rejecting CONN_PARAM=%u procedure: activeProc=%u, reason=DIFFERENT_TRANSACTION_COLLISION", LCTR_PROC_CONN_PARAM, pCtx->llcpActiveProc); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION, TRUE); + break; + + case LCTR_CU_EVENT_HOST_CONN_UPD: + lctrStoreConnUpdateSpec(pCtx); + pCtx->llcpPendMask |= 1 << LCTR_PROC_CONN_UPD; + LL_TRACE_INFO2("Pending CONN_UPD=%u procedure: activeProc=%u", LCTR_PROC_CONN_UPD, pCtx->llcpActiveProc); + break; + + case LCTR_CU_EVENT_PEER_REJECT: + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_CONN_UPD); + if (pCtx->connUpdState != LCTR_CU_STATE_IDLE) + { + pCtx->connUpdState = LCTR_CU_STATE_IDLE; + } + lctrNotifyHostConnUpdateInd(pCtx, lctrDataPdu.pld.rejInd.reason); + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if active procedure can be overridden with connection update procedure. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return None. + * + * This routine will pend the active procedure and allow the connection update procedure to + * override it. + */ +/*************************************************************************************************/ +static void lctrSlvCheckProcOverride(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CU_EVENT_PEER_CONN_UPD_IND: + case LCTR_CU_EVENT_PEER_CONN_PARAM_REQ: + /* Only the procedure without instant fields can be overridden. */ + switch (pCtx->llcpActiveProc) + { + case LCTR_PROC_CMN_VER_EXCH: + case LCTR_PROC_CMN_FEAT_EXCH: + case LCTR_PROC_CMN_DATA_LEN_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_CONN_UPD; + pCtx->llcpIsOverridden = TRUE; + break; + case LCTR_PROC_PHY_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_CONN_UPD; + break; + default: + break; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute slave connection update LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if event belongs to this SM. + */ +/*************************************************************************************************/ +bool_t lctrSlvLlcpExecuteConnUpdSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if ((event = lctrSlvConnUpdRemapEvent(pCtx, event)) == LCTR_CU_EVENT_INVALID) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrSlvLlcpExecuteConnUpdSm: handle=%u, llcpState=IDLE, connUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->connUpdState, event); + lctrExecAction(pCtx, event); + + if (pCtx->connUpdState != LCTR_CU_STATE_IDLE) + { + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + pCtx->llcpActiveProc = LCTR_PROC_CONN_UPD; + pCtx->llcpInstantComp = FALSE; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrSlvLlcpExecuteConnUpdSm: handle=%u, llcpState=BUSY, connUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->connUpdState, event); + + lctrSlvCheckProcOverride(pCtx, event); + + if (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) + { + lctrExecAction(pCtx, event); + + if (pCtx->connUpdState == LCTR_CU_STATE_IDLE) + { + lctrStopLlcpTimer(pCtx); + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_CONN_PARAM_REQ; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + lctrResolveCollision(pCtx, event); + } + + break; + + default: + break; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Execute stateless LLCP event handler. + * + * \param pCtx Connection context. + * \param event Control event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrLlcpStatelessEventHandler(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_CONN_MSG_RX_LLCP_UNKNOWN: + LL_TRACE_WARN2("Received unknown LLCP packet handle=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.opcode); + lctrSendUnknownRsp(pCtx); + break; + case LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM: + LL_TRACE_WARN2("Received LLCP packet with invalid parameter handle=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.opcode); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_INVALID_LMP_PARAMS, FALSE); + break; + case LCTR_CONN_TERM_INST_PASSED: + lctrStoreInstantPassedTerminateReason(pCtx); + lctrFlagLinkTerm(pCtx); + break; + case LCTR_CONN_TMR_LLCP_RSP_EXP: + lctrStoreLlcpTimeoutTerminateReason(pCtx); + lctrFlagLinkTerm(pCtx); + break; + case LCTR_CONN_MSG_RX_LLCP: + /* Mismatch between parser and available SM. */ + LL_TRACE_WARN2("Unhandled LLCP packet handle=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.opcode); + break; + case LCTR_CONN_LLCP_START_PENDING: + /* No action required. */ + break; + default: + LL_TRACE_WARN2("Unhandled LLCP SM event, handle=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), event); + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute slave LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrSlvLlcpExecuteSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + /* Override state machine */ + switch (event) + { + case LCTR_CONN_MSG_API_REMOTE_VERSION: + if (pCtx->remoteVerValid) + { + /* Use cached remote version data. */ + lctrNotifyHostReadRemoteVerCnf(pCtx); + return; + } + break; + default: + break; + } + + if (!(lctrSlvLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT] && lctrSlvLlcpSmTbl[LCTR_LLCP_SM_ENCRYPT](pCtx, event)) && + !(lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PING] && lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PING](pCtx, event)) && + !(lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD] && lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CONN_UPD](pCtx, event)) && + !(lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD] && lctrSlvLlcpSmTbl[LCTR_LLCP_SM_PHY_UPD](pCtx, event)) && + !(lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CMN] && lctrSlvLlcpSmTbl[LCTR_LLCP_SM_CMN](pCtx, event))) + { + lctrLlcpStatelessEventHandler(pCtx, event); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if encryption can override connection update procedure. + * + * \param pCtx Connection context. + * + * \return TRUE if override possible, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvCheckEncOverrideConnParam(lctrConnCtx_t *pCtx) +{ + if ((pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) && + (pCtx->connUpdState == LCTR_CU_STATE_CONN_UPD_IND)) + { + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check if Slave connection update state machine is at CONN_UPD_INSTANT. + * + * \param pCtx Connection context. + * + * \return TRUE if state machine is at CONN_UPD_INSTANT, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvCheckConnUpdInstant(lctrConnCtx_t *pCtx) +{ + return (pCtx->connUpdState == LCTR_CU_STATE_CONN_UPD_INSTANT); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..00fe32f10d847837c0bb8e4aa82b4e8303b9b81f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c @@ -0,0 +1,642 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master encryption connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_enc_master.h" +#include "lctr_int_enc_slave.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief Encryption states. */ +enum +{ + LCTR_ENC_STATE_UNENCRYPTED, /*!< Connection established, unencrypted. */ + LCTR_ENC_STATE_FLUSH_START, /*!< Wait for Tx queue flush on encryption start. */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /*!< Wait for LL_ENC_RSP from peer. */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /*!< Wait for LL_START_ENC_REQ from peer. */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /*!< Wait for LL_START_ENC_RSP from peer. */ + LCTR_ENC_STATE_ENCRYPTED, /*!< Connection encrypted. */ + LCTR_ENC_STATE_FLUSH_RESTART, /*!< Wait for Tx queue flush on encryption restart. */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /*!< Wait for LL_PAUSE_ENC_RSP from peer. */ + LCTR_ENC_STATE_TOTAL /*!< Total encryption states. */ +}; + +/*! \brief Encryption events. */ +enum +{ + LCTR_ENC_EVENT_HOST_START_ENC, /*!< Received host start encryption command. */ + LCTR_ENC_EVENT_PEER_ENC_RSP, /*!< Received peer LL_ENC_RSP. */ + LCTR_ENC_EVENT_PEER_START_ENC_REQ, /*!< Received peer LL_START_ENC_REQ. */ + LCTR_ENC_EVENT_PEER_START_ENC_RSP, /*!< Received peer LL_START_ENC_RSP. */ + LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP, /*!< Received peer LL_PAUSE_ENC_RSP. */ + LCTR_ENC_EVENT_ARQ_FLUSHED, /*!< Internal ARQ queue flushed. */ + LCTR_ENC_EVENT_PEER_REJECT, /*!< Received peer LL_REJECT_IND. */ + LCTR_ENC_EVENT_TOTAL, /*!< Total encryption states. */ + LCTR_ENC_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Notify host of encryption change with disallowed status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActEncChangeDisallow(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested encryption while encryption procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyEncChangeInd(pCtx, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host start encryption command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartEnc(lctrConnCtx_t *pCtx) +{ + lctrPauseTxData(pCtx); + lctrCheckPauseComplete(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action Tx data queue flushed on encryption start. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActTxFlushedOnStart(lctrConnCtx_t *pCtx) +{ + lctrDisableTxDataEnc(pCtx); + lctrDisableRxDataEnc(pCtx); + lctrSendEncReq(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_ENC_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerEncRsp(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + lctrStoreSlvVectors(pCtx); + lctrCalcSessionKey(pCtx); + lctrPauseRxData(pCtx); + + /* Expect a LL_START_ENC_REQ or time out. */ + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_START_ENC_REQ. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerStartEncReq(lctrConnCtx_t *pCtx) +{ + lctrEnableTxDataEnc(pCtx); + lctrEnableRxDataEnc(pCtx); + lctrSendStartEncRsp(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_START_ENC_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerStartEncRsp(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + lctrUnpauseTxData(pCtx); + lctrUnpauseRxData(pCtx); + + (pCtx->keyUpdFlag) ? lctrNotifyEncKeyRefreshInd(pCtx) : lctrNotifyEncChangeInd(pCtx, LL_SUCCESS); + pCtx->keyUpdFlag = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host refresh key. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActRefreshEncKey(lctrConnCtx_t *pCtx) +{ + lctrPauseTxData(pCtx); + lctrCheckPauseComplete(pCtx); + + pCtx->keyUpdFlag = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Action Tx data queue flushed on encryption restart. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActTxFlushedOnRestart(lctrConnCtx_t *pCtx) +{ + lctrSendPauseEncReq(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_PAUSE_ENC_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPauseEncRsp(lctrConnCtx_t *pCtx) +{ + lctrDisableTxDataEnc(pCtx); + lctrDisableRxDataEnc(pCtx); + lctrPauseRxData(pCtx); + lctrSendPauseEncRsp(pCtx); + lctrSendEncReq(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_REJECT_IND. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerEncReject(lctrConnCtx_t *pCtx) +{ + uint8_t reason; + + lctrStopLlcpTimer(pCtx); + lctrUnpauseTxData(pCtx); + lctrUnpauseRxData(pCtx); + + reason = (lctrDataPdu.opcode == LL_PDU_UNKNOWN_RSP) ? + LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE : + lctrDataPdu.pld.rejInd.reason; + + LL_TRACE_WARN2("Peer rejected start/restart encryption, handle=%u, reason=%u", LCTR_GET_CONN_HANDLE(pCtx), reason); + + lctrNotifyEncChangeInd(pCtx, reason); + + pCtx->keyUpdFlag = FALSE; +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrMstEncActionTbl[LCTR_ENC_STATE_TOTAL][LCTR_ENC_EVENT_TOTAL] = +{ + { /* LCTR_ENC_STATE_UNENCRYPTED */ + lctrActStartEnc, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + NULL /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_FLUSH_START */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + lctrActTxFlushedOnStart, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + lctrActPeerEncReject /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_LL_ENC_RSP */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrActPeerEncRsp, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + lctrActPeerEncReject /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_REQ */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrActPeerStartEncReq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + lctrActPeerEncReject /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_RSP */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrActPeerStartEncRsp, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + lctrActPeerEncReject /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_ENCRYPTED */ + lctrActRefreshEncKey, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + NULL /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_FLUSH_RESTART */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + lctrActTxFlushedOnRestart, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + NULL /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP */ + lctrActEncChangeDisallow, /* LCTR_ENC_EVENT_HOST_START_ENC */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrActPeerPauseEncRsp, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + NULL /* LCTR_ENC_EVENT_PEER_REJECT */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrMstEncNextStateTbl[LCTR_ENC_STATE_TOTAL][LCTR_ENC_EVENT_TOTAL] = +{ + { /* LCTR_ENC_STATE_UNENCRYPTED */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_FLUSH_START */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_LL_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_REQ, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_ENCRYPTED */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_ENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_FLUSH_RESTART */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_PEER_REJECT */ + }, + { /* LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_HOST_START_ENC */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_PEER_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_REQ */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_LL_ENC_RSP, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP, /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_RSP /* LCTR_ENC_EVENT_PEER_REJECT */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Get remapped encryption LLCP procedure event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Encryption LLCP procedure event ID. + * + * This routine remaps events for the encryption LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrMstRemapEncryptEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_ENC_RSP: + return LCTR_ENC_EVENT_PEER_ENC_RSP; + case LL_PDU_START_ENC_REQ: + return LCTR_ENC_EVENT_PEER_START_ENC_REQ; + case LL_PDU_START_ENC_RSP: + return LCTR_ENC_EVENT_PEER_START_ENC_RSP; + case LL_PDU_PAUSE_ENC_RSP: + return LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType == LL_PDU_ENC_REQ) + { + return LCTR_ENC_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + case LL_PDU_REJECT_IND: + if (pCtx->llcpActiveProc == LCTR_PROC_ENCRYPT) + { + return LCTR_ENC_EVENT_PEER_REJECT; + } + /* Probably not for this SM. */ + break; + case LL_PDU_REJECT_EXT_IND: + if (lctrDataPdu.pld.rejInd.opcode == LL_PDU_ENC_REQ) + { + return LCTR_ENC_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_START_ENC: + return LCTR_ENC_EVENT_HOST_START_ENC; + + /*** Internal messages ***/ + + case LCTR_CONN_ARQ_Q_FLUSHED: + if (pCtx->llcpActiveProc == LCTR_PROC_ENCRYPT) + { + return LCTR_ENC_EVENT_ARQ_FLUSHED; + } + break; + + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask & (1 << LCTR_PROC_ENCRYPT)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_ENCRYPT); + return LCTR_ENC_EVENT_HOST_START_ENC; + } + break; + + default: + break; + } + + return LCTR_ENC_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Execute encryption master LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t lctrMstEncryptSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + bool_t result; + + if (lctrMstEncActionTbl[pCtx->encState][event]) + { + lctrMstEncActionTbl[pCtx->encState][event](pCtx); + } + + pCtx->encState = lctrMstEncNextStateTbl[pCtx->encState][event]; + + switch (pCtx->encState) + { + /* IDLE states. */ + case LCTR_ENC_STATE_UNENCRYPTED: + case LCTR_ENC_STATE_ENCRYPTED: + result = FALSE; + break; + + /* BUSY states. */ + default: + result = TRUE; + break; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Execute encryption master LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if handled by this SM, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstExecuteEncryptSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (pCtx->pauseRxData == TRUE) /* During encryption start or encryption pause. */ + { + switch(event) + { + case LCTR_CONN_MSG_RX_LLCP: + switch(lctrDataPdu.opcode) + { + /* Allowed PDUs. */ + case LL_PDU_TERMINATE_IND: + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + case LL_PDU_ENC_RSP: + case LL_PDU_START_ENC_REQ: + case LL_PDU_START_ENC_RSP: + case LL_PDU_PAUSE_ENC_RSP: + case LL_PDU_UNKNOWN_RSP: + break; + + /* Illegal PDUs. */ + default: + LL_TRACE_WARN2("Unexpected PDU received during encryption procedure, handle=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.opcode); + lctrInvalidEncPduSeq(pCtx); + return FALSE; + } + break; + + case LCTR_CONN_MSG_RX_LLCP_UNKNOWN: + case LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM: + LL_TRACE_WARN1("Unknown/Invalid PDU received during encryption procedure event=%u", event); + lctrInvalidEncPduSeq(pCtx); /* Transit to standby state and notify the host */ + return TRUE; /* Skip the lctrLlcpStatelessEventHandler */ + + default: + break; + } + } + + /* Save host parameters. */ + if (((pCtx->llcpState == LCTR_LLCP_STATE_IDLE) || /* only when encryption start not active */ + /* otherwise this will be rejected */ + ((pCtx->llcpState == LCTR_LLCP_STATE_BUSY) && (pCtx->llcpActiveProc != LCTR_PROC_ENCRYPT))) && + (event == LCTR_CONN_MSG_API_START_ENC)) + { + lctrGenerateMstVectors(pCtx); + } + + if (((lmgrCb.features & LL_FEAT_ENCRYPTION) == 0) || + ((event = lctrMstRemapEncryptEvent(pCtx, event)) == LCTR_ENC_EVENT_INVALID)) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrMstExecuteEncryptSm: handle=%u, llcpState=IDLE, encState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->encState, event); + + lctrMstEncryptSm(pCtx, event); + + if ((pCtx->encState != LCTR_ENC_STATE_UNENCRYPTED) && + (pCtx->encState != LCTR_ENC_STATE_ENCRYPTED)) + { + pCtx->llcpActiveProc = LCTR_PROC_ENCRYPT; + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrMstExecuteEncryptSm: handle=%u, llcpState=BUSY, encState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->encState, event); + + if (lctrCheckActiveOrPend(pCtx, LCTR_PROC_ENCRYPT)) + { + lctrMstEncryptSm(pCtx, event); + + if ((pCtx->encState == LCTR_ENC_STATE_ENCRYPTED) || + (pCtx->encState == LCTR_ENC_STATE_UNENCRYPTED)) + { + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + LL_TRACE_INFO2("Pending ENCRYPT=%u procedure: activeProc=%u", LCTR_PROC_ENCRYPT, pCtx->llcpActiveProc); + } + break; + + default: + break; + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..e3968710a115cf2501afbd2126ab344c79c14853 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c @@ -0,0 +1,778 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave encryption connection state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_enc_slave.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_slave.h" +#include "lmgr_api.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief Encryption states. */ +enum +{ + LCTR_ENC_STATE_UNENCRYPTED, /*!< Connection established, unencrypted. */ + LCTR_ENC_STATE_FLUSH_START, /*!< Wait for Tx queue flush on encryption start. */ + LCTR_ENC_STATE_HOST_LTK_REPLY, /*!< Wait for host LTK reply command. */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /*!< Wait for LL_START_ENC_RSP from peer. */ + LCTR_ENC_STATE_ENCRYPTED, /*!< Connection encrypted. */ + LCTR_ENC_STATE_FLUSH_RESTART, /*!< Wait for Tx queue flush on encryption restart. */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /*!< Wait for LL_PAUSE_ENC_REQ from peer. */ + LCTR_ENC_STATE_TOTAL /*!< Total encryption states. */ +}; + +/*! \brief Encryption events. */ +enum +{ + LCTR_ENC_EVENT_PEER_ENC_REQ, /*!< Received peer LL_ENC_REQ. */ + LCTR_ENC_EVENT_PEER_START_ENC_RSP, /*!< Received peer LL_START_ENC_RSP. */ + LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ, /*!< Received peer LL_PAUSE_ENC_REQ. */ + LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP, /*!< Received peer LL_PAUSE_ENC_RSP. */ + LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY, /*!< Received host LE LTK Request Reply command. */ + LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY,/*!< Received host LE LTK Request Negative Reply command. */ + LCTR_ENC_EVENT_ARQ_FLUSHED, /*!< Internal ARQ queue flushed. */ + LCTR_ENC_EVENT_TOTAL, /*!< Total encryption states. */ + LCTR_ENC_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/*! \brief LE Ping states. */ +enum +{ + LCTR_PING_STATE_IDLE, /*!< Idle state. */ + LCTR_PING_STATE_WAIT_FOR_RSP /*!< Waiting for LE_PING_RSP. */ +}; + +/*! \brief LE Ping events. */ +enum +{ + LCTR_PING_EVENT_SEND_REQ, /*!< Send a LL_LE_PING_REQ. */ + LCTR_PING_EVENT_RECV_REQ, /*!< Received peer LL_LE_PING_REQ. */ + LCTR_PING_EVENT_RECV_RSP, /*!< Received peer LL_LE_PING_RSP. */ + LCTR_PING_EVENT_PING_PERIOD_EXP, /*!< Ping period timer expired. */ + LCTR_PING_EVENT_AUTH_PAYLOAD_EXP, /*!< Authentication payload timer expired. */ + LCTR_PING_EVENT_TOTAL, /*!< Total encryption states. */ + LCTR_PING_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_ENC_REQ. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerEncReq(lctrConnCtx_t *pCtx) +{ + lctrPauseTxData(pCtx); + lctrPauseRxData(pCtx); + lctrCheckPauseComplete(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action Tx data queue flushed after a start encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActTxFlushedOnStart(lctrConnCtx_t *pCtx) +{ + lctrDisableTxDataEnc(pCtx); + lctrDisableRxDataEnc(pCtx); + lctrGenerateSlvVectors(pCtx); + lctrSendEncRsp(pCtx); + lctrStartLlcpTimer(pCtx); + + pCtx->replyWaitingMsk |= LCTR_HOST_REPLY_LTK_REQ; + lctrEncNotifyHostLtkReqInd(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host LTK request reply HCI command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostLtkReply(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_LTK_REQ; + + lctrStoreLtkReply(pCtx); + lctrCalcSessionKey(pCtx); + lctrEnableRxDataEnc(pCtx); + lctrSendStartEncReq(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host LTK request negative reply HCI command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostLtkNegReply(lctrConnCtx_t *pCtx) +{ + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_LTK_REQ; + + lctrStopLlcpTimer(pCtx); + + if (!pCtx->keyUpdFlag) + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_PIN_KEY_MISSING, FALSE); + } + else + { + lctrStoreLtkNegRepTerminateReason(pCtx); + lctrLlcpExecuteCommonSm(pCtx, LCTR_CONN_LLCP_TERM); + } + + lctrUnpauseTxData(pCtx); + lctrUnpauseRxData(pCtx); + + pCtx->keyUpdFlag = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_START_ENC_RSP. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerStartEncRsp(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + + // Increment the packet counter for the LL_START_ENC_RSP message from the master + // Counter was not incremented when this packet was received because encryption was + // Not yet enabled, but decryption was enabled. + pCtx->rxPktCounter++; + + lctrEnableTxDataEnc(pCtx); + lctrSendStartEncRsp(pCtx); + lctrUnpauseTxData(pCtx); + lctrUnpauseRxData(pCtx); + + (pCtx->keyUpdFlag) ? lctrNotifyEncKeyRefreshInd(pCtx) : lctrNotifyEncChangeInd(pCtx, LL_SUCCESS); + pCtx->keyUpdFlag = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer LL_PAUSE_ENC_REQ. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPauseEncReq(lctrConnCtx_t *pCtx) +{ + lctrDisableRxDataEnc(pCtx); + lctrPauseTxData(pCtx); + lctrPauseRxData(pCtx); + lctrCheckPauseComplete(pCtx); + + pCtx->keyUpdFlag = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Action Tx data queue flushed after a restart encryption. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActTxFlushedOnRestart(lctrConnCtx_t *pCtx) +{ + lctrSendPauseEncRsp(pCtx); + lctrStartLlcpTimer(pCtx); +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrSlvEncActionTbl[LCTR_ENC_STATE_TOTAL][LCTR_ENC_EVENT_TOTAL] = +{ + { /* LCTR_ENC_STATE_UNENCRYPTED */ + lctrActPeerEncReq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + NULL /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_FLUSH_START */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + lctrActTxFlushedOnStart /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_HOST_LTK_REPLY */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + lctrActHostLtkReply, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + lctrActHostLtkNegReply, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + NULL /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrActPeerStartEncRsp, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + NULL /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_ENCRYPTED */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrActPeerPauseEncReq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + NULL /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_FLUSH_RESTART */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + lctrActTxFlushedOnRestart /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + lctrInvalidEncPduSeq, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + lctrDisableTxDataEnc, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + NULL, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + NULL /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrSlvEncNextStateTbl[LCTR_ENC_STATE_TOTAL][LCTR_ENC_EVENT_TOTAL] = +{ + { /* LCTR_ENC_STATE_UNENCRYPTED */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_UNENCRYPTED /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_FLUSH_START */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_FLUSH_START, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_HOST_LTK_REPLY /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_HOST_LTK_REPLY */ + LCTR_ENC_STATE_HOST_LTK_REPLY, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_HOST_LTK_REPLY, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_HOST_LTK_REPLY, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_HOST_LTK_REPLY, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_HOST_LTK_REPLY /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_PEER_START_ENC_RSP, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_PEER_START_ENC_RSP /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_ENCRYPTED */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_ENCRYPTED, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_ENCRYPTED /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_FLUSH_RESTART */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_FLUSH_RESTART, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /* LCTR_ENC_EVENT_PEER_ENC_REQ */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /* LCTR_ENC_EVENT_PEER_START_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ */ + LCTR_ENC_STATE_UNENCRYPTED, /* LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /* LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ, /* LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY */ + LCTR_ENC_STATE_PEER_PAUSE_ENC_REQ /* LCTR_ENC_EVENT_ARQ_FLUSHED */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Get remapped encryption LLCP procedure event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Encryption LLCP procedure event ID. + * + * This routine remaps events for the encryption LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrSlvRemapEncryptEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_ENC_REQ: + return LCTR_ENC_EVENT_PEER_ENC_REQ; + case LL_PDU_START_ENC_RSP: + return LCTR_ENC_EVENT_PEER_START_ENC_RSP; + case LL_PDU_PAUSE_ENC_REQ: + return LCTR_ENC_EVENT_PEER_PAUSE_ENC_REQ; + case LL_PDU_PAUSE_ENC_RSP: + return LCTR_ENC_EVENT_PEER_PAUSE_ENC_RSP; + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_LTK_REPLY: + return LCTR_ENC_EVENT_HOST_LTK_REQ_REPLY; + case LCTR_CONN_MSG_API_LTK_NEG_REPLY: + return LCTR_ENC_EVENT_HOST_LTK_REQ_NEG_REPLY; + + /*** Internal messages ***/ + + case LCTR_CONN_ARQ_Q_FLUSHED: + if (pCtx->llcpActiveProc == LCTR_PROC_ENCRYPT) + { + return LCTR_ENC_EVENT_ARQ_FLUSHED; + } + break; + + default: + break; + } + + return LCTR_ENC_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Check if active procedure can be overridden with encryption procedure. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return None. + * + * This routine will pend the active procedure and allow the encryption procedure to override it. + */ +/*************************************************************************************************/ +static void lctrSlvCheckProcOverride(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_ENC_EVENT_PEER_ENC_REQ: + if (lctrSlvCheckEncOverrideConnParam(pCtx) || + lctrSlvCheckEncOverrideCommonParam(pCtx)) + { + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_ENCRYPT; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped LE Ping LLCP procedure event. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return LE Ping LLCP procedure event ID. + * + * This routine remaps events for the LE Ping LLCP procedure state machine for optimized + * compressed state tables. + */ +/*************************************************************************************************/ +static uint8_t lctrRemapPingEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_PING_REQ: + return LCTR_PING_EVENT_RECV_REQ; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType != LL_PDU_PING_REQ) + { + break; + } + /* no break: treat UNKNOWN_RSP like LE_PING_RSP */ + case LL_PDU_PING_RSP: + return LCTR_PING_EVENT_RECV_RSP; + + default: + break; + } + break; + + /*** Timers ***/ + + case LCTR_CONN_TMR_PING_PERIOD_EXP: + return LCTR_PING_EVENT_PING_PERIOD_EXP; + case LCTR_CONN_TMR_AUTH_PAYLOAD_EXP: + return LCTR_PING_EVENT_AUTH_PAYLOAD_EXP; + + /*** Internal messages ***/ + + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask & (1 << LCTR_PROC_LE_PING)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_LE_PING); + return LCTR_PING_EVENT_SEND_REQ; + } + break; + + default: + break; + } + + return LCTR_PING_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Execute encryption slave LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +static void lctrSlvEncryptSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (lctrSlvEncActionTbl[pCtx->encState][event]) + { + lctrSlvEncActionTbl[pCtx->encState][event](pCtx); + } + + pCtx->encState = lctrSlvEncNextStateTbl[pCtx->encState][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Execute encryption slave LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if handled by this SM, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvExecuteEncryptSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (pCtx->pauseRxData == TRUE) /* During encryption start or encryption pause. */ + { + switch(event) + { + case LCTR_CONN_MSG_RX_LLCP: + switch(lctrDataPdu.opcode) + { + /* Allowed PDUs. */ + case LL_PDU_TERMINATE_IND: + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + case LL_PDU_ENC_REQ: + case LL_PDU_START_ENC_RSP: + case LL_PDU_PAUSE_ENC_REQ: + case LL_PDU_PAUSE_ENC_RSP: + break; + + /* Illegal PDUs */ + default: + LL_TRACE_WARN2("Unexpected PDU received during encryption procedure, handle=%u, opcode=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.opcode); + lctrInvalidEncPduSeq(pCtx); + return FALSE; + } + break; + + /* Illegal PDUs. */ + case LCTR_CONN_MSG_RX_LLCP_UNKNOWN: + case LCTR_CONN_MSG_RX_LLCP_INVALID_PARAM: + LL_TRACE_WARN1("Unknown/Invalid PDU received during encryption procedure event=%u", event); + lctrInvalidEncPduSeq(pCtx); /* Transit to standby state and notify the host */ + return TRUE; /* Skip the lctrLlcpStatelessEventHandler */ + + default: + break; + } + } + + if (((lmgrCb.features & LL_FEAT_ENCRYPTION) == 0) || + ((event = lctrSlvRemapEncryptEvent(pCtx, event)) == LCTR_ENC_EVENT_INVALID)) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrSlvExecuteEncryptSm: handle=%u, llcpState=IDLE, encState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->encState, event); + + lctrSlvEncryptSm(pCtx, event); + + if ((pCtx->encState != LCTR_ENC_STATE_UNENCRYPTED) && + (pCtx->encState != LCTR_ENC_STATE_ENCRYPTED)) + { + pCtx->llcpActiveProc = LCTR_PROC_ENCRYPT; + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrSlvExecuteEncryptSm: handle=%u, llcpState=BUSY, encState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->encState, event); + + lctrSlvCheckProcOverride(pCtx, event); + + if (lctrCheckActiveOrPend(pCtx, LCTR_PROC_ENCRYPT)) + { + lctrSlvEncryptSm(pCtx, event); + + if ((pCtx->encState == LCTR_ENC_STATE_ENCRYPTED) || + (pCtx->encState == LCTR_ENC_STATE_UNENCRYPTED)) + { + pCtx->replyWaitingMsk &= ~LCTR_HOST_REPLY_LTK_REQ; + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + LL_TRACE_INFO2("Pending ENCRYPT=%u procedure: activeProc=%u", LCTR_PROC_ENCRYPT, pCtx->llcpActiveProc); + } + break; + + default: + break; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Execute LE Ping LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +static void lctrPingSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (pCtx->pingState) + { + case LCTR_PING_STATE_IDLE: + switch (event) + { + case LCTR_PING_EVENT_SEND_REQ: + case LCTR_PING_EVENT_PING_PERIOD_EXP: + /* Send LE_PING_REQ regardless of peer feature support. */ + lctrSendPingReq(pCtx); + lctrStartLlcpTimer(pCtx); + pCtx->pingState = LCTR_PING_STATE_WAIT_FOR_RSP; + break; + + case LCTR_PING_EVENT_RECV_REQ: + lctrSendPingRsp(pCtx); + break; + + case LCTR_PING_EVENT_AUTH_PAYLOAD_EXP: + lctrNotifyAuthPayloadTimeout(pCtx); + lctrRestartAuthPayloadTimer(pCtx); + break; + + /* Ignore */ + case LCTR_PING_EVENT_RECV_RSP: + /* No action required. */ + default: + break; + } + break; + + case LCTR_PING_STATE_WAIT_FOR_RSP: + switch (event) + { + case LCTR_PING_EVENT_RECV_RSP: + lctrStopLlcpTimer(pCtx); + pCtx->pingState = LCTR_PING_STATE_IDLE; + break; + + case LCTR_PING_EVENT_RECV_REQ: + LL_TRACE_WARN1("LE Ping procedure collision; send LE_PING_RSP anyway, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendPingRsp(pCtx); + break; + + case LCTR_PING_EVENT_AUTH_PAYLOAD_EXP: + lctrNotifyAuthPayloadTimeout(pCtx); + break; + + /* Ignore */ + case LCTR_PING_EVENT_SEND_REQ: + case LCTR_PING_EVENT_PING_PERIOD_EXP: + default: + break; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute ping LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if handled by this SM, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrExecutePingSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (((lmgrCb.features & LL_FEAT_LE_PING) == 0) || + ((event = lctrRemapPingEvent(pCtx, event)) == LCTR_PING_EVENT_INVALID)) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrExecutePingSm: handle=%u, llcpState=IDLE, pingState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->pingState, event); + + lctrPingSm(pCtx, event); + + if (pCtx->pingState != LCTR_PING_STATE_IDLE) + { + pCtx->llcpActiveProc = LCTR_PROC_LE_PING; + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrExecutePingSm: handle=%u, llcpState=BUSY, pingState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->pingState, event); + + if (lctrCheckActiveOrPend(pCtx, LCTR_PROC_LE_PING)) + { + lctrPingSm(pCtx, event); + + if (pCtx->pingState == LCTR_PING_STATE_IDLE) + { + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + LL_TRACE_INFO2("Pending LE_PING=%u procedure: activeProc=%u", LCTR_PROC_LE_PING, pCtx->llcpActiveProc); + } + break; + + default: + break; + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..870127232dbb562ec27976f1a8080bbb3970b743 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c @@ -0,0 +1,630 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller master PHY update state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_master_phy.h" +#include "lctr_int_slave_phy.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief PHY update states. */ +enum +{ + LCTR_PU_STATE_IDLE, /*!< Idle state. */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /*!< ARQ flush before sending LL_PHY_REQ. */ + LCTR_PU_STATE_PHY_RSP, /*!< Wait for LL_PHY_RSP state. */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /*!< ARQ flush before sending LL_PHY_UPDATE_IND. */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /*!< Wait for PHY update instant state. */ + LCTR_PU_STATE_TOTAL /*!< Total PHY update states. */ +}; + +/*! \brief PHY update events. */ +enum +{ + LCTR_PU_EVENT_HOST_PHY_UPD, /*!< Received host PHY update command. */ + LCTR_PU_EVENT_PEER_PHY_RSP, /*!< Received peer LL_PHY_RSP. */ + LCTR_PU_EVENT_PEER_PHY_REQ, /*!< Received peer LL_PHY_REQ. */ + LCTR_PU_EVENT_PEER_REJECT, /*!< Received peer LL_REJECT_IND or LL_UNKNOWN_RSP. */ + LCTR_PU_EVENT_INT_PROC_COMP, /*!< Procedure completion event. */ + LCTR_PU_EVENT_INT_START_PHY_UPD, /*!< Start pending host PHY update procedure. */ + LCTR_PU_EVENT_INT_START_PHY_UPD_PEER, /*!< Start pending peer PHY update procedure. */ + LCTR_PU_EVENT_ARQ_FLUSHED, /*!< Internal ARQ queue flushed. */ + LCTR_PU_EVENT_TOTAL, /*!< Total PHY update states. */ + LCTR_PU_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +extern void lctrActPeerRejectPhyReq(lctrConnCtx_t *pCtx); +extern void lctrActNotifyHostPhyUpdateSuccess(lctrConnCtx_t *pCtx); +extern uint8_t lctrChoosePreferredPhy(uint8_t val); +extern uint8_t lctrSuppPhys(void); +extern void lctrActStartPhyUpdate(lctrConnCtx_t *pCtx); +extern void lctrActFlushArq(lctrConnCtx_t *pCtx); + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Determine whether preference is symmetric. + * + * \param peerTxPhys Peer's preferred transmitter PHYs. + * \param peerRxPhys Peer'sreferred receiver PHYs. + * + * \return TRUE if preference is symmetric. + */ +/*************************************************************************************************/ +static bool_t lctrPreferenceIsSymmetric(uint8_t peerTxPhys, uint8_t peerRxPhys) +{ + uint8_t phys = lctrChoosePreferredPhy(peerTxPhys | peerRxPhys); + + /* Only one bit is set in each preference and same bit is set in each preference. */ + return ((phys == peerTxPhys) && (phys == peerRxPhys) && (phys != LL_PHYS_NONE)); +} + +/*************************************************************************************************/ +/*! + * \brief Send PHY update. + * + * \param pCtx Connection context. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * \param peerTxPhys Peer's preferred transmitter PHYs. + * \param peerRxPhys Peer'sreferred receiver PHYs. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrSendPhyUpdate(lctrConnCtx_t *pCtx, uint8_t txPhys, uint8_t rxPhys, uint8_t peerTxPhys, uint8_t peerRxPhys) +{ + /* Combine master's request with slave's response. */ + txPhys &= peerRxPhys; + rxPhys &= peerTxPhys; + + /* If outcome must be symmetric, make Tx and Rx identical. */ + if (lctrPreferenceIsSymmetric(peerTxPhys, peerRxPhys) || + (BB_SYM_PHY_REQ || lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_REQ_SYM_PHY))) + { + txPhys &= rxPhys; + rxPhys = txPhys; + } + + /* If more than one bit set, choose preferred PHY. */ + txPhys = lctrChoosePreferredPhy(txPhys); + rxPhys = lctrChoosePreferredPhy(rxPhys); + + /* If no change, indicate no change. */ + if (txPhys == lctrPhyToPhysBit(pCtx->bleData.chan.txPhy)) + { + txPhys = LL_PHYS_NONE; + } + if (rxPhys == lctrPhyToPhysBit(pCtx->bleData.chan.rxPhy)) + { + rxPhys = LL_PHYS_NONE; + } + + /* Send update request. */ + lctrSendPhyUpdateIndPdu(pCtx, txPhys, rxPhys); + + /* If neither PHY will change, this ends the procedure. */ + if ((txPhys == LL_PHYS_NONE) && (rxPhys == LL_PHYS_NONE)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + + /* Set restriction for packet times and allow data again. */ + if (txPhys == LL_PHYS_NONE) + { + lctrRemovePacketTimeRestriction(pCtx); + } + else + { + lctrSetPacketTimeRestriction(pCtx, txPhys); + } + lctrUnpauseTxData(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start PHY update. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartPhyUpdatePeer(lctrConnCtx_t *pCtx) +{ + uint8_t txPhys = pCtx->txPhys; + uint8_t rxPhys = pCtx->rxPhys; + + /* If no preference, use supported PHYs. */ + if ((pCtx->allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) != 0) + { + txPhys = lctrSuppPhys(); + } + if ((pCtx->allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) != 0) + { + rxPhys = lctrSuppPhys(); + } + + /* Send PHY update. */ + lctrSendPhyUpdate(pCtx, txPhys, rxPhys, pCtx->phyReq.txPhys, pCtx->phyReq.rxPhys); + lctrStopLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host PHY update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostPhyUpdate(lctrConnCtx_t *pCtx) +{ + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + lctrStoreHostPhyUpdate(pCtx); + lctrActFlushArq(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer PHY request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPhyReq(lctrConnCtx_t *pCtx) +{ + lctrStorePeerPhyReq(pCtx); + lctrActFlushArq(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer PHY response. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPhyRsp(lctrConnCtx_t *pCtx) +{ + lctrSendPhyUpdate(pCtx, pCtx->phyReq.txPhys, pCtx->phyReq.rxPhys, lctrDataPdu.pld.phyRsp.txPhys, lctrDataPdu.pld.phyRsp.rxPhys); + lctrStopLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Send peer LL_REJECT_IND due to pending operation. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActRejectCollision(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Peer requested PHY while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION, TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of PHY update with disallowed status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPhyUpdateDisallow(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested PHY update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostPhyUpdateInd(pCtx, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrMstPhyUpdateActionTbl[LCTR_PU_STATE_TOTAL][LCTR_PU_EVENT_TOTAL] = +{ + { /* LCTR_PU_STATE_IDLE */ + lctrActHostPhyUpdate, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* out of sequence; ignore */ + lctrActPeerPhyReq, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + lctrActFlushArq, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ + lctrActFlushArq, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* should never occur */ + lctrActRejectCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur (not for this SM) */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + lctrActStartPhyUpdate /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PHY_RSP */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + lctrActPeerPhyRsp, /* LCTR_PU_EVENT_PEER_PHY_RSP */ + lctrActRejectCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + lctrActPeerRejectPhyReq, /* LCTR_PU_EVENT_PEER_REJECT */ + lctrActNotifyHostPhyUpdateSuccess, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* no change */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* should never occur */ + lctrActRejectCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur (not for this SM) */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + lctrActStartPhyUpdatePeer /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PHY_UPD_INSTANT */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* out of sequence; ignore */ + lctrActRejectCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + lctrActNotifyHostPhyUpdateSuccess, /* LCTR_PU_EVENT_INT_PROC_COMP */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrMstPhyUpdateNextStateTbl[LCTR_PU_STATE_TOTAL][LCTR_PU_EVENT_TOTAL] = +{ + { /* LCTR_PU_STATE_IDLE */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* out of sequence; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ + LCTR_PU_STATE_IDLE /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + LCTR_PU_STATE_PHY_RSP /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PHY_RSP */ + LCTR_PU_STATE_PHY_RSP, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_RSP */ + LCTR_PU_STATE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_REJECT */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* no change */ + LCTR_PU_STATE_PHY_RSP, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_PHY_RSP, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + LCTR_PU_STATE_PHY_RSP /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + LCTR_PU_STATE_PHY_UPD_INSTANT /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PHY_UPD_INSTANT */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_RSP */ /* out of sequence; ignore */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_INT_START_PHY_UPD_PEER */ /* should never occur */ + LCTR_PU_STATE_PHY_UPD_INSTANT /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute action function. + * + * \param pCtx Connection context. + * \param event Event ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExecAction(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (lctrMstPhyUpdateActionTbl[pCtx->phyUpdState][event]) + { + lctrMstPhyUpdateActionTbl[pCtx->phyUpdState][event](pCtx); + } + + pCtx->phyUpdState = lctrMstPhyUpdateNextStateTbl[pCtx->phyUpdState][event]; +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Procedure event ID. + */ +/*************************************************************************************************/ +static uint8_t lctrRemapEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_PHY_REQ: + return LCTR_PU_EVENT_PEER_PHY_REQ; + case LL_PDU_PHY_RSP: + return LCTR_PU_EVENT_PEER_PHY_RSP; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType == LL_PDU_PHY_REQ) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + case LL_PDU_REJECT_IND: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Probably not for this SM. */ + break; + case LL_PDU_REJECT_EXT_IND: + if (lctrDataPdu.pld.rejInd.opcode == LL_PDU_PHY_REQ) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_PHY_UPDATE: + return LCTR_PU_EVENT_HOST_PHY_UPD; + + /*** Internal messages ***/ + + case LCTR_CONN_ARQ_Q_FLUSHED: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_ARQ_FLUSHED; + } + break; + case LCTR_CONN_LLCP_PROC_CMPL: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_INT_PROC_COMP; + } + break; + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask & (1 << LCTR_PROC_PHY_UPD)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_PHY_UPD); + return LCTR_PU_EVENT_INT_START_PHY_UPD; + } + if (pCtx->llcpPendMask & (1 << LCTR_PROC_PHY_UPD_PEER)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_PHY_UPD_PEER); + return LCTR_PU_EVENT_INT_START_PHY_UPD_PEER; + } + break; + default: + break; + } + return LCTR_PU_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve procedure collision. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrResolveCollision(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_PU_EVENT_PEER_PHY_REQ: + if ((pCtx->llcpActiveProc == LCTR_PROC_CMN_CH_MAP_UPD) || + (pCtx->llcpActiveProc == LCTR_PROC_CONN_UPD) || + (pCtx->llcpActiveProc == LCTR_PROC_CONN_PARAM)) + { + lctrSendRejectInd(pCtx, LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION, TRUE); + } + else + { + lctrStorePeerPhyReq(pCtx); + pCtx->llcpPendMask |= 1 << LCTR_PROC_PHY_UPD_PEER; + LL_TRACE_INFO2("Pending PHY_UPD=%u procedure: activeProc=%u", LCTR_PROC_PHY_UPD_PEER, pCtx->llcpActiveProc); + } + break; + + case LCTR_PU_EVENT_HOST_PHY_UPD: + lctrStoreHostPhyUpdate(pCtx); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + pCtx->llcpPendMask |= 1 << LCTR_PROC_PHY_UPD; + LL_TRACE_INFO2("Pending PHY_UPD=%u procedure: activeProc=%u", LCTR_PROC_CONN_UPD, pCtx->llcpActiveProc); + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if active procedure can be overridden with phy update procedure. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return None. + * + * This routine will pend the active procedure and allow the phy update procedure to + * override it. + */ +/*************************************************************************************************/ +static void lctrMstCheckProcOverride(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_PU_EVENT_PEER_PHY_REQ: + /* Only the procedure without instant fields can be overridden. */ + switch (pCtx->llcpActiveProc) + { + case LCTR_PROC_CMN_VER_EXCH: + case LCTR_PROC_CMN_FEAT_EXCH: + case LCTR_PROC_CMN_DATA_LEN_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_PHY_UPD; + pCtx->llcpIsOverridden = TRUE; + break; + + default: + break; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute master connection update LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrMstLlcpExecutePhyUpdateSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if ((event = lctrRemapEvent(pCtx, event)) == LCTR_PU_EVENT_INVALID) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrMstLlcpExecutePhyUpdateSm: handle=%u, llcpState=IDLE, phyUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->phyUpdState, event); + + lctrExecAction(pCtx, event); + + if (pCtx->phyUpdState != LCTR_PU_STATE_IDLE) + { + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + pCtx->llcpActiveProc = LCTR_PROC_PHY_UPD; + pCtx->llcpInstantComp = FALSE; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrMstLlcpExecutePhyUpdateSm: handle=%u, llcpState=BUSY, phyUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->phyUpdState, event); + + lctrMstCheckProcOverride(pCtx, event); + + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + lctrExecAction(pCtx, event); + + if (pCtx->phyUpdState == LCTR_PU_STATE_IDLE) + { + lctrStopLlcpTimer(pCtx); + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + lctrResolveCollision(pCtx, event); + } + + break; + + default: + break; + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..42daa4125411fad1b4ec1527a187f31aa3bf9804 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c @@ -0,0 +1,791 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer controller slave PHY update state machine implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_int_master_phy.h" +#include "lctr_int_slave_phy.h" +#include "lctr_int_conn.h" +#include "lctr_int_conn_master.h" +#include "lctr_int_conn_slave.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Action function call signature. */ +typedef void (*lctrActFn_t)(lctrConnCtx_t *pCtx); + +/*! \brief Slave PHY update states. */ +enum +{ + LCTR_PU_STATE_IDLE, /*!< Idle state. */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /*!< ARQ flush before sending LL_PHY_REQ. */ + LCTR_PU_STATE_HOST_PHY_UPDATE_REQ, /*!< Host-initiated PHY update state. */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /*!< ARQ flush before sending LL_PHY_RSP. */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /*!< Peer-initiated PHY update collision. */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /*!< Wait for PHY update instant state. */ + LCTR_PU_STATE_TOTAL /*!< Total PHY update states. */ +}; + +/*! \brief PHY update events. */ +enum +{ + LCTR_PU_EVENT_HOST_PHY_UPD, /*!< Received host PHY update command. */ + LCTR_PU_EVENT_PEER_PHY_UPDATE_IND, /*!< Received peer LL_PHY_UPDATE_IND. */ + LCTR_PU_EVENT_PEER_PHY_REQ, /*!< Received peer LL_PHY_REQ. */ + LCTR_PU_EVENT_PEER_REJECT, /*!< Received peer LL_REJECT_IND or LL_UNKNOWN_RSP. */ + LCTR_PU_EVENT_INT_PROC_COMP, /*!< Procedure completion event. */ + LCTR_PU_EVENT_INT_START_PHY_UPD, /*!< Start pending host PHY update procedure. */ + LCTR_PU_EVENT_ARQ_FLUSHED, /*!< Internal ARQ queue flushed. */ + LCTR_PU_EVENT_TOTAL, /*!< Total PHY update states. */ + LCTR_PU_EVENT_INVALID = 0xFF /*!< Invalid event. */ +}; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void lctrActPeerRejectPhyReq(lctrConnCtx_t *pCtx); +void lctrActNotifyHostPhyUpdateSuccess(lctrConnCtx_t *pCtx); +uint8_t lctrChoosePreferredPhy(uint8_t val); +uint8_t lctrSuppPhys(void); +void lctrActStartPhyUpdate(lctrConnCtx_t *pCtx); +void lctrActFlushArq(lctrConnCtx_t *pCtx); + +/************************************************************************************************** + Global Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Notify host of peer rejected PHY request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActPeerRejectPhyReq(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); + + if (pCtx->llcpNotifyMask & (1 << LCTR_PROC_PHY_UPD)) + { + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_PHY_UPD); + + switch (lctrDataPdu.opcode) + { + case LL_PDU_REJECT_IND: + case LL_PDU_REJECT_EXT_IND: + LL_TRACE_WARN2("Peer rejected PHY update, handle=%u, reason=%u", LCTR_GET_CONN_HANDLE(pCtx), lctrDataPdu.pld.rejInd.reason); + lctrNotifyHostPhyUpdateInd(pCtx, lctrDataPdu.pld.rejInd.reason); + break; + case LL_PDU_UNKNOWN_RSP: + LL_TRACE_WARN1("Peer rejected PHY update, handle=%u, reason=UNSUPPORTED_REMOTE_FEATURE", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostPhyUpdateInd(pCtx, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE); + break; + default: + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of connection update with success status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActNotifyHostPhyUpdateSuccess(lctrConnCtx_t *pCtx) +{ + /* Remove packet time restrictions. */ + lctrRemovePacketTimeRestriction(pCtx); + + if (pCtx->llcpNotifyMask & (1 << LCTR_PROC_PHY_UPD)) + { + pCtx->llcpNotifyMask &= ~(1 << LCTR_PROC_PHY_UPD); + lctrNotifyHostPhyUpdateInd(pCtx, LL_SUCCESS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Choose preferred PHY. + * + * \param phys Mask of PHY bits. + * + * \return PHY bit for preferred PHY. + */ +/*************************************************************************************************/ +uint8_t lctrChoosePreferredPhy(uint8_t phys) +{ + /* Note: A different scheme for prioritizing PHYs could be offered. */ + + if ((phys & LL_PHYS_LE_2M_BIT) != 0) + { + return LL_PHYS_LE_2M_BIT; + } + if ((phys & LL_PHYS_LE_1M_BIT) != 0) + { + return LL_PHYS_LE_1M_BIT; + } + if ((phys & LL_PHYS_LE_CODED_BIT) != 0) + { + return LL_PHYS_LE_CODED_BIT; + } + return LL_PHYS_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Determine supported PHYs. + * + * \return Supported PHYs. + */ +/*************************************************************************************************/ +uint8_t lctrSuppPhys(void) +{ + uint8_t phys = LL_PHYS_LE_1M_BIT; + if ((lmgrCb.features & LL_FEAT_LE_2M_PHY) != 0) + { + phys |= LL_PHYS_LE_2M_BIT; + } + if ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) != 0) + { + phys |= LL_PHYS_LE_CODED_BIT; + } + return phys; +} + +/*************************************************************************************************/ +/*! + * \brief Adjust PHY preference. + * + * \param pCtx Connection context. + * \param allPhys All PHYs preferences. + * \param pTxPhys Preferred transmitter PHYs. + * \param pRxPhys Preferred receiver PHYs. + * \param peerPhys Peer preferred PHYs. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrAdjustPhyPreference(lctrConnCtx_t *pCtx, uint8_t allPhys, uint8_t *pTxPhys, uint8_t *pRxPhys, uint8_t peerPhys) +{ + uint8_t txPhys = *pTxPhys; + uint8_t rxPhys = *pRxPhys; + + /* If no preference, use supported PHYs. */ + if ((allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) != 0) + { + txPhys = lctrSuppPhys(); + } + if ((allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) != 0) + { + rxPhys = lctrSuppPhys(); + } + + /* If symmetric only, restrict and validate choice. */ + if (BB_SYM_PHY_REQ || lctrGetConnOpFlag(pCtx, LL_OP_MODE_FLAG_REQ_SYM_PHY)) + { + txPhys &= rxPhys; /* only common PHYs */ + if (txPhys == 0) + { + /* No common PHY; select current. */ + txPhys = lctrPhyToPhysBit(pCtx->bleData.chan.txPhy); + rxPhys = lctrPhyToPhysBit(pCtx->bleData.chan.rxPhy); + } + else + { + /* Prefer common with peer. */ + if ((txPhys & peerPhys) != 0) + { + txPhys &= peerPhys; + } + + /* Choose preferred PHY. */ + txPhys = lctrChoosePreferredPhy(txPhys); + + /* Tx and Rx identical. */ + rxPhys = txPhys; + } + } + + /* Save preference. */ + *pTxPhys = txPhys; + *pRxPhys = rxPhys; +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start PHY update. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActStartPhyUpdate(lctrConnCtx_t *pCtx) +{ + /* If no preference, procedure is complete. */ + if (((pCtx->allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) != 0) && + ((pCtx->allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) != 0)) + { + lctrUnpauseTxData(pCtx); + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + else + { + uint8_t txPhys = pCtx->txPhys; + uint8_t rxPhys = pCtx->rxPhys; + + lctrAdjustPhyPreference(pCtx, pCtx->allPhys, &txPhys, &rxPhys, LL_PHYS_NONE); + + /* If no change, procedure is complete. */ + if ((txPhys == lctrPhyToPhysBit(pCtx->bleData.chan.txPhy)) && + (rxPhys == lctrPhyToPhysBit(pCtx->bleData.chan.rxPhy))) + { + lctrUnpauseTxData(pCtx); + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + else + { + /* Set restriction for packet times and allow data again. */ + lctrSetPacketTimeRestriction(pCtx, txPhys); + lctrUnpauseTxData(pCtx); + + /* Send PHY request. */ + lctrSendPhyReqPdu(pCtx, txPhys, rxPhys); + lctrStartLlcpTimer(pCtx); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for flushing ARQ. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +void lctrActFlushArq(lctrConnCtx_t *pCtx) +{ + lctrPauseTxData(pCtx); + lctrCheckPauseComplete(pCtx); +} + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received host PHY update command. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActHostPhyUpdate(lctrConnCtx_t *pCtx) +{ + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + lctrStoreHostPhyUpdate(pCtx); + lctrActFlushArq(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for start PHY response. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActStartPhyRsp(lctrConnCtx_t *pCtx) +{ + uint8_t txPhys = pCtx->txPhys; + uint8_t rxPhys = pCtx->rxPhys; + + lctrAdjustPhyPreference(pCtx, pCtx->allPhys, &txPhys, &rxPhys, pCtx->phyReq.txPhys & pCtx->phyReq.rxPhys); + + /* Set restriction for packet times and allow data again. */ + lctrSetPacketTimeRestriction(pCtx, txPhys); + lctrUnpauseTxData(pCtx); + + /* Send PHY response. */ + lctrSendPhyRspPdu(pCtx, txPhys, rxPhys); + lctrStartLlcpTimer(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer PHY request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPhyReq(lctrConnCtx_t *pCtx) +{ + lctrStorePeerPhyReq(pCtx); + lctrActFlushArq(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer PHY update request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPhyUpdateReq(lctrConnCtx_t *pCtx) +{ + lctrStopLlcpTimer(pCtx); /* procedure completes at instant */ + + /* Procedure completes now if neither PHY will change. */ + if ((lctrDataPdu.pld.phyUpdInd.masterToSlavePhy == LL_PHYS_NONE) && + (lctrDataPdu.pld.phyUpdInd.slaveToMasterPhy == LL_PHYS_NONE)) + { + lctrSendConnMsg(pCtx, LCTR_CONN_LLCP_PROC_CMPL); + } + else + { + lctrStorePeerPhyUpdateInd(pCtx); + } +} + +/*************************************************************************************************/ +/*! + * \brief Action indirection for received peer PHY request. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPeerPhyReqWithCollision(lctrConnCtx_t *pCtx) +{ + lctrActPeerPhyReq(pCtx); +} + +/*************************************************************************************************/ +/*! + * \brief Notify host of PHY update with disallowed status. + * + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrActPhyUpdateDisallow(lctrConnCtx_t *pCtx) +{ + LL_TRACE_WARN1("Host requested PHY update while procedure pending, handle=%u", LCTR_GET_CONN_HANDLE(pCtx)); + lctrNotifyHostPhyUpdateInd(pCtx, LL_ERROR_CODE_CMD_DISALLOWED); +} + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief State machine action table. */ +static const lctrActFn_t lctrSlvPhyUpdateActionTbl[LCTR_PU_STATE_TOTAL][LCTR_PU_EVENT_TOTAL] = +{ + { /* LCTR_PU_STATE_IDLE */ + lctrActHostPhyUpdate, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + lctrActPeerPhyReq, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + lctrActFlushArq, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + lctrActPeerPhyReqWithCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + lctrActStartPhyUpdate /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_HOST_PHY_UPDATE_REQ */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + lctrActPeerPhyUpdateReq, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ + lctrActPeerPhyReqWithCollision, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + lctrActPeerRejectPhyReq, /* LCTR_PU_EVENT_PEER_REJECT */ + lctrActNotifyHostPhyUpdateSuccess, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* if no change */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + lctrActPeerRejectPhyReq, /* LCTR_PU_EVENT_PEER_REJECT */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + lctrActStartPhyRsp /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PEER_PHY_UPDATE_IND */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + lctrActPeerPhyUpdateReq, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + lctrActPeerRejectPhyReq, /* LCTR_PU_EVENT_PEER_REJECT */ + NULL, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_PHY_UPD_INSTANT */ + lctrActPhyUpdateDisallow, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + NULL, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + NULL, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + lctrActNotifyHostPhyUpdateSuccess, /* LCTR_PU_EVENT_INT_PROC_COMP */ + NULL, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + NULL /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + } +}; + +/*! \brief State machine next state table. */ +static const uint8_t lctrSlvPhyUpdateNextStateTbl[LCTR_PU_STATE_TOTAL][LCTR_PU_EVENT_TOTAL] = +{ + { /* LCTR_PU_STATE_IDLE */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur (not for this SM) */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ + LCTR_PU_STATE_IDLE /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_HOST_PHY_UPDATE_REQ /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_HOST_PHY_UPDATE_REQ */ + LCTR_PU_STATE_HOST_PHY_UPDATE_REQ, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_REQ */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_PEER_REJECT */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* if no change */ + LCTR_PU_STATE_HOST_PHY_UPDATE_REQ, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_HOST_PHY_UPDATE_REQ /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_PEER_REJECT */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + LCTR_PU_STATE_FLUSH_BEFORE_PHY_RSP, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND /* LCTR_PU_EVENT_ARQ_FLUSHED */ + }, + { /* LCTR_PU_STATE_PEER_PHY_UPDATE_IND */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /* LCTR_PU_EVENT_PEER_REJECT */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_PROC_COMP */ /* should never occur */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_PEER_PHY_UPDATE_IND /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + }, + { /* LCTR_PU_STATE_PHY_UPD_INSTANT */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_HOST_PHY_UPD */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_UPDATE_IND */ /* out of sequence; ignore */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_PHY_REQ */ /* out of sequence; ignore */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_PEER_REJECT */ /* should never occur; ignore */ + LCTR_PU_STATE_IDLE, /* LCTR_PU_EVENT_INT_PROC_COMP */ + LCTR_PU_STATE_PHY_UPD_INSTANT, /* LCTR_PU_EVENT_INT_START_PHY_UPD */ /* should never occur */ + LCTR_PU_STATE_PHY_UPD_INSTANT /* LCTR_PU_EVENT_ARQ_FLUSHED */ /* should never occur (not for this SM) */ + } +}; + +/*************************************************************************************************/ +/*! + * \brief Execute action function. + * + * \param pCtx Connection context. + * \param event Event ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrExecAction(lctrConnCtx_t *pCtx, uint8_t event) +{ + if (lctrSlvPhyUpdateActionTbl[pCtx->phyUpdState][event]) + { + lctrSlvPhyUpdateActionTbl[pCtx->phyUpdState][event](pCtx); + } + + pCtx->phyUpdState = lctrSlvPhyUpdateNextStateTbl[pCtx->phyUpdState][event]; + + if (pCtx->phyUpdState == LCTR_PU_STATE_PHY_UPD_INSTANT) + pCtx->isSlvPhyUpdInstant = TRUE; + else + pCtx->isSlvPhyUpdInstant = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get remapped event. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return Procedure event ID. + */ +/*************************************************************************************************/ +static uint8_t lctrRemapEvent(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + /*** Peer messages ***/ + + case LCTR_CONN_MSG_RX_LLCP: + switch (lctrDataPdu.opcode) + { + case LL_PDU_PHY_REQ: + return LCTR_PU_EVENT_PEER_PHY_REQ; + case LL_PDU_PHY_UPDATE_IND: + return LCTR_PU_EVENT_PEER_PHY_UPDATE_IND; + + case LL_PDU_UNKNOWN_RSP: + if (lctrDataPdu.pld.unknownRsp.unknownType == LL_PDU_PHY_REQ) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + case LL_PDU_REJECT_IND: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Probably not for this SM. */ + break; + case LL_PDU_REJECT_EXT_IND: + if (lctrDataPdu.pld.rejInd.opcode == LL_PDU_PHY_REQ) + { + return LCTR_PU_EVENT_PEER_REJECT; + } + /* Not for this SM. */ + break; + + default: + break; + } + break; + + /*** Host messages ***/ + + case LCTR_CONN_MSG_API_PHY_UPDATE: + return LCTR_PU_EVENT_HOST_PHY_UPD; + + /*** Internal messages ***/ + + case LCTR_CONN_ARQ_Q_FLUSHED: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_ARQ_FLUSHED; + } + break; + case LCTR_CONN_LLCP_PROC_CMPL: + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + return LCTR_PU_EVENT_INT_PROC_COMP; + } + break; + case LCTR_CONN_LLCP_START_PENDING: + if (pCtx->llcpPendMask == (1 << LCTR_PROC_PHY_UPD)) + { + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_PHY_UPD); + return LCTR_PU_EVENT_INT_START_PHY_UPD; + } + break; + default: + break; + } + return LCTR_PU_EVENT_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve procedure collision. + * + * \param event Subsystem event. + * \param pCtx Connection context. + * + * \return None. + */ +/*************************************************************************************************/ +static void lctrResolveCollision(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_PU_EVENT_PEER_PHY_REQ: + LL_TRACE_WARN2("Rejecting PHY_UPD=%u procedure: activeProc=%u, reason=DIFFERENT_TRANSACTION_COLLISION", LCTR_PROC_PHY_UPD, pCtx->llcpActiveProc); + lctrSendRejectInd(pCtx, LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION, TRUE); + break; + + case LCTR_PU_EVENT_HOST_PHY_UPD: + lctrStoreHostPhyUpdate(pCtx); + pCtx->llcpNotifyMask |= 1 << LCTR_PROC_PHY_UPD; + pCtx->llcpPendMask |= 1 << LCTR_PROC_PHY_UPD; + LL_TRACE_INFO2("Pending PHY_UPD=%u procedure: activeProc=%u", LCTR_PROC_PHY_UPD, pCtx->llcpActiveProc); + break; + + case LCTR_PU_EVENT_PEER_REJECT: + pCtx->llcpPendMask &= ~(1 << LCTR_PROC_PHY_UPD); + if (pCtx->phyUpdState != LCTR_PU_STATE_IDLE) + { + pCtx->phyUpdState = LCTR_PU_STATE_IDLE; + } + lctrNotifyHostPhyUpdateInd(pCtx, lctrDataPdu.pld.rejInd.reason); + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if active procedure can be overridden with phy update procedure. + * + * \param pCtx Connection context. + * \param event Subsystem event. + * + * \return None. + * + * This routine will pend the active procedure and allow the phy update procedure to + * override it. + */ +/*************************************************************************************************/ +static void lctrSlvCheckProcOverride(lctrConnCtx_t *pCtx, uint8_t event) +{ + switch (event) + { + case LCTR_PU_EVENT_PEER_PHY_REQ: + /* Only the procedure without instant fields can be overridden. */ + switch (pCtx->llcpActiveProc) + { + case LCTR_PROC_CMN_VER_EXCH: + case LCTR_PROC_CMN_FEAT_EXCH: + case LCTR_PROC_CMN_DATA_LEN_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_PHY_UPD; + pCtx->llcpIsOverridden = TRUE; + break; + case LCTR_PROC_CONN_UPD: + pCtx->llcpPendMask |= 1 << pCtx->llcpActiveProc; + pCtx->llcpActiveProc = LCTR_PROC_PHY_UPD; + break; + default: + break; + } + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute slave PHY update LLCP state machine. + * + * \param pCtx Connection context. + * \param event State machine event. + * + * \return TRUE if peer response pending, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lctrSlvLlcpExecutePhyUpdateSm(lctrConnCtx_t *pCtx, uint8_t event) +{ + if ((event = lctrRemapEvent(pCtx, event)) == LCTR_PU_EVENT_INVALID) + { + return FALSE; + } + + switch (pCtx->llcpState) + { + case LCTR_LLCP_STATE_IDLE: + LL_TRACE_INFO3("lctrSlvLlcpExecutePhyUpdateSm: handle=%u, llcpState=IDLE, phyUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->phyUpdState, event); + + lctrExecAction(pCtx, event); + + if (pCtx->phyUpdState != LCTR_PU_STATE_IDLE) + { + pCtx->llcpState = LCTR_LLCP_STATE_BUSY; + pCtx->llcpActiveProc = LCTR_PROC_PHY_UPD; + pCtx->llcpInstantComp = FALSE; + } + break; + + case LCTR_LLCP_STATE_BUSY: + LL_TRACE_INFO3("lctrSlvLlcpExecutePhyUpdateSm: handle=%u, llcpState=BUSY, phyUpdState=%u, event=%u", LCTR_GET_CONN_HANDLE(pCtx), pCtx->phyUpdState, event); + + lctrSlvCheckProcOverride(pCtx, event); + + if (pCtx->llcpActiveProc == LCTR_PROC_PHY_UPD) + { + lctrExecAction(pCtx, event); + + if (pCtx->phyUpdState == LCTR_PU_STATE_IDLE) + { + lctrStopLlcpTimer(pCtx); + pCtx->llcpState = LCTR_LLCP_STATE_IDLE; + pCtx->llcpActiveProc = LCTR_PROC_INVALID; + + lctrStartPendingLlcp(pCtx); + } + } + else + { + lctrResolveCollision(pCtx, event); + } + + break; + + default: + break; + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd.c new file mode 100644 index 0000000000000000000000000000000000000000..d8f6e5494b230288b964408c8ef666456e6ad52e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd.c @@ -0,0 +1,585 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "bb_ble_drv.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "ll_math.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Unpack a set event mask command packet (either general and LE event masks). + * + * \param pEvtMsk Event mask. + * \param pBuf Packed packet buffer. + * + * \return Payload length. + */ +/*************************************************************************************************/ +static uint8_t lhciUnpackSetEventMaskCmd(uint64_t *pEvtMsk, const uint8_t *pBuf) +{ + const uint8_t len = sizeof(uint64_t); + + BSTREAM_TO_UINT64(*pEvtMsk, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a read buffer size event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param pktLen Data packet length. + * \param numPkts Number of controller data packet buffers. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadBufSizeEvt(uint8_t *pBuf, uint8_t status, uint16_t pktLen, uint16_t numPkts) +{ + const uint8_t len = LHCI_LEN_LE_READ_BUF_SIZE_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, pktLen); + UINT8_TO_BSTREAM (pBuf, numPkts); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a local version info event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackLocalVersionInfo(uint8_t *pBuf, uint8_t status) +{ + const uint8_t len = LHCI_LEN_READ_LOCAL_VER_EVT; + + uint16_t compId; + uint8_t btVer; + uint16_t implRev; + + LlGetVersion(&compId, &btVer, &implRev); + + UINT8_TO_BSTREAM (pBuf, status); + UINT8_TO_BSTREAM (pBuf, btVer); /* HCI_Version */ + UINT16_TO_BSTREAM(pBuf, implRev); /* HCI_Revision */ + UINT8_TO_BSTREAM (pBuf, btVer); /* LMP_Version */ + UINT16_TO_BSTREAM(pBuf, compId); /* Manufacturer_Name */ + UINT16_TO_BSTREAM(pBuf, implRev); /* LMP_Subversion */ + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a local supported commands event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackLocalSupCmds(uint8_t *pBuf, uint8_t status) +{ + const uint8_t len = LHCI_LEN_READ_LOCAL_SUP_CMDS_EVT; + + memset(pBuf, 0, len); + + UINT8_TO_BSTREAM (pBuf, status); + + pBuf[5] = HCI_SUP_SET_EVENT_MASK | /* mandatory */ + HCI_SUP_RESET; /* mandatory */ + pBuf[14] = HCI_SUP_READ_LOCAL_VER_INFO | /* mandatory */ + HCI_SUP_READ_LOCAL_SUP_FEAT; /* mandatory */ + pBuf[15] = HCI_SUP_READ_BD_ADDR; /* mandatory */ + pBuf[22] = HCI_SUP_SET_EVENT_MASK_PAGE2; /* optional or LE ping */ + pBuf[25] = HCI_SUP_LE_SET_EVENT_MASK | /* mandatory */ + HCI_SUP_LE_READ_BUF_SIZE | /* mandatory */ + HCI_SUP_LE_READ_LOCAL_SUP_FEAT | /* mandatory */ + HCI_SUP_LE_SET_RAND_ADDR; /* Tx device */ + pBuf[26] = HCI_SUP_LE_READ_WHITE_LIST_SIZE | /* mandatory */ + HCI_SUP_LE_CLEAR_WHITE_LIST; /* mandatory */ + pBuf[27] = HCI_SUP_LE_ADD_DEV_WHITE_LIST | /* mandatory */ + HCI_SUP_LE_REMOVE_DEV_WHITE_LIST | /* mandatory */ + HCI_SUP_LE_RAND; /* LL encryption or optional */ + pBuf[28] = HCI_SUP_LE_READ_SUP_STATES | /* mandatory (4.1+) */ + HCI_SUP_LE_RECEIVER_TEST | /* Rx device */ + HCI_SUP_LE_TRANSMITTER_TEST | /* Tx device */ + HCI_SUP_LE_TEST_END; /* mandatory */ + pBuf[38] = HCI_SUP_LE_READ_TX_POWER; /* mandatory (5.0) */ + + if (lhciCmdTbl[LHCI_MSG_CONN]) + { + pBuf[0] |= HCI_SUP_DISCONNECT; /* Master or slave */ + pBuf[2] |= HCI_SUP_READ_REMOTE_VER_INFO; /* Master or slave */ + pBuf[10] |= HCI_SUP_READ_TX_PWR_LVL; /* Master or slave */ + pBuf[15] |= HCI_SUP_READ_RSSI; /* Master or slave */ + + pBuf[27] |= HCI_SUP_LE_CONN_UPDATE | /* Master role or initiating conn param req */ + HCI_SUP_LE_READ_CHAN_MAP | /* Master or slave */ + HCI_SUP_LE_READ_REMOTE_FEAT; /* Master or optional */ + + pBuf[33] |= HCI_SUP_LE_SET_DATA_LEN | /* Data length extensions */ + HCI_SUP_LE_READ_DEF_DATA_LEN | /* Data length extensions */ + HCI_SUP_LE_REM_CONN_PARAM_REQ_REPL | /* Accepting conn param req */ + HCI_SUP_LE_REM_CONN_PARAM_REQ_NEG_REPL; /* Accepting conn param req */ + pBuf[34] |= HCI_SUP_LE_WRITE_DEF_DATA_LEN; /* Data length extensions */ + pBuf[35] |= HCI_SUP_LE_READ_MAX_DATA_LEN; /* Data length extensions */ + } + + if (lhciCmdTbl[LHCI_MSG_SCAN]) /* i.e. master */ + { + pBuf[26] |= HCI_SUP_LE_SET_SCAN_PARAM | /* Rx device */ + HCI_SUP_LE_SET_SCAN_ENABLE; /* Rx device */ + + if (lhciCmdTbl[LHCI_MSG_CONN]) + { + pBuf[26] |= HCI_SUP_LE_CREATE_CONN | /* Master role */ + HCI_SUP_LE_CREATE_CONN_CANCEL; /* Master role */ + pBuf[27] |= HCI_SUP_LE_SET_HOST_CHAN_CLASS; /* Master role */ + } + } + + if (lhciCmdTbl[LHCI_MSG_ADV]) /* i.e. slave */ + { + pBuf[25] |= HCI_SUP_LE_SET_ADV_PARAM | /* Tx device */ + HCI_SUP_LE_READ_ADV_TX_POWER | /* Tx device */ + HCI_SUP_LE_SET_ADV_DATA; /* Tx device */ + pBuf[26] |= HCI_SUP_LE_SET_SCAN_RESP_DATA | /* Tx + Rx device */ + HCI_SUP_LE_SET_ADV_ENABLE; /* Tx device */ + } + + if (lhciCmdTbl[LHCI_MSG_ENC] && + lhciCmdTbl[LHCI_MSG_CONN]) + { + pBuf[27] |= HCI_SUP_LE_ENCRYPT; /* LL encryption */ + pBuf[28] |= HCI_SUP_LE_LTK_REQ_REPL | /* LL encryption + slave */ + HCI_SUP_LE_LTK_REQ_NEG_REPL | /* LL encryption + slave */ + HCI_SUP_LE_START_ENCRYPTION; /* LL encryption + master */ + pBuf[32] |= HCI_SUP_READ_AUTH_PAYLOAD_TO | /* LE ping */ + HCI_SUP_WRITE_AUTH_PAYLOAD_TO; /* LE ping */ + } + + if (lhciCmdTbl[LHCI_MSG_PRIV]) + { + pBuf[34] |= HCI_SUP_LE_ADD_DEV_RES_LIST_EVT | /* LE privacy */ + HCI_SUP_LE_REMOVE_DEV_RES_LIST | /* LE privacy */ + HCI_SUP_LE_CLEAR_RES_LIST | /* LE privacy */ + HCI_SUP_LE_READ_RES_LIST_SIZE; /* LE privacy */ + pBuf[35] |= HCI_SUP_LE_SET_ADDR_RES_ENABLE | /* LE privacy */ + HCI_SUP_LE_SET_RES_PRIV_ADDR_TO; /* LE privacy */ + pBuf[39] |= HCI_SUP_LE_SET_PRIVACY_MODE; /* LE privacy */ + + if (lhciCmdTbl[LHCI_MSG_CONN]) + { + pBuf[34] |= HCI_SUP_LE_READ_PEER_RES_ADDR; /* LE privacy + master or slave */ + pBuf[35] |= HCI_SUP_LE_READ_LOCAL_RES_ADDR; /* LE privacy + master or slave */ + } + } + + if (lhciCmdTbl[LHCI_MSG_SC]) + { + pBuf[34] |= HCI_SUP_LE_READ_LOCAL_P256_PUB_KEY | /* Secure connections */ + HCI_SUP_LE_GENERATE_DHKEY; /* Secure connections */ + } + + if (lhciCmdTbl[LHCI_MSG_PHY]) + { + pBuf[35] |= HCI_SUP_LE_READ_PHY | /* LE PHY features */ + HCI_SUP_LE_SET_DEF_PHY | /* LE PHY features */ + HCI_SUP_LE_SET_PHY | /* LE PHY features */ + HCI_SUP_LE_ENHANCED_RECEIVER_TEST; /* LE PHY features */ + pBuf[36] |= HCI_SUP_LE_ENHANCED_TRANSMITTER_TEST; /* LE PHY features */ + } + + if (lhciCmdTbl[LHCI_MSG_EXT_ADV]) + { + pBuf[36] |= HCI_SUP_LE_SET_ADV_SET_RAND_ADDR | /* Extended advertising */ + HCI_SUP_LE_SET_EXT_ADV_PARAM | /* Extended advertising */ + HCI_SUP_LE_SET_EXT_ADV_DATA | /* Extended advertising */ + HCI_SUP_LE_SET_EXT_SCAN_RESP_DATA | /* Extended advertising */ + HCI_SUP_LE_SET_EXT_ADV_ENABLE | /* Extended advertising */ + HCI_SUP_LE_READ_MAX_ADV_DATA_LEN | /* Extended advertising */ + HCI_SUP_LE_READ_NUM_OF_SUP_ADV_SETS; /* Extended advertising */ + pBuf[37] |= HCI_SUP_LE_REMOVE_ADV_SET | /* Extended advertising */ + HCI_SUP_LE_CLEAR_ADV_SETS; /* Extended advertising */ + pBuf[39] |= HCI_SUP_LE_READ_RF_PATH_COMP | /* Extended advertising */ + HCI_SUP_LE_WRITE_RF_PATH_COMP; /* Extended advertising */ + } + + if (lhciCmdTbl[LHCI_MSG_EXT_SCAN]) + { + pBuf[37] |= HCI_SUP_LE_SET_EXT_SCAN_PARAM | /* Extended scanning */ + HCI_SUP_LE_SET_EXT_SCAN_ENABLE; /* Extended scanning */ + + if (lhciCmdTbl[LHCI_MSG_CONN]) + { + pBuf[37] |= HCI_SUP_LE_EXT_CREATE_CONN; /* Extended initiate. */ + } + } + + if (lhciCmdTbl[LHCI_MSG_PER_ADV]) + { + pBuf[37] |= HCI_SUP_LE_SET_PER_ADV_PARAM | /* Periodic advertising */ + HCI_SUP_LE_SET_PER_ADV_DATA | /* Periodic advertising */ + HCI_SUP_LE_SET_PER_ADV_ENABLE; + } + + if (lhciCmdTbl[LHCI_MSG_PER_SCAN]) + { + pBuf[38] |= HCI_SUP_LE_PER_ADV_CREATE_SYNC | /* Periodic scanning */ + HCI_SUP_LE_PER_ADV_CREATE_SYNC_CANCEL | /* Periodic scanning */ + HCI_SUP_LE_PER_ADV_TERMINATE_SYNC | /* Periodic scanning */ + HCI_SUP_LE_ADD_DEV_PER_ADV_LIST | /* Periodic scanning */ + HCI_SUP_LE_REMOVE_DEV_PER_ADV_LIST | /* Periodic scanning */ + HCI_SUP_LE_CLEAR_PER_ADV_LIST | /* Periodic scanning */ + HCI_SUP_LE_READ_PER_ADV_LIST_SIZE; /* Periodic scanning */ + } + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a local supported features event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackLocalSupFeat(uint8_t *pBuf, uint8_t status) +{ + const uint8_t len = LHCI_LEN_LE_READ_LOCAL_SUP_FEAT_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT64_TO_BSTREAM(pBuf, LHCI_LOCAL_SUP_FEAT_VAL); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send command status event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendCmdStatusEvt(LhciHdr_t *pCmdHdr, uint8_t status) +{ + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_STATUS_EVT, HCI_LEN_CMD_STATUS)) == NULL) + { + return; + } + + lhciPackCmdStatusEvt(pEvtBuf, status, pCmdHdr->opCode); + lhciSendEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciCommonSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_SET_EVENT_MASK: + case HCI_OPCODE_SET_EVENT_MASK_PAGE2: + case HCI_OPCODE_LE_SET_EVENT_MASK: + case HCI_OPCODE_LE_SET_RAND_ADDR: + case HCI_OPCODE_LE_CLEAR_WHITE_LIST: + case HCI_OPCODE_LE_ADD_DEV_WHITE_LIST: + case HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST: + case HCI_OPCODE_LE_WRITE_RF_PATH_COMP: + case HCI_OPCODE_NOP: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- status --- */ + + case HCI_OPCODE_LE_RAND: + { + const uint8_t size = sizeof(uint64_t) / sizeof(uint8_t); + + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + BbBleDrvRand(pBuf, size); + pBuf += size; + break; + } + /* --- device management --- */ + + case HCI_OPCODE_LE_READ_WHITE_LIST_SIZE: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + *pBuf = LlGetWhitelistSize(); + break; + case HCI_OPCODE_READ_LOCAL_VER_INFO: + lhciPackLocalVersionInfo(pBuf, status); + break; + case HCI_OPCODE_READ_LOCAL_SUP_CMDS: + lhciPackLocalSupCmds(pBuf, status); + break; + case HCI_OPCODE_READ_LOCAL_SUP_FEAT: + lhciPackLocalSupFeat(pBuf, status); + break; + case HCI_OPCODE_READ_BD_ADDR: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + LlGetBdAddr(pBuf); + break; + case HCI_OPCODE_LE_READ_BUF_SIZE: + lhciPackReadBufSizeEvt(pBuf, status, LlGetAclMaxSize(), LlGetAclTxBufs()); + break; + case HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + LlGetFeatures(pBuf); + break; + case HCI_OPCODE_LE_READ_SUP_STATES: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + LlGetSupStates(pBuf); + break; + case HCI_OPCODE_LE_READ_TX_POWER: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + LlReadSupTxPower((int8_t *)&pBuf[0], (int8_t *)&pBuf[1]); + break; + case HCI_OPCODE_LE_READ_RF_PATH_COMP: + { + int16_t txPathComp; + int16_t rxPathComp; + LlReadRfPathComp(&txPathComp, &rxPathComp); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, txPathComp); + UINT16_TO_BSTREAM(pBuf, rxPathComp); + break; + } + + /* --- test --- */ + + case HCI_OPCODE_LE_RECEIVER_TEST: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + case HCI_OPCODE_LE_TRANSMITTER_TEST: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + case HCI_OPCODE_LE_TEST_END: + { + LlTestReport_t rpt = {0}; + status = LlEndTest(&rpt); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, rpt.numRxSuccess); + break; + } + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - status + * - local device management + * - test + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciCommonDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciCommonVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- status --- */ + + case HCI_OPCODE_LE_RAND: + paramLen = LHCI_LEN_LE_RAND_EVT; + break; + + /* --- local device management --- */ + + case HCI_OPCODE_LE_SET_RAND_ADDR: + status = LlSetRandAddr(pBuf); + paramLen = LHCI_LEN_LE_SET_RAND_ADDR_EVT; + break; + case HCI_OPCODE_LE_READ_WHITE_LIST_SIZE: + paramLen = LHCI_LEN_LE_READ_WL_SIZE_EVT; + break; + case HCI_OPCODE_LE_CLEAR_WHITE_LIST: + status = LlClearWhitelist(); + paramLen = LHCI_LEN_LE_CLEAR_WHITE_LIST_EVT; + break; + case HCI_OPCODE_LE_ADD_DEV_WHITE_LIST: + status = LlAddDeviceToWhitelist(*pBuf, pBuf + 1); + paramLen = LHCI_LEN_LE_ADD_DEV_WHITE_LIST_EVT; + break; + case HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST: + status = LlRemoveDeviceFromWhitelist(*pBuf, pBuf + 1); + paramLen = LHCI_LEN_LE_REMOVE_DEV_WHITE_LIST_EVT; + break; + case HCI_OPCODE_SET_EVENT_MASK: + lhciUnpackSetEventMaskCmd(&lhciCb.evtMsk, pBuf); + paramLen = LHCI_LEN_SET_EVENT_MASK_EVT; + break; + case HCI_OPCODE_SET_EVENT_MASK_PAGE2: + lhciUnpackSetEventMaskCmd(&lhciCb.evtMskPg2, pBuf); + paramLen = LHCI_LEN_SET_EVENT_MASK_EVT; + break; + case HCI_OPCODE_READ_LOCAL_VER_INFO: + paramLen = LHCI_LEN_READ_LOCAL_VER_EVT; + break; + case HCI_OPCODE_READ_LOCAL_SUP_CMDS: + paramLen = LHCI_LEN_READ_LOCAL_SUP_CMDS_EVT; + break; + case HCI_OPCODE_READ_LOCAL_SUP_FEAT: + paramLen = LHCI_LEN_READ_LOCAL_SUP_FEAT_EVT; + break; + case HCI_OPCODE_READ_BD_ADDR: + paramLen = LHCI_LEN_READ_BD_ADDR_EVT; + break; + case HCI_OPCODE_LE_SET_EVENT_MASK: + lhciUnpackSetEventMaskCmd(&lhciCb.leEvtMsk, pBuf); + paramLen = LHCI_LEN_LE_SET_EVENT_MASK_EVT; + break; + case HCI_OPCODE_LE_READ_BUF_SIZE: + paramLen = LHCI_LEN_LE_READ_BUF_SIZE_EVT; + break; + case HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT: + paramLen = LHCI_LEN_LE_READ_LOCAL_SUP_FEAT_EVT; + break; + case HCI_OPCODE_LE_READ_SUP_STATES: + paramLen = LHCI_LEN_LE_READ_SUP_STATES_EVT; + break; + case HCI_OPCODE_LE_READ_TX_POWER: + paramLen = LHCI_LEN_LE_READ_SUP_TX_POWER; + break; + case HCI_OPCODE_LE_WRITE_RF_PATH_COMP: + { + int16_t txPathComp; + int16_t rxPathComp; + BSTREAM_TO_UINT16(txPathComp, pBuf); + BSTREAM_TO_UINT16(rxPathComp, pBuf); + status = LlWriteRfPathComp(txPathComp, rxPathComp); + paramLen = LHCI_LEN_LE_WRITE_RF_PATH_COMP; + break; + } + case HCI_OPCODE_LE_READ_RF_PATH_COMP: + { + paramLen = LHCI_LEN_LE_READ_RF_PATH_COMP; + break; + } + case HCI_OPCODE_RESET: + LlReset(); + + /* No events during reset. */ + lhciCb.evtMsk = 0; + lhciCb.evtMskPg2 = 0; + lhciCb.leEvtMsk = 0; + + return TRUE; /* LL event handler sends command completion */ + case HCI_OPCODE_NOP: + paramLen = 1; + break; + + /* --- test --- */ + + case HCI_OPCODE_LE_RECEIVER_TEST: + status = LlRxTest(pBuf[0], 0); + paramLen = LHCI_LEN_LE_RECEIVER_TEST_EVT; + break; + case HCI_OPCODE_LE_TRANSMITTER_TEST: + status = LlTxTest(pBuf[0], pBuf[1], pBuf[2], 0); + paramLen = LHCI_LEN_LE_TRANSMITTER_TEST_EVT; + break; + case HCI_OPCODE_LE_TEST_END: + paramLen = LHCI_LEN_LE_TEST_END_EVT; + break; + + /* --- default --- */ + + default: + return FALSE; /* exit dispatcher routine */ + } + + lhciCommonSendCmdCmplEvt(pHdr, status, paramLen); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..189336b17db468d972a02b7d2d5fe97c57b10907 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master.c @@ -0,0 +1,147 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Unpack a set scan parameter command packet. + * + * \param pCmd Unpacked command structure. + * \param pBuf Packed packet buffer. + * + * \return Payload length. + */ +/*************************************************************************************************/ +static uint8_t lhciUnpackSetScanParamCmd(LlScanParam_t *pCmd, const uint8_t *pBuf) +{ + const uint8_t len = 7; + + BSTREAM_TO_UINT8 (pCmd->scanType, pBuf); + BSTREAM_TO_UINT16(pCmd->scanInterval, pBuf); + BSTREAM_TO_UINT16(pCmd->scanWindow, pBuf); + BSTREAM_TO_UINT8 (pCmd->ownAddrType, pBuf); + BSTREAM_TO_UINT8 (pCmd->scanFiltPolicy, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciMstScanSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_SCAN_PARAM: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - scan control + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstScanDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciMstScanVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- scan control --- */ + + case HCI_OPCODE_LE_SET_SCAN_PARAM: + { + LlScanParam_t cmd; + lhciUnpackSetScanParamCmd(&cmd, pBuf); + status = LlSetScanParam(&cmd); + paramLen = LHCI_LEN_LE_SET_SCAN_PARAM_EVT; + break; + } + case HCI_OPCODE_LE_SET_SCAN_ENABLE: + LlScanEnable(pBuf[0], pBuf[1]); + return TRUE; /* LL event handler sends command completion */ + + /* --- default --- */ + + default: + return FALSE; /* exit dispatcher routine */ + } + + lhciMstScanSendCmdCmplEvt(pHdr, status, paramLen); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..a2a3f12fe9d3f1e240bfbde211ff33eb94c2f6d2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c @@ -0,0 +1,261 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "util/bstream.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum number of scanning PHYs. */ +#define LHCI_MAX_SCAN_PHY 3 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Set advertising parameter command. */ +typedef struct +{ + uint8_t ownAddrType; /*!< Own address type. */ + uint8_t scanFiltPolicy; /*!< Scan filter policy. */ + uint8_t scanPhys; /*!< Scanning PHYs. */ + LlExtScanParam_t param[LHCI_MAX_SCAN_PHY]; /*!< Extended scan parameters for each PHY. */ +} lhciSetExtScanParamCmd_t; + +/*************************************************************************************************/ +/*! + * \brief Unpack a set scan parameter command packet. + * + * \param pCmd Unpacked command structure. + * \param pBuf Packed packet buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciUnpackSetExtScanParamCmd(lhciSetExtScanParamCmd_t *pCmd, const uint8_t *pBuf) +{ + const unsigned int maxBits = 8; + unsigned int i; /* scanPhy bit position */ + unsigned int j; /* param array index */ + + BSTREAM_TO_UINT8(pCmd->ownAddrType, pBuf); + BSTREAM_TO_UINT8(pCmd->scanFiltPolicy, pBuf); + BSTREAM_TO_UINT8(pCmd->scanPhys, pBuf); + + for (i = 0, j = 0; (i < maxBits) && (j < LHCI_MAX_SCAN_PHY); i++) + { + if (pCmd->scanPhys & (1 << i)) + { + BSTREAM_TO_UINT8 (pCmd->param[j].scanType, pBuf); + BSTREAM_TO_UINT16(pCmd->param[j].scanInterval, pBuf); + BSTREAM_TO_UINT16(pCmd->param[j].scanWindow, pBuf); + j++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciMstAeSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_EXT_SCAN_PARAM: + case HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE: + case HCI_OPCODE_LE_PER_ADV_CREATE_SYNC_CANCEL: + case HCI_OPCODE_LE_PER_ADV_TERMINATE_SYNC: + case HCI_OPCODE_LE_ADD_DEV_PER_ADV_LIST: + case HCI_OPCODE_LE_REMOVE_DEV_PER_ADV_LIST: + case HCI_OPCODE_LE_CLEAR_PER_ADV_LIST: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + case HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE: + { + uint8_t listSize = 0; + status = LlReadPeriodicAdvListSize(&listSize); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT8_TO_BSTREAM(pBuf, listSize); + break; + } + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstExtScanDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciMstExtScanVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- LE Advertising Extensions --- */ + + case HCI_OPCODE_LE_SET_EXT_SCAN_PARAM: + { + lhciSetExtScanParamCmd_t cmd; + lhciUnpackSetExtScanParamCmd(&cmd, pBuf); + status = LlSetExtScanParam(cmd.ownAddrType, cmd.scanFiltPolicy, cmd.scanPhys, cmd.param); + paramLen = LHCI_LEN_LE_SET_EXT_SCAN_PARAM; + break; + } + case HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE: + { + uint8_t enable; + uint8_t filterDup; + uint16_t duration; + uint16_t period; + + enable = *pBuf++; + filterDup = *pBuf++; + BSTREAM_TO_UINT16(duration, pBuf); + BSTREAM_TO_UINT16(period, pBuf); + + LlExtScanEnable(enable, filterDup, duration, period); + return TRUE; /* LL event handler sends command completion */ + } + case HCI_OPCODE_LE_PER_ADV_CREATE_SYNC: + { + LlPerAdvCreateSyncCmd_t cmd; + BSTREAM_TO_UINT8(cmd.filterPolicy, pBuf); + BSTREAM_TO_UINT8(cmd.advSID, pBuf); + BSTREAM_TO_UINT8(cmd.advAddrType, pBuf); + cmd.pAdvAddr = pBuf; + pBuf += BDA_ADDR_LEN; + BSTREAM_TO_UINT16(cmd.skip, pBuf); + BSTREAM_TO_UINT16(cmd.syncTimeOut, pBuf); + pBuf++; + status = LlPeriodicAdvCreateSync(&cmd); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + case HCI_OPCODE_LE_PER_ADV_CREATE_SYNC_CANCEL: + { + status = LlPeriodicAdvCreateSyncCancel(); + paramLen = LHCI_LEN_LE_PER_ADV_CREATE_SYNC_CANCEL; + break; + } + case HCI_OPCODE_LE_PER_ADV_TERMINATE_SYNC: + { + uint16_t syncHandle; + BSTREAM_TO_UINT16(syncHandle, pBuf); + status = LlPeriodicAdvTerminateSync(syncHandle); + paramLen = LHCI_LEN_LE_PER_ADV_TERMINATE_SYNC; + break; + } + case HCI_OPCODE_LE_ADD_DEV_PER_ADV_LIST: + { + LlDevicePerAdvList_t cmd; + BSTREAM_TO_UINT8(cmd.advAddrType, pBuf); + cmd.pAdvAddr = pBuf; + pBuf += BDA_ADDR_LEN; + BSTREAM_TO_UINT8(cmd.advSID, pBuf); + status = LlAddDeviceToPeriodicAdvList(&cmd); + paramLen = LHCI_LEN_LE_ADD_DEV_PER_ADV_LIST; + break; + } + case HCI_OPCODE_LE_REMOVE_DEV_PER_ADV_LIST: + { + LlDevicePerAdvList_t cmd; + BSTREAM_TO_UINT8(cmd.advAddrType, pBuf); + cmd.pAdvAddr = pBuf; + pBuf += BDA_ADDR_LEN; + BSTREAM_TO_UINT8(cmd.advSID, pBuf); + status = LlRemoveDeviceFromPeriodicAdvList(&cmd); + paramLen = LHCI_LEN_LE_REM_DEV_PER_ADV_LIST; + break; + } + case HCI_OPCODE_LE_CLEAR_PER_ADV_LIST: + { + status = LlClearPeriodicAdvList(); + paramLen = LHCI_LEN_LE_CLEAR_PER_ADV_LIST; + break; + } + case HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE: + { + paramLen = LHCI_LEN_LE_READ_PER_ADV_LIST_SIZE; + break; + } + /* --- default --- */ + + default: + return FALSE; + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + else if (paramLen > 0) + { + lhciMstAeSendCmdCmplEvt(pHdr, status, paramLen); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..645cf201341559b5c3c50834ee17ae788b668c49 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_priv.c @@ -0,0 +1,172 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a read resolving list size event. + * + * \param pBuf Packed packet buffer. + * \param status Status code. + * \param size Resolving list size. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadResListSizeEvt(uint8_t *pBuf, uint8_t status, uint16_t size) +{ + const uint8_t len = LHCI_LEN_LE_READ_RES_LIST_SIZE_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, size); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPrivAdvSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_ADD_DEV_RES_LIST: + case HCI_OPCODE_LE_REMOVE_DEV_RES_LIST: + case HCI_OPCODE_LE_CLEAR_RES_LIST: + case HCI_OPCODE_LE_SET_ADDR_RES_ENABLE: + case HCI_OPCODE_LE_SET_RES_PRIV_ADDR_TO: + case HCI_OPCODE_LE_SET_PRIVACY_MODE: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + case HCI_OPCODE_LE_READ_RES_LIST_SIZE: + { + uint8_t size = 0; + status = LlReadResolvingListSize(&size); + lhciPackReadResListSizeEvt(pBuf, status, size); + break; + } + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciPrivAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch (pHdr->opCode) + { + case HCI_OPCODE_LE_ADD_DEV_RES_LIST: + { + status = LlAddDeviceToResolvingList(pBuf[0], pBuf + 1, pBuf + 7, pBuf + 23); + paramLen = LHCI_LEN_LE_ADD_DEV_RES_LIST_EVT; + break; + } + case HCI_OPCODE_LE_REMOVE_DEV_RES_LIST: + { + status = LlRemoveDeviceFromResolvingList(pBuf[0], pBuf + 1); + paramLen = LHCI_LEN_LE_REMOVE_DEV_RES_LIST_EVT; + break; + } + case HCI_OPCODE_LE_CLEAR_RES_LIST: + { + status = LlClearResolvingList(); + paramLen = LHCI_LEN_LE_CLEAR_RES_LIST_EVT; + break; + } + case HCI_OPCODE_LE_READ_RES_LIST_SIZE: + { + paramLen = LHCI_LEN_LE_READ_RES_LIST_SIZE_EVT; + break; + } + case HCI_OPCODE_LE_SET_ADDR_RES_ENABLE: + { + status = LlSetAddrResolutionEnable(pBuf[0]); + paramLen = LHCI_LEN_LE_SET_ADDR_RES_ENABLE_EVT; + break; + } + case HCI_OPCODE_LE_SET_RES_PRIV_ADDR_TO: + { + uint16_t rpaTimeout; + BSTREAM_TO_UINT16(rpaTimeout, pBuf); + status = LlSetResolvablePrivateAddrTimeout(rpaTimeout); + paramLen = LHCI_LEN_LE_SET_RES_PRIV_ADDR_TO_EVT; + break; + } + case HCI_OPCODE_LE_SET_PRIVACY_MODE: + { + status = LlSetPrivacyMode(pBuf[0], pBuf + 1, pBuf[7]); + paramLen = LHCI_LEN_LE_SET_PRIVACY_MODE; + break; + } + + default: + return FALSE; /* exit dispatcher routine */ + } + + lhciPrivAdvSendCmdCmplEvt(pHdr, status, paramLen); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..f999e1e08b772abc1b44ec186782dc2778bc9bb5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave.c @@ -0,0 +1,201 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Set advertising parameter command. */ +typedef struct +{ + uint16_t advIntervalMin; /*!< Minimum advertising interval. */ + uint16_t advIntervalMax; /*!< Maximum advertising interval. */ + uint8_t advType; /*!< Advertising type. */ + uint8_t ownAddrType; /*!< Address type used by this device. */ + uint8_t directAddrType; /*!< Address type of peer device. Only used for directed advertising. */ + bdAddr_t directAddr; /*!< Address of peer device. Only used for directed advertising. */ + uint8_t advChanMap; /*!< Advertising channel map. */ + uint8_t advFiltPolicy; /*!< Advertising filter policy. */ +} lhciSetAdvParamCmd_t; + +/*************************************************************************************************/ +/*! + * \brief Unpack a set advertising parameter command packet. + * + * \param pCmd Unpacked command structure. + * \param pBuf Packed packet buffer. + * + * \return Payload length. + */ +/*************************************************************************************************/ +static uint8_t lhciUnpackSetAdvParamCmd(lhciSetAdvParamCmd_t *pCmd, const uint8_t *pBuf) +{ + const uint8_t len = 15; + + BSTREAM_TO_UINT16(pCmd->advIntervalMin, pBuf); + BSTREAM_TO_UINT16(pCmd->advIntervalMax, pBuf); + BSTREAM_TO_UINT8 (pCmd->advType, pBuf); + BSTREAM_TO_UINT8 (pCmd->ownAddrType, pBuf); + BSTREAM_TO_UINT8 (pCmd->directAddrType, pBuf); + memcpy(pCmd->directAddr, pBuf, sizeof(pCmd->directAddr)); + pBuf += sizeof(pCmd->directAddr); + BSTREAM_TO_UINT8 (pCmd->advChanMap, pBuf); + BSTREAM_TO_UINT8 (pCmd->advFiltPolicy, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciSlvAdvSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_ADV_PARAM: + case HCI_OPCODE_LE_SET_ADV_DATA: + case HCI_OPCODE_LE_SET_SCAN_RESP_DATA: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- advertising control --- */ + + case HCI_OPCODE_LE_READ_ADV_TX_POWER: + { + int8_t advTxPwr = 0; + status = LlGetAdvTxPower(&advTxPwr); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT8_TO_BSTREAM(pBuf, advTxPwr); + break; + } + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - status + * - advertising control + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciSlvAdvVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- status --- */ + + case HCI_OPCODE_LE_READ_ADV_TX_POWER: + paramLen = LHCI_LEN_LE_READ_ADV_TX_POWER_EVT; + break; + + /* --- advertising control --- */ + + case HCI_OPCODE_LE_SET_ADV_DATA: + /* coverity[check_return] */ + status = LlSetAdvData(pBuf[0], pBuf + 1); + paramLen = LHCI_LEN_LE_SET_ADV_DATA_EVT; + break; + case HCI_OPCODE_LE_SET_SCAN_RESP_DATA: + /* coverity[check_return] */ + status = LlSetScanRespData(pBuf[0], pBuf + 1); + paramLen = LHCI_LEN_LE_SET_SCAN_RESP_DATA_EVT; + break; + case HCI_OPCODE_LE_SET_ADV_PARAM: + { + lhciSetAdvParamCmd_t cmd; + lhciUnpackSetAdvParamCmd(&cmd, pBuf); + /* coverity[check_return] */ + status = LlSetAdvParam(cmd.advIntervalMin, cmd.advIntervalMax, cmd.advType, + cmd.ownAddrType, cmd.directAddrType, cmd.directAddr, + cmd.advChanMap, cmd.advFiltPolicy); + paramLen = LHCI_LEN_LE_SET_ADV_PARAM_EVT; + break; + } + case HCI_OPCODE_LE_SET_ADV_ENABLE: + LlAdvEnable(pBuf[0]); + return TRUE; /* LL event handler sends command completion */ + + /* --- default --- */ + + default: + return FALSE; /* exit dispatcher routine */ + } + + lhciSlvAdvSendCmdCmplEvt(pHdr, status, paramLen); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..54c438a13bce2ccc05170761d602c46f2c9e3eb8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c @@ -0,0 +1,261 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * \param handle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciSlvExtAdvSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint8_t handle) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- LE Extended Advertising --- */ + + case HCI_OPCODE_LE_SET_EXT_ADV_PARAM: + { + int8_t selTxPwr; + LlGetExtAdvTxPowerLevel(handle, &selTxPwr); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT8_TO_BSTREAM(pBuf, selTxPwr); + break; + } + case HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN: + { + uint16_t maxLen = 31; + status = LlReadMaxAdvDataLen(&maxLen); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, maxLen); + break; + } + case HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS: + { + uint8_t numSets = 1; + status = LlReadNumSupAdvSets(&numSets); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT8_TO_BSTREAM(pBuf, numSets); + break; + } + + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_ADV_SET_RAND_ADDR: + case HCI_OPCODE_LE_SET_EXT_ADV_DATA: + case HCI_OPCODE_LE_SET_EXT_SCAN_RESP_DATA: + case HCI_OPCODE_LE_SET_EXT_ADV_ENABLE: + case HCI_OPCODE_LE_REMOVE_ADV_SET: + case HCI_OPCODE_LE_CLEAR_ADV_SETS: + case HCI_OPCODE_LE_SET_PER_ADV_PARAM: + case HCI_OPCODE_LE_SET_PER_ADV_DATA: + case HCI_OPCODE_LE_SET_PER_ADV_ENABLE: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvExtAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen, handle; + uint8_t *pAddr; + LlExtAdvEnableParam_t enaParam[LL_MAX_ADV_SETS]; + unsigned int i; + +#if LHCI_ENABLE_VS + if (lhciSlvExtAdvVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + handle = 0xFF; + + switch (pHdr->opCode) + { + /* --- LE Extended Advertising --- */ + + case HCI_OPCODE_LE_SET_ADV_SET_RAND_ADDR: + { + handle = pBuf[0]; + pAddr = &pBuf[1]; + status = LlSetAdvSetRandAddr(handle, pAddr); + paramLen = LHCI_LEN_LE_SET_EXT_SCAN_PARAM; + break; + } + case HCI_OPCODE_LE_SET_EXT_ADV_PARAM: + { + LlExtAdvParam_t extAdvParam; + BSTREAM_TO_UINT8 (handle, pBuf); + BSTREAM_TO_UINT16(extAdvParam.advEventProp, pBuf); + BSTREAM_TO_UINT24(extAdvParam.priAdvInterMin, pBuf); + BSTREAM_TO_UINT24(extAdvParam.priAdvInterMax, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.priAdvChanMap, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.ownAddrType, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.peerAddrType, pBuf); + extAdvParam.pPeerAddr = pBuf; + pBuf += BDA_ADDR_LEN; + BSTREAM_TO_UINT8 (extAdvParam.advFiltPolicy, pBuf); + BSTREAM_TO_INT8 (extAdvParam.advTxPwr, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.priAdvPhy, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.secAdvMaxSkip, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.secAdvPhy, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.advSID, pBuf); + BSTREAM_TO_UINT8 (extAdvParam.scanReqNotifEna, pBuf); + status = LlSetExtAdvParam(handle, &extAdvParam); + /* pBuf += */ lhciPackCmdCompleteEvtStatus(pBuf, status); + paramLen = LHCI_LEN_LE_SET_EXT_ADV_PARAM; + break; + } + case HCI_OPCODE_LE_SET_EXT_ADV_DATA: + { + status = LlSetExtAdvData(pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf + 4); + paramLen = LHCI_LEN_LE_SET_EXT_ADV_DATA; + break; + } + case HCI_OPCODE_LE_SET_EXT_SCAN_RESP_DATA: + { + status = LlSetExtScanRespData(pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf + 4); + paramLen = LHCI_LEN_LE_SET_EXT_SCAN_RESP_DATA; + break; + } + case HCI_OPCODE_LE_SET_EXT_ADV_ENABLE: + { + uint8_t enable; + uint8_t numOfSets; + BSTREAM_TO_UINT8(enable, pBuf); + BSTREAM_TO_UINT8(numOfSets, pBuf); + for (i = 0; i < WSF_MIN(numOfSets, LL_MAX_ADV_SETS); i++) + { + BSTREAM_TO_UINT8 (enaParam[i].handle, pBuf); + BSTREAM_TO_UINT16(enaParam[i].duration, pBuf); + BSTREAM_TO_UINT8 (enaParam[i].numEvents, pBuf); + } + LlExtAdvEnable(enable, numOfSets, enaParam); + /* Send command complete once LL finishes processing the command. */ + return TRUE; + } + case HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN: + { + paramLen = LHCI_LEN_LE_READ_MAX_ADV_DATA_LEN; + break; + } + case HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS: + { + paramLen = LHCI_LEN_LE_READ_NUM_OF_SUP_ADV_SETS; + break; + } + case HCI_OPCODE_LE_REMOVE_ADV_SET: + { + status = LlRemoveAdvSet(pBuf[0]); + paramLen = LHCI_LEN_LE_REMOVE_ADV_SET; + break; + } + case HCI_OPCODE_LE_CLEAR_ADV_SETS: + { + status = LlClearAdvSets(); + paramLen = LHCI_LEN_LE_CLEAR_ADV_SETS; + break; + } + + /* --- LE Periodic Advertising --- */ + + case HCI_OPCODE_LE_SET_PER_ADV_PARAM: + { + LlPerAdvParam_t perAdvParam; + BSTREAM_TO_UINT8 (handle, pBuf); + BSTREAM_TO_UINT16(perAdvParam.perAdvInterMin, pBuf); + BSTREAM_TO_UINT16(perAdvParam.perAdvInterMax, pBuf); + BSTREAM_TO_UINT16(perAdvParam.perAdvProp, pBuf); + status = LlSetPeriodicAdvParam(handle, &perAdvParam); + paramLen = LHCI_LEN_LE_SET_PER_ADV_PARAM; + break; + } + case HCI_OPCODE_LE_SET_PER_ADV_DATA: + { + status = LlSetPeriodicAdvData(pBuf[0], pBuf[1], pBuf[2], pBuf + 3); + paramLen = LHCI_LEN_LE_SET_PER_ADV_DATA; + break; + } + case HCI_OPCODE_LE_SET_PER_ADV_ENABLE: + { + uint8_t enable; + BSTREAM_TO_UINT8(enable, pBuf); + BSTREAM_TO_UINT8(handle, pBuf); + LlSetPeriodicAdvEnable(handle, enable); + /* Send command complete once LL finishes processing the command. */ + return TRUE; + } + + /* --- default --- */ + + default: + return FALSE; + } + + if (paramLen > 0) + { + lhciSlvExtAdvSendCmdCmplEvt(pHdr, status, paramLen, handle); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..58feb74ed1673e51ef3eb704ddec153859e03b18 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn.c @@ -0,0 +1,383 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Unpack a connection specification from a command packet. + * + * \param pConnSpec Unpacked command structure. + * \param pBuf Packed packet buffer. + * + * \return Payload length. + */ +/*************************************************************************************************/ +uint8_t lhciUnpackConnSpec(LlConnSpec_t *pConnSpec, const uint8_t *pBuf) +{ + const uint8_t len = 12; + + BSTREAM_TO_UINT16(pConnSpec->connIntervalMin, pBuf); + BSTREAM_TO_UINT16(pConnSpec->connIntervalMax, pBuf); + BSTREAM_TO_UINT16(pConnSpec->connLatency, pBuf); + BSTREAM_TO_UINT16(pConnSpec->supTimeout, pBuf); + BSTREAM_TO_UINT16(pConnSpec->minCeLen, pBuf); + BSTREAM_TO_UINT16(pConnSpec->maxCeLen, pBuf); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a read Tx power level or RSSI event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param handle Connection handle. + * \param level Tx power level. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadPwrLevel(uint8_t *pBuf, uint8_t status, uint16_t handle, int8_t level) +{ + const uint8_t len = LHCI_LEN_READ_LOCAL_VER_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, handle); + UINT8_TO_BSTREAM (pBuf, level); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * \param pParam Parameter buffer. + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciConnSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint8_t *pParam, uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_WRITE_DEF_DATA_LEN: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- command completion with status and connHandle parameters --- */ + + case HCI_OPCODE_LE_REM_CONN_PARAM_REP: + case HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP: + case HCI_OPCODE_LE_SET_DATA_LEN: + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, handle); + break; + + /* --- connection control --- */ + + case HCI_OPCODE_LE_READ_DEF_DATA_LEN: + { + uint16_t initMaxTxLen; + uint16_t initMaxTxTime; + LlReadDefaultDataLen(&initMaxTxLen, &initMaxTxTime); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, initMaxTxLen); + UINT16_TO_BSTREAM(pBuf, initMaxTxTime); + break; + } + + case HCI_OPCODE_LE_READ_MAX_DATA_LEN: + { + uint16_t maxTxLen; + uint16_t maxTxTime; + uint16_t maxRxLen; + uint16_t maxRxTime; + LlReadMaximumDataLen(&maxTxLen, &maxTxTime, &maxRxLen, &maxRxTime); + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); + UINT16_TO_BSTREAM(pBuf, maxTxLen); + UINT16_TO_BSTREAM(pBuf, maxTxTime); + UINT16_TO_BSTREAM(pBuf, maxRxLen); + UINT16_TO_BSTREAM(pBuf, maxRxTime); + break; + } + + /* --- status --- */ + + case HCI_OPCODE_READ_TX_PWR_LVL: + { + int8_t level = 0; + uint8_t type; + BSTREAM_TO_UINT8(type, pParam); + status = LlGetTxPowerLevel(handle, type, &level); + lhciPackReadPwrLevel(pBuf, status, handle, level); + break; + } + case HCI_OPCODE_READ_RSSI: + { + int8_t rssi; + status = LlGetRssi(handle, &rssi); + lhciPackReadPwrLevel(pBuf, status, handle, rssi); + break; + } + + /* --- remote device management --- */ + + case HCI_OPCODE_LE_READ_CHAN_MAP: + status = LlGetChannelMap(handle, pBuf + 3); /* delay status and handle params; skip for now */ + pBuf += lhciPackCmdCompleteEvtStatus(pBuf, status); /* now that status is known, write it */ + UINT16_TO_BSTREAM(pBuf, handle); /* and now write the handle */ + break; + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - connection control + * - connection status + * - local device management + * - remote device management + * - default + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + uint8_t *pParam; + uint16_t handle; + +#if LHCI_ENABLE_VS + if (lhciConnVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + pParam = NULL; + handle = 0; + + switch (pHdr->opCode) + { + /* --- connection control --- */ + + case HCI_OPCODE_DISCONNECT: + { + uint8_t reason; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_UINT8 (reason, pBuf); + status = LlDisconnect(handle, reason); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + + case HCI_OPCODE_LE_CONN_UPDATE: + { + LlConnSpec_t connSpec; + BSTREAM_TO_UINT16(handle, pBuf); + lhciUnpackConnSpec(&connSpec, pBuf); + status = LlConnUpdate(handle, &connSpec); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + case HCI_OPCODE_LE_REM_CONN_PARAM_REP: + { + LlConnSpec_t connSpec; + BSTREAM_TO_UINT16(handle, pBuf); + lhciUnpackConnSpec(&connSpec, pBuf); + status = LlRemoteConnParamReqReply(handle, &connSpec); + paramLen = LHCI_LEN_LE_REM_CONN_PARAM_REP; + break; + } + case HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP: + { + uint8_t reason; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_UINT8 (reason, pBuf); + status = LlRemoteConnParamReqNegReply(handle, reason); + paramLen = LHCI_LEN_LE_REM_CONN_PARAM_NEG_REP; + break; + } + + case HCI_OPCODE_LE_SET_DATA_LEN: + { + uint16_t txLen; + uint16_t txTime; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_UINT16(txLen, pBuf); + BSTREAM_TO_UINT16(txTime, pBuf); + status = LlSetDataLen(handle, txLen, txTime); + paramLen = LHCI_LEN_LE_SET_DATA_LEN; + break; + } + + /* --- connection status --- */ + + case HCI_OPCODE_READ_TX_PWR_LVL: + BSTREAM_TO_UINT16(handle, pBuf); + paramLen = LHCI_LEN_READ_PWR_LVL_EVT; + pParam = pBuf; + break; + + case HCI_OPCODE_READ_RSSI: + BSTREAM_TO_UINT16(handle, pBuf); + paramLen = LHCI_LEN_READ_PWR_LVL_EVT; + break; + + /* --- local device management --- */ + + case HCI_OPCODE_LE_READ_DEF_DATA_LEN: + paramLen = LHCI_LEN_LE_READ_DEF_DATA_LEN; + break; + case HCI_OPCODE_LE_WRITE_DEF_DATA_LEN: + { + uint16_t txLen; + uint16_t txTime; + BSTREAM_TO_UINT16(txLen, pBuf); + BSTREAM_TO_UINT16(txTime, pBuf); + status = LlWriteDefaultDataLen(txLen, txTime); + paramLen = LHCI_LEN_LE_WRITE_DEF_DATA_LEN; + break; + } + case HCI_OPCODE_LE_READ_MAX_DATA_LEN: + paramLen = LHCI_LEN_LE_READ_MAX_DATA_LEN; + break; + + /* --- remote device management --- */ + + case HCI_OPCODE_LE_READ_REMOTE_FEAT: + BSTREAM_TO_UINT16(handle, pBuf); + status = LlReadRemoteFeat(handle); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + case HCI_OPCODE_LE_READ_CHAN_MAP: + BSTREAM_TO_UINT16(handle, pBuf); + paramLen = LHCI_LEN_LE_READ_CHAN_MAP_EVT; + break; + case HCI_OPCODE_READ_REMOTE_VER_INFO: + BSTREAM_TO_UINT16(handle, pBuf); + status = LlReadRemoteVerInfo(handle); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + + /* --- default --- */ + + default: + return FALSE; /* exit dispatcher routine */ + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + else + { + lhciConnSendCmdCmplEvt(pHdr, status, paramLen, pParam, handle); + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Generate ACL packets. + * + * \param handle Connection handle. + * \param pktLen Packet length. + * \param numPkts Number of packets. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciGenerateAcl(uint16_t handle, uint16_t pktLen, uint8_t numPkts) +{ + uint8_t *pBuf; + + if (lhciCb.genEnaFlag) + { + /* Prevent re-entrance. */ + return; + } + + lhciCb.genEnaFlag = TRUE; + + while (numPkts--) + { + /* Always use large data buffers. */ + unsigned int allocSize = HCI_ACL_HDR_LEN + BB_DATA_PLD_MAX_LEN + BB_DATA_PDU_TAILROOM; + + uint8_t *pAclBuf; + if ((pAclBuf = (uint8_t*)WsfMsgAlloc(allocSize)) == NULL) + { + break; + } + + pBuf = pAclBuf; + UINT16_TO_BSTREAM(pBuf, handle & 0xFFF); /* PB=0 and BC=0 */ + UINT16_TO_BSTREAM(pBuf, pktLen); + memset(pBuf, lhciCb.genPldCnt++, pktLen); + + LlSendAclData(pAclBuf); + } + + lhciCb.genEnaFlag = FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..f3463d8881a43a53f1b2fac1cc87ac03178d2b11 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master.c @@ -0,0 +1,150 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciMstConnSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_HOST_CHAN_CLASS: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - connection control + * - default + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciMstConnVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- connection control --- */ + + case HCI_OPCODE_LE_CREATE_CONN: + { + LlInitParam_t initParam; + LlConnSpec_t connSpec; + + BSTREAM_TO_UINT16(initParam.scanInterval, pBuf); + BSTREAM_TO_UINT16(initParam.scanWindow, pBuf); + BSTREAM_TO_UINT8 (initParam.filterPolicy, pBuf); + BSTREAM_TO_UINT8 (initParam.peerAddrType, pBuf); + initParam.pPeerAddr = pBuf; + pBuf += sizeof(bdAddr_t); + BSTREAM_TO_UINT8 (initParam.ownAddrType, pBuf); + /* pBuf += */ lhciUnpackConnSpec(&connSpec, pBuf); + + status = LlCreateConn(&initParam, &connSpec); + + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + case HCI_OPCODE_LE_CREATE_CONN_CANCEL: + LlCreateConnCancel(); + /* Command completed by SM. */ + break; + case HCI_OPCODE_LE_SET_HOST_CHAN_CLASS: + { + status = LlSetChannelClass(pBuf); + paramLen = LHCI_LEN_LE_SET_HOST_CHAN_CLASS; + break; + } + + /* --- default --- */ + + default: + /* Fall back to slave connection handler. */ + return lhciConnDecodeCmdPkt(pHdr, pBuf); /* exit dispatcher routine */ + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + else if (paramLen > 0) + { + lhciMstConnSendCmdCmplEvt(pHdr, status, paramLen); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..186ad130bdb20dfdc479ed7396f6f7584ec6db1d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c @@ -0,0 +1,134 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*! \brief Maximum number initiating of PHY. */ +#define LHCI_MAX_INIT_PHY 2 + +/*************************************************************************************************/ +/*! + * \brief Unpack extended initiate parameter packet. + * + * \param pInitParam Unpacked extended initiate parameter. + * \param initScanParam Unpacked extended initiate scan parameter table indexed by PHY. + * \param connSpec Unpacked connection specification table indexed by PHY. + * \param pBuf Packed packet buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static uint8_t lhciUnpackExtInitParam(LlExtInitParam_t *pInitParam, LlExtInitScanParam_t initScanParam[], LlConnSpec_t connSpec[], const uint8_t *pBuf) +{ + unsigned int i; /* scanPhy bit position */ + unsigned int j; /* paramPhys array index */ + const unsigned int maxBits = 8; + + const uint8_t *pBufStart = pBuf; + + BSTREAM_TO_UINT8(pInitParam->filterPolicy, pBuf); + BSTREAM_TO_UINT8(pInitParam->ownAddrType, pBuf); + BSTREAM_TO_UINT8(pInitParam->peerAddrType, pBuf); + pInitParam->pPeerAddr = pBuf; + pBuf += sizeof(bdAddr_t); + BSTREAM_TO_UINT8(pInitParam->initPhys, pBuf); + + for (i = 0, j = 0; (i < maxBits) && (j < LHCI_MAX_INIT_PHY); i++) + { + if (pInitParam->initPhys & (1 << i)) + { + BSTREAM_TO_UINT16(initScanParam[j].scanInterval, pBuf); + BSTREAM_TO_UINT16(initScanParam[j].scanWindow, pBuf); + pBuf += lhciUnpackConnSpec(&connSpec[j], pBuf); + j++; + } + } + + return pBuf - pBufStart; +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - connection control + * - default + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstExtConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciMstConnVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- connection control --- */ + + case HCI_OPCODE_LE_EXT_CREATE_CONN: + { + LlExtInitParam_t initParam; + LlExtInitScanParam_t initScanParam[LHCI_MAX_INIT_PHY]; + LlConnSpec_t connSpec[LHCI_MAX_INIT_PHY] = { 0 }; + + lhciUnpackExtInitParam(&initParam, initScanParam, connSpec, pBuf); + status = LlExtCreateConn(&initParam, initScanParam, connSpec); + + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + + /* --- default --- */ + + default: + /* Fall back to legacy master connection handler. */ + return lhciMstConnDecodeCmdPkt(pHdr, pBuf); /* exit dispatcher routine */ + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..9f5ec979e1f3a42ff5357b67f52ef4208483b707 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_conn_priv.c @@ -0,0 +1,132 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a read resolvable address event. + * + * \param pBuf Packed packet buffer. + * \param status Status code. + * \param pAddr Resolvable address. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadResAddrEvt(uint8_t *pBuf, uint8_t status, const uint8_t *pAddr) +{ + const uint8_t len = LHCI_LEN_LE_READ_PEER_RES_ADDR_EVT; + + UINT8_TO_BSTREAM(pBuf, status); + BDA_TO_BSTREAM (pBuf, pAddr); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * \param pParam Pointer to parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPrivConnSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint8_t *pParam) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + case HCI_OPCODE_LE_READ_PEER_RES_ADDR: + case HCI_OPCODE_LE_READ_LOCAL_RES_ADDR: + lhciPackReadResAddrEvt(pBuf, status, pParam); + break; + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciPrivConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + uint8_t *pParam = NULL; + bdAddr_t rpa = {0}; + + switch (pHdr->opCode) + { + case HCI_OPCODE_LE_READ_PEER_RES_ADDR: + { + status = LlReadPeerResolvableAddr(pBuf[0], pBuf + 1, rpa); + paramLen = LHCI_LEN_LE_READ_PEER_RES_ADDR_EVT; + pParam = (uint8_t *)rpa; + break; + } + case HCI_OPCODE_LE_READ_LOCAL_RES_ADDR: + { + status = LlReadLocalResolvableAddr(pBuf[0], pBuf + 1, rpa); + paramLen = LHCI_LEN_LE_READ_LOCAL_RES_ADDR_EVT; + pParam = (uint8_t *)rpa; + break; + } + + default: + return lhciPrivAdvDecodeCmdPkt(pHdr, pBuf); + } + + lhciPrivConnSendCmdCmplEvt(pHdr, status, paramLen, pParam); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..aa0856068a7d32681c11d9884b35383b37f0803a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_master.c @@ -0,0 +1,91 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - data & flow control + * - status + * - advertising control + * - remote device management + * - local device management + * - test + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstEncDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch (pHdr->opCode) + { + /* --- Encryption --- */ + + case HCI_OPCODE_LE_START_ENCRYPTION: + { + uint16_t handle; + uint8_t *pRand = pBuf; + uint16_t diversifier; + uint8_t *pKey; + + BSTREAM_TO_UINT16(handle, pBuf); + pRand = pBuf; + pBuf += HCI_RAND_LEN; + BSTREAM_TO_UINT16(diversifier, pBuf); + pKey = pBuf; + + status = LlStartEncryption(handle, pRand, diversifier, pKey); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + + /* --- default --- */ + + default: + /* Fall back to slave encryption handler. */ + return lhciSlvEncDecodeCmdPkt(pHdr, pBuf); /* exit dispatcher routine */ + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..51c1182c75cb8ed88af8cec13b867bdd2e665740 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_enc_slave.c @@ -0,0 +1,227 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a advertising report event packet. + * + * \param pBuf Packed packet buffer. + * \param status Status code. + * \param pData Encrypted data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackEncryptEvt(uint8_t *pBuf, uint8_t status, uint8_t *pData) +{ + const uint8_t len = LHCI_LEN_LE_ENCRYPT_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + memcpy(pBuf, pData, HCI_ENCRYPT_DATA_LEN); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a common status and handle event. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param handle Connection handle. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackCommonStatusHandleEvt(uint8_t *pBuf, uint8_t status, uint16_t handle) +{ + const uint8_t len = 3; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, handle); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a read authenticated payload TO event. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param handle Connection handle. + * \param timeout Authenticated payload timeout. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadAuthPayloadTimeoutEvt(uint8_t *pBuf, uint8_t status, uint16_t handle, uint16_t timeout) +{ + const uint8_t len = LHCI_LEN_READ_AUTH_PAYLOAD_TO_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, handle); + UINT16_TO_BSTREAM(pBuf, timeout); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * \param pParam Parameter buffer. + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciSlvEncSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint8_t *pParam, uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- Encryption --- */ + + case HCI_OPCODE_LE_ENCRYPT: + lhciPackEncryptEvt(pBuf, status, pParam); + break; + case HCI_OPCODE_LE_LTK_REQ_REPL: + case HCI_OPCODE_LE_LTK_REQ_NEG_REPL: + case HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO: + lhciPackCommonStatusHandleEvt(pBuf, status, handle); + break; + case HCI_OPCODE_READ_AUTH_PAYLOAD_TO: + { + uint16_t timeout = 0; + status = LlReadAuthPayloadTimeout(handle, &timeout); + lhciPackReadAuthPayloadTimeoutEvt(pBuf, status, handle, timeout); + break; + } + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - encryption + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvEncDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + uint8_t *pParam; + uint16_t handle; + +#if LHCI_ENABLE_VS + if (lhciSlvEncVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + pParam = NULL; + handle = 0; + + switch (pHdr->opCode) + { + /* --- Encryption --- */ + + case HCI_OPCODE_LE_ENCRYPT: + { + uint8_t *pKey = pBuf; + pParam = pBuf + HCI_KEY_LEN; + LlEncrypt(pKey, pParam); + paramLen = LHCI_LEN_LE_ENCRYPT_EVT; + break; + } + case HCI_OPCODE_LE_LTK_REQ_REPL: + BSTREAM_TO_UINT16(handle, pBuf); + status = LlLtkReqReply(handle, pBuf); + paramLen = LHCI_LEN_LE_LTK_REQ_REPL_EVT; + break; + case HCI_OPCODE_LE_LTK_REQ_NEG_REPL: + BSTREAM_TO_UINT16(handle, pBuf); + status = LlLtkReqNegReply(handle); + paramLen = LHCI_LEN_LE_LTK_REQ_NEG_REPL_EVT; + break; + case HCI_OPCODE_READ_AUTH_PAYLOAD_TO: + BSTREAM_TO_UINT16(handle, pBuf); + paramLen = LHCI_LEN_READ_AUTH_PAYLOAD_TO_EVT; + break; + case HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO: + { + uint16_t timeout; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_UINT16(timeout, pBuf); + status = LlWriteAuthPayloadTimeout(handle, timeout); + paramLen = LHCI_LEN_WRITE_AUTH_PAYLOAD_TO_EVT; + break; + } + + /* --- default --- */ + + default: + return FALSE; /* exit dispatcher routine */ + } + + lhciSlvEncSendCmdCmplEvt(pHdr, status, paramLen, pParam, handle); + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..dc390045a6460345d83be13aee9e3cefbe4a5832 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_phy.c @@ -0,0 +1,180 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a read PHY event. + * + * \param pBuf Packed packet buffer. + * \param status Status code. + * \param handle Connection handle. + * \param txPhy Transmitter PHY. + * \param rxPhy Receiver PHY. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadPhyEvt(uint8_t *pBuf, uint8_t status, uint16_t handle, uint8_t txPhy, uint8_t rxPhy) +{ + const uint8_t len = LHCI_LEN_LE_READ_PHY_EVT; + + UINT8_TO_BSTREAM (pBuf, status); + UINT16_TO_BSTREAM(pBuf, handle); + UINT8_TO_BSTREAM (pBuf, txPhy); + UINT8_TO_BSTREAM (pBuf, rxPhy); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPhySendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + pBuf = pEvtBuf; + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + + case HCI_OPCODE_LE_SET_DEF_PHY: + case HCI_OPCODE_LE_ENHANCED_RECEIVER_TEST: + case HCI_OPCODE_LE_ENHANCED_TRANSMITTER_TEST: + lhciPackCmdCompleteEvtStatus(pBuf, status); + break; + + case HCI_OPCODE_LE_READ_PHY: + { + uint8_t txPhy = 0; + uint8_t rxPhy = 0; + status = LlReadPhy(handle, &txPhy, &rxPhy); + lhciPackReadPhyEvt(pBuf, status, handle, txPhy, rxPhy); + break; + } + + /* --- default --- */ + + default: + break; + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciPhyDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + uint16_t handle = 0; + + switch (pHdr->opCode) + { + case HCI_OPCODE_LE_READ_PHY: + { + BSTREAM_TO_UINT16(handle, pBuf); + paramLen = LHCI_LEN_LE_READ_PHY_EVT; + break; + } + case HCI_OPCODE_LE_SET_DEF_PHY: + { + status = LlSetDefaultPhy(pBuf[0], pBuf[1], pBuf[2]); + paramLen = LHCI_LEN_LE_SET_DEF_PHY_EVT; + break; + } + case HCI_OPCODE_LE_SET_PHY: + { + uint8_t allPhys; + uint8_t txPhys; + uint8_t rxPhys; + uint16_t phyOptions; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_UINT8 (allPhys, pBuf); + BSTREAM_TO_UINT8 (txPhys, pBuf); + BSTREAM_TO_UINT8 (rxPhys, pBuf); + BSTREAM_TO_UINT16(phyOptions, pBuf); + status = LlSetPhy(handle, allPhys, txPhys, rxPhys, phyOptions); + paramLen = 0xFF; + break; + } + case HCI_OPCODE_LE_ENHANCED_RECEIVER_TEST: + { + status = LlEnhancedRxTest(pBuf[0], pBuf[1], pBuf[2], 0); + paramLen = LHCI_LEN_LE_ENHANCED_RECEIVER_TEST_EVT; + break; + } + case HCI_OPCODE_LE_ENHANCED_TRANSMITTER_TEST: + { + status = LlEnhancedTxTest(pBuf[0], pBuf[1], pBuf[2], pBuf[3], 0); + paramLen = LHCI_LEN_LE_ENHANCED_TRANSMITTER_TEST_EVT; + break; + } + + default: + return FALSE; /* exit dispatcher routine */ + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + else + { + lhciPhySendCmdCmplEvt(pHdr, status, paramLen, handle); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..3f7fc9bbd9026e04d017600393955e4fb240c6a6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_cmd_sc.c @@ -0,0 +1,90 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "ll_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Decode an HCI command packet. + * + * \param pHdr Decoded packet header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing is organized by urgency then by frequency of command calls during normal + * operation. The following grouping is used: + * - LE secure connections + * - default/unused + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciScDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status, paramLen; + +#if LHCI_ENABLE_VS + if (lhciScVsStdDecodeCmdPkt(pHdr, pBuf)) + { + return TRUE; + } +#endif + + status = HCI_SUCCESS; + paramLen = 0; + + switch (pHdr->opCode) + { + /* --- LE Secure Connections --- */ + + case HCI_OPCODE_LE_READ_LOCAL_P256_PUB_KEY: + { + status = LlGenerateP256KeyPair(); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + + case HCI_OPCODE_LE_GENERATE_DHKEY: + { + status = LlGenerateDhKey(pBuf, pBuf + LL_ECC_KEY_LEN); + paramLen = LHCI_LEN_CMD_STATUS_EVT; + break; + } + + /* --- default --- */ + + default: + return FALSE; + } + + if (paramLen == LHCI_LEN_CMD_STATUS_EVT) + { + lhciSendCmdStatusEvt(pHdr, status); + } + + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt.c new file mode 100644 index 0000000000000000000000000000000000000000..659ad3007d5d3a228658113c8eb29d31b9aa9751 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt.c @@ -0,0 +1,260 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "chci_api.h" +#include "ll_defs.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Pack a command status event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t LhciPackCmdStatusEvt(uint8_t *pBuf, uint8_t status, uint16_t opCode) +{ + const uint8_t len = HCI_LEN_CMD_STATUS; + + UINT8_TO_BSTREAM (pBuf, status); + UINT8_TO_BSTREAM (pBuf, 1); /* Num_HCI_Command_Packets is always 1 */ + UINT16_TO_BSTREAM(pBuf, opCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete event packet. + * + * \param pBuf Packed packet buffer. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t LhciPackCmdCompleteEvt(uint8_t *pBuf, uint16_t opCode) +{ + const uint8_t len = HCI_LEN_CMD_CMPL; + + UINT8_TO_BSTREAM (pBuf, 1); /* Num_HCI_Command_Packets is always 1 */ + UINT16_TO_BSTREAM(pBuf, opCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete status parameter. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t LhciPackCmdCompleteEvtStatus(uint8_t *pBuf, uint8_t status) +{ + const uint8_t len = sizeof(uint8_t); + + UINT8_TO_BSTREAM (pBuf, status); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event sent, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciLlEvtHandler(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + bool_t evtSent = TRUE; + unsigned int msg = 0; + + WSF_ASSERT(lhciEvtTbl[LHCI_MSG_ADV]); /* proper init guarantees this handler exists. */ + + LL_TRACE_INFO1("Encoding LL event=%u", pEvt->hdr.event); + + /* Standard event handlers. */ + do + { + if (lhciEvtTbl[msg] && lhciEvtTbl[msg](pEvt)) + { + break; + } + } while (++msg < LHCI_MSG_TOTAL); + + /* Unhandled events. */ + if (msg == LHCI_MSG_TOTAL) + { + switch (pEvt->hdr.event) + { + case LL_RESET_CNF: + lhciReset(); + + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_RESET_EVT)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += LhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_RESET); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->hdr.status); + } + break; + + case LL_ERROR_IND: + if ((pEvtBuf = lhciAllocEvt(HCI_HW_ERROR_EVT, HCI_LEN_HW_ERR)) != NULL) + { + UINT8_TO_BSTREAM(pEvtBuf, pEvt->hwErrorInd.code); + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + } + else + { + LL_TRACE_WARN1("Unhandled, allocation failed or masked LL event=%u", pEvt->hdr.event); + evtSent = FALSE; + } + } + + return evtSent; +} + +/*************************************************************************************************/ +/*! + * \brief Send an HCI event and service the event queue. + * + * \param pBuf Buffer containing HCI event to send or NULL to service the queue. + * + * \return None. + */ +/*************************************************************************************************/ +void LhciSendEvent(uint8_t *pBuf) +{ + if (pBuf != NULL) + { + WsfMsgEnq(&lhciPersistCb.evtQ, 0, pBuf); + } + + if (!lhciPersistCb.evtTrPending) + { + ChciTrNeedsService(CHCI_TR_PROT_BLE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Return event pending status. + * + * \return TRUE if HCI event is pending, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LhciIsEventPending(void) +{ + return lhciPersistCb.evtTrPending; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an event. + * + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Buffer for event. + */ +/*************************************************************************************************/ +uint8_t *lhciAllocEvt(uint8_t evtCode, uint8_t paramLen) +{ + uint8_t *pEvtBuf; + + if ((pEvtBuf = WsfMsgAlloc(HCI_EVT_HDR_LEN + paramLen)) != NULL) + { + pEvtBuf += lhciPackEvtHdr(pEvtBuf, evtCode, paramLen); + } + + return pEvtBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a command complete event. + * + * \param paramLen Parameter length. + * \param opCode OpCode command field. + * + * \return Buffer for command complete event. + */ +/*************************************************************************************************/ +uint8_t *lhciAllocCmdCmplEvt(uint8_t paramLen, uint16_t opCode) +{ + uint8_t *pEvtBuf; + + if ((pEvtBuf = WsfMsgAlloc(HCI_EVT_HDR_LEN + HCI_LEN_CMD_CMPL + paramLen)) != NULL) + { + pEvtBuf += lhciPackEvtHdr(pEvtBuf, HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + paramLen); + pEvtBuf += lhciPackCmdCompleteEvt(pEvtBuf, opCode); + } + + return pEvtBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an event packet header. + * + * \param pBuf Packed packet buffer. + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t LhciPackEvtHdr(uint8_t *pBuf, uint8_t evtCode, uint8_t paramLen) +{ + const uint8_t len = HCI_EVT_HDR_LEN; + + UINT8_TO_BSTREAM(pBuf, evtCode); + UINT8_TO_BSTREAM(pBuf, paramLen); + + return len; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..ec3e559e2532e9f47cfc35fe836920c26ed87231 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master.c @@ -0,0 +1,157 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "lctr_api.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a advertising report event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Advertising report indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackAdvRptEvt(uint8_t *pBuf, const LlAdvReportInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_ADV_RPT_MIN + pEvt->len; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_ADV_REPORT_EVT); + UINT8_TO_BSTREAM (pBuf, 1); + UINT8_TO_BSTREAM (pBuf, pEvt->eventType); + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->addr); + UINT8_TO_BSTREAM (pBuf, pEvt->len); + memcpy(pBuf, pEvt->pData, pEvt->len); + pBuf += pEvt->len; + UINT8_TO_BSTREAM (pBuf, pEvt->rssi); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a direct advertising report event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Advertising report indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackDirectAdvRptEvt(uint8_t *pBuf, const LlAdvReportInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_DIRECT_ADV_REPORT; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_DIRECT_ADV_REPORT_EVT); + UINT8_TO_BSTREAM (pBuf, 1); + UINT8_TO_BSTREAM (pBuf, pEvt->eventType); + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->addr); + UINT8_TO_BSTREAM (pBuf, pEvt->directAddrType); + BDA_TO_BSTREAM (pBuf, pEvt->directAddr); + UINT8_TO_BSTREAM (pBuf, pEvt->rssi); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL master advertising event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstScanEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_ADV_REPORT_IND: + if (pEvt->advReportInd.directAddrType != 0xFF) + { + bool_t evtSent = FALSE; + + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_DIRECT_ADV_REPORT_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((lhciCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_DIRECT_ADV_REPORT)) != NULL)) + { + uint8_t *pBuf = pEvtBuf; + lhciPackDirectAdvRptEvt(pBuf, &pEvt->advReportInd); + evtSent = TRUE; + lhciCb.numAdvReport++; + } + } + if (!evtSent) + { + /* Handle event here even if event cannot be sent. */ + return TRUE; + } + } + else + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_ADV_REPORT_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((lhciCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_ADV_RPT_MIN + pEvt->advReportInd.len)) != NULL)) + { + uint8_t *pBuf = pEvtBuf; + lhciPackAdvRptEvt(pBuf, &pEvt->advReportInd); + lhciCb.numAdvReport++; + } + } + } + break; + + case LL_SCAN_ENABLE_CNF: + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_SET_SCAN_ENABLE_EVT)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_SET_SCAN_ENABLE); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->hdr.status); + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..c953fdbba32ea432a20e6f18994f2e34107d86ed --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c @@ -0,0 +1,399 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "lctr_api.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "wsf_trace.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum size of Data_Length field in extended advertising report. */ +#define LHCI_EXT_ADV_RPT_DATA_LEN_MAX 229 + +/*! \brief Maximum size of Data_Length field in periodic advertising report. */ +#define LHCI_PER_ADV_RPT_DATA_LEN_MAX 247 + +/*************************************************************************************************/ +/*! + * \brief Allocate an extended advertising report event buffer. + * + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Buffer for event. + */ +/*************************************************************************************************/ +static uint8_t *lhciAllocExtAdvRptEvt(uint8_t evtCode, uint8_t paramLen) +{ + uint8_t *pEvtBuf; + + /* Use LHCI_EXT_ADV_RPT_DATA_LEN_MAX to ensure allocation from the extended advertising buffer pool. */ + if ((pEvtBuf = WsfMsgAlloc(HCI_EVT_HDR_LEN + LHCI_EXT_ADV_RPT_DATA_LEN_MAX)) != NULL) + { + pEvtBuf += lhciPackEvtHdr(pEvtBuf, evtCode, paramLen); + } + + return pEvtBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a periodic advertising report event buffer. + * + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Buffer for event. + */ +/*************************************************************************************************/ +static uint8_t *lhciAllocPerAdvRptEvt(uint8_t evtCode, uint8_t paramLen) +{ + uint8_t *pEvtBuf; + + /* Use LHCI_PER_ADV_RPT_DATA_LEN_MAX to ensure allocation from the extended advertising buffer pool. */ + if ((pEvtBuf = WsfMsgAlloc(HCI_EVT_HDR_LEN + LHCI_PER_ADV_RPT_DATA_LEN_MAX)) != NULL) + { + pEvtBuf += lhciPackEvtHdr(pEvtBuf, evtCode, paramLen); + } + + return pEvtBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a extended advertising report event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Extended advertising report indication data. + * \param pFragStart Start of fragmentation buffer. + * \param fragLen Length of fragment. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackExtAdvRptEvt(uint8_t *pBuf, const LlExtAdvReportInd_t *pEvt, + const uint8_t *pFragStart, uint8_t fragLen) +{ + uint16_t eventType; + if (((pFragStart + fragLen) - pEvt->pData) == pEvt->len) + { + eventType = pEvt->eventType; + } + else + { + /* Incomplete, more data to come. */ + eventType = (pEvt->eventType & 0x001F) | (0x0001 << 5); + } + + UINT8_TO_BSTREAM (pBuf, HCI_LE_EXT_ADV_REPORT_EVT); + UINT8_TO_BSTREAM (pBuf, 1); /* Num_Reports */ + UINT16_TO_BSTREAM(pBuf, eventType); + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->addr); + UINT8_TO_BSTREAM (pBuf, pEvt->priPhy); + UINT8_TO_BSTREAM (pBuf, pEvt->secPhy); + UINT8_TO_BSTREAM (pBuf, pEvt->advSID); + UINT8_TO_BSTREAM (pBuf, pEvt->txPwr); + UINT8_TO_BSTREAM (pBuf, pEvt->rssi); + UINT16_TO_BSTREAM(pBuf, pEvt->perAdvInter); + UINT8_TO_BSTREAM (pBuf, pEvt->directAddrType); + BDA_TO_BSTREAM (pBuf, pEvt->directAddr); + UINT8_TO_BSTREAM (pBuf, fragLen); + memcpy(pBuf, pFragStart, fragLen); +} + +/*************************************************************************************************/ +/*! + * \brief Pack a periodic advertising report event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Periodic advertising report indication data. + * \param pFragStart Start of fragmentation buffer. + * \param fragLen Length of fragment. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackPerAdvRptEvt(uint8_t *pBuf, const LlPerAdvReportInd_t *pEvt, + const uint8_t *pFragStart, uint8_t fragLen) +{ + uint8_t dataStatus; + + if (((pFragStart + fragLen) - pEvt->pData) == pEvt->len) + { + if (pEvt->dataStatus == LL_RPT_DATA_INC_TRUNC) + { + dataStatus = LL_RPT_DATA_INC_TRUNC; + } + else + { + dataStatus = LL_RPT_DATA_CMPL; + } + } + else + { + /* Incomplete, more data to come. */ + dataStatus = LL_RPT_DATA_INC_MORE; + } + + UINT8_TO_BSTREAM (pBuf, HCI_LE_PER_ADV_REPORT_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->syncHandle); + UINT8_TO_BSTREAM (pBuf, pEvt->txPwr); + UINT8_TO_BSTREAM (pBuf, pEvt->rssi); + UINT8_TO_BSTREAM (pBuf, pEvt->unused); + UINT8_TO_BSTREAM (pBuf, dataStatus); + UINT8_TO_BSTREAM (pBuf, fragLen); + if (fragLen) + { + memcpy(pBuf, pFragStart, fragLen); + } +} + +/*************************************************************************************************/ +/*! + * \brief Pack a periodic advertising sync established event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Periodic advertising sync established event confirmation. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackPerAdvSyncEstdEvt(uint8_t *pBuf, const LlPerAdvSyncEstdCnf_t *pEvt) +{ + UINT8_TO_BSTREAM (pBuf, HCI_LE_PER_ADV_SYNC_EST_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->syncHandle); + UINT8_TO_BSTREAM (pBuf, pEvt->advSID); + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->addr); + UINT8_TO_BSTREAM (pBuf, pEvt->advPhy); + UINT16_TO_BSTREAM(pBuf, pEvt->perAdvInterval); + UINT8_TO_BSTREAM (pBuf, pEvt->advClkAccuracy); +} + +/*************************************************************************************************/ +/*! + * \brief Pack a periodic advertising sync lost event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Periodic advertising sync lost event confirmation. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackPerAdvSyncLostEvt(uint8_t *pBuf, const LlPerAdvSyncLostInd_t *pEvt) +{ + UINT8_TO_BSTREAM (pBuf, HCI_LE_PER_ADV_SYNC_LOST_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->syncHandle); +} + +/*************************************************************************************************/ +/*! + * \brief LL master advertising extension event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstExtScanEncodeEvtPkt(LlEvt_t *pEvt) +{ + bool_t result = FALSE; + uint8_t *pEvtBuf; + + switch (pEvt->hdr.event) + { + case LL_EXT_ADV_REPORT_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_EXT_ADV_REPORT_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + const uint8_t *pFragStart = pEvt->extAdvReportInd.pData; + unsigned int remDataLen = pEvt->extAdvReportInd.len; + uint8_t num_buffers = remDataLen/LHCI_EXT_ADV_RPT_DATA_LEN_MAX + (remDataLen % LHCI_EXT_ADV_RPT_DATA_LEN_MAX != 0); + + if ((lhciCb.numAdvReport + num_buffers) > pLctrRtCfg->maxAdvReports) + { + LL_TRACE_WARN0("LL_EXT_ADV_REPORT_IND, discarded, not enough advRport buffers available."); + break; + } + + do + { + unsigned int fragLen = WSF_MIN(remDataLen, LHCI_EXT_ADV_RPT_DATA_LEN_MAX); + if ((lhciCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pEvtBuf = lhciAllocExtAdvRptEvt(HCI_LE_META_EVT, HCI_LEN_LE_EXT_ADV_REPORT_MIN + fragLen)) != NULL)) + { + remDataLen -= fragLen; + lhciCb.numAdvReport++; + + if ((lhciCb.numAdvReport == pLctrRtCfg->maxAdvReports) && (remDataLen > 0)) + { + /* Tell the host the data is truncated because remaining fragments can't be sent. */ + pEvt->extAdvReportInd.eventType |= LL_RPT_DATA_INC_TRUNC << 5; + result = FALSE; + + /* Drop remaining fragments. */ + remDataLen = 0; + LL_TRACE_WARN0("LL_EXT_ADV_REPORT_IND, truncated, not enough advRport buffers."); + } + else + { + result = TRUE; + } + + lhciPackExtAdvRptEvt(pEvtBuf, &pEvt->extAdvReportInd, pFragStart, fragLen); + pFragStart += fragLen; + lhciSendEvt(pEvtBuf); + } + else + { + /* Drop remaining fragments. */ + remDataLen = 0; + result = FALSE; + } + } while (remDataLen > 0); + } + break; + } + + case LL_EXT_SCAN_ENABLE_CNF: + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_SET_EXT_SCAN_ENABLE)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->hdr.status); + lhciSendEvt(pEvtBuf); + result = TRUE; + } + break; + + case LL_SCAN_TIMEOUT_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_SCAN_TIMEOUT_EVT) << LHCI_BYTE_TO_BITS(2))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_SCAN_TIMEOUT)) != NULL) + { + pEvtBuf[0] = HCI_LE_SCAN_TIMEOUT_EVT; + lhciSendEvt(pEvtBuf); + result = TRUE; + } + } + break; + } + + case LL_PER_ADV_SYNC_ESTD_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_PER_ADV_SYNC_EST_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_PER_ADV_SYNC_EST)) != NULL) + { + lhciPackPerAdvSyncEstdEvt(pEvtBuf, &pEvt->perAdvSyncEstdCnf); + lhciSendEvt(pEvtBuf); + result = TRUE; + } + } + break; + } + case LL_PER_ADV_REPORT_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_PER_ADV_REPORT_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + const uint8_t *pFragStart = pEvt->perAdvReportInd.pData; + unsigned int remDataLen = pEvt->perAdvReportInd.len; + uint8_t num_buffers = remDataLen/LHCI_PER_ADV_RPT_DATA_LEN_MAX + (remDataLen % LHCI_PER_ADV_RPT_DATA_LEN_MAX != 0); + + if ((lhciCb.numAdvReport + num_buffers) > pLctrRtCfg->maxAdvReports) + { + LL_TRACE_WARN0("LL_PER_ADV_REPORT_IND, discarded, not enough advRport buffers available."); + break; + } + + do + { + unsigned int fragLen = WSF_MIN(remDataLen, (LHCI_PER_ADV_RPT_DATA_LEN_MAX)); + if ((lhciCb.numAdvReport < pLctrRtCfg->maxAdvReports) && + ((pEvtBuf = lhciAllocPerAdvRptEvt(HCI_LE_META_EVT, HCI_LEN_LE_PER_ADV_REPORT + fragLen)) != NULL)) + { + remDataLen -= fragLen; + lhciCb.numAdvReport++; + if ((lhciCb.numAdvReport == pLctrRtCfg->maxAdvReports) && (remDataLen > 0)) + { + /* Tell the host the data is truncated because remaining fragments can't be sent. */ + pEvt->perAdvReportInd.dataStatus = LL_RPT_DATA_INC_TRUNC; + result = FALSE; + + /* Drop remaining fragments. */ + remDataLen = 0; + LL_TRACE_WARN0("LL_PER_ADV_REPORT_IND, truncated, not enough advRport buffers."); + } + else + { + result = TRUE; + } + + lhciPackPerAdvRptEvt(pEvtBuf, &pEvt->perAdvReportInd, pFragStart, fragLen); + pFragStart += fragLen; + lhciSendEvt(pEvtBuf); + } + else + { + /* Drop remaining fragments. */ + remDataLen = 0; + result = FALSE; + } + } while (remDataLen > 0); + } + break; + } + case LL_PER_ADV_SYNC_LOST_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_PER_ADV_SYNC_LOST_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_PER_ADV_SYNC_LOST)) != NULL) + { + lhciPackPerAdvSyncLostEvt(pEvtBuf, &pEvt->perAdvSyncLostInd); + lhciSendEvt(pEvtBuf); + result = TRUE; + } + } + break; + } + + default: + break; + } + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..39a03cbeb66178db2f76822dfc5574d8f9898d1b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave.c @@ -0,0 +1,70 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief LL slave advertising data event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvAdvEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + +#if LHCI_ENABLE_VS + if (lhciSlvVsStdEncodeEvtPkt(pEvt)) + { + return TRUE; + } +#endif + + switch (pEvt->hdr.event) + { + case LL_ADV_ENABLE_CNF: + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_SET_ADV_ENABLE_EVT)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_SET_ADV_ENABLE); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->hdr.status); + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..a7395b6cdf3c9887c3a3274d5bfb667ded67d404 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c @@ -0,0 +1,142 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "lctr_api.h" + +/*************************************************************************************************/ +/*! + * \brief Pack an advertising set terminated event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Advertising set terminated indication data. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackAdvSetTermEvt(uint8_t *pBuf, const LlAdvSetTermInd_t *pEvt) +{ + UINT8_TO_BSTREAM (pBuf, HCI_LE_ADV_SET_TERM_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT8_TO_BSTREAM (pBuf, pEvt->advHandle); + UINT16_TO_BSTREAM(pBuf, pEvt->connHandle); + UINT8_TO_BSTREAM (pBuf, pEvt->numCmplAdvEvt); +} + +/*************************************************************************************************/ +/*! + * \brief Pack a scan request received event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Scan request received indication data. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciPackScanReqRcvdEvt(uint8_t *pBuf, const LlScanReqRcvdInd_t *pEvt) +{ + UINT8_TO_BSTREAM(pBuf, HCI_LE_SCAN_REQ_RCVD_EVT); + UINT8_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM(pBuf, pEvt->scanAddrType); + BDA_TO_BSTREAM (pBuf, pEvt->scanAddr); +} + +/*************************************************************************************************/ +/*! + * \brief LL slave advertising extension data event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvExtAdvEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_SCAN_REQ_RCVD_IND: + { + if ((lhciCb.numScanReqRcvd < pLctrRtCfg->maxScanReqRcvdEvt) && + (lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_SCAN_REQ_RCVD_EVT) << LHCI_BYTE_TO_BITS(2))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_SCAN_REQ_RCVD)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + lhciPackScanReqRcvdEvt(pBuf, &pEvt->scanReqRcvdInd); + lhciCb.numScanReqRcvd++; + } + } + break; + } + + case LL_EXT_ADV_ENABLE_CNF: + { + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_SET_EXT_ADV_ENABLE)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_SET_EXT_ADV_ENABLE); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->extAdvEnableCnf.status); + } + break; + } + + case LL_ADV_SET_TERM_IND: + { + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_ADV_SET_TERM_EVT) << LHCI_BYTE_TO_BITS(2))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_ADV_SET_TERM)) != NULL) + { + lhciPackAdvSetTermEvt(pEvtBuf, &pEvt->advSetTermInd); + } + } + break; + } + + case LL_PER_ADV_ENABLE_CNF: + { + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_SET_PER_ADV_ENABLE)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_SET_PER_ADV_ENABLE); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->perAdvEnableCnf.status); + } + break; + } + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..c3cbbfbfa916dc7e67273f6cf4c2698115c9ab6e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn.c @@ -0,0 +1,433 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "chci_api.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a number of completed packets event packet. + * + * \param pBuf Packed packet buffer. + * \param connHandle Connection handle. + * \param numPkts Number of packets. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackNumCompPktsEvt(uint8_t *pBuf, uint16_t connHandle, uint8_t numPkts) +{ + const uint8_t len = HCI_LEN_NUM_CMPL_PKTS; + uint16_t numPkts_u16 = numPkts; + + UINT8_TO_BSTREAM (pBuf, 1); + UINT16_TO_BSTREAM(pBuf, connHandle); + UINT16_TO_BSTREAM(pBuf, numPkts_u16); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connection complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Connection indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackConnCompleteEvt(uint8_t *pBuf, const LlConnInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_CONN_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_CONN_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->role); + switch (pEvt->addrType) + { + default: + case HCI_ADDR_TYPE_PUBLIC: + case HCI_ADDR_TYPE_RANDOM: + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->peerAddr); + break; + case HCI_ADDR_TYPE_PUBLIC_IDENTITY: + case HCI_ADDR_TYPE_RANDOM_IDENTITY: + UINT8_TO_BSTREAM (pBuf, HCI_ADDR_TYPE_RANDOM); + BDA_TO_BSTREAM (pBuf, pEvt->peerRpa); + break; + } + UINT16_TO_BSTREAM(pBuf, pEvt->connInterval); + UINT16_TO_BSTREAM(pBuf, pEvt->connLatency); + UINT16_TO_BSTREAM(pBuf, pEvt->supTimeout); + UINT8_TO_BSTREAM (pBuf, pEvt->clockAccuracy); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a disconnect complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Disconnect indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackDiscCompleteEvt(uint8_t *pBuf, const LlDisconnectInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_DISCONNECT_CMPL; + + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->reason); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connection update complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Connection update indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackConnUpdateCompleteEvt(uint8_t *pBuf, const LlConnUpdateInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_CONN_UPDATE_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_CONN_UPDATE_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT16_TO_BSTREAM(pBuf, pEvt->connInterval); + UINT16_TO_BSTREAM(pBuf, pEvt->connLatency); + UINT16_TO_BSTREAM(pBuf, pEvt->supTimeout); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connection update complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Connection update indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackRemoteConnParamEvt(uint8_t *pBuf, const LlRemConnParamInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_REM_CONN_PARAM_REQ; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_REM_CONN_PARAM_REQ_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT16_TO_BSTREAM(pBuf, pEvt->connIntervalMin); + UINT16_TO_BSTREAM(pBuf, pEvt->connIntervalMax); + UINT16_TO_BSTREAM(pBuf, pEvt->connLatency); + UINT16_TO_BSTREAM(pBuf, pEvt->supTimeout); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a read remote used feature complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Read remote feature confirm data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadRemoteUsedFeatCompleteEvt(uint8_t *pBuf, const LlReadRemoteFeatCnf_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_READ_REMOTE_FEAT_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_READ_REMOTE_FEAT_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + memcpy(pBuf, pEvt->features, sizeof(pEvt->features)); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a read remote version info event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Read remote version info indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadRemoteVerInfoCompleteEvt(uint8_t *pBuf, const LlReadRemoteVerInfoCnf_t *pEvt) +{ + const uint8_t len = HCI_LEN_READ_REMOTE_VER_INFO_CMPL; + + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->version); + UINT16_TO_BSTREAM(pBuf, pEvt->mfrName); + UINT16_TO_BSTREAM(pBuf, pEvt->subversion); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Data length change event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Data length change indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackDataLenChangeEvt(uint8_t *pBuf, const LlDataLenChangeInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_DATA_LEN_CHANGE; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_DATA_LEN_CHANGE_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT16_TO_BSTREAM(pBuf, pEvt->maxTxLen); + UINT16_TO_BSTREAM(pBuf, pEvt->maxTxTime); + UINT16_TO_BSTREAM(pBuf, pEvt->maxRxLen); + UINT16_TO_BSTREAM(pBuf, pEvt->maxRxTime); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL ACL send complete event handler. + * + * \param handle Connection handle. + * \param numBufs Number of buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciAclSendComplete(uint16_t handle, uint8_t numBufs) +{ + if (lhciCb.genPktLen == 0) + { + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocEvt(HCI_NUM_CMPL_PKTS_EVT, HCI_LEN_NUM_CMPL_PKTS)) != NULL) + { + lhciPackNumCompPktsEvt(pEvtBuf, handle, numBufs); + lhciSendEvt(pEvtBuf); + } + } + else + { + lhciCb.genPktCnt++; + lhciCb.genOctetCnt += lhciCb.genPktLen; + + lhciGenerateAcl(handle, lhciCb.genPktLen, numBufs); + } +} + +/*************************************************************************************************/ +/*! + * \brief Sink LL ACL. + * + * \param pBuf Buffer to sink. + * + * \return TRUE if buffer sink. + */ +/*************************************************************************************************/ +static bool_t lhciSinkAcl(uint8_t *pBuf) +{ + if (lhciCb.recvAclSink) + { + uint16_t len; + + BYTES_TO_UINT16(len, &pBuf[2]); + lhciCb.recvAclPktCnt++; + lhciCb.recvAclOctetCnt += len; + + WsfMsgFree(pBuf); + LlRecvAclDataComplete(1); + return TRUE; + } + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Receive LL ACL. + * + * \return Pointer to buffer for transport. + */ +/*************************************************************************************************/ +uint8_t *lhciRecvAcl(void) +{ + uint8_t *pAclData; + + if ((pAclData = LlRecvAclData()) != NULL) + { + if (!lhciSinkAcl(pAclData)) + { + return pAclData; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief LL ACL receive pending event handler. + * + * \param handle Connection handle. + * \param numBufs Number of buffers. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciAclRecvPending(uint16_t handle, uint8_t numBufs) +{ + uint8_t *pAclData; + + if (lhciCb.recvAclSink && ((pAclData = LlRecvAclData()) != NULL)) + { + lhciSinkAcl(pAclData); + return; + } + + ChciTrNeedsService(CHCI_TR_PROT_BLE); +} + +/*************************************************************************************************/ +/*! + * \brief LL connection event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciConnEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_CONN_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_CONN_CMPL_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_CONN_CMPL)) != NULL) + { + lhciPackConnCompleteEvt(pEvtBuf, &pEvt->connInd); + } + } + break; + + case LL_DISCONNECT_IND: + if (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_DISCONNECT_CMPL) << LHCI_BYTE_TO_BITS(0))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_DISCONNECT_CMPL_EVT, HCI_LEN_DISCONNECT_CMPL)) != NULL) + { + lhciPackDiscCompleteEvt(pEvtBuf, &pEvt->disconnectInd); + } + } + break; + + case LL_CONN_UPDATE_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_CONN_UPDATE_CMPL)) != NULL) + { + lhciPackConnUpdateCompleteEvt(pEvtBuf, &pEvt->connUpdateInd); + } + } + break; + + case LL_REM_CONN_PARAM_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_REMOTE_CONN_PARAM_REQ_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_REM_CONN_PARAM_REQ)) != NULL) + { + lhciPackRemoteConnParamEvt(pEvtBuf, &pEvt->remConnParamInd); + } + } + break; + + case LL_READ_REMOTE_FEAT_CNF: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_READ_REMOTE_FEAT_CMPL)) != NULL) + { + lhciPackReadRemoteUsedFeatCompleteEvt(pEvtBuf, &pEvt->readRemoteFeatCnf); + } + } + break; + + case LL_READ_REMOTE_VER_INFO_CNF: + if (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL) << LHCI_BYTE_TO_BITS(1))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_READ_REMOTE_VER_INFO_CMPL_EVT, HCI_LEN_READ_REMOTE_VER_INFO_CMPL)) != NULL) + { + lhciPackReadRemoteVerInfoCompleteEvt(pEvtBuf, &pEvt->readRemoteVerInfoCnf); + } + } + break; + + case LL_DATA_LEN_CHANGE_IND: + if (lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_DATA_LEN_CHANGE_EVT) << LHCI_BYTE_TO_BITS(0))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_DATA_LEN_CHANGE)) != NULL) + { + lhciPackDataLenChangeEvt(pEvtBuf, &pEvt->dataLenChangeInd); + } + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_cs2.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_cs2.c new file mode 100644 index 0000000000000000000000000000000000000000..87e2f90cd00ab875b6cf611fd911c7d689a5a735 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_cs2.c @@ -0,0 +1,85 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Used channel selection event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Data length change indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackUsedChSelEvt(uint8_t *pBuf, const LlChSelInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_CH_SEL_ALGO; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_CH_SEL_ALGO_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->usedChSel); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL channel selection event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciConnCsEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_CH_SEL_ALGO_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_CH_SEL_ALGO_EVT) << LHCI_BYTE_TO_BITS(2))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_CH_SEL_ALGO)) != NULL) + { + lhciPackUsedChSelEvt(pEvtBuf, &pEvt->usedChSelInd); + } + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..38e74fb78aa16fe278c21600742f5efba45b0c84 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_master.c @@ -0,0 +1,64 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief LL master connection event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstConnEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_CREATE_CONN_CANCEL_CNF: + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_CMPL_EVT, HCI_LEN_CMD_CMPL + LHCI_LEN_LE_CREATE_CONN_CANCEL_EVT)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvt(pBuf, HCI_OPCODE_LE_CREATE_CONN_CANCEL); + lhciPackCmdCompleteEvtStatus(pBuf, pEvt->createConnCancelCnf.status); + } + break; + + default: + /* Fall back to slave connection handler. */ + return lhciConnEncodeEvtPkt(pEvt); /* exit routine */ + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..004ec06d41dde79d6f2266c981df9515c33a6046 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_conn_priv.c @@ -0,0 +1,96 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Pack an enhanced connection complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Connection indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackEnhancedConnCompleteEvt(uint8_t *pBuf, const LlConnInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_ENHANCED_CONN_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_ENHANCED_CONN_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->role); + UINT8_TO_BSTREAM (pBuf, pEvt->addrType); + BDA_TO_BSTREAM (pBuf, pEvt->peerAddr); + BDA_TO_BSTREAM (pBuf, pEvt->localRpa); + BDA_TO_BSTREAM (pBuf, pEvt->peerRpa); + UINT16_TO_BSTREAM(pBuf, pEvt->connInterval); + UINT16_TO_BSTREAM(pBuf, pEvt->connLatency); + UINT16_TO_BSTREAM(pBuf, pEvt->supTimeout); + UINT8_TO_BSTREAM (pBuf, pEvt->clockAccuracy); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL privacy connection event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciPrivConnEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_CONN_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_ENHANCED_CONN_CMPL_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_ENHANCED_CONN_CMPL)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + lhciPackEnhancedConnCompleteEvt(pBuf, &pEvt->connInd); + } + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..2c624446b2fa32d5230e113ac3fe8f50dc8b6f99 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_master.c @@ -0,0 +1,41 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief LL slave data event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciMstEncEncodeEvtPkt(LlEvt_t *pEvt) +{ + /* Fall back to slave encryption handler. */ + return lhciSlvEncEncodeEvtPkt(pEvt); /* exit routine */ +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..e82827d1c3a2351321affe5e3add252a7ed71ff9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_enc_slave.c @@ -0,0 +1,184 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack start encryption event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Encryption change indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackEncChangeEvt(uint8_t *pBuf, const LlEncChangeInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_ENC_CHANGE; + + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->enabled); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack key refresh complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Key refresh indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackEncKeyRefreshEvt(uint8_t *pBuf, const LlEncKeyRefreshInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_ENC_KEY_REFRESH_CMPL; + + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a connection update complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Connection update indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackLtkReqEvt(uint8_t *pBuf, const LlLtkReqInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_LTK_REQ; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_LTK_REQ_EVT); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + memcpy(pBuf, pEvt->randNum, sizeof(pEvt->randNum)); + pBuf += sizeof(pEvt->randNum); + UINT16_TO_BSTREAM(pBuf, pEvt->encDiversifier); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a authenticated payload timeout indication event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Authenticated payload timeout indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackAuthPayloadTimeoutEvt(uint8_t *pBuf, const LlAuthPayloadTimeoutInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_AUTH_PAYLOAD_TIMEOUT; + + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL slave data event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvEncEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_ENC_CHANGE_IND: + if (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_ENC_CHANGE) << LHCI_BYTE_TO_BITS(0))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_ENC_CHANGE_EVT, HCI_LEN_ENC_CHANGE)) != NULL) + { + lhciPackEncChangeEvt(pEvtBuf, &pEvt->encChangeInd); + } + } + break; + case LL_ENC_KEY_REFRESH_IND: + if (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL) << LHCI_BYTE_TO_BITS(5))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_ENC_KEY_REFRESH_CMPL_EVT, HCI_LEN_ENC_KEY_REFRESH_CMPL)) != NULL) + { + lhciPackEncKeyRefreshEvt(pEvtBuf, &pEvt->keyRefreshInd); + } + } + break; + case LL_LTK_REQ_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_LTK_REQ_EVT) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_LTK_REQ)) != NULL) + { + lhciPackLtkReqEvt(pEvtBuf, &pEvt->ltkReqInd); + } + } + /* If the event could not be sent, process it as a negative reply. */ + if (!pEvtBuf) + { + LlLtkReqNegReply(pEvt->ltkReqInd.handle); + } + break; + case LL_AUTH_PAYLOAD_TIMEOUT_IND: + if (lhciCb.evtMskPg2 & ((uint64_t)(HCI_EVT_MASK_AUTH_PAYLOAD_TIMEOUT) << LHCI_BYTE_TO_BITS(2))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_AUTH_PAYLOAD_TIMEOUT_EVT, HCI_LEN_AUTH_PAYLOAD_TIMEOUT)) != NULL) + { + lhciPackAuthPayloadTimeoutEvt(pEvtBuf, &pEvt->authPayloadTimeoutInd); + } + } + break; + + case LL_LTK_REQ_NEG_REPLY_CNF: + case LL_LTK_REQ_REPLY_CNF: + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..012ceda800be1ba6ab313d5b2dac45f23e252f89 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_phy.c @@ -0,0 +1,90 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Pack a PHY update complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Generate PHY update indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackPhyUpdateCmplEvt(uint8_t *pBuf, const LlPhyUpdateInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_PHY_UPDATE_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_PHY_UPDATE_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, pEvt->status); + UINT16_TO_BSTREAM(pBuf, pEvt->handle); + UINT8_TO_BSTREAM (pBuf, pEvt->txPhy); + UINT8_TO_BSTREAM (pBuf, pEvt->rxPhy); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL PHY features event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciPhyEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_PHY_UPDATE_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_PHY_UPDATE_CMPL_EVT) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_PHY_UPDATE_CMPL)) != NULL) + { + lhciPackPhyUpdateCmplEvt(pEvtBuf, &pEvt->phyUpdateInd); + } + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..12f2b930e24a99c0bc82c2a782be1341a5a24eeb --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_sc.c @@ -0,0 +1,121 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Pack a read local P-256 public key complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Read local P-256 public key indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackReadLocalP256PubKeyCmplEvt(uint8_t *pBuf, const LlReadLocalP256PubKeyInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_READ_PUB_KEY_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, LL_SUCCESS); + memcpy(pBuf, pEvt->pubKey_x, sizeof(pEvt->pubKey_x)); + pBuf += sizeof(pEvt->pubKey_x); + memcpy(pBuf, pEvt->pubKey_y, sizeof(pEvt->pubKey_y)); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a generate Diffie-Hellman key complete event packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Generate Diffie-Hellman key indication data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciPackGenerateDhKeyCmplEvt(uint8_t *pBuf, const LlGenerateDhKeyInd_t *pEvt) +{ + const uint8_t len = HCI_LEN_LE_GEN_DHKEY_CMPL; + + UINT8_TO_BSTREAM (pBuf, HCI_LE_GENERATE_DHKEY_CMPL_EVT); + UINT8_TO_BSTREAM (pBuf, LL_SUCCESS); + memcpy(pBuf, pEvt->dhKey, sizeof(pEvt->dhKey)); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL secure connections data event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciScEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_READ_LOCAL_P256_PUB_KEY_CMPL) << LHCI_BYTE_TO_BITS(0))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_READ_PUB_KEY_CMPL)) != NULL) + { + lhciPackReadLocalP256PubKeyCmplEvt(pEvtBuf, &pEvt->readLocalP256PubKeyInd); + } + } + break; + case LL_GENERATE_DHKEY_CMPL_IND: + if ((lhciCb.leEvtMsk & ((uint64_t)(HCI_EVT_MASK_LE_GENERATE_DHKEY_CMPL) << LHCI_BYTE_TO_BITS(1))) && + (lhciCb.evtMsk & ((uint64_t)(HCI_EVT_MASK_LE_META) << LHCI_BYTE_TO_BITS(7)))) + { + if ((pEvtBuf = lhciAllocEvt(HCI_LE_META_EVT, HCI_LEN_LE_GEN_DHKEY_CMPL)) != NULL) + { + lhciPackGenerateDhKeyCmplEvt(pEvtBuf, &pEvt->generateDhKeyInd); + } + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_vs.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_vs.c new file mode 100644 index 0000000000000000000000000000000000000000..ebe532acbf3f538a858ccf389e980115a522fe50 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_evt_vs.c @@ -0,0 +1,141 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Vendor specific HCI event module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "hci_defs.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Note: ARM Ltd. vendor specific subevent code is 0xFFF0-0xFFFF. */ + +#define LHCI_OPCODE_VS_SUBEVT_TRACE_MSG 0xFFF0 /*!< Trace message event. */ +#define LHCI_OPCODE_VS_SUBEVT_SCAN_REPORT 0xFFF1 /*!< Scan report event. */ + +#define LHCI_LEN_VS_SUBEVT_SCAN_REPORT 13 /*!< Scan report event length. */ + +/*************************************************************************************************/ +/*! + * \brief Pack a vendor specific event packet. + * + * \param pBuf Packed packet buffer. + * \param vsEvtCode Event code. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t LhciPackVsEvt(uint8_t *pBuf, uint16_t vsEvtCode) +{ + const uint8_t len = LHCI_LEN_VS_EVT; + + UINT16_TO_BSTREAM(pBuf, vsEvtCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Send a token pending event. + * + * \param pBuf Message. + * \param len Message length. + * + * \return None. + */ +/*************************************************************************************************/ +void LhciVsEncodeTraceMsgEvtPkt(uint8_t *pBuf, uint8_t len) +{ + uint8_t *pPkt; + uint8_t *pEvtBuf; + + if ((pPkt = lhciAllocEvt(HCI_VENDOR_SPEC_EVT, LHCI_LEN_VS_EVT + len)) != NULL) + { + pEvtBuf = pPkt; + pEvtBuf += lhciPackVsEvt(pEvtBuf, LHCI_OPCODE_VS_SUBEVT_TRACE_MSG); + memcpy(pEvtBuf, pBuf, len); + + lhciSendEvt(pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Pack a scan report packet. + * + * \param pBuf Packed packet buffer. + * \param pEvt Scan report data. + * + * \return Packet length. + */ +/*************************************************************************************************/ +static uint8_t lhciVsPackScanReportEvt(uint8_t *pBuf, const LlScanReportInd_t *pEvt) +{ + const uint8_t len = LHCI_LEN_VS_SUBEVT_SCAN_REPORT; + + UINT8_TO_BSTREAM(pBuf, pEvt->peerAddrType); + BDA64_TO_BSTREAM(pBuf, pEvt->peerAddr); + BDA64_TO_BSTREAM(pBuf, pEvt->peerRpa); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL slave VS event handler. + * + * \param pEvt Buffer containing LL event. + * + * \return TRUE if event handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciSlvVsStdEncodeEvtPkt(LlEvt_t *pEvt) +{ + uint8_t *pEvtBuf = NULL; + + switch (pEvt->hdr.event) + { + case LL_SCAN_REPORT_IND: + /* No need to check the event mask; LL should not generate this event without the event masked. */ + if ((pEvtBuf = lhciAllocEvt(HCI_VENDOR_SPEC_EVT, LHCI_LEN_VS_EVT + LHCI_LEN_VS_SUBEVT_SCAN_REPORT)) != NULL) + { + uint8_t *pBuf = pEvtBuf; + pBuf += LhciPackVsEvt(pBuf, LHCI_OPCODE_VS_SUBEVT_SCAN_REPORT); + lhciVsPackScanReportEvt(pBuf, &pEvt->scanReportInd); + } + break; + + default: + break; + } + + if (pEvtBuf) + { + lhciSendEvt(pEvtBuf); + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init.c new file mode 100644 index 0000000000000000000000000000000000000000..a2d6c3f59fc56fd8fd253a909fb08bdb0553b078 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init.c @@ -0,0 +1,65 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "chci_api.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI handler. + * + * \param handlerId WSF handler ID. + * + * \return None. + * + * This function initializes the LL HCI subsystem. It is typically called once upon system + * initialization. + */ +/*************************************************************************************************/ +void LhciHandlerInit(wsfHandlerId_t handlerId) +{ + ChciTrSetCbacks(CHCI_TR_PROT_BLE, lhciRecv, lhciSendComplete, lhciService); + ChciTrSetSendHwErrorCback(lhciSendHwError); + + memset(&lhciPersistCb, 0, sizeof(lhciPersistCb)); + lhciPersistCb.handlerId = handlerId; + memset(&lhciCb, 0, sizeof(lhciCb)); + + LlEvtRegister(lhciLlEvtHandler); + + lhciReset(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize VS extended command decoder. + * + * \param decodeCmd Command decoder. + * + * \return None. + */ +/*************************************************************************************************/ +void LhciVsExtInit(lhciCmdHandler_t decodeCmd) +{ + lhciCmdTbl[LHCI_MSG_VS_EXT] = decodeCmd; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..140fd2bf702995adc2b7217b1545af94f33f2dd0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for master mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for master commands. It is typically called + * once upon system initialization. + */ +/*************************************************************************************************/ +void LhciScanMasterInit(void) +{ + lhciCmdTbl[LHCI_MSG_SCAN] = lhciMstScanDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_SCAN] = lhciMstScanEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..cc2186395188215a1a89f6f31a86300156e41209 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_master_ae.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for master mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for master commands. It is typically called + * once upon system initialization. + */ +/*************************************************************************************************/ +void LhciExtScanMasterInit(void) +{ + lhciCmdTbl[LHCI_MSG_EXT_SCAN] = lhciMstExtScanDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_EXT_SCAN] = lhciMstExtScanEncodeEvtPkt; + + lhciCmdTbl[LHCI_MSG_PER_SCAN] = lhciMstExtScanDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_PER_SCAN] = lhciMstExtScanEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..be20e49542a6f2ab45b09c265e72048bb9f7cb61 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_priv.c @@ -0,0 +1,42 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for privacy. + * + * \return None. + * + * This function initializes the LL HCI subsystem for LE Privacy 1.2. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciPrivAdvInit(void) +{ + if (!lhciCmdTbl[LHCI_MSG_PRIV]) + { + lhciCmdTbl[LHCI_MSG_PRIV] = lhciPrivAdvDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_PRIV] = NULL; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..9e203988b66a8740b3016989454d0dee16cb10b0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for slave mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for slave commands. It is typically called + * once upon system initialization. + */ +/*************************************************************************************************/ +void LhciAdvSlaveInit(void) +{ + lhciCmdTbl[LHCI_MSG_ADV] = lhciSlvAdvDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_ADV] = lhciSlvAdvEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..e229048ef6b7cd19596f26ceab54df79cf4abc09 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c @@ -0,0 +1,42 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for slave mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for slave commands. It is typically called + * once upon system initialization. + */ +/*************************************************************************************************/ +void LhciExtAdvSlaveInit(void) +{ + lhciCmdTbl[LHCI_MSG_EXT_ADV] = lhciSlvExtAdvDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_EXT_ADV] = lhciSlvExtAdvEncodeEvtPkt; + + lhciCmdTbl[LHCI_MSG_PER_ADV] = lhciSlvExtAdvDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_PER_ADV] = lhciSlvExtAdvEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..969d3b597d2a457ad48e5741ceaeb0ef1da7883d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn.c @@ -0,0 +1,46 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for connections. + * + * \return None. + * + * This function initializes the LL HCI subsystem for ACL data exchanges. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciConnInit(void) +{ + LlAclRegister(lhciAclSendComplete, lhciAclRecvPending); + + /* Don't override master's handler if set. */ + if (!lhciCmdTbl[LHCI_MSG_CONN]) + { + lhciCmdTbl[LHCI_MSG_CONN] = lhciConnDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_CONN] = lhciConnEncodeEvtPkt; + } + lhciServiceAcl = lhciRecvAcl; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_cs2.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_cs2.c new file mode 100644 index 0000000000000000000000000000000000000000..f233ab8cd289d790b6ac118d38360e7c098a8215 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_cs2.c @@ -0,0 +1,38 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for channel selection 2. + * + * \return None. + * + * This function initializes the LL HCI subsystem for channel selection 2.. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciChannelSelection2Init(void) +{ + lhciEvtTbl[LHCI_MSG_CONN_CS2] = lhciConnCsEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..7af9e81eb7cfd2e44c30719a74dc706e59d30add --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for master connections. + * + * \return None. + * + * This function initializes the LL HCI subsystem for ACL data exchanges. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciConnMasterInit(void) +{ + LlAclRegister(lhciAclSendComplete, lhciAclRecvPending); + + /* Unconditionally override slave settings if exists. */ + lhciCmdTbl[LHCI_MSG_CONN] = lhciMstConnDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_CONN] = lhciMstConnEncodeEvtPkt; + lhciServiceAcl = lhciRecvAcl; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..a5e9e6ddc8b7ad21ad0b521ab08e18beacaf6013 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_master_ae.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for master connections. + * + * \return None. + * + * This function initializes the LL HCI subsystem for ACL data exchanges. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciExtConnMasterInit(void) +{ + LlAclRegister(lhciAclSendComplete, lhciAclRecvPending); + + /* Unconditionally override slave settings if exists. */ + lhciCmdTbl[LHCI_MSG_CONN] = lhciMstExtConnDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_CONN] = lhciMstConnEncodeEvtPkt; + lhciServiceAcl = lhciRecvAcl; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..39bd91e2492638a2ef6d54f57358daf6ae951c71 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_conn_priv.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for privacy (connections). + * + * \return None. + * + * This function initializes the LL HCI subsystem for LE Privacy 1.2. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciPrivConnInit(void) +{ + lhciCmdTbl[LHCI_MSG_PRIV] = lhciPrivConnDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_PRIV] = lhciPrivConnEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..eea821b3c8a8e2187b53bc3c33e10ef29297b19f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_master.c @@ -0,0 +1,40 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for master encryption mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for master commands. It is typically called + * once upon system initialization. + */ +/*************************************************************************************************/ +void LhciEncMasterInit(void) +{ + /* Unconditionally override slave settings if exists. */ + lhciCmdTbl[LHCI_MSG_ENC] = lhciMstEncDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_ENC] = lhciMstEncEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..a251cd3d827678df41766e046d076002c80d8260 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_enc_slave.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for slave encryption mode. + * + * \return None. + * + * This function initializes the LL HCI subsystem for slave encryption commands. It is typically + * called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciEncSlaveInit(void) +{ + /* Don't override master's handler if set. */ + if (!lhciCmdTbl[LHCI_MSG_ENC]) + { + lhciCmdTbl[LHCI_MSG_ENC] = lhciSlvEncDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_ENC] = lhciSlvEncEncodeEvtPkt; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..7dd995a0f4fda4f9614382878a2c3dfa70188fa5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_phy.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for PHY features. + * + * \return None. + * + * This function initializes the LL HCI subsystem for PHY features commands. It is + * typically called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciPhyInit(void) +{ + lhciCmdTbl[LHCI_MSG_PHY] = lhciPhyDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_PHY] = lhciPhyEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..305a5cfe54c2509be269065f774ebcf633567d1b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_init_sc.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL HCI subsystem for secure connections. + * + * \return None. + * + * This function initializes the LL HCI subsystem for secure connections commands. It is + * typically called once upon system initialization. + */ +/*************************************************************************************************/ +void LhciScInit(void) +{ + lhciCmdTbl[LHCI_MSG_SC] = lhciScDecodeCmdPkt; + lhciEvtTbl[LHCI_MSG_SC] = lhciScEncodeEvtPkt; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_int.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_int.h new file mode 100644 index 0000000000000000000000000000000000000000..3c33995a7e9cfa713b6440ddd5435d5162d39ff6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_int.h @@ -0,0 +1,457 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LL HCI main module interface file. + */ +/*************************************************************************************************/ + +#ifndef LHCI_INT_H +#define LHCI_INT_H + +#include "lhci_api.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "wsf_os.h" +#include "wsf_queue.h" +#include "util/bstream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \addtogroup LL_LHCI_INT + * \{ + */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Command complete parameter lengths */ + +/* --- Controller Group --- */ +#define LHCI_LEN_SET_EVENT_MASK_EVT 1 /*!< Set event mask command complete event length. */ +#define LHCI_LEN_RESET_EVT 1 /*!< Reset command complete event length. */ +#define LHCI_LEN_READ_PWR_LVL_EVT 4 /*!< Read power level command complete event length. */ +#define LHCI_LEN_READ_AUTH_PAYLOAD_TO_EVT 5 /*!< Read authenticated payload timeout command complete event length. */ +#define LHCI_LEN_WRITE_AUTH_PAYLOAD_TO_EVT 3 /*!< Write authenticated payload timeout command complete event length. */ + +/* --- Informational commands --- */ +#define LHCI_LEN_READ_LOCAL_VER_EVT 9 /*!< Read local version command complete event length. */ +#define LHCI_LEN_READ_LOCAL_SUP_CMDS_EVT 65 /*!< Read local supported commands command complete event length. */ +#define LHCI_LEN_READ_LOCAL_SUP_FEAT_EVT 9 /*!< Read local supported feature command complete event length. */ +#define LHCI_LEN_READ_BUF_SIZE_EVT 8 /*!< Read buffer size command complete event length. */ +#define LHCI_LEN_READ_BD_ADDR_EVT 7 /*!< Read BD address command complete event length. */ + +/* --- LE controller commands --- */ +#define LHCI_LEN_LE_SET_EVENT_MASK_EVT 1 /*!< LE set event mask command complete event length. */ +#define LHCI_LEN_LE_READ_BUF_SIZE_EVT 4 /*!< LE read buffer size command complete event length. */ +#define LHCI_LEN_LE_READ_LOCAL_SUP_FEAT_EVT 9 /*!< LE read local supported feature command complete event length. */ +#define LHCI_LEN_LE_SET_RAND_ADDR_EVT 1 /*!< LE set random address command complete event length. */ +#define LHCI_LEN_LE_SET_ADV_PARAM_EVT 1 /*!< LE set advertising parameter command complete event length. */ +#define LHCI_LEN_LE_READ_ADV_TX_POWER_EVT 2 /*!< LE read advertising Tx power command complete event length. */ +#define LHCI_LEN_LE_SET_ADV_DATA_EVT 1 /*!< LE set advertising data command complete event length. */ +#define LHCI_LEN_LE_SET_SCAN_RESP_DATA_EVT 1 /*!< LE set scan response data command complete event length. */ +#define LHCI_LEN_LE_SET_ADV_ENABLE_EVT 1 /*!< LE set advertising enable command complete event length. */ +#define LHCI_LEN_LE_SET_SCAN_PARAM_EVT 1 /*!< LE set scan parameter command complete event length. */ +#define LHCI_LEN_LE_SET_SCAN_ENABLE_EVT 1 /*!< LE set scan enable command complete event length. */ +#define LHCI_LEN_LE_CREATE_CONN_CANCEL_EVT 1 /*!< LE create connection cancel command complete event length. */ +#define LHCI_LEN_LE_READ_WL_SIZE_EVT 2 /*!< LE read white list size command complete event length. */ +#define LHCI_LEN_LE_CLEAR_WHITE_LIST_EVT 1 /*!< LE clear white list command complete event length. */ +#define LHCI_LEN_LE_ADD_DEV_WHITE_LIST_EVT 1 /*!< LE add device to white list command complete event length. */ +#define LHCI_LEN_LE_REMOVE_DEV_WHITE_LIST_EVT 1 /*!< LE remove device from white list command complete event length. */ +#define LHCI_LEN_LE_SET_HOST_CHAN_CLASS 1 /*!< LE set host channel class command complete event length. */ +#define LHCI_LEN_LE_READ_CHAN_MAP_EVT 8 /*!< LE read channel map command complete event length. */ +#define LHCI_LEN_LE_ENCRYPT_EVT 17 /*!< LE encrypt command complete event length. */ +#define LHCI_LEN_LE_LTK_REQ_REPL_EVT 3 /*!< LE LTK request reply command complete event length. */ +#define LHCI_LEN_LE_LTK_REQ_NEG_REPL_EVT 3 /*!< LE LTK request negative reply command complete event length. */ +#define LHCI_LEN_LE_RAND_EVT 9 /*!< LE random command complete event length. */ +#define LHCI_LEN_LE_READ_SUP_STATES_EVT 9 /*!< LE read supported states command complete event length. */ +#define LHCI_LEN_LE_RECEIVER_TEST_EVT 1 /*!< LE receiver test command complete event length. */ +#define LHCI_LEN_LE_TRANSMITTER_TEST_EVT 1 /*!< LE transmitter test command complete event length. */ +#define LHCI_LEN_LE_TEST_END_EVT 3 /*!< LE test end command complete event length. */ +/* New in version 4.1 */ +#define LHCI_LEN_LE_REM_CONN_PARAM_REP 3 /*!< LE remote connection parameter reply command complete event length. */ +#define LHCI_LEN_LE_REM_CONN_PARAM_NEG_REP 3 /*!< LE remote connection parameter negative reply command complete event length. */ +/* New in version 4.2 */ +#define LHCI_LEN_LE_SET_DATA_LEN 3 /*!< LE set data length command complete event length. */ +#define LHCI_LEN_LE_READ_DEF_DATA_LEN 5 /*!< LE read default data length command complete event length. */ +#define LHCI_LEN_LE_WRITE_DEF_DATA_LEN 1 /*!< LE write default data length command complete event length. */ +#define LHCI_LEN_LE_ADD_DEV_RES_LIST_EVT 1 /*!< LE add device to resolving list command complete event length. */ +#define LHCI_LEN_LE_REMOVE_DEV_RES_LIST_EVT 1 /*!< LE remove device from resolving list command complete event length. */ +#define LHCI_LEN_LE_CLEAR_RES_LIST_EVT 1 /*!< LE clear resolving list command complete event length. */ +#define LHCI_LEN_LE_READ_RES_LIST_SIZE_EVT 2 /*!< LE read resolving list size command complete event length. */ +#define LHCI_LEN_LE_READ_PEER_RES_ADDR_EVT 7 /*!< LE read peer resolving address command complete event length. */ +#define LHCI_LEN_LE_READ_LOCAL_RES_ADDR_EVT 7 /*!< LE read local resolving address command complete event length. */ +#define LHCI_LEN_LE_SET_ADDR_RES_ENABLE_EVT 1 /*!< LE set address resolution enable command complete event length. */ +#define LHCI_LEN_LE_SET_RES_PRIV_ADDR_TO_EVT 1 /*!< LE set resolving private address timeout command complete event length. */ +#define LHCI_LEN_LE_READ_MAX_DATA_LEN 9 /*!< LE read maximum data length command complete event length. */ +/* New in version 5.0 */ +#define LHCI_LEN_LE_SET_PRIVACY_MODE 1 /*!< LE set privacy mode command complete event length. */ +#define LHCI_LEN_LE_SET_ADV_SET_RAND_ADDR 1 /*!< LE set advertising set random address command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_ADV_PARAM 2 /*!< LE set extended advertising parameters command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_ADV_DATA 1 /*!< LE set extended advertising data command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_SCAN_RESP_DATA 1 /*!< LE set extended scan response data command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_ADV_ENABLE 1 /*!< LE set extended advertising enable command complete event length. */ +#define LHCI_LEN_LE_READ_MAX_ADV_DATA_LEN 3 /*!< LE read maximum advertising data length command complete event length. */ +#define LHCI_LEN_LE_READ_NUM_OF_SUP_ADV_SETS 2 /*!< LE read number of supported advertising sets command complete event length. */ +#define LHCI_LEN_LE_REMOVE_ADV_SET 1 /*!< LE remove advertising set command complete event length. */ +#define LHCI_LEN_LE_CLEAR_ADV_SETS 1 /*!< LE clear advertising sets command complete event length. */ +#define LHCI_LEN_LE_SET_PER_ADV_PARAM 1 /*!< LE set periodic advertising parameters command complete event length. */ +#define LHCI_LEN_LE_SET_PER_ADV_DATA 1 /*!< LE set periodic advertising data command complete event length. */ +#define LHCI_LEN_LE_SET_PER_ADV_ENABLE 1 /*!< LE set periodic advertising enable command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_SCAN_PARAM 1 /*!< LE set extended scan parameter command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_SCAN_ENABLE 1 /*!< LE set extended scan enable command complete event length. */ +#define LHCI_LEN_LE_PER_ADV_CREATE_SYNC_CANCEL 1 /*!< LE periodic advertising create sync cancel command complete event length. */ +#define LHCI_LEN_LE_PER_ADV_TERMINATE_SYNC 1 /*!< LE periodic advertising terminate sync command complete event length. */ +#define LHCI_LEN_LE_ADD_DEV_PER_ADV_LIST 1 /*!< LE add device from periodic advertising list command complete event length. */ +#define LHCI_LEN_LE_REM_DEV_PER_ADV_LIST 1 /*!< LE remove device from periodic advertising list command complete event length. */ +#define LHCI_LEN_LE_CLEAR_PER_ADV_LIST 1 /*!< LE clear periodic advertising list command complete event length. */ +#define LHCI_LEN_LE_READ_PER_ADV_LIST_SIZE 2 /*!< LE read periodic advertising list size command complete event length. */ +#define LHCI_LEN_LE_READ_SUP_TX_POWER 3 /*!< LE read supported Tx power command complete event length. */ +#define LHCI_LEN_LE_WRITE_RF_PATH_COMP 1 /*!< LE write RF path compensation command complete event length. */ +#define LHCI_LEN_LE_READ_RF_PATH_COMP 5 /*!< LE read RF path compensation command complete event length. */ +#define LHCI_LEN_LE_SET_EXT_SCAN_ENABLE_EVT 1 /*!< LE set extended scan enable command complete event length. */ +#define LHCI_LEN_LE_READ_PHY_EVT 5 /*!< LE read PHY command complete event length. */ +#define LHCI_LEN_LE_SET_DEF_PHY_EVT 1 /*!< LE set default PHY command complete event length. */ +#define LHCI_LEN_LE_ENHANCED_RECEIVER_TEST_EVT 1 /*!< LE enhanced receiver test command complete event length. */ +#define LHCI_LEN_LE_ENHANCED_TRANSMITTER_TEST_EVT 1 /*!< LE enhanced transmitter test command complete event length. */ + +/*! \brief Mandatory event mask. */ +#define LHCI_DEF_EVT_MASK UINT64_C(0x00001FFFFFFFFFFF); + +/*! \brief Default page 2 event mask. */ +#define LHCI_DEF_EVT_PG2_MASK UINT64_C(0x0000000000000000); + +/*! \brief Default LE specific event mask. */ +#define LHCI_DEF_LE_EVT_MASK UINT64_C(0x000000000000001F); + +/*! \brief Local supported features value. */ +#define LHCI_LOCAL_SUP_FEAT_VAL UINT64_C(0x0000006000000000) + /* bit 37: BR/EDR Not Supported */ + /* bit 38: LE Supported (Controller) */ + +/*! \brief Convert bytes to bits. */ +#define LHCI_BYTE_TO_BITS(x) (8 * x) + +/*! \brief Vendor specific event length. */ +#define LHCI_LEN_VS_EVT 2 + +/*! \brief Indicate command status event shall be returned. */ +#define LHCI_LEN_CMD_STATUS_EVT 0xFF + +/* Cordio vendor specific OCF range is 0x3E0-0x3FF. */ +#define LHCI_OPCODE_VS_SET_SCAN_CH_MAP HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E0) /*!< Set Scan Channel Map opcode. */ +#define LHCI_OPCODE_VS_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E1) /*!< Set Vendor Specific Event Mask opcode. */ +#define LHCI_OPCODE_VS_SET_RSRC_MGR_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E2) /*!< DEPRECATED. */ +#define LHCI_OPCODE_VS_ENA_ACL_SINK HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E3) /*!< Enable ACL Packet Sink opcode. */ +#define LHCI_OPCODE_VS_GENERATE_ACL HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E4) /*!< Generate ACL Packets opcode. */ +#define LHCI_OPCODE_VS_ENA_AUTO_GEN_ACL HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E5) /*!< Enable Auto Generate ACL Packets opcode. */ +#define LHCI_OPCODE_VS_SET_TX_TEST_ERR_PATT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E6) /*!< Set Tx Test Error Pattern opcode. */ +#define LHCI_OPCODE_VS_SET_CONN_OP_FLAGS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E7) /*!< Set Connection Operational Flags opcode. */ +#define LHCI_OPCODE_VS_SET_P256_PRIV_KEY HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E8) /*!< Set P-256 Private Key opcode. */ +#define LHCI_OPCODE_VS_GET_ACL_TEST_REPORT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E9) /*!< Get ACL Test Report opcode. */ +#define LHCI_OPCODE_VS_SET_LOCAL_MIN_USED_CHAN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3EA) /*!< Set local minimum number of used channels. */ +#define LHCI_OPCODE_VS_GET_PEER_MIN_USED_CHAN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3EB) /*!< Get peer minimum number of used channels. */ +#define LHCI_OPCODE_VS_SET_BD_ADDR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F0) /*!< Set BD address opcode. */ +#define LHCI_OPCODE_VS_GET_RAND_ADDR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F1) /*!< Get Random Address opcode. */ +#define LHCI_OPCODE_VS_SET_LOCAL_FEAT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F2) /*!< Set Local Feature opcode. */ +#define LHCI_OPCODE_VS_SET_OP_FLAGS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F3) /*!< Set Operational Flags opcode. */ +#define LHCI_OPCODE_VS_SET_ADV_TX_PWR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F5) /*!< Set Advertising Tx Power opcode. */ +#define LHCI_OPCODE_VS_SET_CONN_TX_PWR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F6) /*!< Set Connection Tx Power opcode. */ +#define LHCI_OPCODE_VS_SET_ENC_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F7) /*!< Set Encryption Mode opcode. */ +#define LHCI_OPCODE_VS_SET_CHAN_MAP HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F8) /*!< Set Channel Map opcode. */ + +#define LHCI_OPCODE_VS_SET_DIAG_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F9) /*!< Set Diagnostic Mode opcode. */ + +#define LHCI_OPCODE_VS_GET_PDU_FILT_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F4) /*!< Get PDU Filter Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_SYS_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FA) /*!< Get Memory Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_ADV_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FB) /*!< Get Advertising Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FC) /*!< Get Scan Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_CONN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FD) /*!< Get Connection Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_TEST_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FE) /*!< Get Test Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_POOL_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FF) /*!< Get Pool Statistics opcode. */ + +#define LHCI_OPCODE_VS_SET_AUX_DELAY HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D0) /*!< Set Additional AuxPtr offset. */ +#define LHCI_OPCODE_VS_SET_EXT_ADV_FRAG_LEN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D1) /*!< Set extended advertising data fragmentation length. */ +#define LHCI_OPCODE_VS_SET_EXT_ADV_PHY_OPTS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D2) /*!< Set extended advertising PHY options. */ +#define LHCI_OPCODE_VS_SET_EXT_ADV_DEF_PHY_OPTS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D3) /*!< Set extended advertising default PHY options. */ + +#define LHCI_OPCODE_VS_GET_AUX_ADV_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DA) /*!< Get Auxiliary Advertising Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_AUX_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DB) /*!< Get Auxiliary Scanning Statistics opcode. */ +#define LHCI_OPCODE_VS_GET_PER_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DC) /*!< Get Periodic Scanning Statistics opcode. */ + +/* Vendor specific event masks. */ +#define LHCI_VS_EVT_MASK_SCAN_REPORT_EVT 0x01 /*!< (Byte 0) VS event bit, scan report. */ +#define LHCI_VS_EVT_MASK_DIAG_TRACE_EVT 0x02 /*!< (Byte 0) VS event bit, diagnostic tracing. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Message handler types. */ +enum +{ + LHCI_MSG_PRIV, /*!< Privacy command handler type. Must be before CONN. */ + LHCI_MSG_CONN, /*!< Connection command handler type. */ + LHCI_MSG_CONN_CS2, /*!< Connection Channel Selection 2 command handler type. */ + LHCI_MSG_ENC, /*!< Encryption command handler type. */ + LHCI_MSG_SCAN, /*!< Scan command handler type. */ + LHCI_MSG_EXT_SCAN, /*!< Extended scan command handler type. */ + LHCI_MSG_PER_SCAN, /*!< Periodic scan command handler type. */ + LHCI_MSG_ADV, /*!< Advertising command handler type. */ + LHCI_MSG_EXT_ADV, /*!< Extended advertising command handler type. */ + LHCI_MSG_PER_ADV, /*!< Periodic advertising command handler type. */ + LHCI_MSG_SC, /*!< Secure connections command handler type. */ + LHCI_MSG_PHY, /*!< PHY features command handler type. */ + LHCI_MSG_VS_EXT, /*!< Extended vendor specific command handler type. */ + LHCI_MSG_TESTER, /*!< Tester vendor specific command handler type. */ + LHCI_MSG_TOTAL /*!< Total number of command handlers. */ +}; + +/*! \brief Task event types. */ +enum +{ + LHCI_EVT_ACL_RCVD = (1 << 0), /*!< HCI ACL packet received. */ + LHCI_EVT_CMD_RCVD = (1 << 1), /*!< HCI command packet received. */ + LHCI_EVT_SEND_CMPL = (1 << 2), /*!< HCI event packet send completion. */ + LHCI_EVT_HW_ERR = (1 << 3) /*!< HCI hardware error. */ +}; + +/*! \brief Event handler call signature. */ +typedef bool_t (*lhciEvtHandler_t)(LlEvt_t *pEvt); + +/*! \brief Service ACL call signature. */ +typedef uint8_t *(*lhciServiceAcl_t)(void); + +/*! \brief Control block of the LL HCI subsystem (persists with resets). */ +typedef struct +{ + wsfHandlerId_t handlerId; /*!< Task handler ID. */ + + wsfQueue_t aclQ; /*!< ACL queue. */ + wsfQueue_t cmdQ; /*!< Command queue. */ + wsfQueue_t evtQ; /*!< Event queue. */ + bool_t evtTrPending; /*!< Event transport in progress. */ +} lhciPersistCb_t; + +/*! \brief Control block of the LL HCI subsystem (cleared with resets). */ +typedef struct +{ + uint64_t evtMsk; /*!< General event mask. */ + uint64_t evtMskPg2; /*!< General event mask page 2. */ + uint64_t leEvtMsk; /*!< LE specific event mask. */ + + uint8_t numScanReqRcvd; /*!< Number of scan request received. */ + uint8_t hwErrorCode; /*!< Hardware error code. */ + + bool_t recvAclSink; /*!< Receive ACL sink. */ + uint32_t recvAclPktCnt; /*!< Receive ACL packet count. */ + uint32_t recvAclOctetCnt; /*!< Receive ACL octet count. */ + bool_t genEnaFlag; /*!< Generate enable flag. */ + uint8_t genPldCnt; /*!< Generate ACL packet fill value. */ + uint16_t genPktLen; /*!< Generate ACL packet length (0 to disable). */ + uint32_t genPktCnt; /*!< Generate ACL packet count. */ + uint32_t genOctetCnt; /*!< Generate ACL octet count. */ + + uint8_t numAdvReport; /*!< Number of pending advertising reports. */ +} lhciCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Command handler table. */ +extern lhciCmdHandler_t lhciCmdTbl[LHCI_MSG_TOTAL]; + +/*! \brief Event handler table. */ +extern lhciEvtHandler_t lhciEvtTbl[LHCI_MSG_TOTAL]; + +/*! \brief Receive pending handler. */ +extern lhciServiceAcl_t lhciServiceAcl; + +/* Persistent control block */ +extern lhciPersistCb_t lhciPersistCb; + +/* Control block */ +extern lhciCb_t lhciCb; + +/* Handler duration watermark in microseconds. */ +extern uint16_t lhciHandlerWatermarkUsec; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Reset */ +void lhciReset(void); + +/* Data exchange */ +void lhciRecv(uint8_t type, uint8_t *pBuf); +void lhciSendComplete(uint8_t type, uint8_t *pBuf); +bool_t lhciService(uint8_t *pType, uint16_t *pLen, uint8_t **pBuf); +void lhciSendHwError(uint8_t code); + +/* Handlers */ +bool_t lhciLlEvtHandler(LlEvt_t *pEvt); +void lhciAclSendComplete(uint16_t handle, uint8_t numBufs); +uint8_t *lhciRecvAcl(void); +void lhciAclRecvPending(uint16_t handle, uint8_t numBufs); +void lhciGenerateAcl(uint16_t handle, uint16_t pktLen, uint8_t numPkts); + +/* Command parser */ +bool_t lhciCommonDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstExtConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstEncDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvEncDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstScanDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstExtScanDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvExtAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciPrivAdvDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciPrivConnDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciScDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciPhyDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciConnVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstConnVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstScanVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvAdvVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvEncVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciScVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciMstExtScanVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciSlvExtAdvVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); +bool_t lhciVsExtDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf); + +/* Event builders */ +void lhciSendCmdStatusEvt(LhciHdr_t *pCmdHdr, uint8_t status); +bool_t lhciConnEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciConnCsEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciMstConnEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciMstScanEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciSlvAdvEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciMstExtScanEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciSlvExtAdvEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciMstEncEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciSlvEncEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciPrivConnEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciScEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciPhyEncodeEvtPkt(LlEvt_t *pEvt); +bool_t lhciSlvVsStdEncodeEvtPkt(LlEvt_t *pEvt); + +/* Events */ +uint8_t *lhciAllocEvt(uint8_t evtCode, uint8_t paramLen); +uint8_t *lhciAllocCmdCmplEvt(uint8_t paramLen, uint16_t opCode); + +/* Command packet. */ +uint8_t lhciUnpackConnSpec(LlConnSpec_t *pConnSpec, const uint8_t *pBuf); + +/*************************************************************************************************/ +/*! + * \brief Pack an event packet header. + * + * \param pBuf Packed packet buffer. + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackEvtHdr(uint8_t *pBuf, uint8_t evtCode, uint8_t paramLen); + +/*************************************************************************************************/ +/*! + * \brief Pack a command status event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdStatusEvt(uint8_t *pBuf, uint8_t status, uint16_t opCode); + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete event packet. + * + * \param pBuf Packed packet buffer. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdCompleteEvt(uint8_t *pBuf, uint16_t opCode); + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete status parameter. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdCompleteEvtStatus(uint8_t *pBuf, uint8_t status); + +/*************************************************************************************************/ +/*! + * \brief Pack a vendor specific event packet. + * + * \param pBuf Packed packet buffer. + * \param vsEvtCode Event code. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackVsEvt(uint8_t *pBuf, uint16_t vsEvtCode); + +/*************************************************************************************************/ +/*! + * \brief Send an event. + * + * \param pEvtBuf Buffer containing event. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendEvt(uint8_t *pEvtBuf); + +/*************************************************************************************************/ +/*! + * \brief Send a command complete event. + * + * \param pEvtBuf Buffer containing command complete event. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendCmdCmplEvt(uint8_t *pEvtBuf); + +/*! \} */ /* LL_INT_LHCI */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LHCI_INT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_main.c new file mode 100644 index 0000000000000000000000000000000000000000..bc7a11ff0331bd517253d0e8830e6389fafcdf1e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lhci/lhci_main.c @@ -0,0 +1,465 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) Host Controller Interface (HCI) initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "chci_api.h" +#include "hci_defs.h" +#include "ll_api.h" +#include "bb_api.h" +#include "bb_drv.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Dispatcher table. */ +lhciCmdHandler_t lhciCmdTbl[LHCI_MSG_TOTAL]; + +/*! \brief Dispatcher table. */ +lhciEvtHandler_t lhciEvtTbl[LHCI_MSG_TOTAL]; + +/*! \brief Receive pending handler. */ +lhciServiceAcl_t lhciServiceAcl; + +/*! \brief Persistent control block */ +lhciPersistCb_t lhciPersistCb; + +/*! \brief LL HCI subsystem control block. */ +lhciCb_t lhciCb; + +/*! \brief Handler duration watermark in microseconds. */ +uint16_t lhciHandlerWatermarkUsec = 0; + +/*************************************************************************************************/ +/*! + * \brief Unpack an advertising channel PDU header. + * + * \param pHdr Unpacked header. + * \param pBuf Packed packet buffer. + * + * \return Header length. + */ +/*************************************************************************************************/ +uint8_t lhciUnpackHdr(LhciHdr_t *pHdr, const uint8_t *pBuf) +{ + const uint8_t len = sizeof(uint16_t) + sizeof(uint8_t); + + BSTREAM_TO_UINT16(pHdr->opCode, pBuf); + pHdr->len = *pBuf; + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief LL HCI message dispatch handler. + * + * \param event WSF event. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void LhciHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + bool_t startTimeValid; + uint32_t startTime; + uint32_t endTime; + + startTimeValid = BbDrvGetTimestamp(&startTime); + + if (event & LHCI_EVT_ACL_RCVD) + { + uint8_t *pAclBuf; + wsfHandlerId_t handlerId; + + while ((pAclBuf = WsfMsgDeq(&lhciPersistCb.aclQ, &handlerId)) != NULL) + { + LlSendAclData(pAclBuf); + } + } + + if (event & LHCI_EVT_CMD_RCVD) + { + uint8_t *pCmdBuf; + wsfHandlerId_t handlerId; + LhciHdr_t hdr; + + while ((pCmdBuf = WsfMsgDeq(&lhciPersistCb.cmdQ, &handlerId)) != NULL) + { + uint8_t *pPldBuf = pCmdBuf + lhciUnpackHdr(&hdr, pCmdBuf); + + if (!lhciCommonDecodeCmdPkt(&hdr, pPldBuf)) + { + unsigned int msg = 0; + do + { + if (lhciCmdTbl[msg] && lhciCmdTbl[msg](&hdr, pPldBuf)) + { + break; + } + } while (++msg < LHCI_MSG_TOTAL); + + /* Unhandled command. */ + if (msg == LHCI_MSG_TOTAL) + { + uint8_t *pEvtBuf; + + /* Send command status with unknown command status. */ + if ((pEvtBuf = lhciAllocEvt(HCI_CMD_STATUS_EVT, HCI_LEN_CMD_STATUS)) != NULL) + { + lhciPackCmdStatusEvt(pEvtBuf, HCI_ERR_UNKNOWN_CMD, hdr.opCode); + lhciSendEvt(pEvtBuf); + } + } + } + + WsfMsgFree(pCmdBuf); + } + } + + if (event & LHCI_EVT_SEND_CMPL) + { + lhciPersistCb.evtTrPending = FALSE; + ChciTrNeedsService(CHCI_TR_PROT_BLE); + } + + if (event & LHCI_EVT_HW_ERR) + { + uint8_t *pEvtBuf; + + if ((pEvtBuf = lhciAllocEvt(HCI_HW_ERROR_EVT, HCI_LEN_HW_ERR)) != NULL) + { + uint8_t *pBuf = (uint8_t *)pEvtBuf; + UINT8_TO_BSTREAM(pBuf, lhciCb.hwErrorCode); + + lhciSendEvt(pEvtBuf); + } + } + + if (startTimeValid && + BbDrvGetTimestamp(&endTime)) + { + uint32_t durUsec = BB_TICKS_TO_US(endTime - startTime); + if (lhciHandlerWatermarkUsec < durUsec) + { + lhciHandlerWatermarkUsec = durUsec; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Queue a received buffer for processing by the message handler. + * + * \param type Type of message. + * \param pBuf Pointer to received message. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciRecv(uint8_t type, uint8_t *pBuf) +{ + switch (type) + { + case CHCI_TR_TYPE_DATA: + WsfMsgEnq(&lhciPersistCb.aclQ, 0, pBuf); + WsfSetEvent(lhciPersistCb.handlerId, LHCI_EVT_ACL_RCVD); + break; + + case CHCI_TR_TYPE_CMD: + WsfMsgEnq(&lhciPersistCb.cmdQ, 0, pBuf); + WsfSetEvent(lhciPersistCb.handlerId, LHCI_EVT_CMD_RCVD); + break; + + default: + WsfMsgFree(pBuf); + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Signal transport send completion. + * + * \param type Type of message. + * \param pBuf Pointer to transmitted message. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendComplete(uint8_t type, uint8_t *pBuf) +{ + switch (type) + { + case CHCI_TR_TYPE_EVT: + if (pBuf[0] == HCI_LE_META_EVT) + { + switch (pBuf[2]) + { + case HCI_LE_ADV_REPORT_EVT: + case HCI_LE_DIRECT_ADV_REPORT_EVT: + case HCI_LE_EXT_ADV_REPORT_EVT: + case HCI_LE_PER_ADV_REPORT_EVT: + lhciCb.numAdvReport--; + break; + case HCI_LE_SCAN_REQ_RCVD_EVT: + lhciCb.numScanReqRcvd--; + break; + default: + break; + } + } + WsfMsgFree(pBuf); + break; + + case CHCI_TR_TYPE_DATA: + WsfMsgFree(pBuf); + LlRecvAclDataComplete(1); + break; + + default: + WSF_ASSERT(FALSE); + break; + } + + WsfSetEvent(lhciPersistCb.handlerId, LHCI_EVT_SEND_CMPL); +} + +/*************************************************************************************************/ +/*! + * \brief Service LHCI for transport. + * + * \param pType Storage for type of message. + * \param pLen Storage for length of message. + * \param pBuf Storage for pointer to transmitted message. + * + * \return TRUE if message ready. + */ +/*************************************************************************************************/ +bool_t lhciService(uint8_t *pType, uint16_t *pLen, uint8_t **pBuf) +{ + uint8_t *pBufTemp; + uint16_t len; + + if (!lhciPersistCb.evtTrPending) + { + wsfHandlerId_t handlerId; + + if ((pBufTemp = WsfMsgDeq(&lhciPersistCb.evtQ, &handlerId)) != NULL) + { + len = pBufTemp[1] + HCI_EVT_HDR_LEN; + + lhciPersistCb.evtTrPending = TRUE; + *pType = CHCI_TR_TYPE_EVT; + *pLen = len; + *pBuf = pBufTemp; + return TRUE; + } + else + { + if (lhciServiceAcl != NULL) + { + /* Additionally check if ACL data needs servicing. */ + if ((pBufTemp = lhciServiceAcl()) != NULL) + { + BYTES_TO_UINT16(len, &pBufTemp[2]); + len += HCI_ACL_HDR_LEN; + + lhciPersistCb.evtTrPending = TRUE; + *pType = CHCI_TR_TYPE_DATA; + *pLen = len; + *pBuf = pBufTemp; + return TRUE; + } + } + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Signal transport hardware error. + * + * \param code Error code. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendHwError(uint8_t code) +{ + lhciCb.hwErrorCode = code; + WsfSetEvent(lhciPersistCb.handlerId, LHCI_EVT_HW_ERR); +} + +/*************************************************************************************************/ +/*! + * \brief Reset HCI state. + * + * \return None. + * + * This function is called at the end of a HCI reset. + */ +/*************************************************************************************************/ +void lhciReset(void) +{ + memset(&lhciCb, 0, sizeof(lhciCb)); + + lhciCb.evtMsk = LHCI_DEF_EVT_MASK; + lhciCb.evtMskPg2 = LHCI_DEF_EVT_PG2_MASK; + lhciCb.leEvtMsk = LHCI_DEF_LE_EVT_MASK; +} + +/*************************************************************************************************/ +/*! + * \brief Pack an event packet header. + * + * \param pBuf Packed packet buffer. + * \param evtCode Event code. + * \param paramLen Parameter length. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackEvtHdr(uint8_t *pBuf, uint8_t evtCode, uint8_t paramLen) +{ + const uint8_t len = HCI_EVT_HDR_LEN; + + UINT8_TO_BSTREAM(pBuf, evtCode); + UINT8_TO_BSTREAM(pBuf, paramLen); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a command status event packet. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdStatusEvt(uint8_t *pBuf, uint8_t status, uint16_t opCode) +{ + const uint8_t len = HCI_LEN_CMD_STATUS; + + UINT8_TO_BSTREAM (pBuf, status); + UINT8_TO_BSTREAM (pBuf, 1); /* Num_HCI_Command_Packets is always 1 */ + UINT16_TO_BSTREAM(pBuf, opCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete event packet. + * + * \param pBuf Packed packet buffer. + * \param opCode OpCode. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdCompleteEvt(uint8_t *pBuf, uint16_t opCode) +{ + const uint8_t len = HCI_LEN_CMD_CMPL; + + UINT8_TO_BSTREAM (pBuf, 1); /* Num_HCI_Command_Packets is always 1 */ + UINT16_TO_BSTREAM(pBuf, opCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a command complete status parameter. + * + * \param pBuf Packed packet buffer. + * \param status Completion status. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackCmdCompleteEvtStatus(uint8_t *pBuf, uint8_t status) +{ + const uint8_t len = sizeof(uint8_t); + + UINT8_TO_BSTREAM (pBuf, status); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Pack a vendor specific event packet. + * + * \param pBuf Packed packet buffer. + * \param vsEvtCode Event code. + * + * \return Packet length. + */ +/*************************************************************************************************/ +uint8_t lhciPackVsEvt(uint8_t *pBuf, uint16_t vsEvtCode) +{ + const uint8_t len = LHCI_LEN_VS_EVT; + + UINT16_TO_BSTREAM(pBuf, vsEvtCode); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Send an event. + * + * \param pEvtBuf Buffer containing event. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendEvt(uint8_t *pEvtBuf) +{ + LhciSendEvent(pEvtBuf - HCI_EVT_HDR_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Send a command complete event. + * + * \param pEvtBuf Buffer containing command complete event. + * + * \return None. + */ +/*************************************************************************************************/ +void lhciSendCmdCmplEvt(uint8_t *pEvtBuf) +{ + LhciSendEvent(pEvtBuf - (HCI_EVT_HDR_LEN + HCI_LEN_CMD_CMPL)); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init.c new file mode 100644 index 0000000000000000000000000000000000000000..79d1e261cfc14f45d3d26e0dfcfc93c8b73fc2ee --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init.c @@ -0,0 +1,321 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api.h" +#include "lmgr_api.h" +#include "bb_drv.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Typical implementation revision number (LlRtCfg_t::implRev). */ +#define LL_IMPL_REV 0x2303 + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Runtime configuration. */ +const LlRtCfg_t *pLctrRtCfg = NULL; + +/*! \brief Handler duration watermark in microseconds. */ +static uint16_t llHandlerWatermarkUsec = 0; + +/*************************************************************************************************/ +/*! + * \brief Get default runtime configuration values. + * + * \param pCfg Pointer to runtime configuration parameters. + * + * \return None. + * + * This function returns default value for the LL subsystem's runtime configurations. + */ +/*************************************************************************************************/ +void LlGetDefaultRunTimeCfg(LlRtCfg_t *pCfg) +{ + /* Set minimum values and expect client to override. */ + const LlRtCfg_t defCfg = + { + /* Device */ + /*.compId */ LL_COMP_ID_ARM, + /*.implRev */ LL_IMPL_REV, + /*.btVer */ LL_VER_BT_CORE_SPEC_4_2, + /*._align32 */ 0, + /* Advertiser */ + /*.maxAdvSets */ 0, /* Disable extended advertising. */ + /*.maxAdvReports */ 4, + /*.maxExtAdvDataLen */ LL_EXT_ADVBU_MAX_LEN, + /*.defExtAdvDataFrag */ 64, + /*.auxDelayUsec */ 0, + /* Scanner */ + /*.maxScanReqRcvdEvt */ 4, + /*.maxExtScanDataLen */ LL_EXT_ADVBU_MAX_LEN, + /* Connection */ + /*.maxConn */ 0, /* Disable connections. */ + /*.numTxBufs */ 4, + /*.numRxBufs */ 4, + /*.maxAclLen */ 27, + /*.defTxPwrLvl */ 0, + /*.ceJitterUsec */ 0, + /* DTM */ + /*.dtmRxSyncMs */ 10000, + /* PHY */ + /*.phy2mSup */ FALSE, + /*.phyCodedSup */ FALSE, + /*.stableModIdxTxSup */ FALSE, + /*.stableModIdxRxSup */ FALSE + }; + + *pCfg = defCfg; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize runtime configuration. + * + * \param pCfg Pointer to runtime configuration parameters (data must be static). + * + * \return None. + * + * This function initializes the LL subsystem's runtime configuration. + * + * \note This routine must be called only once before any other initialization routines. + */ +/*************************************************************************************************/ +void LlInitRunTimeCfg(const LlRtCfg_t *pCfg) +{ + WSF_ASSERT(pLctrRtCfg == NULL); + WSF_ASSERT(pCfg); + + WSF_ASSERT(pCfg->btVer >= LL_VER_BT_CORE_SPEC_4_0); + WSF_ASSERT(pCfg->maxAdvReports > 0); + WSF_ASSERT(pCfg->maxAdvSets <= LL_MAX_ADV_SETS); + WSF_ASSERT((pCfg->maxAdvSets == 0) || (pCfg->maxExtAdvDataLen >= LL_ADVBU_MAX_LEN)); + WSF_ASSERT(pCfg->numTxBufs > 0); + WSF_ASSERT(pCfg->numRxBufs > 0); + WSF_ASSERT(pCfg->maxAclLen >= LL_MAX_DATA_LEN_MIN); + WSF_ASSERT(pCfg->maxConn <= LL_MAX_CONN); + WSF_ASSERT(pCfg->dtmRxSyncMs > 0); + + pLctrRtCfg = pCfg; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem with task handler. + * + * \param handlerId WSF handler ID. + * + * \return None. + * + * This function initializes the LL subsystem. It is called once upon system initialization. + * It must be called before any other function in the LL API is called. + */ +/*************************************************************************************************/ +void LlHandlerInit(wsfHandlerId_t handlerId) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LL_TRACE_INFO0("LlHandlerInit: LL initialization completed"); + + lmgrPersistCb.handlerId = handlerId; + LctrSetSupStates(); + + /* Setup default public address. */ + lmgrPersistCb.bdAddr = ((uint64_t)(pLctrRtCfg->compId) << 24) | 0x123456; + + /* Clear state. */ + lmgrCb.numConnEnabled = 0; + lmgrCb.advEnabled = FALSE; + lmgrCb.numExtAdvEnabled = 0; + lmgrCb.numScanEnabled = 0; + lmgrCb.numInitEnabled = 0; + lmgrCb.numWlFilterEnabled = 0; + lmgrCb.testEnabled = FALSE; + + lmgrPersistCb.featuresDefault |= (pLctrRtCfg->phy2mSup) ? LL_FEAT_LE_2M_PHY : 0; + lmgrPersistCb.featuresDefault |= (pLctrRtCfg->phyCodedSup) ? LL_FEAT_LE_CODED_PHY : 0; + lmgrPersistCb.featuresDefault |= (pLctrRtCfg->stableModIdxTxSup) ? LL_FEAT_STABLE_MOD_IDX_TRANSMITTER : 0; + lmgrPersistCb.featuresDefault |= (pLctrRtCfg->stableModIdxRxSup) ? LL_FEAT_STABLE_MOD_IDX_RECEIVER : 0; + LmgrSetDefaults(); + + LlTestInit(); + + LL_TRACE_INFO1(" opModeFlags = 0x%08x", lmgrCb.opModeFlags); +} + +/*************************************************************************************************/ +/*! + * \brief LL message dispatch handler. + * + * \param event WSF event. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void LlHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + bool_t startTimeValid; + uint32_t startTime; + uint32_t endTime; + + startTimeValid = BbDrvGetTimestamp(&startTime); + + if (event != 0) + { + unsigned int eventBit = 0; + do + { + if (event & (1 << eventBit)) + { + LctrEventHandler(eventBit); + } + } while (++eventBit < LCTR_EVENT_TOTAL); + } + + if (pMsg != NULL) + { + LctrMsgDispatcher((lctrMsgHdr_t *)pMsg); + } + + if (startTimeValid && + BbDrvGetTimestamp(&endTime)) + { + uint32_t durUsec = BB_TICKS_TO_US(endTime - startTime); + if (llHandlerWatermarkUsec < durUsec) + { + llHandlerWatermarkUsec = durUsec; + LL_TRACE_INFO1("Raised watermark for LlHandler processing, time watermarkUsec=%u", durUsec); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Reset LL subsystem. + * + * \return None. + * + * Reset the LL subsystem. All active connections are closed and all radio procedures such as + * scanning or advertising are terminated. + */ +/*************************************************************************************************/ +void LlReset(void) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO0("### LlApi ### LlReset"); + + /* Reset state machines. */ + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->dispId = LCTR_DISP_BCST; + pMsg->event = LCTR_MSG_RESET; + pMsg->handle = 0xFF; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Register LL event handler. + * + * \param evtCback Client callback function. + * + * \return None. + * + * This function is called by a client to register for LL events. + */ +/*************************************************************************************************/ +void LlEvtRegister(llEvtCback_t evtCback) +{ + lmgrPersistCb.evtCback = evtCback; +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising set context size. + * + * \param pMaxAdvSets Buffer to return the maximum number of advertising sets. + * \param pAdvSetCtxSize Buffer to return the size in bytes of the advertising set context. + * + * Return the advertising set context sizes. + */ +/*************************************************************************************************/ +void LlGetAdvSetContextSize(uint8_t *pMaxAdvSets, uint16_t *pAdvSetCtxSize) +{ + if (pLctrRtCfg) + { + *pMaxAdvSets = pLctrRtCfg->maxAdvSets; + } + else + { + *pMaxAdvSets = 0; + } + + *pAdvSetCtxSize = lmgrPersistCb.advSetCtxSize; +} + +/*************************************************************************************************/ +/*! + * \brief Get connection context size. + * + * \param pMaxConn Buffer to return the maximum number of connections. + * \param pConnCtxSize Buffer to return the size in bytes of the connection context. + * + * Return the connection context sizes. + */ +/*************************************************************************************************/ +void LlGetConnContextSize(uint8_t *pMaxConn, uint16_t *pConnCtxSize) +{ + if (pLctrRtCfg) + { + *pMaxConn = pLctrRtCfg->maxConn; + } + else + { + *pMaxConn = 0; + } + + *pConnCtxSize = lmgrPersistCb.connCtxSize; +} + +/*************************************************************************************************/ +/*! + * \brief Get the LL handler watermark level. + * + * \return Watermark level in microseconds. + */ +/*************************************************************************************************/ +uint16_t LlStatsGetHandlerWatermarkUsec(void) +{ + return llHandlerWatermarkUsec; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..f3c122649fc3b1141f26e3df3fb7d710a24bacb7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_adv_master.h" +#include "lctr_api_adv_master.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an scanning master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an scanning master. + */ +/*************************************************************************************************/ +void LlScanMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrMstInit(); + LctrMstScanInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..120b19a9d5ddc5794ea6b25e19d4f9fffd5287ab --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_master_ae.c @@ -0,0 +1,68 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_adv_master.h" +#include "lctr_api_adv_master_ae.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for extended scanning. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for extended scanning. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitExtScanMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + WSF_ASSERT(pLctrRtCfg); + WSF_ASSERT(pFreeMem); + + return LctrInitExtScanMem(pFreeMem, freeMemSize); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an scanning master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an scanning master. + */ +/*************************************************************************************************/ +void LlExtScanMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrMstInit(); + LctrMstExtScanInit(); + LctrMstPerCreateSyncInit(); + LctrMstPerScanInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..f9c866f1f5b78412901f86efd8c1d571b8262ff6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_adv_slave.h" +#include "lctr_api_adv_slave.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an advertising slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising slave. + */ +/*************************************************************************************************/ +void LlAdvSlaveInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrSlvInit(); + LctrSlvAdvInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..bec4dc2d64af682c5443223d28b65ef4fd397423 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_adv_slave_ae.c @@ -0,0 +1,73 @@ +/* Copyrig/home/kgills/Workspace/ME14/Firmware/trunk/Applications/InternalUse/btle/cordio-mbed/link_layer/controller/sources/ble/ll/ll_init_adv_slave_ae.cht (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_adv_slave.h" +#include "lctr_api_adv_slave_ae.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for extended advertising. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for extended advertising. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitExtAdvMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint16_t bytesUsed = 0; + + WSF_ASSERT(pLctrRtCfg); + WSF_ASSERT(pFreeMem); + +#if (LL_MAX_ADV_SETS > 0) /* extended advertising capable */ + bytesUsed = LctrInitAdvSetMem(pFreeMem, freeMemSize); +#endif + + return bytesUsed; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation for extended advertising slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an extended advertising slave. + */ +/*************************************************************************************************/ +void LlExtAdvSlaveInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrSlvInit(); + LctrSlvExtAdvInit(); + LctrSlvPeriodicAdvInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_cs2.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_cs2.c new file mode 100644 index 0000000000000000000000000000000000000000..6c572b9c371f72c5a909b103ad918f09aebe697d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_cs2.c @@ -0,0 +1,37 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) channel selection 2 initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_conn_cs2.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for secure connections. + * + * \return None. + * + * This function initializes the LL subsystem for secure connections. + */ +/*************************************************************************************************/ +void LlChannelSelection2Init(void) +{ + LctrChannelSelection2Init(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..5012c414c923641fd3bd12fddd59aecbe6e078ef --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_master.c @@ -0,0 +1,44 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_adv_master.h" +#include "lctr_api_conn.h" +#include "lmgr_api_adv_master.h" +#include "lmgr_api_conn.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a connectable master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and connectable master. + */ +/*************************************************************************************************/ +void LlConnMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrConnInit(); + LctrMstConnInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..e05bb3bb29933b6709c7f8a4e34e548682f50734 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_conn_slave.c @@ -0,0 +1,91 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_adv_slave.h" +#include "lctr_api_conn.h" +#include "lmgr_api_adv_slave.h" +#include "lmgr_api_conn.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize memory for connections. + * + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function allocates memory for connections. + * + * \note This routine must be called after LlInitRunTimeCfg() but only once before any + * other initialization routines. + */ +/*************************************************************************************************/ +uint16_t LlInitConnMem(uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint16_t bytesUsed = 0; + + WSF_ASSERT(pLctrRtCfg); + WSF_ASSERT(pFreeMem); + +#if (LL_MAX_CONN > 0) /* connections capable */ + bytesUsed = LctrInitConnMem(pFreeMem, freeMemSize); +#endif + + return bytesUsed; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a connectable slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and connectable slave. + */ +/*************************************************************************************************/ +void LlConnSlaveInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrConnInit(); + LctrSlvConnInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Register ACL handler. + * + * \param sendCompCback Client ACL send complete callback function. + * \param recvPendCback Client ACL receive pending callback function. + * + * \return None. + * + * This function is called by a client to register for ACL data. + */ +/*************************************************************************************************/ +void LlAclRegister(llAclCback_t sendCompCback, llAclCback_t recvPendCback) +{ + lmgrPersistCb.sendCompCback = sendCompCback; + lmgrPersistCb.recvPendCback = recvPendCback; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..6ad14eb1aaa5081ae3ca4ee6c1395b09c7b2e1a1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_master.c @@ -0,0 +1,45 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) encryptable master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_adv_master.h" +#include "lctr_api_conn.h" +#include "lmgr_api_adv_master.h" +#include "lmgr_api_conn.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a encryptable connectable master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and encryptable + * connectable master. + */ +/*************************************************************************************************/ +void LlEncConnMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrConnInit(); + LctrMstConnEncInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..ade0bf6f1edc0dba6403bd4a3ffc7bbf72a691a9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_enc_slave.c @@ -0,0 +1,45 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) encryptable slave initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_adv_slave.h" +#include "lctr_api_conn.h" +#include "lmgr_api_adv_slave.h" +#include "lmgr_api_conn.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as a encryptable connectable slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising and encryptable + * connectable slave. + */ +/*************************************************************************************************/ +void LlEncConnSlaveInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrConnInit(); + LctrSlvConnEncInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master.c new file mode 100644 index 0000000000000000000000000000000000000000..cb307c16407bc747def81a35288574bd100d3c03 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master.c @@ -0,0 +1,41 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_init_master.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an initiating master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an initiating master. + */ +/*************************************************************************************************/ +void LlInitMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LctrMstInitInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..a5a361a88b875fc192efb6babaee2b471cbb4d52 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_init_master_ae.c @@ -0,0 +1,41 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_init_master_ae.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an initiating master. + * + * \return None. + * + * This function initializes the LL subsystem for use as an initiating master. + */ +/*************************************************************************************************/ +void LlExtInitMasterInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LctrMstExtInitInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_master_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_master_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..cf71a0ddab306ddec6439729dbe73903dd6529ea --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_master_phy.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) PHY features initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_phy.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for PHY features (master). + * + * \return None. + * + * This function initializes the LL subsystem for master PHY features. + */ +/*************************************************************************************************/ +void LlPhyMasterInit(void) +{ + LctrMstPhyConnInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..9934a69f1e697e37d15b931006924a446b5c6d19 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_priv.c @@ -0,0 +1,40 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) privacy initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_priv.h" +#include "lctr_api_priv.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for operation as an advertising slave. + * + * \return None. + * + * This function initializes the LL subsystem for use as an advertising slave. + */ +/*************************************************************************************************/ +void LlPrivInit(void) +{ + LmgrPrivInit(); + LctrPrivInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..0403d308279817128969be50734edaf45c4ff040 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_sc.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) secure connections initialization implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_sc.h" +#include "lctr_api.h" +#include "lctr_api_sc.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for secure connections. + * + * \return None. + * + * This function initializes the LL subsystem for secure connections. + */ +/*************************************************************************************************/ +void LlScInit(void) +{ + WSF_ASSERT(pLctrRtCfg); /* Runtime configuration must be available. */ + + LmgrScInit(); + LctrScInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_slave_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_slave_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..37e4bc02b0fe71fcc85e55ba5abbec56fee89d44 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_init_slave_phy.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) PHY features initialization implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_phy.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Initialize LL subsystem for PHY features (slave). + * + * \return None. + * + * This function initializes the LL subsystem for slave PHY features. + */ +/*************************************************************************************************/ +void LlPhySlaveInit(void) +{ + LctrSlvPhyConnInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main.c new file mode 100644 index 0000000000000000000000000000000000000000..2a4f580d54e0e2d8e0dfba1a5755388d9b25eee4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main.c @@ -0,0 +1,539 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave parameter interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "ll_math.h" +#include "lctr_api.h" +#include "lmgr_api.h" +#include "bb_ble_api.h" +#include "bb_ble_api_whitelist.h" +#include "bb_ble_drv.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Set Bluetooth device address + * + * \param pAddr Bluetooth device address. + * + * \return None. + * + * Set the BD address to be used by LL. + */ +/*************************************************************************************************/ +void LlSetBdAddr(const uint8_t *pAddr) +{ + LL_TRACE_INFO0("### LlApi ### LlSetBdAddr"); + + LL_TRACE_INFO3("Static BDA[5:3]=%02x:%02x:%02x", pAddr[5], pAddr[4], pAddr[3]); + LL_TRACE_INFO3(" BDA[2:0]=%02x:%02x:%02x", pAddr[2], pAddr[1], pAddr[0]); + + BSTREAM_TO_BDA64(lmgrPersistCb.bdAddr, pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Get Bluetooth device address + * + * \param pAddr Bluetooth device address. + * + * \return None. + * + * Get the BD address currently used by LL or all zeros if address is not set. + */ +/*************************************************************************************************/ +void LlGetBdAddr(uint8_t *pAddr) +{ + WSF_ASSERT(pAddr); + + LL_TRACE_INFO0("### LlApi ### LlGetBdAddr"); + + BDA64_TO_BSTREAM(pAddr, lmgrPersistCb.bdAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Set random device address. + * + * \param pAddr Random Bluetooth device address. + * + * \return Status. + * + * Set the random address to be used by LL. + */ +/*************************************************************************************************/ +uint8_t LlSetRandAddr(const uint8_t *pAddr) +{ + uint64_t bdAddr; + + LL_TRACE_INFO0("### LlApi ### LlSetRandAddr"); + + LL_TRACE_INFO3("Private BDA[5:3]=%02x:%02x:%02x", pAddr[5], pAddr[4], pAddr[3]); + LL_TRACE_INFO3(" BDA[2:0]=%02x:%02x:%02x", pAddr[2], pAddr[1], pAddr[0]); + + WSF_CS_INIT(cs); + + WSF_ASSERT(pAddr); + + if (lmgrCb.advEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BSTREAM_TO_BDA64(bdAddr, pAddr); + +#ifndef __CROSSWORKS + /* Check BD Random Address type. */ + switch (bdAddr & LL_RAND_ADDR_TYPE_MASK) + { + case LL_RAND_ADDR_TYPE_STATIC: + case LL_RAND_ADDR_TYPE_RPA: + case LL_RAND_ADDR_TYPE_NRPA: + /* Valid types. */ + break; + default: + LL_TRACE_WARN0("Invalid random address type"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } +#else + // Crossworks doesn't like the 64 bit switch value + if(((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_STATIC) && + ((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_RPA) && + ((bdAddr & LL_RAND_ADDR_TYPE_MASK) != LL_RAND_ADDR_TYPE_NRPA)) { + + LL_TRACE_WARN0("Invalid random address type"); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } +#endif + + WSF_CS_ENTER(cs); + lmgrCb.bdAddrRnd = bdAddr; + lmgrCb.bdAddrRndValid = TRUE; + lmgrCb.bdAddrRndModAdv = lmgrCb.bdAddrRndModScan = TRUE; + WSF_CS_EXIT(cs); + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get random device address + * + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Get the random address currently used by LL or all zeros if address is not set. + */ +/*************************************************************************************************/ +uint8_t LlGetRandAddr(uint8_t *pAddr) +{ + LL_TRACE_INFO0("### LlApi ### LlGetRandAddr"); + + WSF_ASSERT(pAddr); + + if (!lmgrCb.bdAddrRndValid) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + BDA64_TO_BSTREAM(pAddr, lmgrCb.bdAddrRnd); + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get versions + * + * \param pCompId Company ID. + * \param pBtVer Bluetooth version. + * \param pImplRev Implementation revision. + * + * \return None. + */ +/*************************************************************************************************/ +void LlGetVersion(uint16_t *pCompId, uint8_t *pBtVer, uint16_t *pImplRev) +{ + LL_TRACE_INFO0("### LlApi ### LlGetVersion"); + + *pCompId = pLctrRtCfg->compId; + *pBtVer = pLctrRtCfg->btVer; + *pImplRev = pLctrRtCfg->implRev; +} + +/*************************************************************************************************/ +/*! + * \brief Get supported states. + * + * \param pStates Supported states bitmask. + * + * \return None. + * + * Return the states supported by the LL. + */ +/*************************************************************************************************/ +void LlGetSupStates(uint8_t *pStates) +{ + LL_TRACE_INFO0("### LlApi ### LlGetSupStates"); + + WSF_ASSERT(pStates); + + UINT64_TO_BSTREAM(pStates, lmgrPersistCb.supStates); +} + +/*************************************************************************************************/ +/*! + * \brief Get features. + * + * \param pFeatures Supported features bitmask. + * + * \return None. + * + * Return the LE features supported by the LL. + */ +/*************************************************************************************************/ +void LlGetFeatures(uint8_t *pFeatures) +{ + LL_TRACE_INFO0("### LlApi ### LlGetFeatures"); + + WSF_ASSERT(pFeatures); + + UINT64_TO_BSTREAM(pFeatures, lmgrCb.features); +} + +/*************************************************************************************************/ +/*! + * \brief Set features. + * + * \param pFeatures Supported features bitmask. + * + * \return Status error code. + * + * \note This function must only be called when controller is not connected to another + * device. + * + * Set the LE features supported by the LL. + */ +/*************************************************************************************************/ +uint8_t LlSetFeatures(const uint8_t *pFeatures) +{ + uint64_t newMask; + + WSF_ASSERT(pFeatures); + + LL_TRACE_INFO0("### LlApi ### LlSetFeatures"); + + BSTREAM_TO_UINT64(newMask, pFeatures); + + if ((LL_API_PARAM_CHECK == 1) && + ((~LL_FEAT_ALL_MASK & newMask) != 0)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + lmgrCb.features = newMask; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set operational mode flags. + * + * \param flags Flags. + * \param enable TRUE to enable flags, FALSE to disable. + * + * \return Status error code. + * + * Set mode flags governing LL operations. + */ +/*************************************************************************************************/ +uint8_t LlSetOpFlags(uint32_t flags, bool_t enable) +{ + const uint32_t allFlags = + LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP | + LL_OP_MODE_FLAG_SLV_REQ_IMMED_ACK | + LL_OP_MODE_FLAG_BYPASS_CE_GUARD | + LL_OP_MODE_FLAG_MST_RETX_AFTER_RX_NACK | + LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP | + LL_OP_MODE_FLAG_MST_UNCOND_CP_RSP | + LL_OP_MODE_FLAG_REQ_SYM_PHY | + LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP | + LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP | + LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP | + LL_OP_MODE_FLAG_ENA_ADV_DLY | + LL_OP_MODE_FLAG_ENA_SCAN_BACKOFF | + LL_OP_MODE_FLAG_ENA_WW | + LL_OP_MODE_FLAG_ENA_SLV_LATENCY | + LL_OP_MODE_FLAG_ENA_LLCP_TIMER; + + LL_TRACE_INFO2("### LlApi ### LlSetOpFlags flag=%x enable=%d", flags, enable); + + if ((LL_API_PARAM_CHECK == 1) && + ((~allFlags & flags) != 0)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (enable) + { + lmgrCb.opModeFlags |= flags; + } + else + { + lmgrCb.opModeFlags &= ~flags; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get white list size. + * + * \return Total number of white list entries. + * + * Read the white list capacity supported by the LL. + */ +/*************************************************************************************************/ +uint8_t LlGetWhitelistSize(void) +{ + LL_TRACE_INFO0("### LlApi ### LlGetWhitelistSize"); + + return BbBleWhiteListGetSize(); +} + +/*************************************************************************************************/ +/*! + * \brief Clear all white list entries. + * + * \return Status error code. + * + * Clear all white list entries stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlClearWhitelist(void) +{ + LL_TRACE_INFO0("### LlApi ### LlClearWhitelist"); + + if (lmgrCb.numWlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BbBleWhiteListClear(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Add device to the white list. + * + * \param addrType Address type. + * \param pAddr Bluetooth device address. + * + * \return Status error code. + * + * Adds the given address to the white list stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToWhitelist(uint8_t addrType, bdAddr_t pAddr) +{ + LL_TRACE_INFO0("### LlApi ### LlAddDeviceToWhitelist"); + + if (LL_API_PARAM_CHECK == 1) + { + if (((pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2) && + (addrType > LL_ADDR_RANDOM)) || + ((pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) && + (addrType > LL_ADDR_RANDOM) && (addrType != LL_ADDR_ANONYMOUS))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + if (lmgrCb.numWlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (addrType == LL_ADDR_ANONYMOUS) + { + BbBleWhiteListAddAnonymous(); + } + else + { + uint64_t addr = BstreamToBda64(pAddr); + if (!BbBleWhiteListAdd(addrType, addr)) + { + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from the white list. + * + * \param addrType Address type. + * \param pAddr Bluetooth device address. + * + * \return Status error code. + * + * Removes the given address from the white list stored in the LL. + * + * \note This function must only be called when advertising or scan is disabled + * and not initiating. + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromWhitelist(uint8_t addrType, bdAddr_t pAddr) +{ + LL_TRACE_INFO0("### LlApi ### LlRemoveDeviceFromWhitelist"); + + if (LL_API_PARAM_CHECK == 1) + { + if (((pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2) && + (addrType > LL_ADDR_RANDOM)) || + ((pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) && + (addrType > LL_ADDR_RANDOM) && (addrType != LL_ADDR_ANONYMOUS))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + if (lmgrCb.numWlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (addrType == LL_ADDR_ANONYMOUS) + { + BbBleWhiteListRemoveAnonymous(); + } + else + { + uint64_t addr = BstreamToBda64(pAddr); + if (!BbBleWhiteListRemove(addrType, addr)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get random number. + * + * \param pRandNum Buffer to store 8 bytes random data. + * + * \return Status error code. + * + * Request the LL to generate a random number. + */ +/*************************************************************************************************/ +uint8_t LlGetRandNum(uint8_t *pRandNum) +{ + WSF_ASSERT(pRandNum); + + LL_TRACE_INFO0("### LlApi ### LlGetRandNum"); + + /* Return 8 bytes of random data. */ + BbBleDrvRand(pRandNum, sizeof(uint64_t) / sizeof(uint8_t)); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read supported transmit power. + * + * \param pMinTxPwr Return buffer for minimum transmit power. + * \param pMaxTxPwr Return buffer for maximum transmit power. + * + * \return None. + * + * Read the minimum and maximum transmit powers supported by the LL. + */ +/*************************************************************************************************/ +void LlReadSupTxPower(int8_t *pMinTxPwr, int8_t *pMaxTxPwr) +{ + WSF_ASSERT(pMinTxPwr && pMaxTxPwr); + + BbBleRfGetSupTxPower(pMinTxPwr, pMaxTxPwr); +} + +/*************************************************************************************************/ +/*! + * \brief Read RF path compensation. + * + * \param pTxPathComp Return buffer for RF transmit path compensation value. + * \param pRxPathComp Return buffer for RF receive path compensation value. + * + * \return None. + * + * Read the RF Path Compensation Values parameter used in the Tx Power Level and RSSI calculation. + */ +/*************************************************************************************************/ +void LlReadRfPathComp(int16_t *pTxPathComp, int16_t *pRxPathComp) +{ + LL_TRACE_INFO0("### LlApi ### LlReadRfPathComp"); + + WSF_ASSERT(pTxPathComp && pRxPathComp); + BbBleRfReadRfPathComp(pTxPathComp, pRxPathComp); +} + +/*************************************************************************************************/ +/*! + * \brief Write RF path compensation. + * + * \param txPathComp RF transmit path compensation value. + * \param rxPathComp RF receive path compensation value. + * + * \return Status error code. + * + * Indicate the RF path gain or loss between the RF transceiver and the antenna contributed by + * intermediate components. + */ +/*************************************************************************************************/ +uint8_t LlWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp) +{ + LL_TRACE_INFO0("### LlApi ### LlWriteRfPathComp"); + + if (!BbBleRfWriteRfPathComp(txPathComp, rxPathComp)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master.c new file mode 100644 index 0000000000000000000000000000000000000000..53af3c3a040fc49228f3754dc083407f92fb227a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master.c @@ -0,0 +1,165 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master parameter interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_adv_master.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "bb_ble_api.h" + +/*************************************************************************************************/ +/*! + * \brief Set scan channel map. + * + * \param chanMap Scan channel map. + * + * \return Status error code. + * + * Set scan channel map. + * + * \note This function must only be called when scanning is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetSetScanChanMap(uint8_t chanMap) +{ + LL_TRACE_INFO1("### LlApi ### LlSetSetScanChanMap, chanMap=0x%02x", chanMap); + + if (lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((chanMap & ~LL_ADV_CHAN_ALL) || (chanMap == 0))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + lmgrMstScanCb.scanChanMap = chanMap; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set scan parameters. + * + * \param pParam Scan parameters. + * + * \return Status error code. + * + * Set scan parameters. + * + * \note This function must only be called when scanning is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetScanParam(const LlScanParam_t *pParam) +{ + const uint16_t rangeMin = 0x0004; /* 2.5 ms */ + const uint16_t rangeMax = 0x4000; /* 10,240.0 ms */ + const uint8_t scanTypeMax = LL_SCAN_ACTIVE; + const uint8_t scanFiltPolicyMax = ((lmgrCb.features & LL_FEAT_EXT_SCAN_FILT_POLICY) != 0) ? LL_SCAN_FILTER_WL_OR_RES_INIT : LL_SCAN_FILTER_WL_BIT; + const uint8_t ownAddrTypeMax = ((lmgrCb.features & LL_FEAT_PRIVACY) != 0) ? LL_ADDR_RANDOM_IDENTITY : LL_ADDR_RANDOM; + lctrScanParamMsg_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlSetScanParam, scanType=%u", pParam->scanType); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((rangeMax < pParam->scanInterval) || (pParam->scanInterval < pParam->scanWindow) || (pParam->scanWindow < rangeMin) || + (pParam->scanType > scanTypeMax) || + (pParam->ownAddrType > ownAddrTypeMax) || + (pParam->scanFiltPolicy > scanFiltPolicyMax))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_SCAN; + pMsg->hdr.event = LCTR_SCAN_MSG_PARAM_UPD; + + pMsg->param.scanInterval = pParam->scanInterval; + pMsg->param.scanWindow = pParam->scanWindow; + pMsg->param.scanType = pParam->scanType; + pMsg->param.ownAddrType = pParam->ownAddrType; + pMsg->param.scanFiltPolicy = pParam->scanFiltPolicy; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Scan enable. + * + * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. + * \param filterDup Set to TRUE to filter duplicates. + * + * \return None. + * + * Enable or disable scanning. This function is only used when operating in master role. + */ +/*************************************************************************************************/ +void LlScanEnable(uint8_t enable, uint8_t filterDup) +{ + lctrScanEnableMsg_t *pMsg; + + LL_TRACE_INFO2("### LlApi ### LlScanEnable: enable=%u, filterDup=%u", enable, filterDup); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + LmgrSendScanEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsAddressTypeAvailable(lmgrMstScanCb.scanParam.ownAddrType)) + { + LL_TRACE_WARN1("Address type invalid or not available, ownAddrType=%u", lmgrMstScanCb.scanParam.ownAddrType); + LmgrSendScanEnableCnf(LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS); + return; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_SCAN; + pMsg->hdr.event = enable ? LCTR_SCAN_MSG_DISCOVER_ENABLE : LCTR_SCAN_MSG_DISCOVER_DISABLE; + + pMsg->filtDup = filterDup; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..2906bc56a89ec066aeea22f276eb7f39a7173442 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_master_ae.c @@ -0,0 +1,504 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master control interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_adv_master_ae.h" +#include "lmgr_api.h" +#include "lmgr_api_adv_master_ae.h" +#include "bb_ble_api_periodiclist.h" +#include "util/bstream.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Validate scan parameter. + * + * \param pParam Scan parameters. + * + * \return TRUE if parameters are valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t llValidateScanParam(const LlExtScanParam_t *pParam) +{ + const uint16_t rangeMin = 0x0004; /* 2.5 ms */ + /* const uint16_t rangeMax = 0xFFFF; */ /* 40.959375 ms */ + const uint8_t scanTypeMax = LL_SCAN_ACTIVE; + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->scanInterval < pParam->scanWindow) || (pParam->scanWindow < rangeMin) || + (pParam->scanType > scanTypeMax))) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set extended scanning parameters. + * + * \param ownAddrType Address type used by this device. + * \param scanFiltPolicy Scan filter policy. + * \param scanPhys Scanning PHYs bitmask. + * \param param Scanning parameter table indexed by PHY. + * + * \return Status error code. + * + * Set the extended scan parameters to be used on the primary advertising channel. + */ +/*************************************************************************************************/ +uint8_t LlSetExtScanParam(uint8_t ownAddrType, uint8_t scanFiltPolicy, uint8_t scanPhys, const LlExtScanParam_t param[]) +{ + const uint8_t scanFiltPolicyMax = ((lmgrCb.features & LL_FEAT_EXT_SCAN_FILT_POLICY) != 0) ? LL_SCAN_FILTER_WL_OR_RES_INIT : LL_SCAN_FILTER_WL_BIT; + const uint8_t ownAddrTypeMax = ((lmgrCb.features & LL_FEAT_PRIVACY) != 0) ? LL_ADDR_RANDOM_IDENTITY : LL_ADDR_RANDOM; + const uint8_t validScanPhys = LL_PHYS_LE_1M_BIT | LL_PHYS_LE_CODED_BIT; + unsigned int i; + + LL_TRACE_INFO1("### LlApi ### LlSetExtScanParam, scanPhys=0x%02x", scanPhys); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((ownAddrType > ownAddrTypeMax) || + (scanFiltPolicy > scanFiltPolicyMax) || + (scanPhys & ~validScanPhys))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((scanPhys & LL_PHYS_LE_CODED_BIT) && ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) == 0))) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + + if (LL_API_PARAM_CHECK == 1) + { + unsigned int i = 0; + if (scanPhys & LL_PHYS_LE_1M_BIT) + { + if (!llValidateScanParam(¶m[i])) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + i++; + } + if (scanPhys & LL_PHYS_LE_CODED_BIT) + { + if (!llValidateScanParam(¶m[i])) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + i++; + } + } + + i = 0; + if (scanPhys & LL_PHYS_LE_1M_BIT) + { + LctrMstExtScanSetScanPhy(LCTR_SCAN_PHY_1M); + LctrMstExtScanSetParam(LCTR_SCAN_PHY_1M, ownAddrType, scanFiltPolicy, ¶m[i++]); + } + else + { + LctrMstExtScanClearScanPhy(LCTR_SCAN_PHY_1M); + } + if (scanPhys & LL_PHYS_LE_CODED_BIT) + { + LctrMstExtScanSetScanPhy(LCTR_SCAN_PHY_CODED); + LctrMstExtScanSetParam(LCTR_SCAN_PHY_CODED, ownAddrType, scanFiltPolicy, ¶m[i++]); + } + else + { + LctrMstExtScanClearScanPhy(LCTR_SCAN_PHY_CODED); + } + lmgrCb.numExtScanPhys = i; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Extended scan enable. + * + * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. + * \param filterDup Filter duplicate report mode. + * \param duration Duration. + * \param period Period. + * + * \return None. + * + * Enable or disable extended scanning. + */ +/*************************************************************************************************/ +void LlExtScanEnable(uint8_t enable, uint8_t filterDup, uint16_t duration, uint16_t period) +{ + const unsigned int durMsPerUnit = 10; + const unsigned int perMsPerUnit = 1280; + const unsigned int filterDupMax = LL_SCAN_FILTER_DUP_ENABLE_PERIODIC; + + lctrExtScanEnableMsg_t *pMsg; + uint32_t durMs = duration * durMsPerUnit; + uint32_t perMs = period * perMsPerUnit; + + LL_TRACE_INFO2("### LlApi ### LlExtScanEnable: enable=%u, filterDup=%u", enable, filterDup); + + WSF_ASSERT(lmgrCb.extScanEnaDelayCnt == 0); + lmgrCb.extScanEnaDelayCnt = lmgrCb.numExtScanPhys; + lmgrCb.extScanEnaStatus = LL_SUCCESS; + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + lmgrCb.extScanEnaDelayCnt = 1; + LmgrSendExtScanEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((enable != 0) && + ((filterDup > filterDupMax) || + ((perMs > 0) && (durMs == 0)) || /* Minimum Duration is 1. */ + ((perMs > 0) && (perMs <= durMs))))) /* Ensure Period > Duration. */ + { + lmgrCb.extScanEnaDelayCnt = 1; + LmgrSendExtScanEnableCnf(LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS); + return; + } + + if ((LL_API_PARAM_CHECK == 1) && + (!LctrMstExtScanValidateParam())) + { + lmgrCb.extScanEnaDelayCnt = 1; + LmgrSendExtScanEnableCnf(LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS); + return; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->hdr.handle = -1; */ /* Subsystem broadcast message */ + pMsg->hdr.dispId = LCTR_DISP_EXT_SCAN; + pMsg->hdr.event = enable ? LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE : LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE; + + pMsg->filtDup = filterDup; + pMsg->durMs = durMs; + pMsg->perMs = perMs; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Create synchronization of periodic advertising. + * + * \param pParam Create sync parameters. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvCreateSync(const LlPerAdvCreateSyncCmd_t *pParam) +{ + lctrPerCreateSyncMsg_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlPeriodicAdvCreateSync advSID=%u", pParam->advSID); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->filterPolicy > LL_PER_SCAN_FILTER_PL_BIT) || + (pParam->advAddrType > LL_ADDR_RANDOM) || + (pParam->advSID > LL_MAX_ADV_SID) || + (pParam->skip > LL_SYNC_MAX_SKIP) || + (pParam->syncTimeOut > LL_SYNC_MAX_TIMEOUT) || + (pParam->syncTimeOut < LL_SYNC_MIN_TIMEOUT))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (LctrMstPerIsSyncDisabled() == FALSE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (LctrMstPerIsSync(pParam->advSID, pParam->advAddrType, BstreamToBda64(pParam->pAdvAddr))) + { + return LL_ERROR_CODE_ACL_CONN_ALREADY_EXISTS; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_PER_CREATE_SYNC; + pMsg->hdr.event = LCTR_CREATE_SYNC_MSG_CREATE; + + pMsg->advAddr = BstreamToBda64(pParam->pAdvAddr); + pMsg->advAddrType = pParam->advAddrType; + pMsg->advSID = pParam->advSID; + pMsg->filterPolicy = pParam->filterPolicy; + pMsg->skip = pParam->skip; + pMsg->syncTimeOut = pParam->syncTimeOut; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Cancel pending synchronization of periodic advertising. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvCreateSyncCancel(void) +{ + LctrPerScanMsg_t *pMsg; + LL_TRACE_INFO0("### LlApi ### LlPeriodicAdvCreateSyncCancel"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Command is disallowed if there is no create sync pending. */ + if (!LctrMstPerIsSyncPending()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_PER_CREATE_SYNC; + pMsg->hdr.event = LCTR_CREATE_SYNC_MSG_CANCEL; + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Stop synchronization of periodic advertising. + * + * \param syncHandle Sync handle. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlPeriodicAdvTerminateSync(uint16_t syncHandle) +{ + LctrPerScanMsg_t *pMsg; + LL_TRACE_INFO1("### LlApi ### LlPeriodicAdvTerminateSync, syncHandle=0x%02x", syncHandle); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + if ((LL_API_PARAM_CHECK == 1) && + syncHandle > LL_SYNC_MAX_HANDLE) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (LctrMstPerIsSyncPending()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_PER_SCAN; + pMsg->hdr.event = LCTR_PER_SCAN_MSG_TERMINATE; + pMsg->hdr.handle = syncHandle; + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Add device to periodic advertiser list. + * + * \param pParam Add to periodic advertiser list parameters. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToPeriodicAdvList(const LlDevicePerAdvList_t *pParam) +{ + uint64_t addr; + + LL_TRACE_INFO0("### LlApi ### LlAddDeviceToPeriodicAdvList"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.numPlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->advAddrType > LL_ADDR_RANDOM) || + (pParam->advSID > LL_MAX_ADV_SID))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (LctrMstPerIsSyncPending()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + addr = BstreamToBda64(pParam->pAdvAddr); + if (!BbBlePeriodicListAdd(pParam->advAddrType, addr, pParam->advSID)) + { + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from periodic advertiser list command. + * + * \param pParam Remove from periodic advertiser list parameters.. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromPeriodicAdvList(const LlDevicePerAdvList_t *pParam) +{ + uint64_t addr; + + LL_TRACE_INFO0("### LlApi ### LlRemoveDeviceFromPeriodicAdvList"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.numPlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->advAddrType > LL_ADDR_RANDOM) || + (pParam->advSID > LL_MAX_ADV_SID))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (LctrMstPerIsSyncPending()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + addr = BstreamToBda64(pParam->pAdvAddr); + if (!BbBlePeriodicListRemove(pParam->advAddrType, addr, pParam->advSID)) + { + return LL_ERROR_CODE_UNKNOWN_ADV_ID; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Clear all devices in the periodic advertiser list. + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlClearPeriodicAdvList(void) +{ + LL_TRACE_INFO0("### LlApi ### LlClearPeriodicAdvList"); + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.numPlFilterEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (LctrMstPerIsSyncPending()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BbBlePeriodicListClear(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read total number of devices in the periodic advertiser list. + * + * \param pListSize Return size value of periodic advertiser list + * + * \return Status error code. + */ +/*************************************************************************************************/ +uint8_t LlReadPeriodicAdvListSize(uint8_t *pListSize) +{ + LL_TRACE_INFO0("### LlApi ### LlReadPeriodicAdvListSize"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + *pListSize = BbBlePeriodicListGetSize(); + + return LL_SUCCESS; +} + diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..af3dea7290c835503f398c2215907af49f6aee22 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave.c @@ -0,0 +1,308 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave parameter interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api_adv_slave.h" +#include "lctr_api_adv_slave.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "util/bstream.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Set advertising transmit power. + * + * \param advTxPwr Advertising transmit power level. + * + * \return None. + * + * Set the advertising transmit power. + */ +/*************************************************************************************************/ +void LlSetAdvTxPower(int8_t advTxPwr) +{ + LL_TRACE_INFO1("### LlApi ### LlSetAdvTxPower, advTxPwr=%u", advTxPwr); + + lmgrCb.advTxPwr = advTxPwr; +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising transmit power. + * + * \param pAdvTxPwr Advertising transmit power level. + * + * \return Status error code. + * + * Return the advertising transmit power. + */ +/*************************************************************************************************/ +uint8_t LlGetAdvTxPower(int8_t *pAdvTxPwr) +{ + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + WSF_ASSERT(pAdvTxPwr); + *pAdvTxPwr = BbBleRfGetActualTxPower(lmgrCb.advTxPwr, FALSE); + + LL_TRACE_INFO1("### LlApi ### LlGetAdvTxPower, advTxPwr=%d", *pAdvTxPwr); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set advertising parameter. + * + * \param advIntervalMin Minimum advertising interval. + * \param advIntervalMax Maximum advertising interval. + * \param advType Advertising type. + * \param ownAddrType Address type used by this device. + * \param peerAddrType Address type of peer device. Only used for directed advertising. + * \param pPeerAddr Address of peer device. Only used for directed advertising. + * \param advChanMap Advertising channel map. + * \param advFiltPolicy Advertising filter policy. + * + * \return Status error code. + * + * Set advertising parameters. + * + * \note This function must only be called when advertising is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvParam(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, + uint8_t ownAddrType, uint8_t peerAddrType, const uint8_t *pPeerAddr, + uint8_t advChanMap, uint8_t advFiltPolicy) +{ + const uint16_t rangeMin = 0x0020; /* 20 ms */ + const uint16_t rangeMax = 0x4000; /* 10,240 ms */ + const uint8_t advTypeMax = LL_ADV_CONN_DIRECT_LOW_DUTY; + const uint8_t peerAddrTypeMax = LL_ADDR_RANDOM; + const uint8_t advFiltPolicyMax = LL_ADV_FILTER_WL_ONLY; + const uint8_t ownAddrTypeMax = ((lmgrCb.features & LL_FEAT_PRIVACY) != 0) ? LL_ADDR_RANDOM_IDENTITY : LL_ADDR_RANDOM; + lctrAdvParamMsg_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlSetAdvParam, advType=%u", advType); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (lmgrCb.advEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + /* For high-duty cycle directed advertising, advertising intervals are ignored. */ + (((advType != LL_ADV_CONN_DIRECT_HIGH_DUTY) && + ((advIntervalMin < rangeMin) || (advIntervalMax < advIntervalMin) || (rangeMax < advIntervalMax))) || + (advType > advTypeMax) || + (ownAddrType > ownAddrTypeMax) || + /* If directed advertising or advertiser is private, peer address should be valid. */ + (((advType == LL_ADV_CONN_DIRECT_HIGH_DUTY) || (advType == LL_ADV_CONN_DIRECT_LOW_DUTY) || ((ownAddrType & LL_ADDR_IDENTITY_BIT) != 0)) && + (!pPeerAddr || (peerAddrType > peerAddrTypeMax))) || + (advChanMap & ~LL_ADV_CHAN_ALL) || (advChanMap == 0) || + /* If directed advertising, filter policy is ignored. */ + ((advType != LL_ADV_CONN_DIRECT_HIGH_DUTY) && (advType != LL_ADV_CONN_DIRECT_LOW_DUTY) && + (advFiltPolicy > advFiltPolicyMax)))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_ADV; + pMsg->hdr.event = LCTR_ADV_MSG_PARAM_UPD; + + pMsg->param.advInterMin = BB_BLE_TO_BB_TICKS(advIntervalMin); + pMsg->param.advInterMax = BB_BLE_TO_BB_TICKS(advIntervalMax); + pMsg->param.advType = advType; + pMsg->param.ownAddrType = ownAddrType; + pMsg->param.peerAddrType = peerAddrType; + pMsg->param.advChanMap = advChanMap; + pMsg->param.advFiltPolicy = advFiltPolicy; + BSTREAM_TO_BDA64(pMsg->param.peerAddr, pPeerAddr); + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set advertising data. + * + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set advertising data data. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvData(uint8_t len, const uint8_t *pData) +{ + WSF_CS_INIT(cs); + + LL_TRACE_INFO1("### LlApi ### LlSetAdvData, len=%u", len); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (len > sizeof(lmgrSlvAdvCb.advData.buf)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + WSF_CS_ENTER(cs); + memcpy(lmgrSlvAdvCb.advData.buf, pData, len); + lmgrSlvAdvCb.advData.len = len; + lmgrSlvAdvCb.advData.modified = TRUE; + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set scan response data. + * + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return Status error code. + * + * Set scan response data. + */ +/*************************************************************************************************/ +uint8_t LlSetScanRespData(uint8_t len, const uint8_t *pData) +{ + WSF_CS_INIT(cs); + + LL_TRACE_INFO1("### LlApi ### LlSetScanRespData, len=%u", len); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (len > sizeof(lmgrSlvAdvCb.scanRspData.buf)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + WSF_CS_ENTER(cs); + memcpy(lmgrSlvAdvCb.scanRspData.buf, pData, len); + lmgrSlvAdvCb.scanRspData.len = len; + lmgrSlvAdvCb.scanRspData.modified = TRUE; + WSF_CS_EXIT(cs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Advertising enable. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * + * \return None. + * + * Enable or disable advertising. + */ +/*************************************************************************************************/ +void LlAdvEnable(uint8_t enable) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlAdvEnable: enable=%u", enable); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + LmgrSendAdvEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + /* Disallow connectable advertising when no connections remain. */ + switch (lmgrSlvAdvCb.advParam.advType) + { + case LL_ADV_CONN_UNDIRECT: + case LL_ADV_CONN_DIRECT_HIGH_DUTY: + case LL_ADV_CONN_DIRECT_LOW_DUTY: + if (lmgrCb.numConnEnabled == pLctrRtCfg->maxConn) + { + LmgrSendAdvEnableCnf(LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + break; + default: + break; + } + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsAddressTypeAvailable(lmgrSlvAdvCb.advParam.ownAddrType)) + { + LL_TRACE_WARN1("Address type invalid or not available, ownAddrType=%u", lmgrSlvAdvCb.advParam.ownAddrType); + LmgrSendAdvEnableCnf(LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS); + return; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->dispId = LCTR_DISP_ADV; + pMsg->event = enable ? LCTR_ADV_MSG_START : LCTR_ADV_MSG_STOP; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} + + /*************************************************************************************************/ + /*! + * \brief Scan report enable. + * + * \param enable Set to TRUE to enable scan reports, FALSE to disable scan reports. + * + * \return None. + * + * Enable or disable reports about the scanners from which an advertiser receives scan requests. + */ + /*************************************************************************************************/ + void LlScanReportEnable(uint8_t enable) + { + lmgrSlvAdvCb.scanReportEna = enable; + } diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..e5ff29d83bc9c03c1a1685a07d8a16387bcea1ad --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_adv_slave_ae.c @@ -0,0 +1,670 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master control interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "ll_math.h" +#include "lctr_api_adv_slave_ae.h" +#include "lmgr_api_adv_slave.h" +#include "lmgr_api_adv_slave_ae.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Set advertising set random device address. + * + * \param handle Advertising set ID. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Set the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LlSetAdvSetRandAddr(uint8_t handle, const uint8_t *pAddr) +{ + LL_TRACE_INFO1("### LlApi ### LlSetAdvSetRandAddr, handle=%u", handle); + + LL_TRACE_INFO3("Private BDA[5:3]=%02x:%02x:%02x", pAddr[5], pAddr[4], pAddr[3]); + LL_TRACE_INFO3(" BDA[2:0]=%02x:%02x:%02x", pAddr[2], pAddr[1], pAddr[0]); + + WSF_ASSERT(pAddr); + + return LctrSetExtAdvSetRandAddr(handle, pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Get advertising set random device address. + * + * \param handle Advertising set ID. + * \param pAddr Random Bluetooth device address. + * + * \return Status error code. + * + * Get the random address to be used by a advertising set. + */ +/*************************************************************************************************/ +uint8_t LlGetAdvSetRandAddr(uint8_t handle, uint8_t *pAddr) +{ + LL_TRACE_INFO1("### LlApi ### LlGetAdvSetRandAddr, handle=%u", handle); + + WSF_ASSERT(pAddr); + + return LctrGetExtAdvSetRandAddr(handle, pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising parameters. + * + * \param handle Advertising set ID. + * \param pExtAdvParam Extended advertising parameters. + * + * \return Status error code. + * + * Set extended advertising parameters. + * + * \note This function must only be called when advertising for this set is disabled. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvParam(uint8_t handle, LlExtAdvParam_t *pExtAdvParam) +{ + const uint16_t validAdvEventProp = 0x007F; + const uint32_t validAdvInterMin = 0x000020; + const uint16_t highDutyConnDirectAdvProp = LL_ADV_EVT_PROP_LEGACY_ADV_BIT | + LL_ADV_EVT_PROP_HIGH_DUTY_ADV_BIT | + LL_ADV_EVT_PROP_DIRECT_ADV_BIT | + LL_ADV_EVT_PROP_CONN_ADV_BIT; + + /* Maximum extended advertising interval is half the maximum BB clock rollover time. */ + const uint32_t bbDurMaxUsec = BB_TICKS_TO_US(UINT64_C(1) << 31); + const uint32_t validAdvInterMax = WSF_MIN(LL_MATH_DIV_625(bbDurMaxUsec), 0xFFFFFF); + + LL_TRACE_INFO2("### LlApi ### LlSetExtAdvParam, handle=%u, advEventProp=0x%04x", handle, pExtAdvParam->advEventProp); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + if ((LL_API_PARAM_CHECK == 1) && + (handle > LL_MAX_ADV_HANDLE)) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + if ((LL_API_PARAM_CHECK == 1) && + ((pExtAdvParam->priAdvInterMax < pExtAdvParam->priAdvInterMin) || + /* Ignore unused intervals for high duty cycle connectable directed advertising. */ + ((pExtAdvParam->advEventProp != highDutyConnDirectAdvProp) && + ((pExtAdvParam->priAdvInterMin < validAdvInterMin) || + (pExtAdvParam->priAdvInterMax < validAdvInterMin))))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((LL_API_PARAM_CHECK == 1) && + /* Ignore unused intervals for high duty cycle connectable directed advertising. */ + ((pExtAdvParam->advEventProp != highDutyConnDirectAdvProp) && + ((pExtAdvParam->priAdvInterMin > validAdvInterMax) || + (pExtAdvParam->priAdvInterMax > validAdvInterMax)))) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + if ((LL_API_PARAM_CHECK == 1) && + ((pExtAdvParam->advEventProp & ~validAdvEventProp) || + ((pExtAdvParam->advEventProp & (LL_ADV_EVT_PROP_LEGACY_ADV_BIT | LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)) == + (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)) || + ((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) && + (pExtAdvParam->advEventProp & (LL_ADV_EVT_PROP_OMIT_AA_BIT | LL_ADV_EVT_PROP_TX_PWR_BIT))))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((LL_API_PARAM_CHECK == 1) && + ((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_OMIT_AA_BIT) && + (pExtAdvParam->advEventProp & (LL_ADV_EVT_PROP_CONN_ADV_BIT | LL_ADV_EVT_PROP_SCAN_ADV_BIT)))) + { + /* Only non-connectable and non-scannable advertising can do anonymous advertising. */ + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((LL_API_PARAM_CHECK == 1) && + ((((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) != 0) && + (pExtAdvParam->priAdvPhy != LL_PHY_LE_1M)) || + (((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) && + (pExtAdvParam->priAdvPhy != LL_PHY_LE_1M) && (pExtAdvParam->priAdvPhy != LL_PHY_LE_CODED)) || + (((pExtAdvParam->advEventProp & LL_ADV_EVT_PROP_LEGACY_ADV_BIT) == 0) && + (pExtAdvParam->secAdvPhy != LL_PHY_LE_1M) && (pExtAdvParam->secAdvPhy != LL_PHY_LE_2M) && (pExtAdvParam->secAdvPhy != LL_PHY_LE_CODED)))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((LL_API_PARAM_CHECK == 1) && + (((pExtAdvParam->secAdvPhy == LL_PHY_LE_2M) && ((lmgrCb.features & LL_FEAT_LE_2M_PHY) == 0)) || + (((pExtAdvParam->priAdvPhy == LL_PHY_LE_CODED) || (pExtAdvParam->secAdvPhy == LL_PHY_LE_CODED)) && ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) == 0)))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + pExtAdvParam->priAdvInterMin = BB_BLE_TO_BB_TICKS(pExtAdvParam->priAdvInterMin); + pExtAdvParam->priAdvInterMax = BB_BLE_TO_BB_TICKS(pExtAdvParam->priAdvInterMax); + + return LctrSetExtAdvParam(handle, pExtAdvParam); +} + +/*************************************************************************************************/ +/*! + * \brief Get extended advertising TX power level. + * + * \param handle Advertising handle. + * \param pLevel Transmit power level. + * + * \return Status error code. + * + * Get the TX power of an advertising set. + */ +/*************************************************************************************************/ +uint8_t LlGetExtAdvTxPowerLevel(uint16_t handle, int8_t *pLevel) +{ + *pLevel = -127; + return LctrGetExtAdvTxPowerLevel(handle, pLevel); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data. + * + * \param handle Advertising set ID. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData) +{ + LL_TRACE_INFO2("### LlApi ### LlSetExtAdvData, handle=%u, len=%u", handle, len); + + WSF_ASSERT(pData); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + return LctrSetExtAdvData(handle, op, fragPref, len, pData); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended scan response data. + * + * \param handle Advertising set ID. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return Status error code. + * + * Set extended scan response data. + */ +/*************************************************************************************************/ +uint8_t LlSetExtScanRespData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData) +{ + LL_TRACE_INFO2("### LlApi ### LlSetExtScanRespData, handle=%u, len=%u", handle, len); + + WSF_ASSERT(pData); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + return LctrSetExtScanRespData(handle, op, fragPref, len, pData); +} + +/*************************************************************************************************/ +/*! + * \brief Extended advertising enable. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * \param numAdvSets Number of elements in enaParam[]. + * \param enaParam Enable parameter table. + * + * \return None. + * + * Enable or disable extended advertising. + */ +/*************************************************************************************************/ +void LlExtAdvEnable(uint8_t enable, uint8_t numAdvSets, LlExtAdvEnableParam_t enaParam[]) +{ + unsigned int i; + + LL_TRACE_INFO2("### LlApi ### LlExtAdvEnable: enable=%u, numAdvSets=%u", enable, numAdvSets); + + /* Non-overlapping enable requests. */ + WSF_ASSERT(lmgrCb.extAdvEnaDelayCnt == 0); + + lmgrCb.advSetEnaStatus = LL_SUCCESS; + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + lmgrCb.extAdvEnaDelayCnt = 1; + LmgrSendExtAdvEnableCnf(0, LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + if ((LL_API_PARAM_CHECK == 1) && + (((numAdvSets > LL_MAX_ADV_SETS)) || + ((numAdvSets == 0) && enable))) + { + lmgrCb.extAdvEnaDelayCnt = 1; + LmgrSendExtAdvEnableCnf(0, LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS); + return; + } + + for (i = 0; i < numAdvSets; i++) + { + uint8_t status; + if (((status = LctrIsExtAdvEnableReady(enaParam[i].handle)) != LL_SUCCESS) || + ((status = LctrIsExtAdvEnableParamValid(enable, &enaParam[i])) != LL_SUCCESS)) + { + lmgrCb.extAdvEnaDelayCnt = 1; + LmgrSendExtAdvEnableCnf(enaParam[i].handle, status); + return; + } + } + + if (numAdvSets > 0) + { + for (i = 0; i < numAdvSets; i++) + { + LctrExtAdvEnableMsg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = enaParam[i].handle; + pMsg->hdr.dispId = LCTR_DISP_EXT_ADV; + pMsg->hdr.event = enable ? LCTR_EXT_ADV_MSG_START : LCTR_EXT_ADV_MSG_STOP; + pMsg->durMs = enaParam[i].duration * 10; + pMsg->maxEvents = enaParam[i].numEvents; + + /* Delay enable confirm event until all advertising sets respond. */ + lmgrCb.extAdvEnaDelayCnt++; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + } + else /* (numAdvSets == 0) */ + { + /* N.B. Parameter check guarantees enable is FALSE. */ + + uint8_t numHandles; + uint8_t handles[LL_MAX_ADV_SETS] = { 0 }; + + numHandles = LctrGetAdvHandles(handles); + + for (i = 0; i < numHandles; i++) + { + LctrExtAdvEnableMsg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handles[i]; + pMsg->hdr.dispId = LCTR_DISP_EXT_ADV; + pMsg->hdr.event = LCTR_EXT_ADV_MSG_STOP; + pMsg->durMs = 0; + pMsg->maxEvents = 0; + + /* Delay enable confirm event until all advertising sets respond. */ + lmgrCb.extAdvEnaDelayCnt++; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Read maximum advertising data length. + * + * \param pLen Return buffer for Maximum data length. + * + * \return Status error code. + * + * Read maximum advertising data length. + */ +/*************************************************************************************************/ +uint8_t LlReadMaxAdvDataLen(uint16_t *pLen) +{ + LL_TRACE_INFO0("### LlApi ### LlReadMaxAdvDataLen"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + WSF_ASSERT(pLen); + *pLen = WSF_MIN(pLctrRtCfg->maxExtAdvDataLen, LL_MAX_ADV_DATA_LEN); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read number of supported advertising sets. + * + * \param pNumSets Return buffer for number of advertising sets. + * + * \return Status error code. + * + * Read number of supported advertising sets. + */ +/*************************************************************************************************/ +uint8_t LlReadNumSupAdvSets(uint8_t *pNumSets) +{ + LL_TRACE_INFO1("### LlApi ### LlReadNumSupAdvSets: numSets=%u", pLctrRtCfg->maxAdvSets); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + WSF_ASSERT(pNumSets); + *pNumSets = pLctrRtCfg->maxAdvSets; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Remove advertising set. + * + * \param handle Advertising set ID. + * + * \return Status error code. + * + * Removes the an advertising set from the LL. + */ +/*************************************************************************************************/ +uint8_t LlRemoveAdvSet(uint8_t handle) +{ + LL_TRACE_INFO1("### LlApi ### LlRemoveAdvSet: handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + return LctrRemoveAdvSet(handle); +} + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets. + * + * \return Status error code. + * + * Remove all existing advertising sets from the LL. + */ +/*************************************************************************************************/ +uint8_t LlClearAdvSets(void) +{ + LL_TRACE_INFO0("### LlApi ### LlClearAdvSets"); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + return LctrClearAdvSets(); +} + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising parameters. + * + * \param handle Advertising set ID. + * \param pPerAdvParam Periodic advertising parameters. + * + * \return Status error code. + * + * Set periodic advertising parameters. + * + * \note This function must only be called when advertising handle exists. + */ +/*************************************************************************************************/ +uint8_t LlSetPeriodicAdvParam(uint8_t handle, LlPerAdvParam_t *pPerAdvParam) +{ + LL_TRACE_INFO2("### LlApi ### LlSetPeriodicAdvParam, handle=%u, perAdvProp=0x%04x", handle, pPerAdvParam->perAdvProp); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + (handle > LL_MAX_ADV_HANDLE)) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((pPerAdvParam->perAdvInterMax < pPerAdvParam->perAdvInterMin) || + (pPerAdvParam->perAdvInterMin < LL_PER_ADV_INT_MIN))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + return LctrSetPeriodicAdvParam(handle, pPerAdvParam); +} +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising data. + * + * \param handle Advertising handle. + * \param op Operation. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return Status error code. + * + * Set extended advertising data data. + */ +/*************************************************************************************************/ +uint8_t LlSetPeriodicAdvData(uint8_t handle, uint8_t op, uint8_t len, const uint8_t *pData) +{ + LL_TRACE_INFO2("### LlApi ### LlSetPeriodicAdvData, handle=%u, len=%u", handle, len); + + WSF_ASSERT(pData); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + (handle > LL_MAX_ADV_HANDLE)) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + if ((LL_API_PARAM_CHECK == 1) && + (op > LL_ADV_DATA_OP_COMP)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + return LctrSetPeriodicAdvData(handle, op, len, pData); +} + +/*************************************************************************************************/ +/*! + * \brief Set periodic advertising enable. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * \param handle Advertising handle. + * + * \return Status error code. + * + * Enable or disable periodic advertising. + */ +/*************************************************************************************************/ +void LlSetPeriodicAdvEnable(uint8_t handle, uint8_t enable) +{ + LL_TRACE_INFO2("### LlApi ### LlSetPeriodicAdvEnable: enable=%u, handle=%u", enable, handle); + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsExtCommandAllowed()) + { + LmgrSendPeriodicAdvEnableCnf(handle, LL_ERROR_CODE_CMD_DISALLOWED); + return; + } + + if ((LL_API_PARAM_CHECK == 1) && + (handle > LL_MAX_ADV_HANDLE)) + { + LmgrSendPeriodicAdvEnableCnf(handle, LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE); + return; + } + + LctrSetPeriodicAdvEnable(handle, enable); +} + +/*************************************************************************************************/ +/*! + * \brief Set auxiliary packet offset delay. + * + * \param handle Advertising handle. + * \param delayUsec Additional time in microseconds. "0" to disable. + * + * \return None. + * + * Additional delay given to auxiliary packets specified by AuxPtr. Offset values are + * limited by the advertising interval. + */ +/*************************************************************************************************/ +uint8_t LlSetAuxOffsetDelay(uint8_t handle, uint32_t delayUsec) +{ + LL_TRACE_INFO2("### LlApi ### LlSetAuxOffsetDelay: handle=%u, delayUsec=%u", handle, delayUsec); + + return LctrSetAuxOffsetDelay(handle, delayUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising data fragmentation length. + * + * \param handle Advertising handle. + * \param fragLen Fragmentation length. + * + * \return Status error code. + * + * Fragmentation size for Advertising Data and Scan Response Data when selected by the host. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvDataFragLen(uint8_t handle, uint8_t fragLen) +{ + LL_TRACE_INFO2("### LlApi ### LlSetExtAdvDataFragLen: handle=%u, fragLen=%u", handle, fragLen); + + return LctrSetExtAdvDataFragLen(handle, fragLen); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising transmit PHY options. + * + * \param handle Advertising handle. + * \param priPhyOpts Primary advertising channel PHY options. + * \param secPhyOpts Secondary advertising channel PHY options. + * + * \return Status error code. + * + * PHY options for extended advertising transmissions. New values are applied dynamically. + */ +/*************************************************************************************************/ +uint8_t LlSetExtAdvTxPhyOptions(uint8_t handle, uint8_t priPhyOpts, uint8_t secPhyOpts) +{ + LL_TRACE_INFO3("### LlApi ### LlSetExtAdvTxPhyOptions: handle=%u, priPhyOpts=%u, secPhyOpts=%u", handle, priPhyOpts, secPhyOpts); + + if (LL_API_PARAM_CHECK == 1) + { + switch (priPhyOpts) + { + case LL_PHY_OPTIONS_S2_PREFERRED: + case LL_PHY_OPTIONS_S8_PREFERRED: + /* Allowed options. */ + break; + default: + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + switch (secPhyOpts) + { + case LL_PHY_OPTIONS_S2_PREFERRED: + case LL_PHY_OPTIONS_S8_PREFERRED: + /* Allowed options. */ + break; + default: + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + + return LctrSetExtAdvTxPhyOptions(handle, priPhyOpts, secPhyOpts); +} + +/*************************************************************************************************/ +/*! + * \brief Set the default Ext adv TX PHY options. + * + * \param phyOptions PHY options. + * + * \return None. + * + * Set the default TX PHY options for extended adv slave primary and secondary channel. + */ +/*************************************************************************************************/ +void LlSetDefaultExtAdvTxPhyOptions(const uint8_t phyOptions) +{ + LL_TRACE_INFO1("### LlApi ### LlSetDefaultExtAdvTxPhyOptions phyOptions=%x", phyOptions); + + lmgrSlvAdvCb.defTxPhyOpts = phyOptions; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..950878046d20d08954aa21890e08c47c37387e1a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn.c @@ -0,0 +1,849 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave parameter interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lctr_api_conn.h" +#include "lmgr_api.h" +#include "lmgr_api_conn.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Get RSSI of a connection. + * + * \param handle Connection handle. + * \param pRssi RSSI value. + * + * \return Status error code. + * + * Get the current RSSI of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetRssi(uint16_t handle, int8_t *pRssi) +{ + uint8_t result = LL_SUCCESS; + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + *pRssi = LL_RSSI_NOT_AVAIL; + result = LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + else + { + *pRssi = LctrGetRssi(handle); + } + + WSF_CS_EXIT(cs); + + LL_TRACE_INFO2("### LlApi ### LlGetRssi, handle=%u, rssi=%d", handle, *pRssi); + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Get connection's TX power level. + * + * \param handle Connection handle. + * \param type Power level type. + * \param pLevel Transmit power level. + * + * \return Status error code. + * + * Get the TX power of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetTxPowerLevel(uint16_t handle, uint8_t type, int8_t *pLevel) +{ + uint8_t result = LL_SUCCESS; + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + *pLevel = LL_MIN_TX_PWR_LVL; + result = LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + else if ((LL_API_PARAM_CHECK == 1) && + (type > LL_TX_PWR_LVL_TYPE_MAX)) + { + *pLevel = LL_MIN_TX_PWR_LVL; + result = LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + else + { + switch (type) + { + case LL_TX_PWR_LVL_TYPE_CURRENT: + *pLevel = LctrGetTxPowerLevel(handle); + break; + case LL_TX_PWR_LVL_TYPE_MAX: + default: + *pLevel = LL_MAX_TX_PWR_LVL; + break; + } + } + + WSF_CS_EXIT(cs); + + LL_TRACE_INFO3("### LlApi ### LlGetTxPowerLevel, handle=%u, type, level=%d", handle, type, *pLevel); + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Set connection's TX power level. + * + * \param handle Connection handle. + * \param level Transmit power level. + * + * \return Status error code. + * + * Set the TX power of a connection. + */ +/*************************************************************************************************/ +uint8_t LlSetTxPowerLevel(uint16_t handle, int8_t level) +{ + uint8_t result = LL_SUCCESS; + + LL_TRACE_INFO2("### LlApi ### LlSetTxPowerLevel, handle=%u, level=%d", handle, level); + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + result = LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + else + { + LctrSetTxPowerLevel(handle, level); + } + + WSF_CS_EXIT(cs); + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Get connection's channel map. + * + * \param handle Connection handle. + * \param pChanMap Channel map. + * + * \return Status error code. + * + * Get the current channel map of a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetChannelMap(uint16_t handle, uint8_t *pChanMap) +{ + uint64_t chanMap; + uint8_t result = LL_SUCCESS; + + LL_TRACE_INFO1("### LlApi ### LlGetChannelMap, handle=%u", handle); + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + result = LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + else + { + chanMap = LctrGetChannelMap(handle); + UINT40_TO_BSTREAM(pChanMap, chanMap); + } + + WSF_CS_EXIT(cs); + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Set connection operational mode flags. + * + * \param flags Flags. + * \param enable TRUE to set flags or FALSE to clear flags. + * + * \return Status error code. + * + * Set mode flags governing LL operations of a given connection. + */ +/*************************************************************************************************/ +uint8_t LlSetConnOpFlags(uint16_t handle, uint32_t flags, bool_t enable) +{ + const uint32_t flagAll = + LL_OP_MODE_FLAG_SLV_REQ_IMMED_ACK | + LL_OP_MODE_FLAG_BYPASS_CE_GUARD | + LL_OP_MODE_FLAG_MST_RETX_AFTER_RX_NACK | + LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP | + LL_OP_MODE_FLAG_MST_UNCOND_CP_RSP | + LL_OP_MODE_FLAG_REQ_SYM_PHY | + LL_OP_MODE_FLAG_ENA_WW | + LL_OP_MODE_FLAG_ENA_SLV_LATENCY | + LL_OP_MODE_FLAG_ENA_LLCP_TIMER; + + LL_TRACE_INFO2("### LlApi ### LlSetConnFlags flag=%x enable=%d", flags, enable); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((~flagAll & flags) != 0)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + LctrSetConnOpFlags(handle, flags, enable); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Disconnect a connection. + * + * \param handle Connection handle. + * \param reason Disconnect reason. + * + * \return Status error code. + * + * Disconnect a connection. + */ +/*************************************************************************************************/ +uint8_t LlDisconnect(uint16_t handle, uint8_t reason) +{ + lctrDisconnect_t *pMsg; + + LL_TRACE_INFO2("### LlApi ### LlDisconnect, handle=%u, reason=%u", handle, reason); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((pMsg = (lctrDisconnect_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_DISCONNECT; + pMsg->reason = reason; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Update connection parameters. + * + * \param handle Connection handle. + * \param pConnSpec New connection specification. + * + * \return Status error code. + * + * Update the connection parameters of a connection. + */ +/*************************************************************************************************/ +uint8_t LlConnUpdate(uint16_t handle, const LlConnSpec_t *pConnSpec) +{ + lctrConnUpdate_t *pMsg; + uint8_t status; + + WSF_ASSERT(pConnSpec); /* not NULL */ + + LL_TRACE_INFO1("### LlApi ### LlConnUpdate, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_CONN_UPDATE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((LctrGetRole(handle) == LL_ROLE_SLAVE) && + ((LctrGetUsedFeatures(handle) & LL_FEAT_CONN_PARAM_REQ_PROC) == 0))) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((status = LctrValidateConnSpec(pConnSpec)) != LL_SUCCESS)) + { + return status; + } + + if ((pMsg = (lctrConnUpdate_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_CONN_UPDATE; + + pMsg->connSpec = *pConnSpec; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Remote connection parameter request reply. + * + * \param handle Connection handle. + * \param pConnSpec New connection specification. + * + * \return Status error code. + * + * Reply to a connection parameter request. + */ +/*************************************************************************************************/ +uint8_t LlRemoteConnParamReqReply(uint16_t handle, const LlConnSpec_t *pConnSpec) +{ + lctrConnParamReply_t *pMsg; + uint8_t status; + + WSF_ASSERT(pConnSpec); /* not NULL */ + + LL_TRACE_INFO1("### LlApi ### LlRemoteConnParamReqReply, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + !LctrIsWaitingForReply(handle, LCTR_HOST_REPLY_CONN_PARAM_REQ)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((status = LctrValidateConnSpec(pConnSpec)) != LL_SUCCESS)) + { + return status; + } + + if ((pMsg = (lctrConnParamReply_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_CONN_PARAM_REPLY; + + pMsg->connSpec = *pConnSpec; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Remote connection parameter request negative reply. + * + * \param handle Connection handle. + * \param reason Reason code. + * + * \return None. + * + * Negative reply to a connection parameter request. + */ +/*************************************************************************************************/ +uint8_t LlRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason) +{ + lctrConnParamNegReply_t *pMsg; + + LL_TRACE_INFO2("### LlApi ### LlRemoteConnParamReqNegReply, handle=%u, reason=%u", handle, reason); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + !LctrIsWaitingForReply(handle, LCTR_HOST_REPLY_CONN_PARAM_REQ)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrConnParamNegReply_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_CONN_PARAM_NEG_REPLY; + + pMsg->reason = reason; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read remote version information. + * + * \param handle Connection handle. + * + * \return Status error code. + * + * Read the version information of the remote device. + */ +/*************************************************************************************************/ +uint8_t LlReadRemoteVerInfo(uint16_t handle) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlReadRemoteVerInfo, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_REMOTE_VERSION) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->handle = handle; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_MSG_API_REMOTE_VERSION; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set data length. + * + * \param handle Connection handle. + * \param txLen Maximum number of payload bytes for a Data PDU + * \param txTime Maximum microseconds for a Data PDU + * + * \return Status error code. + * + * Preferred maximum microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +uint8_t LlSetDataLen(uint16_t handle, uint16_t txLen, uint16_t txTime) +{ + lctrDataLengthChange_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlSetDataLen: handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_DATA_LEN_CHANGE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((txLen < LL_MAX_DATA_LEN_MIN) || + (txLen > LL_MAX_DATA_LEN_ABS_MAX) || + (txTime < LL_MAX_DATA_TIME_MIN) || + ((pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2) && (txTime > LL_MAX_DATA_TIME_ABS_MAX_1M)) || + ((pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) && (txTime > LL_MAX_DATA_TIME_ABS_MAX)))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_DATA_LEN_CHANGE; + + pMsg->maxTxLen = WSF_MIN(txLen, LCTR_MAX_DATA_LEN_MAX); + pMsg->maxTxTime = txTime; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read default data length. + * + * \param pMaxTxLen Maximum number of payload bytes for a Data PDU + * \param pMaxTxTime Maximum microseconds for a Data PDU + * + * \return None. + * + * Suggested length and microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +void LlReadDefaultDataLen(uint16_t *pMaxTxLen, uint16_t *pMaxTxTime) +{ + LL_TRACE_INFO0("### LlApi ### LlReadDefaultDataLen"); + + WSF_ASSERT(pMaxTxLen && pMaxTxTime); + + *pMaxTxLen = lmgrConnCb.maxTxLen; + *pMaxTxTime = lmgrConnCb.maxTxTime; +} + +/*************************************************************************************************/ +/*! + * \brief Write default data length. + * + * \param maxTxLen Maximum number of payload bytes for a Data PDU + * \param maxTxTime Maximum microseconds for a Data PDU + * + * \return Status error code. + * + * Suggested length and microseconds that the local Controller should use to transmit a + * single Link Layer Data Channel PDU. + */ +/*************************************************************************************************/ +uint8_t LlWriteDefaultDataLen(uint16_t maxTxLen, uint16_t maxTxTime) +{ + LL_TRACE_INFO0("### LlApi ### LlWriteDefaultDataLen"); + + if ((LL_API_PARAM_CHECK == 1) && + ((maxTxLen < LL_MAX_DATA_LEN_MIN) || + (maxTxLen > LL_MAX_DATA_LEN_ABS_MAX) || + (maxTxTime < LL_MAX_DATA_TIME_MIN) || + ((pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2) && (maxTxTime > LL_MAX_DATA_TIME_ABS_MAX_1M)) || + ((pLctrRtCfg->btVer >= LL_VER_BT_CORE_SPEC_5_0) && (maxTxTime > LL_MAX_DATA_TIME_ABS_MAX)))) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + if ((LL_API_PARAM_CHECK == 1) && + (maxTxLen > WSF_MIN(pLctrRtCfg->maxAclLen, LCTR_MAX_DATA_LEN_MAX))) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + + lmgrConnCb.maxTxLen = maxTxLen; + lmgrConnCb.maxTxTime = maxTxTime; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read maximum data length. + * + * \param pMaxTxLen Maximum number of payload bytes for a Tx Data PDU + * \param pMaxTxTime Maximum microseconds for a Tx Data PDU + * \param pMaxRxLen Maximum number of payload bytes for a Rx Data PDU + * \param pMaxRxTime Maximum microseconds for a Rx Data PDU + * + * \return None. + * + * Read the Controller's maximum supported payload octets and packet duration times for + * transmission and reception. + */ +/*************************************************************************************************/ +void LlReadMaximumDataLen(uint16_t *pMaxTxLen, uint16_t *pMaxTxTime, uint16_t *pMaxRxLen, uint16_t *pMaxRxTime) +{ + LL_TRACE_INFO0("### LlApi ### LlReadMaximumDataLen"); + + WSF_ASSERT(pMaxTxLen && pMaxTxTime); + + *pMaxTxLen = WSF_MIN(pLctrRtCfg->maxAclLen, LCTR_MAX_DATA_LEN_MAX); + *pMaxTxTime = LL_DATA_LEN_TO_TIME_1M(*pMaxTxLen); + *pMaxRxLen = *pMaxTxLen; + *pMaxRxTime = *pMaxTxTime; +} + +/*************************************************************************************************/ +/*! + * \brief Set local minimum number of used channels. + * + * \param phys Bitmask for the PHYs. + * \param pwrThres Power threshold. + * \param minUsedCh Minimum number of used channels. + * + * \return Status error code. + * + * Set local minimum number of used channels. + */ +/*************************************************************************************************/ +uint8_t LlSetLocalMinUsedChan(uint8_t phys, int8_t pwrThres, uint8_t minUsedCh) +{ + lctrSetMinUsedChan_t *pMsg; + uint16_t handle; + unsigned i; + + LL_TRACE_INFO0("### LlApi ### LlSetLocalMinUsedChan"); + + if ((LL_API_PARAM_CHECK == 1) && + (pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + else if ((LL_API_PARAM_CHECK == 1) && + ((phys == 0) || + (phys >= (1 << LL_MAX_PHYS)) || + (minUsedCh > LL_MAX_NUM_CHAN_DATA) || + (minUsedCh < LL_MIN_NUM_CHAN_DATA))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Save the local minimum number of channels for the PHYs. */ + for (i = 0; i < LL_MAX_PHYS; i++) + { + if ((phys & (1 << i)) == (1 << i)) + { + lmgrCb.powerThreshold[i] = pwrThres; + lmgrCb.localMinUsedChan[i] = minUsedCh; + } + } + + /* If slave, start the LL_SET_MIN_USED_CHAN procedure to inform the peer localMinUsedChan. */ + for (handle = 0; handle < pLctrRtCfg->maxConn; handle++) + { + if ((LctrIsConnHandleEnabled(handle)) && + (LctrGetRole(handle) == LL_ROLE_SLAVE)) + { + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_SET_MIN_USED_CHAN) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrSetMinUsedChan_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_SET_MIN_USED_CHAN; + pMsg->phys = phys; + pMsg->minUsedChan = minUsedCh; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get peer minimum number of used channels. + * + * \param handle Connection handle. + * \param pPeerMinUsedChan Storage for the peer minimum number of used channels. + * + * \return Status error code. + * + * Get peer minimum number of used channels. + */ +/*************************************************************************************************/ +uint8_t LlGetPeerMinUsedChan(uint16_t handle, uint8_t *pPeerMinUsedChan) +{ + uint8_t result = LL_SUCCESS; + + LL_TRACE_INFO1("### LlApi ### LlGetPeerMinUsedChan, handle=%u", handle); + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + result = LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + else if ((LL_API_PARAM_CHECK == 1) && + ((pLctrRtCfg->btVer <= LL_VER_BT_CORE_SPEC_4_2) || + (LctrGetRole(handle) != LL_ROLE_MASTER))) + { + result = LL_ERROR_CODE_CMD_DISALLOWED; + } + else + { + LctrGetPeerMinUsedChan(handle, pPeerMinUsedChan); + } + + WSF_CS_EXIT(cs); + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum ACL buffers size. + * + * \return Maximum buffers size in bytes. + */ +/*************************************************************************************************/ +uint16_t LlGetAclMaxSize(void) +{ + LL_TRACE_INFO1("### LlApi ### LlGetAclMaxSize, maxBufSize=%u", pLctrRtCfg->maxAclLen); + + return pLctrRtCfg->maxAclLen; +} + +/*************************************************************************************************/ +/*! + * \brief Get the number of buffers in the LL ACL transmit queue. + * + * \return Number of buffers. + */ +/*************************************************************************************************/ +uint8_t LlGetAclTxBufs(void) +{ + LL_TRACE_INFO1("### LlApi ### LlGetAclTxBufs, numBufs=%u", pLctrRtCfg->numTxBufs); + + return pLctrRtCfg->numTxBufs; +} + +/*************************************************************************************************/ +/*! + * \brief Get the number of buffers in the LL ACL receive queue. + * + * \return Number of buffers. + */ +/*************************************************************************************************/ +uint8_t LlGetAclRxBufs(void) +{ + LL_TRACE_INFO1("### LlApi ### LlGetAclRxBufs, numBufs=%u", pLctrRtCfg->numRxBufs); + + return pLctrRtCfg->numRxBufs; +} + +/*************************************************************************************************/ +/*! + * \brief Send an ACL data packet. + * + * \param pData Data buffer + * + * \return None. + * + * Send an ACL data packet. pData points to an ACL buffer formatted according to [1]; the host + * must set the connection handle, flags, and length fields in the buffer. + */ +/*************************************************************************************************/ +void LlSendAclData(uint8_t *pData) +{ + if (lmgrConnCb.availTxBuf == 0) + { + LL_TRACE_WARN0("!!! ACL flow control detected; dropping Tx data PDU"); + + /* Drop packet due to out of Tx buffers condition. */ + WsfMsgFree(pData); + return; + } + + LctrTxAcl(pData); +} + +/*************************************************************************************************/ +/*! + * \brief Receive an ACL data packet + * + * \return Data buffer. + * + * Receive an ACL data packet. This function returns a pointer to an ACL buffer formatted + * according to [1]. The host must parse the header to determine the connection handle, flags, + * and length fields. If no ACL buffers are available this function returns NULL. + * + * The host must deallocate the buffer by calling WsfMsgFree() and then calling + * LlRecvAclDataComplete(). + */ +/*************************************************************************************************/ +uint8_t *LlRecvAclData(void) +{ + return LctrRxAcl(); +} + +/*************************************************************************************************/ +/*! + * \brief Indicate that received ACL data buffer has been deallocated + * + * \param numBufs Number of completed packets. + * + * \return None. + * + * Indicate that received ACL data buffer has been deallocated. + */ +/*************************************************************************************************/ +void LlRecvAclDataComplete(uint8_t numBufs) +{ + LctrRxAclComplete(numBufs); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..602c8b10df8ae3fdbf58db80d6e282f79a4ae207 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master.c @@ -0,0 +1,255 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave parameter interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "ll_math.h" +#include "lctr_api_adv_master.h" +#include "lctr_api_init_master.h" +#include "lctr_api_conn.h" +#include "lmgr_api_adv_master.h" +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Set channel class. + * + * \param pChanMap Channel map (0=bad, 1=usable). + * + * \return Status error code. + * + * Set the channel class. At least 2 bits must be set. + */ +/*************************************************************************************************/ +uint8_t LlSetChannelClass(const uint8_t *pChanMap) +{ + lctrChanMapUpdate_t *pMsg; + uint64_t chanMap; + uint16_t handle; + + LL_TRACE_INFO0("### LlApi ### LlSetChannelClass"); + + BSTREAM_TO_UINT40(chanMap, pChanMap); + + if ((LL_API_PARAM_CHECK == 1) && + ((LlMathGetNumBitsSet(chanMap) < 2) || + ((chanMap & ~LL_CHAN_DATA_ALL) != 0))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + lmgrMstScanCb.chanClass = chanMap; + + for (handle = 0; handle < pLctrRtCfg->maxConn; handle++) + { + if ((LctrIsConnHandleEnabled(handle)) && + (LctrGetRole(handle) == LL_ROLE_MASTER)) + { + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_CHAN_MAP_UPDATE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrChanMapUpdate_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_CHAN_MAP_UPDATE; + + pMsg->chanMap = chanMap; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set connection's channel map. + * + * \param handle Connection handle. + * \param pChanMap Channel map. + * + * \return Status error code. + * + * Set the channel map of a connection. + */ +/*************************************************************************************************/ +uint8_t LlSetChannelMap(uint16_t handle, const uint8_t *pChanMap) +{ + lctrChanMapUpdate_t *pMsg; + uint64_t chanMap; + + LL_TRACE_INFO1("### LlApi ### LlSetChannelMap, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_CHAN_MAP_UPDATE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + (LctrGetRole(handle) != LL_ROLE_MASTER)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BSTREAM_TO_UINT64(chanMap, pChanMap); + chanMap &= lmgrMstScanCb.chanClass; + + if ((LL_API_PARAM_CHECK == 1) && + (LlMathGetNumBitsSet(chanMap) < 2)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pMsg = (lctrChanMapUpdate_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_CHAN_MAP_UPDATE; + + pMsg->chanMap = chanMap; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Create connection. + * + * \param pInitParam Initiating parameters. + * \param pConnSpec Connection specification. + * + * \return Status error code. + * + * Create a connection to the specified peer address with the specified connection parameters. + * This function is only when operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlCreateConn(const LlInitParam_t *pInitParam, const LlConnSpec_t *pConnSpec) +{ + lctrInitiateMsg_t *pMsg; + const uint16_t scanRangeMin = 0x0004; + const uint16_t scanRangeMax = 0x4000; + const uint8_t filterPolicyMax = LL_SCAN_FILTER_WL_BIT; + const uint8_t addrTypeMax = ((lmgrCb.features & LL_FEAT_PRIVACY) != 0) ? LL_ADDR_RANDOM_IDENTITY : LL_ADDR_RANDOM; + + LL_TRACE_INFO2("### LlApi ### LlCreateConn: scanInterval=%u, scanWindow=%u", pInitParam->scanInterval, pInitParam->scanWindow); + LL_TRACE_INFO2(" connIntervalMin=%u, connIntervalMax=%u", pConnSpec->connIntervalMin, pConnSpec->connIntervalMax); + LL_TRACE_INFO2(" connLatency=%u, supTimeout=%u", pConnSpec->connLatency, pConnSpec->supTimeout); + + WSF_ASSERT(pInitParam->pPeerAddr); /* not NULL */ + WSF_ASSERT(pConnSpec); /* not NULL */ + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsLegacyCommandAllowed()) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pInitParam->scanInterval > scanRangeMax) || (pInitParam->scanWindow > pInitParam->scanInterval) || (scanRangeMin > pInitParam->scanWindow) || + (pInitParam->filterPolicy > filterPolicyMax) || + ((pInitParam->filterPolicy == LL_SCAN_FILTER_NONE) && (pInitParam->peerAddrType > addrTypeMax)) || + (pInitParam->ownAddrType > addrTypeMax) || + (LctrValidateConnSpec(pConnSpec) != LL_SUCCESS)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((LL_API_PARAM_CHECK == 1) && + !LmgrIsAddressTypeAvailable(pInitParam->ownAddrType)) + { + LL_TRACE_WARN1("Address type invalid or not available, ownAddrType=%u", pInitParam->ownAddrType); + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_INIT; + pMsg->hdr.event = LCTR_INIT_MSG_INITIATE; + + pMsg->connSpec = *pConnSpec; + + pMsg->scanParam.scanInterval = pInitParam->scanInterval; + pMsg->scanParam.scanWindow = pInitParam->scanWindow; + /* pMsg->scanParam.scanType = LL_SCAN_ACTIVE; */ /* not used */ + pMsg->scanParam.ownAddrType = pInitParam->ownAddrType; + pMsg->scanParam.scanFiltPolicy = pInitParam->filterPolicy; + + pMsg->peerAddrType = pInitParam->peerAddrType; + pMsg->peerAddr = BstreamToBda64(pInitParam->pPeerAddr); + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Cancel a create connection operation. + * + * \return None. + * + * Cancel a connection before it is established. This function is only used when operating + * in master role. This command is used to cancel extended and legacy create connection. + */ +/*************************************************************************************************/ +void LlCreateConnCancel(void) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO0("### LlApi ### LlCreateConnCancel"); + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + if (lmgrCb.useExtCmds) + { + pMsg->dispId = LCTR_DISP_EXT_INIT; + } + else + { + pMsg->dispId = LCTR_DISP_INIT; + } + /* LCTR_EXT_INIT_MSG_INITIATE_CANCEL and LCTR_INIT_MSG_INITIATE_CANCEL shall be aligned. */ + pMsg->event = LCTR_INIT_MSG_INITIATE_CANCEL; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..2c1e23434ae0fcab451e1c8c8c6a83f38f19b9dc --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_master_ae.c @@ -0,0 +1,194 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) master extended control interface implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_adv_master_ae.h" +#include "lctr_api_init_master_ae.h" +#include "lmgr_api_adv_master_ae.h" +#include "ll_math.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Validate extended initiate parameters. + * + * \param pParam Pointer to initiation parameters. + * + * \return TRUE if valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t llValidateInitiateParams(const LlExtInitParam_t *pParam) +{ + const uint8_t filtPolicyMax = ((lmgrCb.features & LL_FEAT_EXT_SCAN_FILT_POLICY) != 0) ? LL_SCAN_FILTER_WL_OR_RES_INIT : LL_SCAN_FILTER_WL_BIT; + const uint8_t addrTypeMax = ((lmgrCb.features & LL_FEAT_PRIVACY) != 0) ? LL_ADDR_RANDOM_IDENTITY : LL_ADDR_RANDOM; + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->ownAddrType > addrTypeMax) || + (pParam->peerAddrType > addrTypeMax) || + (pParam->filterPolicy > filtPolicyMax) || + !LmgrIsAddressTypeAvailable(pParam->ownAddrType))) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Validate extended initiate scan parameters. + * + * \param pParam Pointer to scan parameters. + * + * \return TRUE if valid, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t llValidateInitiateScanParams(const LlExtInitScanParam_t *pParam) +{ + const uint16_t rangeMin = 0x0004; /* 2.5 ms */ + /* const uint16_t rangeMax = 0xFFFF; */ /* 40.959375 ms */ + + if ((LL_API_PARAM_CHECK == 1) && + ((pParam->scanInterval < pParam->scanWindow) || (pParam->scanWindow < rangeMin))) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Extended create connection. + * + * \param pInitParam Initiating parameters. + * \param scanParam Scan parameters table indexed by PHY. + * \param connSpec Connection specification table indexed by PHY. + * + * \return Status error code. + * + * Create a connection to the specified peer address with the specified connection parameters. + * This function is only when operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlExtCreateConn(const LlExtInitParam_t *pInitParam, const LlExtInitScanParam_t scanParam[], const LlConnSpec_t connSpec[]) +{ + unsigned int i; + lctrExtInitiateMsg_t *pMsg; + const uint8_t validInitPhys = LL_PHYS_LE_1M_BIT | LL_PHYS_LE_2M_BIT | LL_PHYS_LE_CODED_BIT; + const uint8_t numInitPhyBits = LlMathGetNumBitsSet(pInitParam->initPhys); + + LL_TRACE_INFO1("### LlApi ### LlExtCreateConn: initPhys=0x%02x", pInitParam->initPhys); + + WSF_ASSERT(pInitParam); /* not NULL */ + + if ((LL_API_PARAM_CHECK == 1) && + (!LmgrIsExtCommandAllowed() || + lmgrCb.numInitEnabled)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((pInitParam->initPhys & ~validInitPhys) || (pInitParam->initPhys == 0))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((LL_API_PARAM_CHECK == 1) && + (!llValidateInitiateParams(pInitParam))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if (LL_API_PARAM_CHECK == 1) + { + for (i = 0; i < numInitPhyBits; i++) + { + if (!llValidateInitiateScanParams(&scanParam[i])) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + } + } + + lmgrCb.numExtScanPhys = 0; + i = 0; + + if (pInitParam->initPhys & LL_PHYS_LE_1M_BIT) + { + LctrMstExtInitSetScanPhy(LCTR_SCAN_PHY_1M); + lmgrCb.numExtScanPhys++; + LctrMstExtInitParam(LCTR_SCAN_PHY_1M, &scanParam[i], &connSpec[i]); + i++; + } + else + { + LctrMstExtInitClearScanPhy(LCTR_SCAN_PHY_1M); + /* Provide default connSpec. */ + LctrMstExtInitParam(LCTR_SCAN_PHY_1M, NULL, &connSpec[0]); + } + + if (pInitParam->initPhys & LL_PHYS_LE_2M_BIT) + { + /* Skip scanner settings, 2M PHY scanning not allowed; store only the 2M PHY connSpec. */ + LctrMstExtInitParam(LCTR_INIT_PHY_2M, NULL, &connSpec[i]); + i++; + } + else + { + /* Provide default connSpec. */ + LctrMstExtInitParam(LCTR_INIT_PHY_2M, NULL, &connSpec[0]); + } + + if (pInitParam->initPhys & LL_PHYS_LE_CODED_BIT) + { + LctrMstExtInitSetScanPhy(LCTR_SCAN_PHY_CODED); + lmgrCb.numExtScanPhys++; + LctrMstExtInitParam(LCTR_SCAN_PHY_CODED, &scanParam[i], &connSpec[i]); + i++; + } + else + { + LctrMstExtInitClearScanPhy(LCTR_SCAN_PHY_CODED); + /* Provide default connSpec. */ + LctrMstExtInitParam(LCTR_SCAN_PHY_CODED, NULL, &connSpec[0]); + } + + if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.dispId = LCTR_DISP_EXT_INIT; + pMsg->hdr.event = LCTR_EXT_INIT_MSG_INITIATE; + + pMsg->filterPolicy = pInitParam->filterPolicy; + pMsg->ownAddrType = pInitParam->ownAddrType; + pMsg->peerAddrType = pInitParam->peerAddrType; + pMsg->peerAddr = BstreamToBda64(pInitParam->pPeerAddr); + pMsg->initPhys = pInitParam->initPhys; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..4606d8bae10b113ba8cca329db7a8488a0a43fd5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_conn_slave.c @@ -0,0 +1,67 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave control interface implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_conn.h" +#include "lmgr_api.h" +#include "wsf_msg.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Read remote features. + * + * \param handle Connection handle. + * + * \return Status error code. + * + * Read the link layer features of the remote device. + */ +/*************************************************************************************************/ +uint8_t LlReadRemoteFeat(uint16_t handle) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlReadRemoteFeat, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_REMOTE_FEATURE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->handle = handle; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_MSG_API_REMOTE_FEATURE; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_diag.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_diag.c new file mode 100644 index 0000000000000000000000000000000000000000..f30515a9b88470b5e6a051c209dcfaebb9243b81 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_diag.c @@ -0,0 +1,73 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) test interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "lmgr_api.h" +#include "bb_api.h" +#include "bb_drv.h" + +/*************************************************************************************************/ +/*! + * \brief Get the current FRC time. + * + * \param pTime Pointer to return the current time. + * + * \return Status error code. + * + * Get the current FRC time. + * + * \note FRC is limited to the same bit-width as the BB clock. Return value is available + * only when the BB is active. + */ +/*************************************************************************************************/ +uint8_t LlGetTime(uint32_t *pTime) +{ + /* Only use BB clock when the BB is active. */ + if ((lmgrCb.numConnEnabled == 0) && + !lmgrCb.advEnabled && + !lmgrCb.numExtAdvEnabled && + !lmgrCb.numScanEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + *pTime = BbDrvGetCurrentTime(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the difference between two timestamps in microseconds. + * + * \param endTime Ending time. + * \param startTime Starting time. + * + * \return Time in microseconds. + * + * Calculate the difference between two timestamps in microseconds. + */ +/*************************************************************************************************/ +uint32_t LlCalcDeltaTimeUsec(uint32_t endTime, uint32_t startTime) +{ + return BB_TICKS_TO_US(endTime - startTime); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_dtm.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_dtm.c new file mode 100644 index 0000000000000000000000000000000000000000..afe3cc69a5dd0f2230caaf0989f08786dde19405 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_dtm.c @@ -0,0 +1,1016 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) DTM interface implementation file. + */ +/*************************************************************************************************/ + +#include "ll_api.h" +#include "ll_defs.h" +#include "lctr_api.h" +#include "lmgr_api_adv_slave.h" +#include "sch_api.h" +#include "bb_api.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "bb_ble_drv.h" +#include "wsf_buf.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> + +/* Access internal definitions. */ +#include "../lctr/lctr_int.h" + +#if (LL_ENABLE_TESTER) +#include "ll_tester_api.h" +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum DTM payload length. */ +#define LL_DTM_MAX_PLD_LEN (BB_DATA_PLD_MAX_LEN + BB_DATA_PDU_TAILROOM) + +/*! \brief Capable maximum DTM PDU length. */ +#define LL_DTM_MAX_PDU_LEN (LL_DTM_HDR_LEN + LL_DTM_MAX_PLD_LEN) + +/*! \brief Test states. */ +enum +{ + LL_TEST_STATE_IDLE = 0, /*!< Disabled state */ + LL_TEST_STATE_TX = 1, /*!< Tx enabled state */ + LL_TEST_STATE_RX = 2, /*!< Rx enabled state */ + LL_TEST_STATE_TERM = 3, /*!< Terminating state */ + LL_TEST_STATE_RESET = 4 /*!< Reset state. */ +}; + +/*! \brief Test task messages for LCTR_DISP_TEST dispatcher. */ +enum +{ + /* Broadcast events */ + LL_TEST_MSG_RESET = LCTR_MSG_RESET, + /* Test events */ + LL_TEST_MSG_TERMINATE /* Test BOD terminated event. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Test mode control block. */ +static struct +{ + uint8_t state; /*!< Test mode enable state. */ + uint16_t numPkt; /*!< Number of packet operations for auto-termination of tests. */ + LlTestReport_t rpt; /*!< Test report. */ + + struct + { + uint8_t pduLen; /*!< Transmit PDU buffer length. */ + uint8_t pktType; /*!< Transmit packet type. */ + uint8_t chanIdx; /*!< Transmit channel. */ + uint8_t phy; /*!< Transmit PHY. */ + uint16_t phyOptions; /*!< Transmit PHY options. */ + uint32_t pktInterUsec; /*!< Transmit packet interval. */ + uint32_t errPattern; /*!< Error pattern. */ + uint32_t errBit; /*!< Error bit. */ + } tx; /*!< Transmit parameters. */ +} llTestCb; + +/*************************************************************************************************/ +/*! + * \brief Calculate packet interval. + * + * \param len Packet length. + * \param phy PHY. + * \param phyOptions PHY options. + * + * \return Packet length in microseconds. + */ +/*************************************************************************************************/ +static uint32_t llCalcPacketInterval(uint8_t len, uint8_t phy, uint8_t phyOptions) +{ + unsigned int totalTime; + + switch (phy) + { + case BB_PHY_BLE_CODED: + totalTime = (LL_PREAMBLE_LEN_CODED_BITS + (LL_AA_LEN * 8) + LL_CI_LEN_BITS + LL_TERM1_LEN_BITS) * LL_BLE_US_PER_BIT_CODED_S8; + switch (phyOptions) + { + case BB_PHY_OPTIONS_BLE_S2: + totalTime += ((LL_DTM_HDR_LEN + len + LL_CRC_LEN) * LL_BLE_US_PER_BYTE_CODED_S2) + (LL_TERM2_LEN_BITS * LL_BLE_US_PER_BIT_CODED_S2); + break; + default: + case BB_PHY_OPTIONS_BLE_S8: + totalTime += ((LL_DTM_HDR_LEN + len + LL_CRC_LEN) * LL_BLE_US_PER_BYTE_CODED_S8) + (LL_TERM2_LEN_BITS * LL_BLE_US_PER_BIT_CODED_S8); + break; + } + break; + case BB_PHY_BLE_2M: + totalTime = (LL_PREAMBLE_LEN_2M + LL_AA_LEN + LL_DTM_HDR_LEN + len + LL_CRC_LEN) * LL_BLE_US_PER_BYTE_2M; + break; + case BB_PHY_BLE_1M: + default: + totalTime = (LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_DTM_HDR_LEN + len + LL_CRC_LEN) * LL_BLE_US_PER_BYTE_1M; + break; + } + + /* ceil((L + 249) / 625) * 625 */ + return LL_MATH_DIV_625(totalTime + 249 + 624) * 625; +} + +/*************************************************************************************************/ +/*! + * \brief Convert channel number to channel index. + * + * \param rfChan RF channel number. + * + * \return Channel index. + */ +/*************************************************************************************************/ +uint8_t llConvertRfChanToChanIdx(uint8_t rfChan) +{ + if (rfChan == 0) + { + return 37; + } + else if (rfChan <= 11) + { + return rfChan - 1; + } + else if (rfChan == 12) + { + return 38; + } + else if (rfChan <= 38) + { + return rfChan - 2; + } + else /* if (rfChan == 39) */ + { + return 39; + } +} + +/*************************************************************************************************/ +/*! + * \brief Fill buffer with random payload values. + * + * \param pBuf Buffer to fill. + * \param len Number of bytes to fill. + * + * \return None. + * + * Fill payload with random numbers. + */ +/*************************************************************************************************/ +static void llPrbs9Payload(uint8_t *pBuf, uint8_t len) +{ + const uint32_t lfsrInit = 0x1FF; + const uint32_t bitsPerByte = 8; + + unsigned int bit; + unsigned int bitNum; + uint32_t lfsr = lfsrInit; + + while (len-- > 0) + { + /* Empty buffer (initial value contains first byte). */ + *(pBuf++) = (uint8_t)lfsr; + + /* Calculate next 8 bits. */ + bitNum = bitsPerByte; + while (bitNum-- > 0) + { + /* Cycle PRBS9 sequence; taps are 5th (bit 4) and 9th (bit 0) position. */ + bit = ((lfsr >> 4) ^ (lfsr >> 0)) & 1; + lfsr = (lfsr >> 1) | (bit << 8); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Buikld transmit buffer. + * + * \param len Length of test data. + * \param pktType Test packet payload type. + * \param pBuf Tx buffer. + * + * Build DTM packet header and payload buffer. + */ +/*************************************************************************************************/ +static void llBuildTxPkt(uint8_t len, uint8_t pktType, uint8_t *pBuf) +{ + /* Fill header. */ + *pBuf++ = pktType; + *pBuf++ = len; + + /* Fill payload. */ + switch (pktType) + { + case LL_TEST_PKT_TYPE_0F: + memset(pBuf, 0x0F, len); + break; + case LL_TEST_PKT_TYPE_55: + memset(pBuf, 0x55, len); + break; + case LL_TEST_PKT_TYPE_FF: + memset(pBuf, 0xFF, len); + break; + case LL_TEST_PKT_TYPE_00: + memset(pBuf, 0x00, len); + break; + case LL_TEST_PKT_TYPE_F0: + memset(pBuf, 0xF0, len); + break; + case LL_TEST_PKT_TYPE_AA: + memset(pBuf, 0xAA, len); + break; + case LL_TEST_PKT_TYPE_PRBS9: + llPrbs9Payload(pBuf, len); + break; + case LL_TEST_PKT_TYPE_PRBS15: + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Tx operation end callback. + * + * \param pOp Tx operation descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +static void llTestTxOpEndCback(BbOpDesc_t *pOp) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleTestTx_t * const pTx = &pBle->op.testTx; + + llTestCb.rpt.numTx++; + + if ((llTestCb.numPkt > 0) && (llTestCb.numPkt == llTestCb.rpt.numTx)) + { + /* Auto terminate. */ + LlEndTest(NULL); + } + + if (llTestCb.state == LL_TEST_STATE_TX) + { + /* Check for changes in operating parameters. */ + if ((llTestCb.tx.chanIdx != pBle->chan.chanIdx) || + (llTestCb.tx.pktType != pTx->pTxBuf[0]) || + (llTestCb.tx.pduLen != pTx->pTxBuf[1]) || + (llTestCb.tx.phy != pBle->chan.txPhy) || + (llTestCb.tx.phyOptions != pBle->chan.initTxPhyOptions)) + { + /* Update operational parameters. */ + pBle->chan.chanIdx = llTestCb.tx.chanIdx; + pBle->chan.rxPhy = llTestCb.tx.phy; + pBle->chan.txPhy = llTestCb.tx.phy; + pBle->chan.initTxPhyOptions = llTestCb.tx.phyOptions; + pBle->chan.tifsTxPhyOptions = 0; /* Field not used. */ + pTx->txLen = LL_DTM_HDR_LEN + llTestCb.tx.pduLen; + pTx->pktInterUsec = llCalcPacketInterval(llTestCb.tx.pduLen, pBle->chan.txPhy, pBle->chan.initTxPhyOptions); + + /* Build packet buffer. */ + llBuildTxPkt(llTestCb.tx.pduLen, llTestCb.tx.pktType, pTx->pTxBuf); + } + + /* Reschedule transmit. */ + SchInsertNextAvailable(pOp); + } + else + { + WsfBufFree(pTx->pTxBuf); + WsfBufFree(pBle); + WsfBufFree(pOp); + + BbStop(BB_PROT_BLE_DTM); + + if (llTestCb.state == LL_TEST_STATE_RESET) + { + lctrMsgHdr_t *pMsg; + + /* Send SM an test termination event. */ + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->handle = 0; */ /* not used */ + pMsg->dispId = LCTR_DISP_TEST; + pMsg->event = LL_TEST_MSG_TERMINATE; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + else + { + /* Terminate immediately. */ + llTestCb.state = LL_TEST_STATE_IDLE; + lmgrCb.testEnabled = FALSE; + LmgrDecResetRefCount(); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Complete a receive. + * + * \param pOp Operation context. + * \param status Receive status. + * + * \return TRUE if next receive should be set up. + */ +/*************************************************************************************************/ +static bool_t llTestTxCb(BbOpDesc_t *pOp, uint8_t status) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleTestTx_t * const pTx = &pBle->op.testTx; + bool_t err; + + llTestCb.rpt.numTx++; + + /* All of the requested packets have been sent. */ + if ((llTestCb.numPkt > 0) && (llTestCb.numPkt == llTestCb.rpt.numTx)) + { + return FALSE; + } + + if (llTestCb.state == LL_TEST_STATE_TX) + { + /* Operating parameters have changed. */ + if ((llTestCb.tx.chanIdx != pBle->chan.chanIdx) || + (llTestCb.tx.pktType != pTx->pTxBuf[0]) || + (llTestCb.tx.pduLen != pTx->pTxBuf[1]) || + (llTestCb.tx.phy != pBle->chan.txPhy)) + { + return FALSE; + } + + /* Update CRC for PER testing. */ + err = ((llTestCb.tx.errPattern & (1 << llTestCb.tx.errBit)) != 0) ? FALSE : TRUE; + llTestCb.tx.errBit = (llTestCb.tx.errBit + 1) & (32 - 1); + pBle->chan.crcInit = err ? (LL_DTM_CRC_INIT ^ 0xFFFFFF) : LL_DTM_CRC_INIT; +#if (LL_ENABLE_TESTER) + pBle->chan.crcInitTx = pBle->chan.crcInit ^ llTesterCb.dataCrcInitTx; +#endif + } + else + { + /* DTM has ended. */ + return FALSE; + } + + /* Continue transmitting next packet. */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Enter enhanced transmit test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param len Length of test data. + * \param pktType Test packet payload type. + * \param phy Transmitter PHY. + * \param numPkt Auto terminate after number of packets, 0 for infinite. + * + * \return Status error code. + * + * Start the transmit test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlEnhancedTxTest(uint8_t rfChan, uint8_t len, uint8_t pktType, uint8_t phy, uint16_t numPkt) +{ + BbOpDesc_t *pOp; + BbBleData_t *pBle; + BbBleTestTx_t *pTx; + + WSF_CS_INIT(cs); + + LL_TRACE_INFO3("### LlApi ### LlTxTest, rfChan=%u, len=%u, pktType=%u", rfChan, len, pktType); + + if ((LL_API_PARAM_CHECK == 1) && + (!((llTestCb.state == LL_TEST_STATE_IDLE) || (llTestCb.state == LL_TEST_STATE_TX)) || + (lmgrCb.numConnEnabled > 0) || + lmgrCb.advEnabled || + lmgrCb.numExtAdvEnabled || + lmgrCb.numScanEnabled || + lmgrCb.numInitEnabled)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Extra parameter checks for dynamic changes. */ + if ((LL_API_PARAM_CHECK == 1) && + (llTestCb.state == LL_TEST_STATE_TX)) + { + /* Do not allow transition from CBS to packet mode dynamically or vice-versa. */ + if (((pktType == LL_TEST_PKT_TYPE_PRBS15) && (llTestCb.tx.pktType != LL_TEST_PKT_TYPE_PRBS15)) || + ((pktType != LL_TEST_PKT_TYPE_PRBS15) && (llTestCb.tx.pktType == LL_TEST_PKT_TYPE_PRBS15))) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + } + + if ((LL_API_PARAM_CHECK == 1) && + ((rfChan > LL_DTM_MAX_CHAN_IDX) || + /* (len > LL_DTM_PDU_ABS_MAX_LEN) || */ /* always valid since len is uint8_t. */ + (pktType > LL_TEST_PKT_TYPE_AA) || + ((phy < LL_TEST_PHY_LE_1M) || (phy > LL_TEST_PHY_LE_CODED_S2)))) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + /* Check whether PHY is supported. */ + switch (phy) + { + case LL_TEST_PHY_LE_2M: + if ((lmgrCb.features & LL_FEAT_LE_2M_PHY) == 0) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + break; + case LL_TEST_PHY_LE_CODED_S2: + case LL_TEST_PHY_LE_CODED_S8: + if ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) == 0) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + break; + } + + if (llTestCb.state == LL_TEST_STATE_IDLE) + { + /* Init test state. */ + memset(&llTestCb.rpt, 0, sizeof(llTestCb.rpt)); + } + + /* Handle non-packet test mode. */ + if (pktType == LL_TEST_PKT_TYPE_PRBS15) + { + llTestCb.state = LL_TEST_STATE_TX; + llTestCb.tx.pktType = pktType; + + BbStart(BB_PROT_PRBS15); + + lmgrCb.testEnabled = TRUE; + LmgrIncResetRefCount(); + + return LL_SUCCESS; + } + + /* Restrict length to maximum. */ + len = WSF_MIN(len, WSF_MAX(LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN, LL_DTM_MAX_PLD_LEN)); + + /* Modify operational parameters. */ + WSF_CS_ENTER(cs); + llTestCb.tx.pduLen = WSF_MIN(len, WSF_MAX(LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN, LL_DTM_MAX_PLD_LEN)); + llTestCb.tx.pktType = pktType; + llTestCb.tx.chanIdx = llConvertRfChanToChanIdx(rfChan); + switch (phy) + { + case LL_TEST_PHY_LE_1M: + llTestCb.tx.phy = BB_PHY_BLE_1M; + llTestCb.tx.phyOptions = BB_PHY_OPTIONS_DEFAULT; + break; + case LL_TEST_PHY_LE_2M: + llTestCb.tx.phy = BB_PHY_BLE_2M; + llTestCb.tx.phyOptions = BB_PHY_OPTIONS_DEFAULT; + break; + case LL_TEST_PHY_LE_CODED_S2: + llTestCb.tx.phy = BB_PHY_BLE_CODED; + llTestCb.tx.phyOptions = BB_PHY_OPTIONS_BLE_S2; + break; + case LL_TEST_PHY_LE_CODED_S8: + llTestCb.tx.phy = BB_PHY_BLE_CODED; + llTestCb.tx.phyOptions = BB_PHY_OPTIONS_BLE_S8; + break; + } + + llTestCb.tx.errPattern = 0xFFFFFFFF; + llTestCb.tx.errBit = 0; + WSF_CS_EXIT(cs); + + if (llTestCb.state == LL_TEST_STATE_TX) + { + return LL_SUCCESS; + } + + if ((pOp = WsfBufAlloc(sizeof(BbOpDesc_t))) == NULL) + { + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + if ((pBle = WsfBufAlloc(sizeof(BbBleData_t))) == NULL) + { + WsfBufFree(pOp); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + pTx = &pBle->op.testTx; + + memset(pOp, 0, sizeof(*pOp)); + memset(pBle, 0, sizeof(*pBle)); + pOp->prot.pBle = pBle; + + /*** General Setup ***/ + + llTestCb.numPkt = numPkt; + pOp->protId = BB_PROT_BLE_DTM; + pOp->endCback = llTestTxOpEndCback; + pOp->dueOffsetUsec = 0; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_TEST_TX; + pBle->chan.chanIdx = llTestCb.tx.chanIdx; + pBle->chan.accAddr = LL_DTM_SYNC_WORD; + pBle->chan.crcInit = LL_DTM_CRC_INIT; + pBle->chan.txPower = lmgrCb.advTxPwr; + pBle->chan.rxPhy = llTestCb.tx.phy; + pBle->chan.initTxPhyOptions = llTestCb.tx.phyOptions; + /* pBle->chan.tifsTxPhyOptions = 0; */ /* Field not used. */ + pBle->chan.txPhy = pBle->chan.rxPhy; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrTx = LL_DTM_SYNC_WORD ^ llTesterCb.dataAccessAddrTx; + pBle->chan.crcInitTx = LL_DTM_CRC_INIT ^ llTesterCb.dataCrcInitTx; +#endif + + /*** BLE Tx Test Setup ***/ + + /* Longest packet for dynamic test changes. */ + pTx->txLen = WSF_MAX(LL_DTM_MAX_PDU_LEN, LL_ADVB_MAX_LEN); + pTx->testCback = llTestTxCb; + pTx->pktInterUsec = llCalcPacketInterval(llTestCb.tx.pduLen, pBle->chan.txPhy, pBle->chan.initTxPhyOptions); + + if ((pTx->pTxBuf = WsfBufAlloc(pTx->txLen)) == NULL) + { + WsfBufFree(pBle); + WsfBufFree(pOp); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + llBuildTxPkt(len, pktType, pTx->pTxBuf); + llTestCb.tx.pktInterUsec = pTx->pktInterUsec; + + /*** Commit operation ***/ + + llTestCb.state = LL_TEST_STATE_TX; + lmgrCb.testEnabled = TRUE; + LmgrIncResetRefCount(); + BbStart(BB_PROT_BLE_DTM); + SchInsertNextAvailable(pOp); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Enter transmit test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param len Length of test data. + * \param pktType Test packet payload type. + * \param numPkt Auto terminate after number of packets, 0 for infinite. + * + * \return Status error code. + * + * Start the transmit test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlTxTest(uint8_t rfChan, uint8_t len, uint8_t pktType, uint16_t numPkt) +{ + return LlEnhancedTxTest(rfChan, len, pktType, LL_TEST_PHY_LE_1M, numPkt); +} + +/*************************************************************************************************/ +/*! + * \brief Rx operation completion callback. + * + * \param pOp Rx operation descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +static void llTestRxOpEndCback(BbOpDesc_t *pOp) +{ + BbBleData_t * const pBle = pOp->prot.pBle; + BbBleTestRx_t * const pRx = &pBle->op.testRx; + + if (llTestCb.numPkt > 0) + { + uint32_t attempts = llTestCb.rpt.numRxSuccess + + llTestCb.rpt.numRxCrcError + + llTestCb.rpt.numRxTimeout; + + if (llTestCb.numPkt <= attempts) + { + /* Auto terminate. */ + LlEndTest(NULL); + } + } + + if (llTestCb.state == LL_TEST_STATE_RX) + { + /* Reschedule receive. */ + SchInsertNextAvailable(pOp); + } + else + { + WsfBufFree(pRx->pRxBuf); + WsfBufFree(pBle); + WsfBufFree(pOp); + + BbStop(BB_PROT_BLE_DTM); + + if (llTestCb.state == LL_TEST_STATE_RESET) + { + lctrMsgHdr_t *pMsg; + + /* Send SM an test termination event. */ + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + /* pMsg->handle = 0; */ /* not used */ + pMsg->dispId = LCTR_DISP_TEST; + pMsg->event = LL_TEST_MSG_TERMINATE; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + } + else + { + /* Terminate immediately. */ + llTestCb.state = LL_TEST_STATE_IDLE; + lmgrCb.testEnabled = FALSE; + LmgrDecResetRefCount(); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Complete a receive. + * + * \param pBod Pointer to the BOD to execute. + * \param status Receive status. + * + * \return TRUE if next receive should be set up. + */ +/*************************************************************************************************/ +static bool_t llTestRxCb(BbOpDesc_t *pBod, uint8_t status) +{ + switch (status) + { + case BB_STATUS_SUCCESS: + llTestCb.rpt.numRxSuccess++; + break; + case BB_STATUS_CRC_FAILED: + llTestCb.rpt.numRxCrcError++; + break; + case BB_STATUS_RX_TIMEOUT: + default: + llTestCb.rpt.numRxTimeout++; + break; + } + + /* All of the requested packets have been received. */ + if (llTestCb.numPkt > 0) + { + uint32_t attempts = llTestCb.rpt.numRxSuccess + + llTestCb.rpt.numRxCrcError + + llTestCb.rpt.numRxTimeout; + + if (llTestCb.numPkt <= attempts) + { + return FALSE; + } + } + + /* DTM has ended. */ + if (llTestCb.state != LL_TEST_STATE_RX) + { + return FALSE; + } + + /* Continue receiving next packet. */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Enter enhanced receive test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param phy Receiver PHY. + * \param modIdx Modulation index. + * \param numPkt Auto terminate after number of successful packets, 0 for infinite. + * + * \return Status error code. + * + * Start the receive test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlEnhancedRxTest(uint8_t rfChan, uint8_t phy, uint8_t modIdx, uint16_t numPkt) +{ + BbOpDesc_t *pOp; + BbBleData_t *pBle; + BbBleTestRx_t *pRx; + uint16_t allocLen; + + LL_TRACE_INFO1("### LlApi ### LlRxTest, rfChan=%u", rfChan); + + if ((LL_API_PARAM_CHECK == 1) && + ((llTestCb.state != LL_TEST_STATE_IDLE) || + (lmgrCb.numConnEnabled > 0) || + lmgrCb.advEnabled || + lmgrCb.numExtAdvEnabled || + lmgrCb.numScanEnabled || + lmgrCb.numInitEnabled)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((rfChan > LL_DTM_MAX_CHAN_IDX) || + ((phy < LL_TEST_PHY_LE_1M) || (phy > LL_TEST_PHY_LE_CODED)) || + (modIdx > LL_TEST_MOD_IDX_STABLE))) + { + return LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + /* Check whether PHY is supported. */ + switch (phy) + { + case LL_TEST_PHY_LE_2M: + if ((lmgrCb.features & LL_FEAT_LE_2M_PHY) == 0) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + break; + case LL_TEST_PHY_LE_CODED: + if ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) == 0) + { + return LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE; + } + break; + } + + if ((pOp = WsfBufAlloc(sizeof(BbOpDesc_t))) == NULL) + { + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + if ((pBle = WsfBufAlloc(sizeof(BbBleData_t))) == NULL) + { + WsfBufFree(pOp); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + pRx = &pBle->op.testRx; + + memset(pOp, 0, sizeof(*pOp)); + memset(pBle, 0, sizeof(*pBle)); + pOp->prot.pBle = pBle; + + /*** General Setup ***/ + + llTestCb.numPkt = numPkt; + pOp->protId = BB_PROT_BLE_DTM; + pOp->endCback = llTestRxOpEndCback; + pOp->dueOffsetUsec = 0; + + /*** BLE General Setup ***/ + + pBle->chan.opType = BB_BLE_OP_TEST_RX; + pBle->chan.chanIdx = llConvertRfChanToChanIdx(rfChan); + pBle->chan.accAddr = LL_DTM_SYNC_WORD; + pBle->chan.crcInit = LL_DTM_CRC_INIT; + /* pBle->txPwrLevel = 0; */ /* value ignored */ + switch (phy) + { + case LL_TEST_PHY_LE_1M: + pBle->chan.rxPhy = BB_PHY_BLE_1M; + break; + case LL_TEST_PHY_LE_2M: + pBle->chan.rxPhy = BB_PHY_BLE_2M; + break; + case LL_TEST_PHY_LE_CODED: + pBle->chan.rxPhy = BB_PHY_BLE_CODED; + break; + } + pBle->chan.txPhy = pBle->chan.rxPhy; + +#if (LL_ENABLE_TESTER) + pBle->chan.accAddrRx = LL_DTM_SYNC_WORD ^ llTesterCb.dataAccessAddrRx; + pBle->chan.crcInitRx = LL_DTM_CRC_INIT ^ llTesterCb.dataCrcInitRx; +#endif + + /*** BLE Rx Test Setup ***/ + + pRx->rxSyncDelayUsec = pLctrRtCfg->dtmRxSyncMs * 1000; + pRx->rxLen = WSF_MAX(LL_DTM_MAX_PDU_LEN, LL_ADVB_MAX_LEN); + pRx->testCback = llTestRxCb; + + allocLen = WSF_MAX(pRx->rxLen, BB_FIXED_DATA_PKT_LEN); + if ((pRx->pRxBuf = WsfBufAlloc(allocLen)) == NULL) + { + WsfBufFree(pBle); + WsfBufFree(pOp); + return LL_ERROR_CODE_UNSPECIFIED_ERROR; + } + + /*** Commit operation ***/ + + llTestCb.state = LL_TEST_STATE_RX; + lmgrCb.testEnabled = TRUE; + LmgrIncResetRefCount(); + memset(&llTestCb.rpt, 0, sizeof(llTestCb.rpt)); /* clear report */ + BbStart(BB_PROT_BLE_DTM); + SchInsertNextAvailable(pOp); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Enter receive test mode. + * + * \param rfChan RF channel number, i.e. "rfChan = (F - 2402) / 2)". + * \param numPkt Auto terminate after number of successful packets, 0 for infinite. + * + * \return Status error code. + * + * Start the receive test mode on the given channel. + */ +/*************************************************************************************************/ +uint8_t LlRxTest(uint8_t rfChan, uint16_t numPkt) +{ + return LlEnhancedRxTest(rfChan, LL_TEST_PHY_LE_1M, LL_TEST_MOD_IDX_STANDARD, numPkt); +} + +/*************************************************************************************************/ +/*! + * \brief End test mode. + * + * \param pRpt Report return buffer. + * + * \return Status error code. + * + * End test mode and return the report. + * + * \note Receive tests must wait for the duration of the synchronization timeout before + * another test can be issued. + */ +/*************************************************************************************************/ +uint8_t LlEndTest(LlTestReport_t *pRpt) +{ + LL_TRACE_INFO0("### LlApi ### LlEndTest"); + + if ((llTestCb.state == LL_TEST_STATE_TX) && + (llTestCb.tx.pktType == LL_TEST_PKT_TYPE_PRBS15)) + { + BbStop(BB_PROT_PRBS15); + llTestCb.state = LL_TEST_STATE_IDLE; + lmgrCb.testEnabled = FALSE; + LmgrDecResetRefCount(); + + return LL_SUCCESS; + } + + if ((llTestCb.state == LL_TEST_STATE_TX) || (llTestCb.state == LL_TEST_STATE_RX)) + { + /* Signal termination. */ + llTestCb.state = LL_TEST_STATE_TERM; + BbCancelBod(); + } + else + { + LL_TRACE_WARN1("Test not running, state=%u", llTestCb.state); + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if (pRpt) + { + *pRpt = llTestCb.rpt; + } + + LL_TRACE_INFO1("Test completed, numTx=%u", llTestCb.rpt.numTx); + LL_TRACE_INFO1(" numRxSuccess=%u", llTestCb.rpt.numRxSuccess); + LL_TRACE_INFO1(" numRxCrcError=%u", llTestCb.rpt.numRxCrcError); + LL_TRACE_INFO1(" numRxTimeout=%u", llTestCb.rpt.numRxTimeout); + + memset(&llTestCb.rpt, 0, sizeof(llTestCb.rpt)); /* clear report */ + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set pattern of errors for Tx test mode. + * + * \param pattern Error pattern (1s = no error; 0s = CRC failure). + * + * \return Status error code. + * + * Set pattern of errors for Tx test mode. + * + * \note The error pattern must be set after the Tx test is started. + */ +/*************************************************************************************************/ +uint8_t LlSetTxTestErrorPattern(uint32_t pattern) +{ + llTestCb.tx.errPattern = pattern; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Test reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void llTestResetHandler(void) +{ + memset(&llTestCb, 0, sizeof(llTestCb)); + llTestCb.tx.errPattern = 0xFFFFFFFF; +} + +/*************************************************************************************************/ +/*! + * \brief Test message dispatcher. + * + * \param pMsg Pointer to message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void llTestDisp(lctrMsgHdr_t *pMsg) +{ + switch (pMsg->event) + { + case LL_TEST_MSG_RESET: + if (lmgrCb.testEnabled) + { + LlEndTest(NULL); + if (llTestCb.state == LL_TEST_STATE_TERM) + { + /* Terminate will send confirm. */ + llTestCb.state = LL_TEST_STATE_RESET; + } + } + break; + + case LL_TEST_MSG_TERMINATE: + llTestCb.state = LL_TEST_STATE_IDLE; + lmgrCb.testEnabled = FALSE; + LmgrDecResetRefCount(); + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer controller resources for test. + * + * \return None. + */ +/*************************************************************************************************/ +void LlTestInit(void) +{ + llTestResetHandler(); + + /* Add test reset handler. */ + lctrResetHdlrTbl[LCTR_DISP_TEST] = llTestResetHandler; + + /* Add test message dispatchers. */ + lctrMsgDispTbl[LCTR_DISP_TEST] = (LctrMsgDisp_t)llTestDisp; + + BbBleTestInit(); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_master.c new file mode 100644 index 0000000000000000000000000000000000000000..ce68e5316b8b5856d892b148d8404a806a4b53af --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_master.c @@ -0,0 +1,83 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave control interface implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_conn.h" +#include "lmgr_api.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Start encryption. + * + * \param handle Connection handle. + * \param pRand Pointer to the random number. + * \param diversifier Diversifier value. + * \param pKey Pointer to the encryption key. + * + * \return Status error code. + * + * Start or restart link layer encryption on a connection. This function is only used when + * operating in master role. + */ +/*************************************************************************************************/ +uint8_t LlStartEncryption(uint16_t handle, const uint8_t *pRand, uint16_t diversifier, const uint8_t *pKey) +{ + lctrStartEnc_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlStartEncryption, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_START_ENC) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + (LctrGetRole(handle) != LL_ROLE_MASTER)) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrStartEnc_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_START_ENC; + + memcpy(pMsg->rand, pRand, sizeof(pMsg->rand)); + pMsg->diversifier = diversifier; + memcpy(pMsg->key, pKey, sizeof(pMsg->key)); + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..f60cecc102e6aa45706ad0c50375d6d26d9fef24 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_enc_slave.c @@ -0,0 +1,278 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) slave control interface implementation file. + */ +/*************************************************************************************************/ + +#include "lctr_api_conn.h" +#include "lmgr_api.h" +#include "ll_math.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Encrypt data. + * + * \param pKey Encryption key. + * \param pData 16 bytes of plain text data. + * + * \return Status error code. + * + * Request the LL to encrypt a block of data in place. + */ +/*************************************************************************************************/ +uint8_t LlEncrypt(uint8_t *pKey, uint8_t *pData) +{ + LL_TRACE_INFO0("### LlApi ### LlEncrypt"); + + LlMathAesEcb(pKey, pData, pData); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Reply to a LTK request. + * + * \param handle Connection handle. + * \param pKey Pointer to new key. + * + * \return None. + * + * Provide the requested LTK encryption key. This function is only used when operating in + * slave mode. + */ +/*************************************************************************************************/ +uint8_t LlLtkReqReply(uint16_t handle, const uint8_t *pKey) +{ + lctrLtkReply_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlLtkReqReply, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((LctrGetRole(handle) != LL_ROLE_SLAVE) || + !LctrIsWaitingForReply(handle, LCTR_HOST_REPLY_LTK_REQ))) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrLtkReply_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_LTK_REPLY; + + memcpy(pMsg->key, pKey, sizeof(pMsg->key)); + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Negative reply to a LTK request. + * + * \param handle Connection handle. + * + * \return None. + * + * Requested LTK encryption key not available. This function is only used when operating in + * slave mode. + */ +/*************************************************************************************************/ +uint8_t LlLtkReqNegReply(uint16_t handle) +{ + lctrMsgHdr_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlLtkReqNegReply, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((LctrGetRole(handle) != LL_ROLE_SLAVE) || + !LctrIsWaitingForReply(handle, LCTR_HOST_REPLY_LTK_REQ))) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + if ((pMsg = (lctrMsgHdr_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->handle = handle; + pMsg->dispId = LCTR_DISP_CONN; + pMsg->event = LCTR_CONN_MSG_API_LTK_NEG_REPLY; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read authenticated payload timeout value. + * + * \param handle Connection handle. + * \param pTimeout Pointer to timeout value in 10 millisecond units. + * + * \return Status error code. + * + * Read authenticated payload timeout value for the given handle. + */ +/*************************************************************************************************/ +uint8_t LlReadAuthPayloadTimeout(uint16_t handle, uint16_t *pTimeout) +{ + uint32_t timeoutMs; + + LL_TRACE_INFO1("### LlApi ### LlReadAuthPayloadTimeout, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + timeoutMs = LctrGetAuthPayloadTimeout(handle); + /* Convert to 10-milliseconds units. */ + *pTimeout = LL_MATH_DIV_10(timeoutMs); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Write authenticated payload timeout value. + * + * \param handle Connection handle. + * \param timeout New timeout value in 10 millisecond units. + * + * \return Status error code. + * + * Write new authenticated payload timeout value for the given handle. + */ +/*************************************************************************************************/ +uint8_t LlWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout) +{ + uint32_t timeoutMs; + const uint16_t timeoutMin = 0x0001; /* 10 ms */ + /* const uint16_t timeoutMax = 0xFFFF; */ /* 655,350 ms */ + + LL_TRACE_INFO2("### LlApi ### LlWriteAuthPayloadTimeout, handle=%u, timeout=%u", handle, timeout); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if ((LL_API_PARAM_CHECK == 1) && + (timeout < timeoutMin)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Convert to milliseconds. */ + timeoutMs = timeout * 10; + + if (!LctrSetAuthPayloadTimeout(handle, timeoutMs)) + { + return LL_ERROR_CODE_INVALID_LMP_PARAMS; + } + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode Storage for encryption mode. + * + * \return Status error code. + * + * Get the encryption mode used by a connection. + */ +/*************************************************************************************************/ +uint8_t LlGetEncMode(uint16_t handle, LlEncMode_t *pMode) +{ + LL_TRACE_INFO1("### LlApi ### LlGetEncMode, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + LctrGetEncMode(handle, pMode); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set encryption mode used in a connection. + * + * \param handle Connection handle. + * \param pMode New encryption mode. + * + * \return Status error code. + * + * Set the encryption mode used by a connection. Must be called before encryption is started or + * when encryption is paused. + */ +/*************************************************************************************************/ +uint8_t LlSetEncMode(uint16_t handle, const LlEncMode_t *pMode) +{ + LL_TRACE_INFO1("### LlApi ### LlSetEncMode, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + if (LctrSetEncMode(handle, pMode)) + { + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_phy.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..227230aa159f5895a340effa317e125c8e60d1ff --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_phy.c @@ -0,0 +1,224 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) PHY features control interface implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api.h" +#include "lctr_api_phy.h" +#include "lmgr_api_conn.h" +#include "lctr_api_conn.h" +#include "wsf_msg.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Read current transmitter PHY and receive PHY. + * + * \param handle Connection handle. + * \param pTxPhy Storage for transmitter PHY. + * \param pRxPhy Storage for receiver PHY. + * + * \return Status error code. + * + * Read current transmitter PHY and receive PHY. + */ +/*************************************************************************************************/ +uint8_t LlReadPhy(uint16_t handle, uint8_t *pTxPhy, uint8_t *pRxPhy) +{ + LL_TRACE_INFO1("### LlApi ### LlReadPhy, handle=%u", handle); + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + *pTxPhy = LctrGetTxPhy(handle); + *pRxPhy = LctrGetRxPhy(handle); + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Validate PHY preferences. + * + * \param allPhys All PHYs preferences. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * \param phyOptions PHY options. + * + * \return TRUE if PHY preferences are valid. + */ +/*************************************************************************************************/ +static bool_t llValidatePhyPreferences(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions) +{ + const uint8_t allPhysMask = LL_ALL_PHY_TX_PREFERENCE_BIT | LL_ALL_PHY_RX_PREFERENCE_BIT; + const uint8_t phyMask = LL_PHYS_LE_1M_BIT | LL_PHYS_LE_2M_BIT | LL_PHYS_LE_CODED_BIT; + + if (((allPhys & ~allPhysMask) != 0) || /* no unknown all PHYs preferences */ + ((txPhys & ~phyMask) != 0) || /* no unknown Tx PHYs */ + ((rxPhys & ~phyMask) != 0) || /* no unknown Rx PHYs */ + (((allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) == 0) && (txPhys == 0)) || /* at least one Tx PHY if preference */ + (((allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) == 0) && (rxPhys == 0)) || /* at least one Rx PHY if preference */ + (phyOptions > LL_PHY_OPTIONS_S8_PREFERRED)) /* no unknown PHY options */ + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Determine supported PHYs. + * + * \return Supported PHYs. + */ +/*************************************************************************************************/ +static uint8_t lctrSuppPhys(void) +{ + uint8_t phys = LL_PHYS_LE_1M_BIT; + if ((lmgrCb.features & LL_FEAT_LE_2M_PHY) != 0) + { + phys |= LL_PHYS_LE_2M_BIT; + } + if ((lmgrCb.features & LL_FEAT_LE_CODED_PHY) != 0) + { + phys |= LL_PHYS_LE_CODED_BIT; + } + return phys; +} + +/*************************************************************************************************/ +/*! + * \brief Set default PHYs. + * + * \param allPhys All PHYs preferences. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * + * \return Status error code. + * + * Specify the preferred values for the transmitter PHY and receiver PHY to be used for all + * subsequent connections over the LE transport. + */ +/*************************************************************************************************/ +uint8_t LlSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys) +{ + LL_TRACE_INFO0("### LlApi ### LlSetDefaultPhy"); + + /* Ignore unsupported PHYs. */ + txPhys &= lctrSuppPhys(); + rxPhys &= lctrSuppPhys(); + + if ((LL_API_PARAM_CHECK == 1) && + !llValidatePhyPreferences(allPhys, txPhys, rxPhys, LL_PHY_OPTIONS_NONE)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + /* Discard Tx or Rx PHYs value without preference. */ + if ((allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) != 0) + { + txPhys = LL_PHYS_NONE; + } + if ((allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) != 0) + { + rxPhys = LL_PHYS_NONE; + } + + lmgrConnCb.allPhys = allPhys; + lmgrConnCb.txPhys = txPhys; + lmgrConnCb.rxPhys = rxPhys; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set PHY for a connection. + * + * \param handle Connection handle. + * \param allPhys All PHYs preferences. + * \param txPhys Preferred transmitter PHYs. + * \param rxPhys Preferred receiver PHYs. + * \param phyOptions PHY options. + * + * \return Status error code. + * + * Set PHY preferences for a given connection. The controller might not be able to make the + * change (e.g., because the peer does not support the requested PHY) or may decide that the + * current PHY is preferable. + */ +/*************************************************************************************************/ +uint8_t LlSetPhy(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions) +{ + lctrPhyUpdate_t *pMsg; + + LL_TRACE_INFO1("### LlApi ### LlSetPhy, handle=%u", handle); + + if (LctrIsProcActPended(handle, LCTR_CONN_MSG_API_PHY_UPDATE) == TRUE) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + /* Ignore unsupported PHYs. */ + txPhys &= lctrSuppPhys(); + rxPhys &= lctrSuppPhys(); + + if ((LL_API_PARAM_CHECK == 1) && + !llValidatePhyPreferences(allPhys, txPhys, rxPhys, phyOptions)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((LL_API_PARAM_CHECK == 1) && + ((handle >= pLctrRtCfg->maxConn) || + !LctrIsConnHandleEnabled(handle))) + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } + + /* Discard Tx or Rx PHYs value without preference. */ + if ((allPhys & LL_ALL_PHY_TX_PREFERENCE_BIT) != 0) + { + txPhys = LL_PHYS_NONE; + } + if ((allPhys & LL_ALL_PHY_RX_PREFERENCE_BIT) != 0) + { + rxPhys = LL_PHYS_NONE; + } + + if ((pMsg = (lctrPhyUpdate_t *)WsfMsgAlloc(sizeof(*pMsg))) != NULL) + { + pMsg->hdr.handle = handle; + pMsg->hdr.dispId = LCTR_DISP_CONN; + pMsg->hdr.event = LCTR_CONN_MSG_API_PHY_UPDATE; + pMsg->allPhys = allPhys; + pMsg->txPhys = txPhys; + pMsg->rxPhys = rxPhys; + pMsg->phyOptions = phyOptions; + + WsfMsgSend(lmgrPersistCb.handlerId, pMsg); + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..6b3e9c34e0f1e805016cb06cf1652747b7e9cace --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_priv.c @@ -0,0 +1,328 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) privacy control interface implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_api_reslist.h" +#include "lmgr_api.h" +#include "lmgr_api_priv.h" +#include "lctr_api_priv.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * \param pPeerIrk Peer IRK. + * \param pLocalIrk Local IRK. + * + * \return Status error code. + * + * Add device to resolving list. + */ +/*************************************************************************************************/ +uint8_t LlAddDeviceToResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, const uint8_t *pPeerIrk, const uint8_t *pLocalIrk) +{ + uint64_t peerIdentityAddr; + + LL_TRACE_INFO0("### LlApi ### LlAddDeviceToResolvingList"); + + if ((LL_API_PARAM_CHECK == 1) && + (peerAddrType > LL_ADDR_RANDOM)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((lmgrCb.advEnabled || lmgrCb.numExtAdvEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) && lmgrCb.addrResEna) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + peerIdentityAddr = BstreamToBda64(pPeerIdentityAddr); + if (BbBleResListAdd(peerAddrType, peerIdentityAddr, pPeerIrk, pLocalIrk)) + { + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_MEM_CAP_EXCEEDED; + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * + * \return Status error code. + * + * Remove device from resolving list. + */ +/*************************************************************************************************/ +uint8_t LlRemoveDeviceFromResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr) +{ + uint64_t peerIdentityAddr; + + LL_TRACE_INFO0("### LlApi ### LlRemoveDeviceFromResolvingList"); + + if ((LL_API_PARAM_CHECK == 1) && + (peerAddrType > LL_ADDR_RANDOM)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if ((lmgrCb.advEnabled || lmgrCb.numExtAdvEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) && lmgrCb.addrResEna) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + peerIdentityAddr = BstreamToBda64(pPeerIdentityAddr); + if (BbBleResListRemove(peerAddrType, peerIdentityAddr)) + { + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list. + * + * \return Status error code. + * + * Clear resolving list. + */ +/*************************************************************************************************/ +uint8_t LlClearResolvingList(void) +{ + LL_TRACE_INFO0("### LlApi ### LlClearResolvingList"); + + if ((lmgrCb.advEnabled || lmgrCb.numExtAdvEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) && lmgrCb.addrResEna) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + BbBleResListClear(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read resolving list size. + * + * \param pSize Storage for resolving list size. + * + * \return Status error code. + * + * Read number of address translation entries that can be stored in the resolving list. + */ +/*************************************************************************************************/ +uint8_t LlReadResolvingListSize(uint8_t *pSize) +{ + LL_TRACE_INFO0("### LlApi ### LlReadResolvingListSize"); + + *pSize = BbBleResListGetSize(); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Read peer resolvable address. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return Status error code. + * + * Get the peer resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +uint8_t LlReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pRpa) +{ + uint64_t identityAddr, rpa; + + LL_TRACE_INFO0("### LlApi ### LlReadPeerResolvableAddr"); + + if ((LL_API_PARAM_CHECK == 1) && + (addrType > LL_ADDR_RANDOM)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + identityAddr = BstreamToBda64(pIdentityAddr); + rpa = 0; + if (BbBleResListReadPeer(addrType, identityAddr, &rpa)) + { + Bda64ToBstream(pRpa, rpa); + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } +} + +/*************************************************************************************************/ +/*! + * \brief Read local resolvable address. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return Status error code. + * + * Get the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +uint8_t LlReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pRpa) +{ + uint64_t identityAddr, rpa; + + LL_TRACE_INFO0("### LlApi ### LlReadLocalResolvableAddr"); + + if ((LL_API_PARAM_CHECK == 1) && + (addrType > LL_ADDR_RANDOM)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + identityAddr = BstreamToBda64(pIdentityAddr); + rpa = 0; + if (BbBleResListReadLocal(addrType, identityAddr, &rpa)) + { + Bda64ToBstream(pRpa, rpa); + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } +} + +/*************************************************************************************************/ +/*! + * \brief Enable or disable address resolution. + * + * \param enable Set to TRUE to enable address resolution or FALSE to disable address + * resolution. + * + * \return Status error code. + * + * Enable or disable address resolution so that received local or peer resolvable private + * addresses are resolved. + */ +/*************************************************************************************************/ +uint8_t LlSetAddrResolutionEnable(uint8_t enable) +{ + LL_TRACE_INFO0("### LlApi ### LlSetAddrResolutionEnable"); + + if ((LL_API_PARAM_CHECK == 1) && + (enable > 1)) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + if (lmgrCb.advEnabled || lmgrCb.numExtAdvEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + lmgrCb.addrResEna = enable; + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set resolvable private address timeout. + * + * \param rpaTimeout Timeout measured in seconds. + * + * \return Status error code. + * + * Set the time period between automatic generation of new resolvable private addresses. + */ +/*************************************************************************************************/ +uint8_t LlSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout) +{ + const uint16_t rpaTimeoutMin = 1; + const uint16_t rpaTimeoutMax = 0xA1B8; + + LL_TRACE_INFO0("### LlApi ### LlSetResolvablePrivateAddrTimeout"); + + if ((LL_API_PARAM_CHECK == 1) && + ((rpaTimeout < rpaTimeoutMin) || (rpaTimeout > rpaTimeoutMax))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + LctrPrivSetResPrivAddrTimeout(rpaTimeout); + + return LL_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * \param privMode Privacy mode. + * + * \return Status error code. + * + * Allow the host to specify the privacy mode to be used for a given entry on the resolving list. + */ +/*************************************************************************************************/ +uint8_t LlSetPrivacyMode(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, uint8_t privMode) +{ + uint64_t peerIdentityAddr; + + LL_TRACE_INFO0("### LlApi ### LlSetPrivacyMode"); + + if ((LL_API_PARAM_CHECK == 1) && + ((peerAddrType > LL_ADDR_RANDOM) || (privMode > LL_PRIV_MODE_DEVICE))) + { + return LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + + if ((lmgrCb.advEnabled || lmgrCb.numExtAdvEnabled || lmgrCb.numScanEnabled || lmgrCb.numInitEnabled) && lmgrCb.addrResEna) + { + return LL_ERROR_CODE_CMD_DISALLOWED; + } + + peerIdentityAddr = BstreamToBda64(pPeerIdentityAddr); + if (BbBleResListSetPrivacyMode(peerAddrType, peerIdentityAddr, privMode)) + { + return LL_SUCCESS; + } + else + { + return LL_ERROR_CODE_UNKNOWN_CONN_ID; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..7faab76af242cb5ec646cb26ca4a072ddd3880d8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_main_sc.c @@ -0,0 +1,114 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer (LL) secure connections control interface file. + */ +/*************************************************************************************************/ + +#include "lmgr_api.h" +#include "lmgr_api_sc.h" +#include "lctr_api.h" +#include "ll_api.h" +#include "lctr_api_sc.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include <string.h> +#if (LL_ENABLE_TESTER) +#include "ll_tester_api.h" +#endif + +/*************************************************************************************************/ +/*! + * \brief Generate a P-256 public/private key pair. + * + * \return Status error code. + * + * Generate a P-256 public/private key pair. If another ECC operation (P-256 key pair generation + * or Diffie-Hellman key generation) is ongoing, an error will be returned. + */ +/*************************************************************************************************/ +uint8_t LlGenerateP256KeyPair(void) +{ + return LctrGenerateP256KeyPair(); +} + +/*************************************************************************************************/ +/*! + * \brief Generate a Diffie-Hellman key. + * + * \param pubKey_x Remote public key x-coordinate. + * \param pubKey_y Remote public key y-coordinate. + * + * \return Status error code. + * + * Generate a Diffie-Hellman key from a remote public key and the local private key. If another + * ECC operation (P-256 key pair generation or Diffie-Hellman key generation) is ongoing, an error + * will be returned. + */ +/*************************************************************************************************/ +uint8_t LlGenerateDhKey(const uint8_t pubKey_x[LL_ECC_KEY_LEN], const uint8_t pubKey_y[LL_ECC_KEY_LEN]) +{ + uint8_t pubKey[LL_ECC_KEY_LEN * 2]; + uint8_t privKey[LL_ECC_KEY_LEN]; + + memcpy(pubKey, pubKey_x, LL_ECC_KEY_LEN); + memcpy(pubKey + LL_ECC_KEY_LEN, pubKey_y, LL_ECC_KEY_LEN); + memcpy(privKey, lmgrScCb.privKey, LL_ECC_KEY_LEN); + + return LctrGenerateDhKey(pubKey, privKey); +} + +/*************************************************************************************************/ +/*! + * \brief Set P-256 private key for debug purposes. + * + * \param privKey Private key, or all zeros to clear set private key. + * + * \return Status error code. + * + * Set P-256 private key or clear set private key. The private key will be used for generate key + * pairs and Diffie-Hellman keys until cleared. + */ +/*************************************************************************************************/ +uint8_t LlSetP256PrivateKey(const uint8_t privKey[LL_ECC_KEY_LEN]) +{ + bool_t allZeros = TRUE; + unsigned int i; + + for (i = 0; i < LL_ECC_KEY_LEN; i++) + { + if (privKey[i] != 0) + { + allZeros = FALSE; + break; + } + } + + if (allZeros) + { + lmgrScCb.privKeySet = FALSE; + } + else + { + memcpy(lmgrScCb.privKey, privKey, LL_ECC_KEY_LEN); + lmgrScCb.privKeySet = TRUE; + } + + return LL_SUCCESS; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_math.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_math.c new file mode 100644 index 0000000000000000000000000000000000000000..d5801bb206859adafcbf32c2f6dceabefeff75a3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/ll/ll_math.c @@ -0,0 +1,130 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Common math utilities generic implementation file. + */ +/*************************************************************************************************/ + +#include "ll_math.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +static uint32_t wsfRngW = 88675123; /*!< W seed for random number generation. */ +static uint32_t wsfRngX = 123456789; /*!< X seed for random number generation. */ +static uint32_t wsfRngY = 362436069; /*!< Y seed for random number generation. */ +static uint32_t wsfRngZ = 521288629; /*!< Z seed for random number generation. */ + +/*************************************************************************************************/ +/*! + * \brief Initialize random number seeds. + * + * \param seed Pointer to initial seed for random numbers. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathSetSeed(const uint32_t *pSeed) +{ + wsfRngW ^= *pSeed; + wsfRngX ^= *pSeed; + wsfRngY ^= *pSeed; + wsfRngZ ^= *pSeed; +} + +/*************************************************************************************************/ +/*! + * \fn LlMathRandNum + * + * \brief Generate random number. + * + * \return 32-bit random number. + * + * This software implementation uses a xorshift random number generator. + * George Marsaglia (2003), "Xorshift RNGs", Journal of Statistical Software + * + * \note This routine is not a cryptographic grade random number generator. + */ +/*************************************************************************************************/ +uint32_t LlMathRandNum(void) +{ + uint32_t t; + + t = wsfRngX ^ (wsfRngX << 11); + wsfRngX = wsfRngY; + wsfRngY = wsfRngZ; + wsfRngZ = wsfRngW; + wsfRngW = wsfRngW ^ (wsfRngW >> 19) ^ (t ^ (t >> 8)); + return wsfRngW; +} + +/*************************************************************************************************/ +/*! + * \brief Return the number of bits which are set. + * + * \param num Input parameter. + * + * \return Number of bits which are set. + */ +/*************************************************************************************************/ +uint8_t LlMathGetNumBitsSet(uint64_t num) +{ + num = num - ((num >> 1) & 0x5555555555555555ULL); + num = (num & 0x3333333333333333ULL) + ((num >> 2) & 0x3333333333333333ULL); + return (((num + (num >> 4)) & 0xF0F0F0F0F0F0F0FULL) * 0x101010101010101ULL) >> 56; +} + +/*************************************************************************************************/ +/*! + * \brief Return result of a division. + * + * \param nu32 Numerator of size 32 bits. + * \param de32 Denominator of size 32 bits. + * + * \return Result of a division. + */ +/*************************************************************************************************/ +uint32_t LlMathDivideUint32(uint32_t nu32, uint32_t de32) +{ + uint32_t temp = 1; + uint32_t result = 0; + uint64_t nu = nu32; + uint64_t de = de32; + + while (de <= nu) + { + de <<= 1; + temp <<= 1; + } + + while (temp > 1) + { + de >>= 1; + temp >>= 1; + + if (nu >= de) + { + nu -= de; + result += temp; + } + } + + return result; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_events.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_events.c new file mode 100644 index 0000000000000000000000000000000000000000..6c8c92708f62ca941709f18caccec16d6ccad647 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_events.c @@ -0,0 +1,117 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link controller manager event implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_api.h" +#include "lmgr_api.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include <string.h> + +/*************************************************************************************************/ +/*! + * \brief Send advertising enable confirm. + * + * \param status Confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendAdvEnableCnf(uint8_t status) +{ + wsfMsgHdr_t evt; + evt.event = LL_ADV_ENABLE_CNF; + evt.status = status; + + LL_TRACE_INFO1("### LlEvent ### LL_ADV_ENABLE_CNF, status=%u", status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send scan enable confirm. + * + * \param status Confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendScanEnableCnf(uint8_t status) +{ + wsfMsgHdr_t evt; + evt.event = LL_SCAN_ENABLE_CNF; + evt.status = status; + + LL_TRACE_INFO1("### LlEvent ### LL_SCAN_ENABLE_CNF, status=%u", status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send advertising set terminated indication. + * + * \param handle Advertising handle. + * \param status Confirm status. + * \param connHandle Connection handle. + * \param numEvents Number of completed events. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendAdvSetTermInd(uint8_t handle, uint8_t status, uint16_t connHandle, uint8_t numEvents) +{ + LlAdvSetTermInd_t evt; + evt.hdr.event = LL_ADV_SET_TERM_IND; + evt.hdr.param = handle; + evt.hdr.status = status; + + evt.status = status; + evt.advHandle = handle; + evt.connHandle = connHandle; + evt.numCmplAdvEvt = numEvents; + + LL_TRACE_INFO2("### LlEvent ### LL_ADV_SET_TERM_IND, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send event to registered handler. + * + * \param pEvt Event data. + * + * \return TRUE if event was sent. + */ +/*************************************************************************************************/ +bool_t LmgrSendEvent(LlEvt_t *pEvt) +{ + bool_t evtSent = FALSE; + + if (lmgrPersistCb.evtCback) + { + evtSent = lmgrPersistCb.evtCback(pEvt); + } + return evtSent; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main.c new file mode 100644 index 0000000000000000000000000000000000000000..eb88464d32fd5ef8e5f9dba0a0ce17d5633d65da --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main.c @@ -0,0 +1,226 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager common implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api.h" +#include "wsf_assert.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Link layer manager system control block (persists with resets). */ +lmgrPersistCtrlBlk_t lmgrPersistCb; + +/*! \brief Link layer manager control block (clears with resets). */ +lmgrCtrlBlk_t lmgrCb; + +/*************************************************************************************************/ +/*! + * \brief Set default values. + * + * \return None. + * + * Restore default values to fields that require initial state after reset. Values that + * survive reset are unchanged. + */ +/*************************************************************************************************/ +void LmgrSetDefaults(void) +{ + /* Ensure reset shuts down resources. */ + WSF_ASSERT(lmgrCb.numConnEnabled == 0); + WSF_ASSERT(lmgrCb.advEnabled == FALSE); + WSF_ASSERT(lmgrCb.numExtAdvEnabled == 0); + WSF_ASSERT(lmgrCb.numScanEnabled == 0); + WSF_ASSERT(lmgrCb.numInitEnabled == 0); + WSF_ASSERT(lmgrCb.numWlFilterEnabled == 0); + WSF_ASSERT(lmgrCb.numPlFilterEnabled == 0); + WSF_ASSERT(lmgrCb.testEnabled == FALSE); + + memset(&lmgrCb, 0, sizeof(lmgrCb)); + + lmgrCb.features = lmgrPersistCb.featuresDefault; + + lmgrCb.opModeFlags = + /* LL_OP_MODE_FLAG_ENA_VER_LLCP_STARTUP | */ /* disabled */ + /* LL_OP_MODE_FLAG_SLV_REQ_IMMED_ACK | */ /* disabled */ + /* LL_OP_MODE_FLAG_BYPASS_CE_GUARD | */ /* disabled */ + /* LL_OP_MODE_FLAG_MST_RETX_AFTER_RX_NACK | */ /* disabled */ + /* LL_OP_MODE_FLAG_MST_IGNORE_CP_RSP | */ /* disabled */ + /* LL_OP_MODE_FLAG_MST_UNCOND_CP_RSP | */ /* disabled */ + /* LL_OP_MODE_FLAG_REQ_SYM_PHY | */ /* disabled */ + /* LL_OP_MODE_FLAG_ENA_FEAT_LLCP_STARTUP | */ /* disabled */ + /* LL_OP_MODE_FLAG_SLV_DELAY_LLCP_STARTUP | */ /* disabled */ + LL_OP_MODE_FLAG_ENA_LEN_LLCP_STARTUP | + LL_OP_MODE_FLAG_ENA_ADV_DLY | + LL_OP_MODE_FLAG_ENA_SCAN_BACKOFF | + LL_OP_MODE_FLAG_ENA_WW | + LL_OP_MODE_FLAG_ENA_SLV_LATENCY | + LL_OP_MODE_FLAG_ENA_LLCP_TIMER; +} + +/*************************************************************************************************/ +/*! + * \brief Increment reset delay counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrIncResetRefCount(void) +{ + lmgrCb.resetDelayRefCnt++; +} + +/*************************************************************************************************/ +/*! + * \brief Decrement reset delay counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrDecResetRefCount(void) +{ + WSF_ASSERT(lmgrCb.resetDelayRefCnt); + lmgrCb.resetDelayRefCnt--; +} + +/*************************************************************************************************/ +/*! + * \brief Increment whitelist filter enable counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrIncWhitelistRefCount(void) +{ + lmgrCb.numWlFilterEnabled++; +} + +/*************************************************************************************************/ +/*! + * \brief Decrement whitelist filter enable counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrDecWhitelistRefCount(void) +{ + WSF_ASSERT(lmgrCb.numWlFilterEnabled); + lmgrCb.numWlFilterEnabled--; +} + +/*************************************************************************************************/ +/*! + * \brief Increment periodiclist filter enable counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrIncPeriodiclistRefCount(void) +{ + lmgrCb.numPlFilterEnabled++; +} + +/*************************************************************************************************/ +/*! + * \brief Decrement periodiclist filter enable counter. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrDecPeriodiclistRefCount(void) +{ + WSF_ASSERT(lmgrCb.numPlFilterEnabled); + lmgrCb.numPlFilterEnabled--; +} + +/*************************************************************************************************/ +/*! + * \brief Check that that a given address type is available. + * + * \param ownAddrType Own address type. + * + * \return TRUE if value is valid, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LmgrIsAddressTypeAvailable(uint8_t ownAddrType) +{ + bool_t isAddrTypeValid = TRUE; + + switch (ownAddrType) + { + case LL_ADDR_RANDOM: + case LL_ADDR_RANDOM_IDENTITY: + if (!lmgrCb.bdAddrRndValid) + { + /* Random address not available. */ + isAddrTypeValid = FALSE; + } + break; + case LL_ADDR_PUBLIC: + case LL_ADDR_PUBLIC_IDENTITY: + case LL_ADDR_ANONYMOUS: + /* Addresses are always available. */ + break; + default: + /* Invalid type. */ + isAddrTypeValid = FALSE; + } + + return isAddrTypeValid; +} + +/*************************************************************************************************/ +/*! + * \brief Check that extended commands have not been issued. + * + * \return TRUE if allowed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LmgrIsLegacyCommandAllowed(void) +{ + if (lmgrCb.useExtCmds) + { + return FALSE; + } + + lmgrCb.useLegacyCmds = TRUE; + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Check that legacy commands have not been issued. + * + * \return TRUE if allowed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t LmgrIsExtCommandAllowed(void) +{ + if (lmgrCb.useLegacyCmds) + { + return FALSE; + } + + lmgrCb.useExtCmds = TRUE; + return TRUE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..08e95e2524648ebca42769db0dd0e177c235b0fc --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c @@ -0,0 +1,169 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager extended scan implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_adv_master_ae.h" +#include "wsf_assert.h" +#include "wsf_trace.h" + +/*************************************************************************************************/ +/*! + * \brief Send extended scan enable confirm. + * + * \param status Confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendExtScanEnableCnf(uint8_t status) +{ + LlExtScanEnableCnf_t evt; + + if ((lmgrCb.extScanEnaStatus == LL_SUCCESS) && (status != LL_SUCCESS)) + { + /* Store first error. */ + lmgrCb.extScanEnaStatus = status; + } + + if ((lmgrCb.extScanEnaDelayCnt == 0) || /* Suppress event. */ + (--lmgrCb.extScanEnaDelayCnt > 0)) /* Wait for last scanner. */ + { + /* Delay until all enable confirms received. */ + return; + } + + evt.hdr.event = LL_EXT_SCAN_ENABLE_CNF; + evt.hdr.status = lmgrCb.extScanEnaStatus; + evt.status = lmgrCb.extScanEnaStatus; + + LL_TRACE_INFO1("### LlEvent ### LL_EXT_SCAN_ENABLE_CNF, status=%u", lmgrCb.extScanEnaStatus); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send scan timeout indication. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendScanTimeoutInd(void) +{ + wsfMsgHdr_t evt; + evt.event = LL_SCAN_TIMEOUT_IND; + evt.status = LL_SUCCESS; + + LL_TRACE_INFO0("### LlEvent ### LL_SCAN_TIMEOUT_IND"); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send extended advertising report indication. + * + * \param pEvt Extended advertising report event. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendExtAdvRptInd(LlExtAdvReportInd_t *pEvt) +{ + pEvt->hdr.param = 0; + pEvt->hdr.event = LL_EXT_ADV_REPORT_IND; + pEvt->hdr.status = LL_SUCCESS; + + LL_TRACE_INFO2("### LlEvent ### LL_EXT_ADV_REPORT_IND, status=LL_SUCCESS, eventType=%u, SID=%u", pEvt->eventType, pEvt->advSID); + + LmgrSendEvent((LlEvt_t *)pEvt); +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising report event. + * + * \param pEvt Periodic advertising report. + * + * \return TRUE if event was sent. + */ +/*************************************************************************************************/ +void LmgrSendPerAdvRptInd(LlPerAdvReportInd_t *pEvt) +{ + pEvt->hdr.param = 0; + pEvt->hdr.event = LL_PER_ADV_REPORT_IND; + pEvt->hdr.status = LL_SUCCESS; + + LL_TRACE_INFO2("### LlEvent ### LL_PER_ADV_REPORT_IND, handle=%u dataLen=%u ", pEvt->syncHandle, pEvt->len); + + LmgrSendEvent((LlEvt_t *)pEvt); +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising sync established event. + * + * \param status Confirm status. + * \param handle Sync handle. + * \param pEvt Periodic advertising sync established event. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendSyncEstInd(uint8_t status, uint16_t handle, lmgrPerAdvSyncEstdInd_t *pEvt) +{ + LlPerAdvSyncEstdCnf_t evt; + evt.hdr.event = LL_PER_ADV_SYNC_ESTD_IND, + evt.status = status; + evt.syncHandle = handle; + evt.advSID = pEvt->advSID; + evt.addrType = pEvt->addrType; + evt.advPhy = pEvt->advPhy; + evt.perAdvInterval = pEvt->advInterval; + evt.advClkAccuracy = pEvt->advClkAccuracy; + + BdaCpy(evt.addr, pEvt->addr); + + LL_TRACE_INFO3("### LlEvent ### LL_PER_ADV_SYNC_ESTD_IND, handle=%u status=%u advSID=%u", handle, status, pEvt->advSID); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising sync lost event. + * + * \param handle Sync handle. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendSyncLostInd(uint16_t handle) +{ + LlPerAdvSyncLostInd_t evt; + + evt.hdr.event = LL_PER_ADV_SYNC_LOST_IND, + evt.syncHandle = handle; + + LL_TRACE_INFO1("### LlEvent ### LL_PER_ADV_SYNC_LOST_IND, handle=%u", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..5f8dc839ff846605dab0d264c0f6e00b1f5e3ea4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c @@ -0,0 +1,117 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager extended advertising implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_adv_slave_ae.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "util/bstream.h" + +/*************************************************************************************************/ +/*! + * \brief Send extended advertising enable confirm. + * + * \param handle Advertising handle. + * \param status Confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendExtAdvEnableCnf(uint8_t handle, uint8_t status) +{ + LlExtAdvEnableCnf_t evt; + + if ((lmgrCb.advSetEnaStatus == LL_SUCCESS) && (status != LL_SUCCESS)) + { + /* Store first error. */ + lmgrCb.advSetEnaStatus = status; + } + + WSF_ASSERT(lmgrCb.extAdvEnaDelayCnt > 0); + if (--lmgrCb.extAdvEnaDelayCnt > 0) + { + /* Delay until all enable confirms received. */ + return; + } + + evt.hdr.event = LL_EXT_ADV_ENABLE_CNF; + evt.hdr.param = handle; + evt.hdr.status = lmgrCb.advSetEnaStatus; + evt.handle = handle; + evt.status = lmgrCb.advSetEnaStatus; + + LL_TRACE_INFO2("### LlEvent ### LL_EXT_ADV_ENABLE_CNF, handle=%u, status=%u", handle, lmgrCb.advSetEnaStatus); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send extended advertising enable confirm. + * + * \param handle Advertising handle. + * \param scanAddrType Scanner address type. + * \param scanAddr Scanner address. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendScanReqReceivedInd(uint8_t handle, uint8_t scanAddrType, uint64_t scanAddr) +{ + LlScanReqRcvdInd_t evt; + + evt.hdr.event = LL_SCAN_REQ_RCVD_IND; + evt.hdr.param = handle; + evt.hdr.status = LL_SUCCESS; + evt.handle = handle; + evt.scanAddrType = scanAddrType; + + Bda64ToBstream(evt.scanAddr, scanAddr); + + LL_TRACE_INFO1("### LlEvent ### LL_SCAN_REQ_RCVD_IND, handle=%u, status=LL_SUCCESS", handle); + + LmgrSendEvent((LlEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Send periodic advertising enable confirm. + * + * \param handle Advertising handle. + * \param status Confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSendPeriodicAdvEnableCnf(uint8_t handle, uint8_t status) +{ + LlPerAdvEnableCnf_t evt; + + evt.hdr.event = LL_PER_ADV_ENABLE_CNF; + evt.hdr.param = handle; + evt.hdr.status = status; + evt.handle = handle; + evt.status = status; + + LL_TRACE_INFO2("### LlEvent ### LL_PER_ADV_ENABLE_CNF, handle=%u, status=%u", handle, status); + + LmgrSendEvent((LlEvt_t *)&evt); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_conn.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..3fcfcd91688c667c09e7505a35baba5eed0e59ae --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_conn.c @@ -0,0 +1,55 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager connection implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_conn.h" +#include "bb_ble_api.h" +#include "lctr_api.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Slave role device parameters. */ +lmgrConnCtrlBlk_t lmgrConnCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer manager connection resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrConnInit(void) +{ + memset(&lmgrConnCb, 0, sizeof(lmgrConnCb)); + + lmgrConnCb.availTxBuf = pLctrRtCfg->numTxBufs; + lmgrConnCb.availRxBuf = pLctrRtCfg->numRxBufs; + + lmgrConnCb.maxTxLen = LL_MAX_DATA_LEN_MIN; + lmgrConnCb.maxTxTime = LL_MAX_DATA_TIME_MIN; + + lmgrConnCb.allPhys = LL_ALL_PHY_TX_PREFERENCE_BIT | LL_ALL_PHY_RX_PREFERENCE_BIT; + lmgrConnCb.rxPhys = LL_PHYS_NONE; + lmgrConnCb.txPhys = LL_PHYS_NONE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_master.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_master.c new file mode 100644 index 0000000000000000000000000000000000000000..f84446205839e8fa315539d1b0adf7d4e8aebb01 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_master.c @@ -0,0 +1,54 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager master role implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_adv_master.h" +#include "bb_ble_api.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Master role device parameters. */ +lmgrMstScanCtrlBlk_t lmgrMstScanCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer manager master mode resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrMstInit(void) +{ + static lmgrScanParam_t defScanParam; + defScanParam.scanType = LL_SCAN_PASSIVE; + defScanParam.scanInterval = 0x0010; + defScanParam.scanWindow = 0x0010; + defScanParam.ownAddrType = LL_ADDR_PUBLIC; + defScanParam.scanFiltPolicy = LL_SCAN_FILTER_NONE; + + memset(&lmgrMstScanCb, 0, sizeof(lmgrMstScanCb)); + lmgrMstScanCb.scanParam = defScanParam; + lmgrMstScanCb.chanClass = LL_CHAN_DATA_ALL; + lmgrMstScanCb.scanChanMap = LL_ADV_CHAN_ALL; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_priv.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..0093c675adf64dbad3ea7695bc22cf3871038170 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_priv.c @@ -0,0 +1,45 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager privacy implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_priv.h" +#include "bb_ble_api.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Privacy parameters. */ +lmgrPrivCtrlBlk_t lmgrPrivCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer manager privacy resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrPrivInit(void) +{ + lmgrPrivCb.resPrivAddrTimeout = LL_DEF_RES_ADDR_TO_SEC; /* seconds */ + lmgrPrivCb.numPendingAddrRes = 0; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_sc.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..363da37ac25b76e3480311c9a18119306acbf737 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_sc.c @@ -0,0 +1,45 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager secure connections implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_sc.h" +#include "bb_ble_api.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Secure connection parameters. */ +lmgrScCtrlBlk_t lmgrScCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer manager connection resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrScInit(void) +{ + lmgrScCb.eccOpActive = FALSE; + lmgrScCb.privKeySet = FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_slave.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..3c78c802774237d216ecc697b2ee457c161b063a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/lmgr/lmgr_main_slave.c @@ -0,0 +1,64 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link manager slave role implementation file. + */ +/*************************************************************************************************/ + +#include "lmgr_api_adv_slave.h" +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include <string.h> + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Slave role device parameters. */ +lmgrSlvAdvCtrlBlk_t lmgrSlvAdvCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize link layer manager slave mode resources. + * + * \return None. + */ +/*************************************************************************************************/ +void LmgrSlvInit(void) +{ + static lmgrAdvParam_t defAdvParam; + defAdvParam.advInterMin = 0x0800; + defAdvParam.advInterMax = 0x0800; + defAdvParam.advType = LL_ADV_CONN_UNDIRECT; + defAdvParam.ownAddrType = LL_ADDR_PUBLIC; + defAdvParam.peerAddrType = LL_ADDR_PUBLIC; + defAdvParam.advChanMap = LL_ADV_CHAN_ALL; + defAdvParam.advFiltPolicy = LL_ADV_FILTER_NONE; + + memset(&lmgrSlvAdvCb, 0, sizeof(lmgrSlvAdvCb)); + + /* Set default Tx PHY options */ + lmgrSlvAdvCb.defTxPhyOpts = BB_PHY_OPTIONS_BLE_S8; + + lmgrSlvAdvCb.advParam = defAdvParam; + /* The maximum adv interval is 0x4000 and it times 625 still fits in uint32_t. */ + /* coverity[overflow_before_widen] */ + lmgrSlvAdvCb.advParam.advInterMin = BB_BLE_TO_BB_TICKS(lmgrSlvAdvCb.advParam.advInterMin); + /* coverity[overflow_before_widen] */ + lmgrSlvAdvCb.advParam.advInterMax = BB_BLE_TO_BB_TICKS(lmgrSlvAdvCb.advParam.advInterMax); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_ble.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_ble.c new file mode 100644 index 0000000000000000000000000000000000000000..5b51421a16856954634d1adf72e00d8850814333 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_ble.c @@ -0,0 +1,406 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE protocol scheduler implementation file. + */ +/*************************************************************************************************/ + +/* Common internal definitions. */ +#include "../../common/sch/sch_int.h" + +#include "bb_ble_api.h" +#include "bb_ble_api_op.h" +#include "ll_defs.h" +#include "wsf_assert.h" + +/*************************************************************************************************/ +/*! + * \brief Compute the duration in microseconds of an data BLE packet. + * + * \param phy PHY. + * \param len Packet length. + * + * \return Time in microseconds for the packet to be transferred on the medium. + * + * \note This value includes preamble, access address, CRC and T_IFS. + */ +/*************************************************************************************************/ +uint32_t SchBleCalcDataPktDurationUsec(uint8_t phy, uint16_t len) +{ + uint32_t duration = LL_BLE_TIFS_US; + + switch (phy) + { + case BB_PHY_BLE_1M: + duration += LL_DATA_LEN_TO_TIME_1M(len); + break; + case BB_PHY_BLE_2M: + duration += LL_DATA_LEN_TO_TIME_2M(len); + break; + case BB_PHY_BLE_CODED: + duration += LL_DATA_LEN_TO_TIME_CODED_S8(len); + break; + } + + return duration; +} + +/*************************************************************************************************/ +/*! + * \brief Compute the duration in microseconds of an advertising BLE packet. + * + * \param phy PHY. + * \param phyOptions PHY Options. + * \param len Packet length. + * + * \return Time in microseconds for the packet to be transferred on the medium. + * + * \note This value includes preamble, access address, CRC and T_IFS. + */ +/*************************************************************************************************/ +uint32_t SchBleCalcAdvPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len) +{ + uint32_t usec; + switch (phy) + { + case BB_PHY_BLE_1M: + default: + usec = (LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_CRC_LEN + len) * LL_BLE_US_PER_BYTE_1M; + break; + case BB_PHY_BLE_2M: + usec = (LL_PREAMBLE_LEN_2M + LL_AA_LEN + LL_CRC_LEN + len) * LL_BLE_US_PER_BYTE_2M; + break; + case BB_PHY_BLE_CODED: + usec = (LL_PREAMBLE_LEN_CODED_BITS + (LL_AA_LEN * 8) + LL_CI_LEN_BITS + LL_TERM1_LEN_BITS ) * LL_BLE_US_PER_BIT_CODED_S8; + usec += ((phyOptions == BB_PHY_OPTIONS_BLE_S2) ? LL_BLE_US_PER_BIT_CODED_S2 : LL_BLE_US_PER_BIT_CODED_S8) * + ((len * 8) + (LL_CRC_LEN * 8) + LL_TERM2_LEN_BITS); + break; + } + return usec; +} + +/*************************************************************************************************/ +/*! + * \brief Compute the duration in microseconds of an auxiliary BLE packet. + * + * \param phy PHY. + * \param phyOptions PHY Options. + * \param len Packet length. + * + * \return Time in microseconds for the packet to be transferred on the medium. + * + * \note This value includes preamble, access address, CRC and MAFS. + */ +/*************************************************************************************************/ +uint32_t SchBleCalcAuxPktDurationUsec(uint8_t phy, uint8_t phyOptions, uint16_t len) +{ + return SchBleCalcAdvPktDurationUsec(phy, phyOptions, len) + LL_BLE_MAFS_US; +} + +/*************************************************************************************************/ +/*! + * \brief Compute the duration of the given BOD. + * + * \param pBod Operation to compute duration. + * + * \return None. + * + * Compute all the actions time and assign the duration of the given BOD. + */ +/*************************************************************************************************/ +void SchBleCalcAdvOpDuration(BbOpDesc_t *pBod) +{ + uint32_t usec; + unsigned int numChan; + BbBleData_t * const pBle = pBod->prot.pBle; + BbBleMstAdvEvent_t *pAdvMst; + BbBleSlvAdvEvent_t *pAdvSlv; + + WSF_ASSERT(pBod->protId == BB_PROT_BLE); + + switch (pBle->chan.opType) + { + case BB_BLE_OP_MST_ADV_EVENT: + { + WSF_ASSERT(pBle->chan.txPhy != BB_PHY_BLE_2M); + WSF_ASSERT(pBle->chan.rxPhy != BB_PHY_BLE_2M); + + pAdvMst = &pBle->op.mstAdv; + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec = LL_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec = LL_ADVB_MAX_TIME_S8; + break; + } + + if (pAdvMst->pTxReqBuf) + { + usec += LL_BLE_TIFS_US; + /* Coded PHY doesn't have pTxReqBuf on primary channel. BB_PHY_OPTIONS_DEFAULT is OK. */ + usec += SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, BB_PHY_OPTIONS_DEFAULT, pBle->op.mstAdv.txReqLen); + + if (pAdvMst->pRxRspBuf) + { + usec += LL_BLE_TIFS_US; + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec += LL_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec += LL_ADVB_MAX_TIME_S8; + break; + } + } + } + break; + } + case BB_BLE_OP_SLV_ADV_EVENT: + { + WSF_ASSERT(pBle->chan.txPhy != BB_PHY_BLE_2M); + WSF_ASSERT(pBle->chan.rxPhy != BB_PHY_BLE_2M); + + pAdvSlv = &pBle->op.slvAdv; + + numChan = (pAdvSlv->advChMap & (1 << 0)) ? 1 : 0; + numChan += (pAdvSlv->advChMap & (1 << 1)) ? 1 : 0; + numChan += (pAdvSlv->advChMap & (1 << 2)) ? 1 : 0; + + WSF_ASSERT(numChan > 0); + + usec = numChan * SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, pBle->chan.initTxPhyOptions, pBle->op.slvAdv.txAdvLen); + usec += (numChan - 1) * BbGetSchSetupDelayUs(); + + if (pAdvSlv->pRxReqBuf) + { + usec += LL_BLE_TIFS_US; + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec += LL_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec += LL_ADVB_MAX_TIME_S8; + break; + } + if (pAdvSlv->pTxRspBuf) + { + usec += LL_BLE_TIFS_US; + /* Coded PHY doesn't have pTxRspBuf on primary channel. BB_PHY_OPTIONS_DEFAULT is OK. */ + usec += SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, BB_PHY_OPTIONS_DEFAULT, pBle->op.mstAdv.txReqLen); + } + } + break; + } + case BB_BLE_OP_MST_AUX_ADV_EVENT: + { + BbBleMstAuxAdvEvent_t * const pAdv = &pBle->op.mstAuxAdv; + + if (pAdv->isInit == FALSE) + { + /* Scan due to discovery. */ + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec = LL_EXT_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec = LL_EXT_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec = LL_EXT_ADVB_MAX_TIME_S8; + break; + } + + if (pAdv->pTxAuxReqBuf) + { + usec += LL_BLE_TIFS_US; + /*if TIFS has preference, it should use this value. Otherwise, it will assume longest time, codes S8. */ + usec += SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) ? pBle->chan.tifsTxPhyOptions : BB_PHY_OPTIONS_BLE_S8, pAdv->txAuxReqLen); + + usec += LL_BLE_TIFS_US; + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec += LL_EXT_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec += LL_EXT_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec += LL_EXT_ADVB_MAX_TIME_S8; + break; + } + } + } + else + { + /* Scan due to initiation */ + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec = LL_EXT_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec = LL_EXT_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec = LL_EXT_ADVB_MAX_TIME_S8; + break; + } + if (pAdv->pTxAuxReqBuf) + { + usec += LL_BLE_TIFS_US; + /* Ff TIFS has preference, it should use this value. Otherwise, it will assume longest time, coded S8. */ + usec += SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) ? pBle->chan.tifsTxPhyOptions : BB_PHY_OPTIONS_BLE_S8, LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN); /* aux_conn_req */ + usec += LL_BLE_TIFS_US; + /* Assume longest time, coded S8. */ + usec += SchBleCalcAdvPktDurationUsec(pBle->chan.rxPhy, BB_PHY_OPTIONS_BLE_S8, LL_ADV_HDR_LEN + LL_CONN_RSP_PDU_LEN); /* aux_conn_rsp */ + } + } + break; + } + case BB_BLE_OP_SLV_AUX_ADV_EVENT: + { + BbBleSlvAuxAdvEvent_t * const pAdv = &pBle->op.slvAuxAdv; + + usec = SchBleCalcAdvPktDurationUsec(pBle->chan.txPhy, pBle->chan.initTxPhyOptions, pAdv->txAuxAdvPdu[0].len + pAdv->txAuxAdvPdu[1].len); + + if (pAdv->pRxAuxReqBuf) + { + usec += LL_BLE_TIFS_US; + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec += LL_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec += LL_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec += LL_ADVB_MAX_TIME_S8; + break; + } + + usec += LL_BLE_TIFS_US; + /* If TIFS has preference, it should use this value. Otherwise, it will assume longest time, coded S8. */ + usec += SchBleCalcAuxPktDurationUsec(pBle->chan.txPhy, (pBle->chan.tifsTxPhyOptions != BB_PHY_OPTIONS_DEFAULT) ? pBle->chan.tifsTxPhyOptions : BB_PHY_OPTIONS_BLE_S8, pAdv->txAuxRspPdu[0].len + pAdv->txAuxRspPdu[1].len); + } + else + { + /* Use MAFS spacing instead of TIFS. */ + usec += LL_BLE_MAFS_US; + } + + /* Do not reserve AUX_CHAIN_IND, transmission only if scheduler has opportunity. */ + break; + } + case BB_BLE_OP_SLV_PER_ADV_EVENT: + { + switch (pBle->chan.txPhy) + { + case BB_PHY_BLE_1M: + default: + usec = LL_EXT_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec = LL_EXT_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec = LL_EXT_ADVB_MAX_TIME_S8; + break; + } + + /* Do not reserve AUX_CHAIN_IND, transmission allowed only if scheduler has opportunity. */ + break; + } + case BB_BLE_OP_MST_PER_SCAN_EVENT: + { + switch (pBle->chan.rxPhy) + { + case BB_PHY_BLE_1M: + default: + usec = LL_EXT_ADVB_MAX_TIME_1M; + break; + case BB_PHY_BLE_2M: + usec = LL_EXT_ADVB_MAX_TIME_2M; + break; + case BB_PHY_BLE_CODED: + /* Assume longest time, coded S8. */ + usec = LL_EXT_ADVB_MAX_TIME_S8; + break; + } + break; + } + + default: + usec = 0; + break; + } + + pBod->minDurUsec = usec; +} + +/*************************************************************************************************/ +/*! + * \brief Get the next BLE master connection due time. + * + * \param pDueTime Due time return buffer. + * + * \return TRUE if dueTime is valid, FALSE otherwise. + * + * Find the next master connection operation and return the due time. + */ +/*************************************************************************************************/ +bool_t SchBleGetNextMstConnDueTime(uint32_t *pDueTime) +{ + BbOpDesc_t *pCur = schCb.pHead; + + while (pCur != NULL) + { + /* Only consider master connection events. */ + if ((pCur->protId == BB_PROT_BLE) && + (pCur->prot.pBle->chan.opType == BB_BLE_OP_MST_CONN_EVENT)) + { + *pDueTime = pCur->due; + return TRUE; + } + + pCur = pCur->pNext; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_int_rm.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_int_rm.h new file mode 100644 index 0000000000000000000000000000000000000000..e2911f73a120858baf051548f9735f16a0553fe6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_int_rm.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal scheduler resource manager interface file. + */ +/*************************************************************************************************/ + +#ifndef SCH_INT_RM_H +#define SCH_INT_RM_H + +#include "sch_api.h" +#include "ll_math.h" +#include "cfg_mac_ble.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum number of reservations per unit of preferred periodicity. */ +#define SCH_RM_MAX_RSVN_PREF_PER 2 /* TODO allow run-time configuration */ + +/*! \brief Preferred periodicity. */ +#define SCH_RM_PREF_PER_USEC 40000 /* TODO allow run-time configuration (e.g. multiples of 10-ms) */ + /* Use 10000 for 1M and 2M only PHY support. */ + /* Use 40000 for Coded S8 PHY support. */ + +/*! \brief Binary divide by preferred periodicity (10,000us) (n[max]=75,776). */ +#define SCH_RM_DIV_PREF_PER(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(1717987)) >> 34)) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Reservation descriptor. */ +typedef struct +{ + uint8_t handle; /*!< Reservation handle. */ + uint32_t offsUsec; /*!< Offset in microseconds. */ + uint32_t interUsec; /*!< Interval in microseconds. */ +} schRmRsvn_t; + +/*! \brief Scheduler resource manager control block. */ +typedef struct +{ + uint8_t numRsvn; /*!< Number of reservations. */ + uint32_t rsvnInterUsec[SCH_RM_MAX_RSVN]; /*!< Reserved intervals indexed by handle. */ +} SchRmCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern SchRmCb_t schRmCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +uint8_t schRmBuildReservationTable(schRmRsvn_t rsvn[], uint32_t rsvnOffs[], uint8_t exclude); +void schRmSortListDescending(uint32_t item[], uint8_t numItems); +void schRmSortRsvnList(schRmRsvn_t rsvn[], uint8_t numRsvn); + +#ifdef __cplusplus +}; +#endif + +#endif /* SCH_INT_RM_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_rm.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_rm.c new file mode 100644 index 0000000000000000000000000000000000000000..d2087074a8e2426ea731f532b976e5c2a684dd4c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/ble/sch/sch_rm.c @@ -0,0 +1,743 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Operation list maintenance implementation file. + */ +/*************************************************************************************************/ + +/*************************************************************************************************/ +/* + * This resource manager consists of the following features: + * + * * Verification of reservation capacity + * * Selection of intervals given a range + * * Selection of txWindowOffset for adding or updating a reservation + * + * Selection of txWindowOffset is optimized to allow the most medium time between each + * reservation's CE. It attempts to place the offset at 1/2 the largest gap among the largest + * reservation intervals. + * + * For example, consider adding 3 reservations as illustrated below. Each reservation is added + * in order of its handle value. The first reservation added, handle=0, is given the maximum + * txWindowOffset to maximize the scan opportunity. Next, handle=1 is placed 1/2 the interval + * of handle=0 to maximize the CE duration between both handle=0 and handle=1. And finally, + * handle=2 and handle=3 split the remaining gaps. + * + * rsvn[0] = { .handle=3, .offsUsec=30000, .interUsec=120000 } + * rsvn[1] = { .handle=1, .offsUsec=60000, .interUsec=120000 } + * rsvn[2] = { .handle=2, .offsUsec=90000, .interUsec=120000 } + * rsvn[3] = { .handle=0, .offsUsec=120000, .interUsec=120000 } + * |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+- + * :...........0 : 0 : 0 : 0 : 0 : 0 : 0 : 0 : + * :.....1 : 1 : 1 : 1 : 1 : 1 : 1 : 1 : + * :........2: :2 : 2 : 2 : 2 : 2: :2 : 2 : + * :..3 : 3 : 3 : 3: :3 : 3 : 3 : 3 : 3: + * |---------|---------|---------|---------|---------|---------|---------|---------|---------|---------| + * 0 1 2 3 4 5 6 7 8 9 10-ms + * + */ +/*************************************************************************************************/ + +#include "sch_int_rm.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include <string.h> + +/*! \brief Assert table doesn't exceed 32 entries addressable by RM 32-bit descriptor masks. */ +WSF_CT_ASSERT((SCH_RM_MAX_RSVN <= 32)); + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Total number of reservation bins. */ +#define SCH_RM_MAX_RSVN_BINS ((SCH_RM_MAX_RSVN + (SCH_RM_MAX_RSVN_PREF_PER - 1)) / SCH_RM_MAX_RSVN_PREF_PER) + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Scheduler resource manager control block. */ +SchRmCb_t schRmCb; + +/*************************************************************************************************/ +/*! + * \brief Select the preferred interval. + * + * \param minUsec Minimum interval in microseconds. + * \param maxUsec Maximum interval in microseconds. + * \param exclude Handle to exclude. + * + * \return Preferred interval in microseconds. + */ +/*************************************************************************************************/ +static uint32_t schRmSelectPreferredIntervalUsec(uint32_t minUsec, uint32_t maxUsec, uint8_t exclude) +{ + /*** Select lower bound rounded to preferred interval ***/ + + uint32_t numMinInter = SCH_RM_DIV_PREF_PER(minUsec); + uint32_t prefMinInterUsec = numMinInter * SCH_RM_PREF_PER_USEC; + uint32_t intervUsec[SCH_RM_MAX_RSVN]; + uint8_t numIntervUsec = 0; + unsigned int i; + + if (prefMinInterUsec < minUsec) + { + /* Round up to next periodic interval. */ + prefMinInterUsec = (numMinInter + 1) * SCH_RM_PREF_PER_USEC; + } + + /*** Prefer existing intervals ***/ + + for (i = 0; i < SCH_RM_MAX_RSVN; i++) + { + if ((i != exclude) && + schRmCb.rsvnInterUsec[i]) + { + intervUsec[numIntervUsec++] = schRmCb.rsvnInterUsec[i]; + } + } + + /* Use larger intervals first to avoid capacity limitation. */ + schRmSortListDescending(intervUsec, numIntervUsec); + + for (i = 0; i < numIntervUsec; i++) + { + if ((intervUsec[i] >= prefMinInterUsec) && + (intervUsec[i] <= maxUsec)) + { + return intervUsec[i]; + } + } + + /*** Limit upper bound ***/ + + if (prefMinInterUsec > maxUsec) + { + /* Limit to max value. */ + prefMinInterUsec = maxUsec; + } + + return prefMinInterUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Check reservation is within capacity. + * + * \param handle Reservation handle. + * \param interUsec Interval in microseconds. + * + * \return TRUE if new reservation does not exceed capacity, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t schRmCheckRsvnCapacity(uint8_t handle, uint32_t interUsec) +{ + unsigned int maxBinIdx = 0; + unsigned int i; + unsigned int binIdx; + unsigned int numRsvnLimit; + unsigned int numRsvnSum; + bool_t isMaxCap; + + /* Number of reservations by interval size; zero index is SCH_RM_PREF_PER_USEC. */ + uint8_t numRsvnPerInter[SCH_RM_MAX_RSVN_BINS] = { 0 }; + for (i = 0; i < SCH_RM_MAX_RSVN; i++) + { + unsigned int rsvnIntervUsec; + if (i != handle) + { + rsvnIntervUsec = schRmCb.rsvnInterUsec[i]; + } + else + { + rsvnIntervUsec = interUsec; + } + + if (!rsvnIntervUsec) + { + /* Inactive reservation. */ + continue; + } + + /* Bin interval value inclusive of max value. */ + binIdx = SCH_RM_DIV_PREF_PER(rsvnIntervUsec - 1); + if (binIdx < SCH_RM_MAX_RSVN_BINS) + { + numRsvnPerInter[binIdx]++; + maxBinIdx = WSF_MAX(binIdx, maxBinIdx); + } + /* Else interval is too large to be significant. */ + } + + /* Check capacity. */ + numRsvnLimit = 0; + numRsvnSum = 0; + isMaxCap = FALSE; + for (i = 0; i < (maxBinIdx + 1); i++) + { + if (!isMaxCap) + { + numRsvnLimit += SCH_RM_MAX_RSVN_PREF_PER; + numRsvnSum += numRsvnPerInter[i]; + + if (numRsvnSum > numRsvnLimit) + { + /* Capacity exceeded. */ + return FALSE; + } + + if (numRsvnSum == numRsvnLimit) + { + isMaxCap = TRUE; + } + } + else + { + if (numRsvnPerInter[i]) + { + /* Capacity exceeded. */ + return FALSE; + } + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Find reservations with equal intervals. + * + * \param rsvn Sorted reservation sequence table. + * \param numRsvn Number of reservations in sequence table. + * \param handle Target reservation handle. + * \param pSelectMask Bitmask of selected reservations. + * \param pNumSelected Number of selected reservations. + * + * \return None. + */ +/*************************************************************************************************/ +static void schRmFindEqualIntervals(schRmRsvn_t rsvn[], uint8_t numRsvn, uint8_t handle, + uint32_t *pSelectMask, uint8_t *pNumSelected) +{ + unsigned int i; + uint32_t selectMask = 0; + uint8_t numSelected = 0; + const uint32_t inter = schRmCb.rsvnInterUsec[handle]; + + WSF_ASSERT(numRsvn > 0); + + for (i = 0; i < numRsvn; i++) + { + if (rsvn[i].interUsec == inter) + { + selectMask |= 1 << i; + numSelected++; + } + } + + /* Return values. */ + *pSelectMask = selectMask; + *pNumSelected = numSelected; +} + +/*************************************************************************************************/ +/*! + * \brief Find reservations with the largest intervals. + * + * \param rsvn Sorted reservation sequence table. + * \param numRsvn Number of reservations in sequence table. + * \param pSelectMask Bitmask of selected reservations. + * + * \return None. + */ +/*************************************************************************************************/ +static void schRmFindLargestIntervals(schRmRsvn_t rsvn[], uint8_t numRsvn, uint32_t *pSelectMask) +{ + /* Initially the largest interval is first reservation. */ + uint32_t selectMask = 1 << 0; + uint32_t lgInterUsec = rsvn[0].interUsec; + unsigned int i; + + WSF_ASSERT(numRsvn > 0); + + /* Start comparison with the second reservation. */ + for (i = 1; i < numRsvn; i++) + { + if (rsvn[i].interUsec < lgInterUsec) + { + /* Skip this reservation. */ + continue; + } + + if (rsvn[i].interUsec > lgInterUsec) + { + /* New largest interval found. */ + selectMask = 0; + lgInterUsec = rsvn[i].interUsec; + } + + selectMask |= 1 << i; + } + + /* Return values. */ + *pSelectMask = selectMask; +} + +/*************************************************************************************************/ +/*! + * \brief Find largest gap between start times of reservation with equal intervals. + * + * \param rsvn Sorted reservation sequence table. + * \param numRsvn Number of reservations in sequence table. + * \param selectMask Bitmask of equal interval reservations. + * + * \return Offset in microseconds of the center of the largest gap. + */ +/*************************************************************************************************/ +static uint32_t schRmFindLargestGapOffsetUsec(schRmRsvn_t rsvn[], uint8_t numRsvn, uint32_t selectMask) +{ + schRmRsvn_t *pFirstRsvn = NULL; + schRmRsvn_t *pLastRsvn = NULL; + schRmRsvn_t *pLgGapEnd = NULL; + uint32_t lgGap = 0; + uint32_t gapStartOffsUsec = 0; + uint32_t gap; + unsigned int i; + + WSF_ASSERT(numRsvn > 0); + WSF_ASSERT(selectMask != 0); + + for (i = 0; i < numRsvn; i++) + { + if ((selectMask & (1 << i)) == 0) + { + continue; + } + + if (!pFirstRsvn) + { + pFirstRsvn = &rsvn[i]; + } + + gap = pLastRsvn ? (rsvn[i].offsUsec - pLastRsvn->offsUsec) : rsvn[i].offsUsec; + + /* Favor latest offset. */ + if (lgGap <= gap) + { + lgGap = gap; + if (pLgGapEnd) + { + gapStartOffsUsec = pLgGapEnd->offsUsec; + } + pLgGapEnd = &rsvn[i]; + } + + pLastRsvn = &rsvn[i]; + } + + /* Check end of sequence gap. */ + if (pFirstRsvn) /* pLastRsvn valid if pFirstRsvn valid */ + { + uint32_t firstNextOffsUsec = pFirstRsvn->offsUsec + pFirstRsvn->interUsec; + WSF_ASSERT(firstNextOffsUsec > pLastRsvn->offsUsec); + + if (firstNextOffsUsec > pLastRsvn->offsUsec) + { + uint32_t gap = firstNextOffsUsec - pLastRsvn->offsUsec; + + /* Favor earliest offset. */ + if (lgGap < gap) + { + lgGap = gap; + gapStartOffsUsec = pLastRsvn->offsUsec; + } + } + } + + return gapStartOffsUsec + (lgGap >> 1); +} + +/*************************************************************************************************/ +/*! + * \brief Select initial offset considering existing reservations. + * + * \param rsvn Sorted reservation sequence table. + * \param numRsvn Number of reservations in sequence table. + * \param selectMask Bitmask of selected reservations in rsvn[]. + * \param numSelected Number of selected reservations in rsvn[]. + * + * \return Suggested offset in microseconds. + */ +/*************************************************************************************************/ +static uint32_t schRmSelectInitOffset(schRmRsvn_t rsvn[], uint8_t numRsvn, uint32_t selectMask, uint8_t numSelected) +{ + uint32_t interUsec = 0; + unsigned int i; + uint32_t offsetUsec; + + for (i = 0; i < numRsvn; i++) + { + if ((selectMask & (1 << i)) == 0) + { + /* Reservation not selected. */ + continue; + } + + interUsec = rsvn[i].interUsec; + break; + } + + WSF_ASSERT(interUsec != 0); + + offsetUsec = schRmFindLargestGapOffsetUsec(rsvn, numRsvn, selectMask); + + if (offsetUsec > interUsec) + { + /* Ensure offset is within bounds. */ + offsetUsec -= interUsec; + } + + return offsetUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Build reservation table. + * + * \param rsvn Target reservation sequence table. + * \param rsvnOffs List of reservation offsets indexed by handle. + * \param exclude Handle of reservation to exclude. + * + * \return Number of valid reservation entries. + */ +/*************************************************************************************************/ +uint8_t schRmBuildReservationTable(schRmRsvn_t rsvn[], uint32_t rsvnOffs[], uint8_t exclude) +{ + uint8_t numRsvn = 0; + unsigned int i; + + for (i = 0; i < SCH_RM_MAX_RSVN; i++) + { + if ((schRmCb.rsvnInterUsec[i]) && + (i != exclude)) + { + rsvn[numRsvn].handle = i; + rsvn[numRsvn].offsUsec = rsvnOffs[i]; + rsvn[numRsvn].interUsec = schRmCb.rsvnInterUsec[i]; + + numRsvn++; + } + } + + schRmSortRsvnList(rsvn, numRsvn); + + return numRsvn; +} + +/*************************************************************************************************/ +/*! + * \brief In-place descending sort of a list of numbers. + * + * \param item List of numbers. + * \param numItems Number of numbers in item[]. + * Descending + * + * \return None. + */ +/*************************************************************************************************/ +void schRmSortListDescending(uint32_t item[], uint8_t numItems) +{ + unsigned int i, numUnsorted, swapIdx; + + if (numItems <= 1) + { + return; + } + + numUnsorted = numItems; + + do + { + swapIdx = 0; + + for (i = 1; i < numUnsorted; i++) + { + if (item[i-1] < item[i]) + { + uint32_t tmp; + tmp = item[i-1]; + item[i-1] = item[i]; + item[i] = tmp; + swapIdx = i; + } + } + + /* Items after swapIdx are sorted. */ + numUnsorted = swapIdx; + + } while (numUnsorted > 1); +} + +/*************************************************************************************************/ +/*! + * \brief In-place sorting of a reservation description list. + * + * \param rsvn Reservation descriptor table. + * \param numRsvn Number of reservation descriptors in rsvn[]. + * + * \return None. + */ +/*************************************************************************************************/ +void schRmSortRsvnList(schRmRsvn_t rsvn[], uint8_t numRsvn) +{ + unsigned int i, numUnsorted, swapIdx; + + if (numRsvn <= 1) + { + return; + } + + numUnsorted = numRsvn; + + do + { + swapIdx = 0; + + for (i = 1; i < numUnsorted; i++) + { + if (rsvn[i-1].offsUsec > rsvn[i].offsUsec) + { + schRmRsvn_t tmp; + memcpy(&tmp, &rsvn[i-1], sizeof(schRmRsvn_t)); + memcpy(&rsvn[i-1], &rsvn[i], sizeof(schRmRsvn_t)); + memcpy(&rsvn[i], &tmp, sizeof(schRmRsvn_t)); + swapIdx = i; + } + } + + /* Reservations after swapIdx are sorted. */ + numUnsorted = swapIdx; + + } while (numUnsorted > 1); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the resource manager. + * + * \return None. + */ +/*************************************************************************************************/ +void SchRmInit(void) +{ + memset(&schRmCb, 0, sizeof(schRmCb)); +} + +/*************************************************************************************************/ +/*! + * \brief Preferred periodicity. + * + * \return Preferred periodicity in microseconds. + */ +/*************************************************************************************************/ +uint32_t SchRmPreferredPeriodUsec(void) +{ + return SCH_RM_PREF_PER_USEC; +} + +/*************************************************************************************************/ +/*! + * \brief Validate and commit a new reservation against collision. + * + * \param handle Client defined reservation handle. + * \param minUsec Minimum interval in microseconds. + * \param maxUsec Maximum interval in microseconds. + * \param durUsec Duration of the connection in microseconds. + * \param pInterUsec Actual interval return value in microseconds. + * + * \return TRUE if reservation available, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t SchRmAdd(uint8_t handle, uint32_t minUsec, uint32_t maxUsec, uint32_t durUsec, uint32_t *pInterUsec) +{ + uint32_t prefInterUsec; + + WSF_ASSERT(handle < SCH_RM_MAX_RSVN); + WSF_ASSERT(maxUsec >= minUsec); + WSF_ASSERT(durUsec <= (SCH_RM_PREF_PER_USEC / SCH_RM_MAX_RSVN_PREF_PER)); + + /*** Select reservation's preferred interval. ***/ + + prefInterUsec = schRmSelectPreferredIntervalUsec(minUsec, maxUsec, handle); + + /*** Check reservation capacity. ***/ + + if (!schRmCheckRsvnCapacity(handle, prefInterUsec)) + { + return FALSE; + } + + /*** Commit reservation. ***/ + + schRmCb.rsvnInterUsec[handle] = prefInterUsec; + schRmCb.numRsvn++; + *pInterUsec = prefInterUsec; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Start update to a reservation. + * + * \param handle Client defined reservation handle. + * \param minUsec Minimum interval in microseconds. + * \param maxUsec Maximum interval in microseconds. + * \param durUsec Duration of the connection in microseconds. + * \param pInterUsec Actual interval return value in microseconds. + * + * \return TRUE if resource is can be updated, FALSE otherwise. + * + * \note For BLE, connection belonging to handle must be a master only. + */ +/*************************************************************************************************/ +bool_t SchRmStartUpdate(uint8_t handle, uint32_t minUsec, uint32_t maxUsec, uint32_t durUsec, uint32_t *pInterUsec) +{ + uint32_t prefInterUsec; + + WSF_ASSERT(handle < SCH_RM_MAX_RSVN); + WSF_ASSERT(maxUsec >= minUsec); + WSF_ASSERT(durUsec <= (SCH_RM_PREF_PER_USEC / SCH_RM_MAX_RSVN_PREF_PER)); + + /*** Select reservation's preferred interval. ***/ + + prefInterUsec = schRmSelectPreferredIntervalUsec(minUsec, maxUsec, handle); + + /*** Check reservation capacity. ***/ + + if (!schRmCheckRsvnCapacity(handle, prefInterUsec)) + { + return FALSE; + } + + /*** Commit reservation. ***/ + + schRmCb.rsvnInterUsec[handle] = prefInterUsec; + *pInterUsec = prefInterUsec; + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Commit an update to a reservation. + * + * \param handle Client defined reservation handle. + * + * \return None. + */ +/*************************************************************************************************/ +void SchRmCommitUpdate(uint8_t handle) +{ + /* No action required; already committed in SchRmStartUpdate(). */ +} + +/*************************************************************************************************/ +/*! + * \brief Remove an existing reservation. + * + * \param handle Client defined reservation handle. + * + * \return None. + */ +/*************************************************************************************************/ +void SchRmRemove(uint8_t handle) +{ + WSF_ASSERT(handle < SCH_RM_MAX_RSVN); + WSF_ASSERT(schRmCb.rsvnInterUsec[handle]); + + schRmCb.rsvnInterUsec[handle] = 0; + schRmCb.numRsvn--; +} + +/*************************************************************************************************/ +/*! + * \brief Set the current reference point. + * + * \param handle Client defined reservation handle. + * + * \return None. + * + * The handle is the last completed reservation. Set the reference point to the next reservation + * represented by this handle. + */ +/*************************************************************************************************/ +void SchRmSetReference(uint8_t handle) +{ + /* No action required. */ +} + +/*************************************************************************************************/ +/*! + * \brief Get the next available offset in microseconds. + * + * \param rsvnOffs List of reservation offsets indexed by handle. + * \param defOffsUsec Default offset in microseconds. + * \param handle Reservation handle. + * + * \return Offset in microseconds. + */ +/*************************************************************************************************/ +uint32_t SchRmGetOffsetUsec(uint32_t rsvnOffs[], uint32_t defOffsUsec, uint8_t handle) +{ + schRmRsvn_t rsvn[SCH_RM_MAX_RSVN]; + uint8_t numRsvn; + uint8_t numSelected; + uint32_t selectMask, lgGapOffsUsec; + + WSF_ASSERT(schRmCb.numRsvn); + + if (schRmCb.numRsvn <= 1) + { + /* No competing reservations. */ + return defOffsUsec; + } + + numRsvn = schRmBuildReservationTable(rsvn, rsvnOffs, handle); + + /* Attempt alignment with existing reservations at equal intervals. */ + schRmFindEqualIntervals(rsvn, numRsvn, handle, &selectMask, &numSelected); + if (numSelected) + { + return schRmSelectInitOffset(rsvn, numRsvn, selectMask, numSelected); + } + + /* Else align with largest interval reservations. */ + schRmFindLargestIntervals(rsvn, numRsvn, &selectMask); + lgGapOffsUsec = schRmFindLargestGapOffsetUsec(rsvn, numRsvn, selectMask); + + /* Ensure offset is within bounds. */ + while (lgGapOffsUsec > schRmCb.rsvnInterUsec[handle]) + { + lgGapOffsUsec = lgGapOffsUsec >> 1; + } + + return lgGapOffsUsec; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_int.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_int.h new file mode 100644 index 0000000000000000000000000000000000000000..153d2b783453aba92f02bb29f7ffb48162e2a9e5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_int.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_INT_H +#define BB_INT_H + +#include "bb_api.h" +#include "wsf_assert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief BB control block. */ +typedef struct +{ + BbOpDesc_t *pOpInProgress; /*!< Current BB operation in progress. */ + BbBodCompCback_t bodCompCback; /*!< BOD completion handler. */ + + struct + { + BbBodCback_t execOpCback; /*!< Execute operation handler. */ + BbBodCback_t cancelOpCback; /*!< Cancel operation handler. */ + BbProtCback_t startProtCback; /*!< Start protocol handler. */ + BbProtCback_t stopProtCback; /*!< Stop protocol handler. */ + uint32_t startCnt; /*!< Start counter. */ + } prot[BB_PROT_NUM]; /*!< Protocol callbacks. */ + + uint8_t protIdStarted; /*!< Started protocol ID. */ + bool_t protStarted; /*!< Protocol started. */ + bool_t termBod; /*!< Terminate current BOD. */ +} BbCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern BbCtrlBlk_t bbCb; +extern const BbRtCfg_t *pBbRtCfg; + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_INT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_main.c new file mode 100644 index 0000000000000000000000000000000000000000..011e3e1f90c8af6bc6b7b3058bccc7cad08693d3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/bb/bb_main.c @@ -0,0 +1,399 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic baseband driver implementation file. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "bb_api.h" +#include "bb_int.h" +#include "bb_drv.h" + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +BbCtrlBlk_t bbCb; /*!< BB control block. */ +const BbRtCfg_t *pBbRtCfg = NULL; /*!< Runtime configuration. */ + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize runtime configuration. + * + * \param pCfg Pointer to runtime configuration parameters (data must be static). + * + * \return None. + * + * This function initializes the BB subsystem's runtime configuration. + * + * \note This routine must be called only once before any other initialization routine. + */ +/*************************************************************************************************/ +void BbInitRunTimeCfg(const BbRtCfg_t *pCfg) +{ + WSF_ASSERT(pBbRtCfg == NULL); + WSF_ASSERT(pCfg); + + WSF_ASSERT(pCfg->clkPpm >= 20); + WSF_ASSERT(pCfg->rfSetupDelayUs > 0); + WSF_ASSERT(pCfg->maxScanPeriodMs > 0); + WSF_ASSERT(pCfg->schSetupDelayUs > 0); + + pBbRtCfg = pCfg; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the BB. + * + * \return None. + * + * Initialize baseband resources. + */ +/*************************************************************************************************/ +void BbInit(void) +{ + WSF_ASSERT(pBbRtCfg); + + BbDrvInit(); + + memset(&bbCb, 0, sizeof(bbCb)); +} + +/*************************************************************************************************/ +/*! + * \brief Register operation completion handler. + * + * \param eventCback Event callback. + * + * \return None. + * + * Register operation completion handler. + */ +/*************************************************************************************************/ +void BbRegister(BbBodCompCback_t eventCback) +{ + bbCb.bodCompCback = eventCback; +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of given protocol. + * + * \param protId Protocol ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbProtStart(uint8_t protId) +{ + WSF_ASSERT(bbCb.prot[protId].startProtCback != NULL); + + /* Enable protocol-specific BB. */ + bbCb.prot[protId].startProtCback(); + + /* Protocol now started. */ + bbCb.protStarted = TRUE; + bbCb.protIdStarted = protId; +} + +/*************************************************************************************************/ +/*! + * \brief Start BB processing of given protocol. + * + * \param protId Protocol ID. + * + * \return None. + * + * Enable BB and start processing the list of BODs. This routine may be called several times, if + * a protocol layers has several simultaneously-enabled operations. However, \ref BbStop() must + * be called an equal number of time to disable the baseband. + */ +/*************************************************************************************************/ +void BbStart(uint8_t protId) +{ + WSF_ASSERT(protId < BB_PROT_NUM); + + if (!bbCb.protStarted) + { + /* Enable generic BB. */ + BbDrvEnable(); + + /* Enable protocol-specific BB. */ + bbProtStart(protId); + } + + bbCb.prot[protId].startCnt++; +} + +/*************************************************************************************************/ +/*! + * \brief Stop BB processing of given protocol. + * + * \param protId Protocol ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void bbProtStop(uint8_t protId) +{ + WSF_ASSERT(bbCb.prot[protId].stopProtCback != NULL); + + /* No protocol started. */ + bbCb.protStarted = FALSE; + + /* Disable protocol-specific BB. */ + bbCb.prot[protId].stopProtCback(); +} + +/*************************************************************************************************/ +/*! + * \brief Stop BB processing of given protocol. + * + * \param protId Protocol ID. + * + * Disable BB processing of BODs. + * + * \note For any particular protocol, calls to \ref BbStart() and \ref BbStop() must be + * balanced to ensure that the hardware is disabled if and only if appropriate. + */ +/*************************************************************************************************/ +void BbStop(uint8_t protId) +{ + WSF_ASSERT(protId < BB_PROT_NUM); + WSF_ASSERT(bbCb.prot[protId].startCnt > 0); + + bbCb.prot[protId].startCnt--; + + if (bbCb.protStarted && (bbCb.protIdStarted == protId) && (bbCb.prot[protId].startCnt == 0)) + { + /* Disable protocol-specific BB. */ + bbProtStop(protId); + + /* Disable generic BB. */ + BbDrvDisable(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute BOD. + * + * \param pBod Pointer to the BOD to execute. + * + * \return None. + * + * Execute the protocol specific BOD handler. + */ +/*************************************************************************************************/ +void BbExecuteBod(BbOpDesc_t *pBod) +{ + WSF_ASSERT(pBod); + + WSF_ASSERT(pBod->protId < BB_PROT_NUM); + /* TODO: Removed this assert as it spuriously seems to be taken. */ + /* WSF_ASSERT(!bbCb.pOpInProgress); */ + bbCb.pOpInProgress = pBod; + bbCb.termBod = FALSE; + + /* Enable generic BB. */ + if (!bbCb.protStarted) + { + BbDrvEnable(); + } + + /* Switch protocols if necessary. */ + if (bbCb.protStarted && (bbCb.protIdStarted != pBod->protId)) + { + /* Disable protocol-specific BB. */ + bbProtStop(bbCb.protIdStarted); /* sets bbCb.protStarted = FALSE */ + } + if (!bbCb.protStarted) + { + /* TODO: Removed this assert as it prevents background BOD. Seems unnecessary? */ + /* WSF_ASSERT(bbCb.prot[pBod->protId].startCnt > 0); */ + + /* Enable protocol-specific BB. */ + bbProtStart(pBod->protId); + } + + if (bbCb.prot[pBod->protId].execOpCback != NULL) + { + bbCb.prot[pBod->protId].execOpCback(pBod); + } + + if (bbCb.termBod) + { + bbCb.pOpInProgress = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Cancel current executing BOD. + * + * \return None. + */ +/*************************************************************************************************/ +void BbCancelBod(void) +{ + if (bbCb.pOpInProgress) + { + BbOpDesc_t * const pBod = bbCb.pOpInProgress; + + WSF_ASSERT(pBod->protId < BB_PROT_NUM); + if (bbCb.prot[pBod->protId].cancelOpCback != NULL) + { + bbCb.prot[pBod->protId].cancelOpCback(pBod); + } + + bbCb.pOpInProgress = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get the currently-executing BOD. + * + * \return Currently-executing BOD. + */ +/*************************************************************************************************/ +BbOpDesc_t *BbGetCurrentBod(void) +{ + return bbCb.pOpInProgress; +} + +/*************************************************************************************************/ +/*! + * \brief Cancel current executing BOD. + * + * \return None. + * + * \note This function is expected to be called during the execution context of the + * current executing BOD, typically in the related ISRs. + */ +/*************************************************************************************************/ +void BbSetBodTerminateFlag(void) +{ + if (bbCb.pOpInProgress) + { + bbCb.termBod = TRUE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get termination state of current executing BOD. + * + * \return TRUE if termination flag set, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbGetBodTerminateFlag(void) +{ + return bbCb.termBod; +} + +/*************************************************************************************************/ +/*! + * \brief Terminate a BOD immediately. + * + * \return None. + * + * \note This function is expected to be called during the execution context of the + * current executing BOD, typically in the related ISRs. + */ +/*************************************************************************************************/ +void BbTerminateBod(void) +{ + WSF_ASSERT(bbCb.bodCompCback); + + bbCb.pOpInProgress = NULL; + bbCb.termBod = TRUE; + bbCb.bodCompCback(); +} + +/*************************************************************************************************/ +/*! + * \brief Get BB clock accuracy. + * + * \return Clock accuracy in part per million. + * + * Returns the current BB clock accuracy. + */ +/*************************************************************************************************/ +uint16_t BbGetClockAccuracy(void) +{ + return pBbRtCfg->clkPpm; +} + +/*************************************************************************************************/ +/*! + * \brief Get scheduler setup delay. + * + * \return Scheduler setup delay in microseconds. + * + * Returns the scheduler setup delay. + */ +/*************************************************************************************************/ +uint16_t BbGetSchSetupDelayUs(void) +{ + return pBbRtCfg->schSetupDelayUs; +} + +/*************************************************************************************************/ +/*! + * \brief Returns the ID of the active protocol. + * + * \return Protocol operation in progress. + */ +/*************************************************************************************************/ +uint8_t BbGetActiveProtocol(void) +{ + return bbCb.protIdStarted; +} + +/*************************************************************************************************/ +/*! + * \brief Register protocol handlers. + * + * \param protId Protocol ID. + * \param execOpCback Execute operation callback. + * \param cancelOpCback Cancel operation callback. + * \param startProtCback Start protocol callback. + * \param stopProtCback Stop protocol callback. + * + * \return None. + */ +/*************************************************************************************************/ +void BbRegisterProt(uint8_t protId, BbBodCback_t execOpCback, BbBodCback_t cancelOpCback, + BbProtCback_t startProtCback, BbProtCback_t stopProtCback) +{ + WSF_ASSERT(protId < BB_PROT_NUM); + WSF_ASSERT(startProtCback != NULL); + WSF_ASSERT(stopProtCback != NULL); + + bbCb.prot[protId].execOpCback = execOpCback; + bbCb.prot[protId].cancelOpCback = cancelOpCback; + bbCb.prot[protId].startProtCback = startProtCback; + bbCb.prot[protId].stopProtCback = stopProtCback; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_int.h b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_int.h new file mode 100644 index 0000000000000000000000000000000000000000..8d4925441e4a189dd76b0c437d88229952b226f9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_int.h @@ -0,0 +1,107 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal multi-protocol scheduler interface file. + */ +/*************************************************************************************************/ + +#ifndef SCH_INT_H +#define SCH_INT_H + +#include "sch_api.h" +#include "bb_drv.h" +#include "wsf_assert.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum span of scheduler elements. */ +#define SCH_MAX_SPAN 0x80000000 + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Scheduler states. */ +enum +{ + SCH_STATE_IDLE, /*!< Scheduler idle. */ + SCH_STATE_LOAD, /*!< Scheduler loading next BOD. */ + SCH_STATE_EXEC /*!< Scheduler executing BOD. */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +typedef struct +{ + bool_t active; /*!< Whether background task is active. */ + BbOpDesc_t *pBod; /*!< Head element of scheduled list of BOD. */ +} SchBackground_t; + +/*! \brief Scheduler control block. */ +typedef struct +{ + bool_t state; /*!< Current scheduler state. */ + bool_t eventSetFlag; /*!< Scheduler event set (BB terminated BOD). */ + wsfHandlerId_t handlerId; /*!< System event handler ID. */ + + BbOpDesc_t *pHead; /*!< Head element of scheduled list of BOD. */ + BbOpDesc_t *pTail; /*!< Tail element of scheduled list of BOD. */ + SchBackground_t background; /*!< Background BOD. */ +} SchCtrlBlk_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern SchCtrlBlk_t schCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Load */ +void schLoadNext(void); +bool_t schTryLoadHead(void); + +/* List management */ +void schRemoveHead(void); + +/*************************************************************************************************/ +/*! + * \brief Is BOD due time in the future. + * + * \param pBod Target BOD. + * + * \return TRUE if BOD time is in the future, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t schDueTimeInFuture(BbOpDesc_t *pBod); + +#ifdef __cplusplus +}; +#endif + +#endif /* SCH_INT_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_list.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_list.c new file mode 100644 index 0000000000000000000000000000000000000000..92efbe1a34b5c4ec6cc7858c59d8aa2e73c10dc9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_list.c @@ -0,0 +1,1064 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Operation list maintenance implementation file. + */ +/*************************************************************************************************/ + +#include "sch_int.h" +#include "wsf_assert.h" +#include "wsf_cs.h" +#include "wsf_math.h" +#include "wsf_trace.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Total BOD time including setup delay. */ +#define SCH_TOTAL_DUR(p) (p->minDurUsec + BbGetSchSetupDelayUs()) + +/*! \brief Time immediately after the given BOD. */ +#define SCH_END_TIME(p) (p->due + BB_US_TO_BB_TICKS(SCH_TOTAL_DUR(p))) + +/*! \brief Is BOD[a] due time before BOD[b] due time (rt = reference time). */ +#define SCH_IS_DUE_BEFORE(a, b, rt) ((((a)->due) - (rt)) < (((b)->due) - (rt))) + +/*! \brief Is BOD[a] completion time before BOD[b] due time (rt = reference time). */ +#define SCH_IS_DONE_BEFORE(a, b, rt) ((SCH_END_TIME(a) - (rt)) <= (((b)->due) - (rt))) + +/*! \brief Is BOD[a] due time after BOD[b] completion time. */ +#define SCH_IS_DUE_AFTER(a, b, rt) SCH_IS_DONE_BEFORE(b, a, rt) + +#ifndef SCH_TRACE_ENABLE +/*! \brief Enable scheduler trace. */ +#define SCH_TRACE_ENABLE FALSE +#endif + +#if SCH_TRACE_ENABLE +#define SCH_TRACE_INFO0(msg) WSF_TRACE0("SCH", "INFO", msg) +#define SCH_TRACE_INFO1(msg, var1) WSF_TRACE1("SCH", "INFO", msg, var1) +#define SCH_TRACE_WARN0(msg) WSF_TRACE0("SCH", "WARN", msg) +#define SCH_TRACE_WARN1(msg, var1) WSF_TRACE1("SCH", "WARN", msg, var1) +#else +/*! \brief Information trace with 0 parameters. */ +#define SCH_TRACE_INFO0(msg) +/*! \brief Information trace with 1 parameters. */ +#define SCH_TRACE_INFO1(msg, var1) +/*! \brief Warning trace with 0 parameters. */ +#define SCH_TRACE_WARN0(msg) +/*! \brief Warning trace with 1 parameters. */ +#define SCH_TRACE_WARN1(msg, var1) +#endif + +#ifndef SCH_CHECK_LIST_INTEGRITY +/*! \brief Check list requirements upon insertions and removals. */ +#define SCH_CHECK_LIST_INTEGRITY FALSE +#endif + +#if (SCH_CHECK_LIST_INTEGRITY) +/*************************************************************************************************/ +/*! + * \brief Ensure BOD is not already inserted in the list. + * + * \param pBod Target BOD. + * + * \return None. + */ +/*************************************************************************************************/ +void SchCheckIsNotInserted(BbOpDesc_t *pBod) +{ + BbOpDesc_t *pCur = schCb.pHead; + + while (pCur != NULL) + { + WSF_ASSERT(pCur != pBod); + pCur = pCur->pNext; + } +} + +/*************************************************************************************************/ +/*! + * \brief Ensure BOD is already inserted in the list. + * + * \param pBod Target BOD. + * + * \return None. + */ +/*************************************************************************************************/ +void SchCheckIsInserted(BbOpDesc_t *pBod) +{ + BbOpDesc_t *pCur = schCb.pHead; + + while (pCur != NULL) + { + if (pCur == pBod) + { + /* pBod found in the list. */ + return; + } + pCur = pCur->pNext; + } + WSF_ASSERT(pCur != NULL); +} +#endif + +/*************************************************************************************************/ +/*! + * \brief Is BOD due within next BOD if not already started. + * + * \param pBod Target BOD. + * + * \return TRUE if BOD is cancelable, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t SchEnoughTimeToCancel(BbOpDesc_t *pBod) +{ + bool_t result = FALSE; + + const uint32_t curTime = BbDrvGetCurrentTime(); + const uint32_t delta = pBod->due - curTime; + + if ((delta >= BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs())) && /* sufficient time to cancel */ + (delta < SCH_MAX_SPAN)) /* due time has not passed */ + { + result = TRUE; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Get start reference time. + * + * \return Start reference time. + * + * Returns the earliest time as a time base for calculations. + */ +/*************************************************************************************************/ +uint32_t SchGetStartRefTime(void) +{ + if (schCb.pHead) + { + return schCb.pHead->due - SCH_MAX_SPAN; + } + else + { + return BbDrvGetCurrentTime(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cancel current head operation. + * + * \return TRUE if successful, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t schCancelHead(void) +{ + bool_t result = FALSE; + + if (schCb.state == SCH_STATE_EXEC) + { + if ((result = SchEnoughTimeToCancel(schCb.pHead)) == TRUE) + { + BbCancelBod(); + + schCb.state = SCH_STATE_IDLE; + } + } + else + { + /* If not the current BOD then cancel is unconditional. */ + result = TRUE; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Insert item into an empty list. + * + * \param pItem Item to insert. + * + * \return None. + */ +/*************************************************************************************************/ +void schInsertToEmptyList(BbOpDesc_t *pItem) +{ + WSF_ASSERT(pItem); + WSF_ASSERT(schCb.pHead == NULL); + WSF_ASSERT(schCb.pTail == NULL); + + schCb.pHead = pItem; + schCb.pTail = pItem; + + pItem->pPrev = NULL; + pItem->pNext = NULL; + + SCH_TRACE_INFO1("++| schInsertToEmptyList |++ pBod=0x%08x", (uint32_t)pItem); + SCH_TRACE_INFO1("++| |++ .due=%u", pItem->due); + SCH_TRACE_INFO1("++| |++ .minDurUsec=%u", pItem->minDurUsec); + SCH_TRACE_INFO1("++| |++ .maxDurUsec=%u", pItem->maxDurUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Insert item before the given target position. + * + * \param pItem Item to insert. + * \param pTgt Target position. + * + * \return None. + */ +/*************************************************************************************************/ +void schInsertBefore(BbOpDesc_t *pItem, BbOpDesc_t *pTgt) +{ + WSF_ASSERT(pTgt && pItem); + + pItem->pNext = pTgt; + pItem->pPrev = pTgt->pPrev; + pTgt->pPrev = pItem; + + if (pItem->pPrev) + { + pItem->pPrev->pNext = pItem; + } + else + { + schCb.pHead = pItem; + } + + SCH_TRACE_INFO1("++| schInsertBefore |++ pBod=0x%08x", (uint32_t)pItem); + SCH_TRACE_INFO1("++| |++ .due=%u", pItem->due); + SCH_TRACE_INFO1("++| |++ .minDurUsec=%u", pItem->minDurUsec); + SCH_TRACE_INFO1("++| |++ .maxDurUsec=%u", pItem->maxDurUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Insert item after the given target position. + * + * \param pItem Item to insert. + * \param pTgt Target position. + * + * \return None. + */ +/*************************************************************************************************/ +void schInsertAfter(BbOpDesc_t *pItem, BbOpDesc_t *pTgt) +{ + WSF_ASSERT(pTgt && pItem); + + pItem->pPrev = pTgt; + pItem->pNext = pTgt->pNext; + pTgt->pNext = pItem; + + if (pItem->pNext) + { + pItem->pNext->pPrev = pItem; + } + else + { + schCb.pTail = pItem; + } + + SCH_TRACE_INFO1("++| schInsertAfter |++ pBod=0x%08x", (uint32_t)pItem); + SCH_TRACE_INFO1("++| |++ .due=%u", pItem->due); + SCH_TRACE_INFO1("++| |++ .minDurUsec=%u", pItem->minDurUsec); + SCH_TRACE_INFO1("++| |++ .maxDurUsec=%u", pItem->maxDurUsec); +} + +/*************************************************************************************************/ +/*! + * \brief Remove head item from BOD list. + * + * \return None. + */ +/*************************************************************************************************/ +void schRemoveHead(void) +{ + WSF_ASSERT(schCb.pHead); + + schCb.pHead = schCb.pHead->pNext; + + if (schCb.pHead) + { + schCb.pHead->pPrev = NULL; + } + else + { + /* Now empty list */ + schCb.pTail = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove non-head item from BOD list. + * + * \param pBod Element to remove. + * + * \return None. + */ +/*************************************************************************************************/ +static void schRemoveMiddle(BbOpDesc_t *pBod) +{ + if (schCb.pTail == pBod) + { + /* Last element */ + schCb.pTail = schCb.pTail->pPrev; + + if (schCb.pTail) + { + schCb.pTail->pNext = NULL; + } + else + { + /* Now empty list */ + schCb.pHead = NULL; + } + } + else + { + /* Linkage is intact. */ + WSF_ASSERT(pBod->pPrev && pBod->pNext); + + /* Middle element */ + pBod->pPrev->pNext = pBod->pNext; + pBod->pNext->pPrev = pBod->pPrev; + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove item from list for conflict. + * + * \param pBod Element to remove. + * + * \return Return TRUE if removed successfully, FALSE if item not in the list or could not be + * removed. + * + * Remove item from list. + */ +/*************************************************************************************************/ +static bool_t schRemoveForConflict(BbOpDesc_t *pBod) +{ + bool_t result = FALSE; + + if (schCb.pHead == NULL) + { + return FALSE; + } + + + if (schCb.pHead == pBod) + { + if (schCb.state == SCH_STATE_EXEC) + { + if ((result = SchEnoughTimeToCancel(pBod)) == TRUE) + { + BbCancelBod(); + schRemoveHead(); + result = TRUE; + } + } + else + { + schRemoveHead(); + result = TRUE; + } + } + else + { + schRemoveMiddle(pBod); + result = TRUE; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether the conflict between BODs is resolvable. + * + * \param pItem Item to insert. + * \param pTgt Target position. + * \param conflictCback Conflict action callback. + * + * \return TRUE if conflict is resolvable, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t SchIsBodResolvable(BbOpDesc_t *pItem, BbOpDesc_t *pTgt, BbConflictAct_t conflictCback) +{ + bool_t result = FALSE; + + if (pItem->reschPolicy < pTgt->reschPolicy) + { + result = TRUE; + } + else if ((pItem->reschPolicy == pTgt->reschPolicy) && + conflictCback) + { + if (conflictCback(pItem, pTgt) == pItem) + { + result = TRUE; + } + } + else + { + /* pItem is lower priority; no insertion. */ + LL_TRACE_WARN2("!!! Scheduling conflict: existing policy=%u prioritized over incoming policy=%u", pTgt->reschPolicy, pItem->reschPolicy); + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve conflict between BODs. + * + * \param pItem Item to insert. + * \param pTgt Target position. + * + * \note Resolve the conflict between the pItem and pTgt. It is possible that + * there is a conflict between the pItem and BODs after pTgt. But these conflict + * resolutions will be delayed until the BODs are executed. + * + * \return TRUE if \a pItem is inserted, FALSE for no change. + */ +/*************************************************************************************************/ +static bool_t SchResolveConflict(BbOpDesc_t *pItem, BbOpDesc_t *pTgt) +{ + bool_t result = FALSE; + + BbOpDesc_t *pNext = pTgt->pNext; + BbOpDesc_t *pPrev = pTgt->pPrev; + + if ((result = schRemoveForConflict(pTgt)) == TRUE) + { + if (pNext) + { + schInsertBefore(pItem, pNext); + } + else if (pPrev) + { + schInsertAfter(pItem, pPrev); + } + else + { + /* Insert at head. */ + schInsertToEmptyList(pItem); + } + + if (pTgt->abortCback) + { + pTgt->abortCback(pTgt); + } + } + else + { + LL_TRACE_WARN0("!!! Could not remove existing BOD"); + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Remove background BOD. + * + * \return None. + * + * \note Removes the background BOD, usually unconditionally. It will call the BOD's cancel + * callback. + */ +/*************************************************************************************************/ +void SchRemoveBackground(void) +{ + if ((schCb.background.pBod != NULL) && + schCb.background.active) + { + BbCancelBod(); + schCb.background.active = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Insert BOD into background slot. + * + * \param pBod Element to insert. + * + * \return None. + * + * Insert this BOD in the background slot. + */ +/*************************************************************************************************/ +void SchInsertBackground(BbOpDesc_t *pBod) +{ + /* Only set if there is no current background or activity in the list */ + if ((schCb.background.pBod == NULL) && + !schCb.background.active) + { + /* Mark the BOD as background */ + schCb.background.pBod = pBod; + if (schCb.pHead == NULL) + { + /* Only start it if there is no other active BOD */ + BbExecuteBod(pBod); + schCb.background.active = TRUE; + } + } + SCH_TRACE_INFO1("++| schInsertBackground |++ pBod=0x%08x", (uint32_t)pBod); + SCH_TRACE_INFO1("++| |++ .active=%u", (uint32_t)schCb.background.active); +} + +/*************************************************************************************************/ +/*! + * \brief Check whether the conflicts between pItem and BODs starting at pTgt are + * resolvable. + * + * \param pItem Item to insert. + * \param pTgt Target position. + * \param conflictCback Conflict action callback + * + * \return TRUE if conflict is resolvable, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t SchIsConflictResolvable(BbOpDesc_t *pItem, BbOpDesc_t *pTgt, BbConflictAct_t conflictCback) +{ + bool_t result; + const uint32_t startRef = SchGetStartRefTime(); + BbOpDesc_t *pCur = pTgt; + + WSF_ASSERT(pTgt && pItem); + + while (TRUE) + { + if ((pCur->pNext == NULL) || /* pCur is the tail. */ + (SCH_IS_DONE_BEFORE(pItem, pCur->pNext, startRef))) /* Only conflict with pCur. */ + { + /* Only 1 conflicting BOD. */ + result = SchIsBodResolvable(pItem, pCur, conflictCback); + break; + } + else + { + /* Check all conflicting BODs. */ + if ((result = SchIsBodResolvable(pItem, pCur, conflictCback)) == FALSE) + { + break; + } + } + /* Traverse to the next BOD. */ + pCur = pCur->pNext; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Insert item into BOD list at the next available opportunity. + * + * \param pBod Element to insert. + * + * \return None. + * + * Insert this BOD in the active BOD list where its duration can be accommodated. + */ +/*************************************************************************************************/ +void SchInsertNextAvailable(BbOpDesc_t *pBod) +{ + uint32_t startRef; + +#if (SCH_CHECK_LIST_INTEGRITY) + SchCheckIsNotInserted(pBod); +#endif + + SchRemoveBackground(); + + startRef = SchGetStartRefTime(); + + pBod->due = BbDrvGetCurrentTime() + BB_US_TO_BB_TICKS(BbGetSchSetupDelayUs()); + + if (schCb.pHead == NULL) + { + schInsertToEmptyList(pBod); + } + else if (SCH_IS_DONE_BEFORE(pBod, schCb.pHead, startRef) && + schCancelHead()) + { + /* Insert at head */ + WSF_ASSERT(pBod != schCb.pHead); + schInsertBefore(pBod, schCb.pHead); + } + else + { + BbOpDesc_t *pCur = schCb.pHead; + + while (TRUE) + { + WSF_ASSERT(pBod != pCur); + + /* Only update due time when pCur ends in the future. */ + if (SCH_END_TIME(pCur) > pBod->due) + { + pBod->due = SCH_END_TIME(pCur); + } + + if ((pCur->pNext == NULL) || /* insert at tail */ + SCH_IS_DONE_BEFORE(pBod, pCur->pNext, startRef)) + { + schInsertAfter(pBod, pCur); + break; + } + + pCur = pCur->pNext; + } + } + + schLoadNext(); +} + +/*************************************************************************************************/ +/*! + * \brief Insert item into BOD list sorted by due time. + * + * \param pBod Element to insert. + * \param conflictCback Conflict callback. + * + * \return Return TRUE if inserted successfully, FALSE otherwise. + * + * Insert BOD in the active list at the specified due time. + */ +/*************************************************************************************************/ +bool_t SchInsertAtDueTime(BbOpDesc_t *pBod, BbConflictAct_t conflictCback) +{ + bool_t result = FALSE; + uint32_t startRef; + +#if (SCH_CHECK_LIST_INTEGRITY) + SchCheckIsNotInserted(pBod); +#endif + + SchRemoveBackground(); + + startRef = SchGetStartRefTime(); + + if (!schDueTimeInFuture(pBod)) + { + return FALSE; + } + + if (schCb.pHead == NULL) + { + /* No conflict when list is empty. */ + WSF_ASSERT(pBod != schCb.pHead); + schInsertToEmptyList(pBod); + result = TRUE; + } + else + { + /* List is not empty. */ + BbOpDesc_t *pCur = schCb.pHead; + + while (TRUE) + { + WSF_ASSERT(pBod != pCur); + + if (SCH_IS_DUE_BEFORE(pBod, pCur, startRef)) /* BOD is due before pCur. */ + { + if ((SCH_IS_DONE_BEFORE(pBod, pCur, startRef)) || /* BOD is due and done before pCur, insert before. */ + ((result = SchIsConflictResolvable(pBod, pCur, conflictCback)) == TRUE)) /* Check priority if due before but done after pCur. */ + { + schInsertBefore(pBod, pCur); + result = TRUE; + } + break; + } + else if (!SCH_IS_DONE_BEFORE(pCur, pBod, startRef)) /* BOD is due during pCur, check priority and resolve BOD. */ + { + if ((result = SchIsConflictResolvable(pBod, pCur, conflictCback)) == TRUE) + { + /* Resolve conflict here otherwise delay conflict resolution when BOD is executed. */ + result = SchResolveConflict(pBod, pCur); + } + break; + } + else if (pCur->pNext == NULL) /* BOD is due after pCur and pCur is tail, insert after. */ + { + schInsertAfter(pBod, pCur); + result = TRUE; + break; + } + + /* Traverse to the next BOD. */ + pCur = pCur->pNext; + } + } + + if (result && (pBod == schCb.pHead)) + { + result = schTryLoadHead(); + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Insert item into BOD list at the earliest possible opportunity. + * + * \param pBod Element to insert. + * \param min Minimum operation interval from BOD due time. + * \param max Maximum operation interval from BOD due time. + * + * \return Return TRUE if inserted successfully, FALSE otherwise. + * + * Insert this BOD in the active BOD list where its duration can be accommodated at the earliest + * possible due time. + */ +/*************************************************************************************************/ +bool_t SchInsertEarlyAsPossible(BbOpDesc_t *pBod, uint32_t min, uint32_t max) +{ + uint32_t startRef, dueOrigin, nextAvailInter; + bool_t result = FALSE; + + WSF_ASSERT(min <= max); + +#if (SCH_CHECK_LIST_INTEGRITY) + SchCheckIsNotInserted(pBod); +#endif + + SchRemoveBackground(); + + + startRef = SchGetStartRefTime(); + dueOrigin = pBod->due; + + /* Try inserting at minimum interval. */ + pBod->due += min; + + if (schDueTimeInFuture(pBod)) + { + if (schCb.pHead == NULL) + { + schInsertToEmptyList(pBod); + result = TRUE; + } + else if (SCH_IS_DUE_BEFORE (pBod, schCb.pHead, startRef) && + SCH_IS_DONE_BEFORE(pBod, schCb.pHead, startRef) && + schCancelHead()) + { + /* Insert at head */ + WSF_ASSERT(pBod != schCb.pHead); + schInsertBefore(pBod, schCb.pHead); + result = TRUE; + } + else if (SCH_IS_DONE_BEFORE(schCb.pTail, pBod, startRef)) + { + /* Insert at tail */ + WSF_ASSERT(pBod != schCb.pTail); + schInsertAfter(pBod, schCb.pTail); + result = TRUE; + } + else + { + BbOpDesc_t *pCur = schCb.pHead; + + while (pCur) + { + WSF_ASSERT(pBod != pCur); + + /* Only update due time when pCur ends in the future. */ + if (SCH_END_TIME(pCur) > pBod->due) + { + pBod->due = SCH_END_TIME(pCur); + } + nextAvailInter = pBod->due - dueOrigin; + + if ((nextAvailInter >= min) && + (nextAvailInter <= max)) + { + if (pCur->pNext == NULL) + { + /* Insert at tail */ + schInsertAfter(pBod, pCur); + result = TRUE; + break; + } + else if (SCH_IS_DONE_BEFORE(pBod, pCur->pNext, startRef)) + { + /* Insert middle. */ + schInsertBefore(pBod, pCur->pNext); + result = TRUE; + break; + } + } + + pCur = pCur->pNext; + } + } + } + + if (result && (pBod == schCb.pHead)) + { + result = schTryLoadHead(); + } + + if (!result) + { + /* Reset due time origin. */ + pBod->due = dueOrigin; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Insert item into BOD list at the latest possible opportunity. + * + * \param pBod Element to insert. + * \param min Minimum operation interval from BOD due time. + * \param max Maximum operation interval from BOD due time. + * + * \return Return TRUE if inserted successfully, FALSE otherwise. + * + * Insert this BOD in the active BOD list where its duration can be accommodated at the latest + * possible due time. + */ +/*************************************************************************************************/ +bool_t SchInsertLateAsPossible(BbOpDesc_t *pBod, uint32_t min, uint32_t max) +{ + bool_t result = FALSE; + uint32_t startRef, dueOrigin, nextAvailInter; + BbOpDesc_t *pCur; + + WSF_ASSERT(min <= max); + +#if (SCH_CHECK_LIST_INTEGRITY) + SchCheckIsNotInserted(pBod); +#endif + + SchRemoveBackground(); + + startRef = SchGetStartRefTime(); + dueOrigin = pBod->due; + + /* Try inserting at maximum interval. */ + pBod->due = dueOrigin + max; + + if (schCb.pTail == NULL) + { + if (schDueTimeInFuture(pBod)) + { + schInsertToEmptyList(pBod); + result = TRUE; + } + } + else if (SCH_IS_DUE_AFTER(pBod, schCb.pTail, startRef)) + { + if (schDueTimeInFuture(pBod)) + { + /* Insert at tail. */ + WSF_ASSERT(pBod != schCb.pTail); + schInsertAfter(pBod, schCb.pTail); + result = TRUE; + } + } + else + { + pCur = schCb.pTail; + + while (pCur) + { + WSF_ASSERT(pBod != pCur); + + if (pCur->pPrev == NULL) + { + pBod->due = pCur->due - BB_US_TO_BB_TICKS(SCH_TOTAL_DUR(pBod)); + + if (!schDueTimeInFuture(pBod)) + { + break; + } + + nextAvailInter = pBod->due - dueOrigin; + + if ((nextAvailInter >= min) && + (nextAvailInter <= max) && + schCancelHead()) + { + /* Insert at head. */ + schInsertBefore(pBod, pCur); + result = TRUE; + break; + } + } + else + { + pBod->due = SCH_END_TIME(pCur->pPrev); + + if (!schDueTimeInFuture(pBod)) + { + break; + } + + nextAvailInter = pBod->due - dueOrigin; + + if ((nextAvailInter >= min) && + (nextAvailInter <= max) && + SCH_IS_DONE_BEFORE(pBod, pCur, startRef)) + { + /* Insert middle. */ + schInsertBefore(pBod, pCur); + result = TRUE; + break; + } + } + + pCur = pCur->pPrev; + } + } + + if (result && (pBod == schCb.pHead)) + { + result = schTryLoadHead(); + } + + if (!result) + { + /* Reset due time origin. */ + pBod->due = dueOrigin; + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Remove BOD from list. + * + * \param pBod Element to remove. + * + * \return Return TRUE if removed successfully, FALSE if item not in the list. + * + * Remove item from list. + */ +/*************************************************************************************************/ +bool_t SchRemove(BbOpDesc_t *pBod) +{ + bool_t result = FALSE; + + WSF_ASSERT(pBod); + + if (schCb.pHead == NULL) + { + return FALSE; + } + + if (schCb.pHead == pBod) + { + if (schCb.state == SCH_STATE_EXEC) + { + if ((result = SchEnoughTimeToCancel(pBod)) == TRUE) + { + BbCancelBod(); + + /* Call callback after removing from list. */ + schRemoveHead(); + schCb.state = SCH_STATE_LOAD; + if (pBod->abortCback) + { + pBod->abortCback(pBod); + } + schCb.state = SCH_STATE_IDLE; + + result = TRUE; + } + else + { + BbSetBodTerminateFlag(); + } + } + else + { + /* Call callback after removing from list. */ + schRemoveHead(); + if (pBod->abortCback) + { + pBod->abortCback(pBod); + } + + result = TRUE; + } + + if (result) + { + schLoadNext(); /* TODO prevent recursion */ + } + } + else + { +#if (SCH_CHECK_LIST_INTEGRITY) + SchCheckIsInserted(pBod); +#endif + + /* Call callback after removing from list. */ + schRemoveMiddle(pBod); + if (pBod->abortCback) + { + pBod->abortCback(pBod); + } + + result = TRUE; + } + + if (result) + { + SCH_TRACE_INFO1("--| SchRemove |-- pBod=0x%08x", (uint32_t)pBod); + SCH_TRACE_INFO1("--| |-- .due=%u", pBod->due); + } + + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Reload BOD. + * + * \param pBod Element to reload. + * + * \return None. + * + * Only if the head operation, cancel the operation and re-start it. + */ +/*************************************************************************************************/ +void SchReload(BbOpDesc_t *pBod) +{ + if ((schCb.pHead == pBod) && + schCancelHead()) + { + schLoadNext(); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_main.c b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_main.c new file mode 100644 index 0000000000000000000000000000000000000000..162c1c710d6ad253b36198ec17b541b0a658558c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/controller/sources/common/sch/sch_main.c @@ -0,0 +1,330 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Operation list maintenance implementation file. + */ +/*************************************************************************************************/ + +#include "sch_int.h" +#include "bb_api.h" +#include "wsf_trace.h" +#include <string.h> + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/*! \brief Scheduler task events. */ +enum +{ + SCH_EVENT_BOD_COMPLETE = (1 << 1) /*!< BOD completion event. */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Scheduler control block. */ +SchCtrlBlk_t schCb; + +/*! \brief Handler duration watermark in microseconds. */ +static uint16_t schHandlerWatermarkUsec = 0; + +/*************************************************************************************************/ +/*! + * \brief BOD completion handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void schBodCompHandler(void) +{ + WsfSetEvent(schCb.handlerId, SCH_EVENT_BOD_COMPLETE); + schCb.eventSetFlag = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the scheduler subsystem. + * + * \return None. + */ +/*************************************************************************************************/ +void SchInit(void) +{ + memset(&schCb, 0, sizeof(schCb)); + SchReset(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the scheduler subsystem. + * + * \param handlerId WSF handler ID. + * + * \return None. + * + * \note This initialization to used to enable task-based scheduler completions. For + * ISR-based scheduler completions, do not call this routine. Instead install an + * ISR which calls SchHandler() on BOD completions. + */ +/*************************************************************************************************/ +void SchHandlerInit(wsfHandlerId_t handlerId) +{ + SchInit(); + + schCb.handlerId = handlerId; + + BbRegister(schBodCompHandler); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the scheduler subsystem. + * + * \return None. + */ +/*************************************************************************************************/ +void SchReset(void) +{ + schCb.state = SCH_STATE_IDLE; + schCb.pHead = NULL; + schCb.pTail = NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Scheduler message dispatch handler. + * + * \param event WSF event. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void SchHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + uint16_t durUsec; + BbOpDesc_t *pBod = schCb.pHead; + /* Assume BB clock started. */ + uint32_t startTime = BbDrvGetCurrentTime(); + + WSF_ASSERT(schCb.state == SCH_STATE_EXEC); + + + if (!pBod) + { + schCb.state = SCH_STATE_IDLE; + return; + } + + /*** Complete current BOD ***/ + + schRemoveHead(); + + schCb.state = SCH_STATE_LOAD; + + if (pBod->endCback) + { + pBod->endCback(pBod); + } + + schCb.state = SCH_STATE_IDLE; + schLoadNext(); + + durUsec = BB_TICKS_TO_US(BbDrvGetCurrentTime() - startTime); + if (schHandlerWatermarkUsec < durUsec) + { + schHandlerWatermarkUsec = durUsec; + } +} + +/*************************************************************************************************/ +/*! + * \brief Load head BOD if not already started. + * + * \return TRUE if loaded, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t schLoadHead(void) +{ + bool_t loaded = FALSE; + BbOpDesc_t *pBod = schCb.pHead; + + if (schDueTimeInFuture(pBod)) + { + schCb.eventSetFlag = FALSE; + + /* Setup BB services. */ + BbExecuteBod(pBod); + + if (!BbGetBodTerminateFlag()) + { + loaded = TRUE; + } + else + { + LL_TRACE_WARN1("!!! BOD terminated on startup, pBod=0x%08x", pBod); + + if (schCb.eventSetFlag) + { + /* Termination or failure is scheduled to complete at next task event. */ + loaded = TRUE; + } + + BbCancelBod(); + } + } + else + { + /* This might occur due to the delay of conflict resolution. */ + LL_TRACE_WARN1("!!! Head element in the past, pBod=0x%08x", pBod); + } + + return loaded; +} + +/*************************************************************************************************/ +/*! + * \brief Load next BOD if not already started. + * + * \return None. + */ +/*************************************************************************************************/ +void schLoadNext(void) +{ + /* Only load if scheduler is idle. */ + if (schCb.state == SCH_STATE_IDLE) + { + while (TRUE) + { + if (!schCb.pHead) + { + schCb.state = SCH_STATE_IDLE; + if ((schCb.background.pBod != NULL) && + !schCb.background.active) + { + /* Reactivate background BOD */ + BbExecuteBod(schCb.background.pBod); + schCb.background.active = TRUE; + } + break; + } + + schCb.state = SCH_STATE_EXEC; + + if (schLoadHead()) + { + break; + } + + schCb.state = SCH_STATE_LOAD; + + SchRemove(schCb.pHead); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Try to load head BOD if not already started. + * + * \return TRUE if load succeeded (or head BOD already started). + */ +/*************************************************************************************************/ +bool_t schTryLoadHead(void) +{ + bool_t loaded = TRUE; + + /* Only load if scheduler is idle. */ + if (schCb.state == SCH_STATE_IDLE) + { + if (schCb.pHead) + { + schCb.state = SCH_STATE_EXEC; + + if (!schLoadHead()) + { + schRemoveHead(); + + schCb.state = SCH_STATE_IDLE; + loaded = FALSE; + } + } + } + + return loaded; +} + +/*************************************************************************************************/ +/*! + * \brief Get the scheduler handler watermark level. + * + * \return Watermark level in microseconds. + */ +/*************************************************************************************************/ +uint16_t SchStatsGetHandlerWatermarkUsec(void) +{ + return schHandlerWatermarkUsec; +} + +/*************************************************************************************************/ +/*! + * \brief Terminate background. + * + * Completely terminates the background BDO and removes it from record. The end callback should + * free the BOD if necessary. It will subsequently need to be fully restarted. + * + * \return None. + * + */ +/*************************************************************************************************/ +void SchTerminateBackground(void) +{ + if ((schCb.background.pBod != NULL) && + (schCb.background.pBod->endCback != NULL)) + { + schCb.background.pBod->endCback(schCb.background.pBod); + schCb.background.pBod = NULL; + schCb.background.active = FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Is BOD due time in the future. + * + * \param pBod Target BOD. + * + * \return TRUE if BOD time is in the future, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t schDueTimeInFuture(BbOpDesc_t *pBod) +{ + bool_t result = FALSE; + + const uint32_t curTime = BbDrvGetCurrentTime(); + const uint32_t delta = pBod->due - curTime; + + if (delta < SCH_MAX_SPAN) /* due time has not passed */ + { + result = TRUE; + } + + return result; +} diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_154_drv.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_154_drv.h similarity index 94% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/bb_154_drv.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_154_drv.h index a8a44e4387fd54e95ed660e8283b062a0742a234..3059b8c6334d4c2b6c8593dde3ce5806568bdba4 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_154_drv.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_154_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Baseband driver interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband driver interface file. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_ble_drv.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_ble_drv.h similarity index 95% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/bb_ble_drv.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_ble_drv.h index 8890a4bf44b4a681f836f66f449b6defda522509..4db66a4d3b715e6fc7600ecb1598227ab1b2e850 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_ble_drv.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_ble_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Baseband driver interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband driver interface file. */ /*************************************************************************************************/ @@ -22,7 +25,7 @@ #include "wsf_types.h" #include "ll_defs.h" -#include "cfg_mac.h" +#include "cfg_mac_ble.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_drv.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_drv.h similarity index 81% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/bb_drv.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_drv.h index 0c8810428f70cc2677e4e6f0b2b05fb0466cde78..9a41784ddd076835f0ddcf912e20b175831cacc6 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/bb_drv.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/bb_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Baseband driver interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband driver interface file. */ /*************************************************************************************************/ @@ -124,12 +127,6 @@ uint32_t BbDrvGetCurrentTime(void); /*************************************************************************************************/ bool_t BbDrvGetTimestamp(uint32_t *pTime); -uint16_t BbDrvGetSleepClockAccuracy(void); -uint32_t BbDrvGetStartTimestamp(void); -uint32_t BbDrvGetEndTimestamp(void); -uint32_t BbDrvConvertUsToTicks(uint32_t us); -uint32_t BbDrvConvertTicksToUs(uint32_t ticks); - /*! \} */ /* BB_DRV_CLOCK */ #ifdef __cplusplus diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_api.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_api.h similarity index 86% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/chci_api.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_api.h index 5278a82f416c093cd86dd53b24a42feb383a5428..0715c7b05ee7eefd30babbe7e1ba760154225675 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Controller HCI transport API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI transport API. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_drv.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_drv.h similarity index 72% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/chci_drv.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_drv.h index 9d13f3a94783e008ae653229874adf7ff4bced54..29230946d22961262e178b497b41eeafff195b9c 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_drv.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Controller HCI driver interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI driver interface. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr.h similarity index 72% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr.h index e192d4a40b403f85be42eb1b2b91371af8420fea..c496064fac42e9049b46c095bbe74bdc42d8748f 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Controller HCI transport interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI transport interface file. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr_serial.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr_serial.h similarity index 54% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr_serial.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr_serial.h index d3cbde5580627ac986603c03c456ee7b0a2928d2..e63ac29623296eec19a856929a6c3a17c62a469d 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/chci_tr_serial.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/chci_tr_serial.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Controller HCI serial transport interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI serial transport interface file. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/hci_defs.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/hci_defs.h similarity index 75% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/hci_defs.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/hci_defs.h index 7bd5682516827fe29b6d77de5344e82041e3049d..f9bf8d270cfc66c508bb1f1da49096f64437c5e4 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/hci_defs.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/hci_defs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file hci_defs.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI constants and definitions from the Bluetooth specification. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI constants and definitions from the Bluetooth specification. */ /*************************************************************************************************/ #ifndef HCI_DEFS_H @@ -32,6 +35,7 @@ extern "C" { /**@{*/ #define HCI_CMD_HDR_LEN 3 /*!< \brief Command packet header length */ #define HCI_ACL_HDR_LEN 4 /*!< \brief ACL packet header length */ +#define HCI_ISO_HDR_LEN 4 /*!< \brief ISO packet header length */ #define HCI_EVT_HDR_LEN 2 /*!< \brief Event packet header length */ #define HCI_EVT_PARAM_MAX_LEN 255 /*!< \brief Maximum length of event packet parameters */ #define HCI_ACL_DEFAULT_LEN 27 /*!< \brief Default maximum ACL packet length */ @@ -49,6 +53,7 @@ extern "C" { #define HCI_CMD_TYPE 1 /*!< \brief HCI command packet */ #define HCI_ACL_TYPE 2 /*!< \brief HCI ACL data packet */ #define HCI_EVT_TYPE 4 /*!< \brief HCI event packet */ +#define HCI_ISO_TYPE 5 /*!< \brief HCI ISO data packet */ /**@}*/ /** \name Error codes @@ -119,6 +124,8 @@ extern "C" { #define HCI_ERR_UNKNOWN_ADV_ID 0x42 /*!< \brief Unknown advertising identifier */ #define HCI_ERR_LIMIT_REACHED 0x43 /*!< \brief Limit reached */ #define HCI_ERR_OP_CANCELLED_BY_HOST 0x44 /*!< \brief Operation cancelled by host */ +/*! \brief New in version 5.1 */ +#define HCI_ERR_PKT_TOO_LONG 0x45 /*!< \brief Packet too long */ /**@}*/ /** \name Command groups @@ -270,6 +277,45 @@ extern "C" { #define HCI_OCF_LE_READ_RF_PATH_COMP 0x4C #define HCI_OCF_LE_WRITE_RF_PATH_COMP 0x4D #define HCI_OCF_LE_SET_PRIVACY_MODE 0x4E +/*! \brief New in version 5.1 */ +#define HCI_OCF_LE_RECEIVER_TEST_V3 0x4F +#define HCI_OCF_LE_TRANSMITTER_TEST_V3 0x50 +#define HCI_OCF_LE_SET_CONNLESS_CTE_TX_PARAMS 0x51 +#define HCI_OCF_LE_SET_CONNLESS_CTE_TX_ENABLE 0x52 +#define HCI_OCF_LE_SET_CONNLESS_IQ_SAMP_ENABLE 0x53 +#define HCI_OCF_LE_SET_CONN_CTE_RX_PARAMS 0x54 +#define HCI_OCF_LE_SET_CONN_CTE_TX_PARAMS 0x55 +#define HCI_OCF_LE_CONN_CTE_REQ_ENABLE 0x56 +#define HCI_OCF_LE_CONN_CTE_RSP_ENABLE 0x57 +#define HCI_OCF_LE_READ_ANTENNA_INFO 0x58 +#define HCI_OCF_LE_SET_PER_ADV_RCV_ENABLE 0x59 +#define HCI_OCF_LE_PER_ADV_SYNC_TRANSFER 0x5A +#define HCI_OCF_LE_PER_ADV_SET_INFO_TRANSFER 0x5B +#define HCI_OCF_LE_SET_PAST_PARAM 0x5C +#define HCI_OCF_LE_SET_DEFAULT_PAST_PARAM 0x5D +#define HCI_OCF_LE_GENERATE_DHKEY_V2 0x5E +#define HCI_OCF_LE_MODIFY_SLEEP_CLK_ACC 0x5F +/*! \brief New in version Milan */ +#define HCI_OCF_LE_READ_ISO_BUFFER_SIZE 0x60 +#define HCI_OCF_LE_READ_ISO_TX_SYNC 0x61 +#define HCI_OCF_LE_SET_CIG_PARAMS 0x62 +#define HCI_OCF_LE_SET_CIG_PARAMS_TEST 0x63 +#define HCI_OCF_LE_CREATE_CIS 0x64 +#define HCI_OCF_LE_REMOVE_CIG 0x65 +#define HCI_OCF_LE_ACCEPT_CIS_REQ 0x66 +#define HCI_OCF_LE_REJECT_CIS_REQ 0x67 +#define HCI_OCF_LE_CREATE_BIG 0x68 +#define HCI_OCF_LE_CREATE_BIG_TEST 0x69 +#define HCI_OCF_LE_BIG_CREATE_SYNC 0x6A +#define HCI_OCF_LE_TERMINATE_BIG 0x6B +#define HCI_OCF_LE_BIG_TERMINATE_SYNC 0x6C +#define HCI_OCF_LE_REQUEST_PEER_SCA 0x6D +#define HCI_OCF_LE_SETUP_ISO_DATA_PATH 0x6E +#define HCI_OCF_LE_REMOVE_ISO_DATA_PATH 0x6F +#define HCI_OCF_LE_ISO_TX_TEST 0x70 +#define HCI_OCF_LE_ISO_RX_TEST 0x71 +#define HCI_OCF_LE_ISO_READ_TEST_COUNTER 0x72 +#define HCI_OCF_LE_ISO_TERMINATE_TEST 0x73 /**@}*/ /** \name Opcode manipulation macros @@ -293,9 +339,6 @@ extern "C" { #define HCI_OPCODE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK) #define HCI_OPCODE_RESET HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_RESET) #define HCI_OPCODE_READ_TX_PWR_LVL HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_TX_PWR_LVL) -#define HCI_OPCODE_SET_CONTROLLER_TO_HOST_FC HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_CONTROLLER_TO_HOST_FC) -#define HCI_OPCODE_HOST_BUFFER_SIZE HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_BUFFER_SIZE) -#define HCI_OPCODE_HOST_NUM_CMPL_PKTS HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_NUM_CMPL_PKTS) #define HCI_OPCODE_SET_EVENT_MASK_PAGE2 HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK_PAGE2) #define HCI_OPCODE_READ_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_AUTH_PAYLOAD_TO) #define HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_WRITE_AUTH_PAYLOAD_TO) @@ -388,6 +431,45 @@ extern "C" { #define HCI_OPCODE_LE_WRITE_RF_PATH_COMP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_WRITE_RF_PATH_COMP) #define HCI_OPCODE_LE_READ_RF_PATH_COMP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_RF_PATH_COMP) #define HCI_OPCODE_LE_SET_PRIVACY_MODE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PRIVACY_MODE) +/*! \brief New in version 5.1 */ +#define HCI_OPCODE_LE_RECEIVER_TEST_V3 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST_V3) +#define HCI_OPCODE_LE_TRANSMITTER_TEST_V3 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST_V3) +#define HCI_OPCODE_LE_SET_CONNLESS_CTE_TX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_CTE_TX_PARAMS) +#define HCI_OPCODE_LE_SET_CONNLESS_CTE_TX_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_CTE_TX_ENABLE) +#define HCI_OPCODE_LE_SET_CONNLESS_IQ_SAMP_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_IQ_SAMP_ENABLE) +#define HCI_OPCODE_LE_SET_CONN_CTE_RX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONN_CTE_RX_PARAMS) +#define HCI_OPCODE_LE_SET_CONN_CTE_TX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONN_CTE_TX_PARAMS) +#define HCI_OPCODE_LE_CONN_CTE_REQ_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_CTE_REQ_ENABLE) +#define HCI_OPCODE_LE_CONN_CTE_RSP_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_CTE_RSP_ENABLE) +#define HCI_OPCODE_LE_READ_ANTENNA_INFO HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ANTENNA_INFO) +#define HCI_OPCODE_LE_SET_PER_ADV_RCV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PER_ADV_RCV_ENABLE) +#define HCI_OPCODE_LE_PER_ADV_SYNC_TRANSFER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_SYNC_TRANSFER) +#define HCI_OPCODE_LE_PER_ADV_SET_INFO_TRANSFER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_SET_INFO_TRANSFER) +#define HCI_OPCODE_LE_SET_PAST_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PAST_PARAM) +#define HCI_OPCODE_LE_SET_DEFAULT_PAST_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_DEFAULT_PAST_PARAM) +#define HCI_OPCODE_LE_GENERATE_DHKEY_V2 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_GENERATE_DHKEY_V2) +#define HCI_OPCODE_LE_MODIFY_SLEEP_CLK_ACC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_MODIFY_SLEEP_CLK_ACC) +/*! \brief New in version Milan */ +#define HCI_OPCODE_LE_READ_ISO_BUFFER_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ISO_BUFFER_SIZE) +#define HCI_OPCODE_LE_READ_ISO_TX_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ISO_TX_SYNC) +#define HCI_OPCODE_LE_SET_CIG_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CIG_PARAMS) +#define HCI_OPCODE_LE_SET_CIG_PARAMS_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CIG_PARAMS_TEST) +#define HCI_OPCODE_LE_CREATE_CIS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CIS) +#define HCI_OPCODE_LE_REMOVE_CIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_CIG) +#define HCI_OPCODE_LE_ACCEPT_CIS_REQ HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ACCEPT_CIS_REQ) +#define HCI_OPCODE_LE_REJECT_CIS_REQ HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REJECT_CIS_REQ) +#define HCI_OPCODE_LE_CREATE_BIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_BIG) +#define HCI_OPCODE_LE_CREATE_BIG_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_BIG_TEST) +#define HCI_OPCODE_LE_BIG_CREATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_BIG_CREATE_SYNC) +#define HCI_OPCODE_LE_TERMINATE_BIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TERMINATE_BIG) +#define HCI_OPCODE_LE_BIG_TERMINATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_BIG_TERMINATE_SYNC) +#define HCI_OPCODE_LE_REQUEST_PEER_SCA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REQUEST_PEER_SCA) +#define HCI_OPCODE_LE_SETUP_ISO_DATA_PATH HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SETUP_ISO_DATA_PATH) +#define HCI_OPCODE_LE_REMOVE_ISO_DATA_PATH HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_ISO_DATA_PATH) +#define HCI_OPCODE_LE_ISO_TX_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_TX_TEST) +#define HCI_OPCODE_LE_ISO_RX_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_RX_TEST) +#define HCI_OPCODE_LE_ISO_READ_TEST_COUNTER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_READ_TEST_COUNTER) +#define HCI_OPCODE_LE_ISO_TERMINATE_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_TERMINATE_TEST) /**@}*/ /** \name ARM Vendor Specific @@ -504,6 +586,18 @@ extern "C" { #define HCI_LEN_LE_READ_RF_PATH_COMP 0 #define HCI_LEN_LE_WRITE_RF_PATH_COMP 4 #define HCI_LEN_LE_SET_PRIVACY_MODE 8 +/*! \brief New in version 5.1 */ +#define HCI_LEN_LE_SET_CONN_CTE_RX_PARAMS(spLen) (5 + (spLen)) +#define HCI_LEN_LE_SET_CONN_CTE_TX_PARAMS(spLen) (4 + (spLen)) +#define HCI_LEN_LE_CONN_CTE_REQ_ENABLE 7 +#define HCI_LEN_LE_CONN_CTE_RSP_ENABLE 3 +#define HCI_LEN_LE_READ_ANTENNA_INFO 0 +#define HCI_LEN_LE_SET_PER_ADV_RCV_ENABLE 3 +#define HCI_LEN_LE_PER_ADV_SYNC_TRANSFER 6 +#define HCI_LEN_LE_PER_ADV_SET_INFO_TRANSFER 5 +#define HCI_LEN_LE_SET_PAST_PARAM 8 +#define HCI_LEN_LE_SET_DEFAULT_PAST_PARAM 6 +#define HCI_LEN_LE_GENERATE_DHKEY_V2 65 /**@}*/ /** \name Events @@ -551,6 +645,17 @@ extern "C" { #define HCI_LE_ADV_SET_TERM_EVT 0x12 #define HCI_LE_SCAN_REQ_RCVD_EVT 0x13 #define HCI_LE_CH_SEL_ALGO_EVT 0x14 +/*! \brief New in version 5.1 */ +#define HCI_LE_CONNLESS_IQ_REPORT_EVT 0x15 +#define HCI_LE_CONN_IQ_REPORT_EVT 0x16 +#define HCI_LE_CTE_REQ_FAILED_EVT 0x17 +#define HCI_LE_PER_SYNC_TRSF_RCVD_EVT 0x18 +/*! \brief New in version Milan */ +#define HCI_LE_CIS_EST_EVT 0x19 +#define HCI_LE_CIS_REQ_EVT 0x1A +#define HCI_LE_BIG_CMPL_EVT 0x1B +#define HCI_LE_BIG_SYNC_LOST_EVT 0x1C +#define HCI_LE_REQ_PEER_SCA_CMPLT_EVT 0x1D /**@}*/ /** \name Event parameter lengths @@ -589,6 +694,12 @@ extern "C" { #define HCI_LEN_LE_SCAN_TIMEOUT 1 /*!< \brief Scan timeout event length. */ #define HCI_LEN_LE_ADV_SET_TERM 6 /*!< \brief Advertising set terminated event length. */ #define HCI_LEN_LE_SCAN_REQ_RCVD 9 /*!< \brief Scan request received event length. */ +/*! \brief New in version 5.1 */ +#define HCI_LEN_LE_PER_SYNC_TRSF_RCVT 20 /*!< \brief Periodic advertising sync transfer received event length. */ +/*! \brief New in version Milan */ +#define HCI_LEN_LE_CIS_EST 12 /*!< \brief CIS established event length. */ +#define HCI_LEN_LE_CIS_REQ 7 /*!< \brief CIS request event length. */ +#define HCI_LEN_LE_PEER_SCA_CMPL 5 /*!< \brief Request peer SCA complete event length. */ /**@}*/ /** \name Supported commands @@ -600,9 +711,6 @@ extern "C" { #define HCI_SUP_SET_EVENT_MASK 0x40 /*!< \brief Byte 5 */ #define HCI_SUP_RESET 0x80 /*!< \brief Byte 5 */ #define HCI_SUP_READ_TX_PWR_LVL 0x04 /*!< \brief Byte 10 */ -#define HCI_SUP_SET_CON_HOST_FLOW 0x20 /*!< \brief Byte 10 */ -#define HCI_SUP_HOST_BUF_SIZE 0x40 /*!< \brief Byte 10 */ -#define HCI_SUP_HOST_NUM_CPL_PKTS 0x80 /*!< \brief Byte 10 */ #define HCI_SUP_READ_LOCAL_VER_INFO 0x08 /*!< \brief Byte 14 */ #define HCI_SUP_READ_LOCAL_SUP_FEAT 0x20 /*!< \brief Byte 14 */ #define HCI_SUP_READ_BD_ADDR 0x02 /*!< \brief Byte 15 */ @@ -690,6 +798,40 @@ extern "C" { #define HCI_SUP_LE_READ_RF_PATH_COMP 0x01 /*!< \brief Byte 39 */ #define HCI_SUP_LE_WRITE_RF_PATH_COMP 0x02 /*!< \brief Byte 39 */ #define HCI_SUP_LE_SET_PRIVACY_MODE 0x04 /*!< \brief Byte 39 */ +/*! \brief New in version 5.1 */ +#define HCI_SUP_LE_RECEIVER_TEST_V3 0x08 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_TRANSMITTER_TEST_V3 0x10 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_CTE_TX_PARAMS 0x20 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_CTE_TX_ENABLE 0x40 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_IQ_SAMP_ENABLE 0x80 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONN_CTE_RX_PARAMS 0x01 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_CONN_CTE_TX_PARAMS 0x02 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_CONN_CTE_REQ_ENABLE 0x04 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_CONN_CTE_RSP_ENABLE 0x08 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_READ_ANTENNA_INFO 0x10 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_PER_ADV_RCV_ENABLE 0x20 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_PER_ADV_SYNC_TRANSFER 0x40 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_PER_ADV_SET_INFO_TRANSFER 0x80 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_PAST_PARAM 0x01 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_SET_DEFAULT_PAST_PARAM 0x02 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_GENERATE_DHKEY_V2 0x04 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_MODIFY_SLEEP_CLK_ACCURACY 0x10 /*!< \brief Byte 41 */ +/*! \brief New in version Milan */ +#define HCI_SUP_LE_READ_BUF_SIZE_V2 0x01 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_SET_CIG_PARAM 0x02 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_CREATE_CIS 0x04 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_REMOVE_CIG 0x08 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_ACCEPT_CIS_REQ 0x01 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_REJECT_CIS_REQ 0x02 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_CREATE_BIG 0x04 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_BIG_CREATE_SYNC 0x08 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_TERMINATE_BIG 0x01 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_SETUP_ISO_DATA_PATH 0x02 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_REMOVE_ISO_DATA_PATH 0x04 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_REQ_PEER_SCA 0x08 /*!< \brief Byte 44 */ + +#define HCI_SUP_CMD_LEN 64 /*!< \brief Byte length of support cmd field. */ + /**@}*/ /** \name Event mask @@ -738,7 +880,18 @@ extern "C" { #define HCI_EVT_MASK_LE_SCAN_TIMEOUT_EVT 0x01 /*!< \brief Byte 2 */ #define HCI_EVT_MASK_LE_ADV_SET_TERM_EVT 0x02 /*!< \brief Byte 2 */ #define HCI_EVT_MASK_LE_SCAN_REQ_RCVD_EVT 0x04 /*!< \brief Byte 2 */ -#define HCI_EVT_MASK_LE_CH_SEL_ALGO_EVT 0x08 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CH_SEL_ALGO_EVT 0x08 /*!< \brief Byte 2 (Bit 19) */ +/*! \brief New in version 5.1 */ +#define HCI_EVT_MASK_LE_CONNLESS_IQ_REPORT_EVT 0x10 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CONN_IQ_REPORT_EVT 0x20 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CTE_REQ_FAILED_EVT 0x40 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_PER_SYNC_TRSF_RCVT_EVT 0x80 /*!< \brief Byte 2 (Bit 23) */ +/*! \brief New in version Milan */ +#define HCI_EVT_MASK_LE_CIS_EST_EVT 0x01 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_CIS_REQ_EVT 0x02 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_BIG_CMPL_EVT 0x04 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_BIG_SYNC_LOST_EVT 0x08 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_PEER_SCA_CMPL_EVT 0x10 /*!< \brief Byte 3 */ /**@}*/ /** \name LE supported features @@ -746,27 +899,43 @@ extern "C" { */ /**@{*/ /*! \brief New in version 4.0 */ -#define HCI_LE_SUP_FEAT_ENCRYPTION 0x0000001 /*!< \brief Encryption supported */ +#define HCI_LE_SUP_FEAT_ENCRYPTION 0x00000001 /*!< \brief Encryption supported */ /*! \brief New in version 4.1 */ -#define HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC 0x0000002 /*!< \brief Connection Parameters Request Procedure supported */ -#define HCI_LE_SUP_FEAT_EXT_REJECT_IND 0x0000004 /*!< \brief Extended Reject Indication supported */ -#define HCI_LE_SUP_FEAT_SLV_INIT_FEAT_EXCH 0x0000008 /*!< \brief Slave-Initiated Features Exchange supported */ -#define HCI_LE_SUP_FEAT_LE_PING 0x0000010 /*!< \brief LE Ping supported */ +#define HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC 0x00000002 /*!< \brief Connection Parameters Request Procedure supported */ +#define HCI_LE_SUP_FEAT_EXT_REJECT_IND 0x00000004 /*!< \brief Extended Reject Indication supported */ +#define HCI_LE_SUP_FEAT_SLV_INIT_FEAT_EXCH 0x00000008 /*!< \brief Slave-Initiated Features Exchange supported */ +#define HCI_LE_SUP_FEAT_LE_PING 0x00000010 /*!< \brief LE Ping supported */ /*! \brief New in version 4.2 */ -#define HCI_LE_SUP_FEAT_DATA_LEN_EXT 0x0000020 /*!< \brief Data Length Extension supported */ -#define HCI_LE_SUP_FEAT_PRIVACY 0x0000040 /*!< \brief LL Privacy supported */ -#define HCI_LE_SUP_FEAT_EXT_SCAN_FILT_POLICY 0x0000080 /*!< \brief Extended Scan Filter Policy supported */ +#define HCI_LE_SUP_FEAT_DATA_LEN_EXT 0x00000020 /*!< \brief Data Length Extension supported */ +#define HCI_LE_SUP_FEAT_PRIVACY 0x00000040 /*!< \brief LL Privacy supported */ +#define HCI_LE_SUP_FEAT_EXT_SCAN_FILT_POLICY 0x00000080 /*!< \brief Extended Scan Filter Policy supported */ /*! \brief New in version 5.0 */ -#define HCI_LE_SUP_FEAT_LE_2M_PHY 0x0000100 /*!< \brief LE 2M PHY supported */ -#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_TRANSMITTER 0x0000200 /*!< \brief Stable Modulation Index - Transmitter supported */ -#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_RECEIVER 0x0000400 /*!< \brief Stable Modulation Index - Receiver supported */ -#define HCI_LE_SUP_FEAT_LE_CODED_PHY 0x0000800 /*!< \brief LE Coded PHY supported */ -#define HCI_LE_SUP_FEAT_LE_EXT_ADV 0x0001000 /*!< \brief LE Extended Advertising supported */ -#define HCI_LE_SUP_FEAT_LE_PER_ADV 0x0002000 /*!< \brief LE Periodic Advertising supported */ -#define HCI_LE_SUP_FEAT_CH_SEL_2 0x0004000 /*!< \brief Channel Selection Algorithm #2 supported */ -#define HCI_LE_SUP_FEAT_LE_POWER_CLASS_1 0x0008000 /*!< \brief LE Power Class 1 supported */ -#define HCI_LE_SUP_MIN_NUM_USED_CH_PROCEDURE 0x0001000 /*!< \brief Mininum number used channels procedure supported */ -#define HCI_LE_SUP_REMOTE_PK_VALID 0x8000000 /*!< \brief Remote public key validation supported */ +#define HCI_LE_SUP_FEAT_LE_2M_PHY 0x00000100 /*!< \brief LE 2M PHY supported */ +#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_TRANSMITTER 0x00000200 /*!< \brief Stable Modulation Index - Transmitter supported */ +#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_RECEIVER 0x00000400 /*!< \brief Stable Modulation Index - Receiver supported */ +#define HCI_LE_SUP_FEAT_LE_CODED_PHY 0x00000800 /*!< \brief LE Coded PHY supported */ +#define HCI_LE_SUP_FEAT_LE_EXT_ADV 0x00001000 /*!< \brief LE Extended Advertising supported */ +#define HCI_LE_SUP_FEAT_LE_PER_ADV 0x00002000 /*!< \brief LE Periodic Advertising supported */ +#define HCI_LE_SUP_FEAT_CH_SEL_2 0x00004000 /*!< \brief Channel Selection Algorithm #2 supported */ +#define HCI_LE_SUP_FEAT_LE_POWER_CLASS_1 0x00008000 /*!< \brief LE Power Class 1 supported */ +#define HCI_LE_SUP_FEAT_MIN_NUN_USED_CHAN 0x00010000 /*!< \brief Minimum Number of Used Channels Procedure supported */ +/*! \brief New in version 5.1 */ +#define HCI_LE_SUP_FEAT_CONN_CTE_REQ 0x00020000 /*!< \brief Connection CTE Request supported */ +#define HCI_LE_SUP_FEAT_CONN_CTE_RSP 0x00040000 /*!< \brief Connection CTE Response supported */ +#define HCI_LE_SUP_FEAT_CONNLESS_CTE_TRANS 0x00080000 /*!< \brief Connectionless CTE Transmitter supported */ +#define HCI_LE_SUP_FEAT_CONNLESS_CTE_RECV 0x00100000 /*!< \brief Connectionless CTE Receiver supported */ +#define HCI_LE_SUP_FEAT_ANTENNA_SWITCH_AOD 0x00200000 /*!< \brief Anetenna Switching during CTE Transmission (AoD) supported */ +#define HCI_LE_SUP_FEAT_ANTENNA_SWITCH_AOA 0x00400000 /*!< \brief Anetenna Switching during CTE Reception (AoA) supported */ +#define HCI_LE_SUP_FEAT_RECV_CTE 0x00800000 /*!< \brief Receive Constant Tone Extension supported */ +#define HCI_LE_SUP_FEAT_PAST_SENDER 0x01000000 /*!< \brief Periodic Advertising Sync Transfer Sender supported */ +#define HCI_LE_SUP_FEAT_PAST_RECIPIENT 0x02000000 /*!< \brief Periodic Advertising Sync Transfer Recipient supported */ +#define HCI_LE_SUP_FEAT_SCA_UPDATE 0x04000000 /*!< \brief Sleep Clock Accuracy Update supported */ +#define HCI_LE_SUP_FEAT_REMOTE_PUB_KEY_VALIDATION 0x08000000 /*!< \brief Remote Public Key Validation supported */ +/*! \brief New in version Milan */ +#define HCI_LE_SUP_FEAT_CIS_MASTER 0x10000000 /*!< \brief Connected Isochronous Master Role supported */ +#define HCI_LE_SUP_FEAT_CIS_SLAVE 0x20000000 /*!< \brief Connected Isochronous Slave Role supported */ +#define HCI_LE_SUP_FEAT_ISO_BROADCASTER 0x40000000 /*!< \brief Isochronous Broadcaster Role supported */ +#define HCI_LE_SUP_FEAT_ISO_SYNC 0x80000000 /*!< \brief Isochronous Synchronizer Role supported */ /**@}*/ /** \name Advertising command parameters @@ -985,6 +1154,15 @@ extern "C" { #define HCI_CH_SEL_ALGO_2 0x01 /*!< \brief LE channel selection algorithm #2 used */ /**@}*/ +/** \name KeyType parameters + * + */ +/**@{*/ +#define HCI_PRIVATE_KEY_GENERATED 0x00 /*!< \brief Use generated private key */ +#define HCI_PRIVATE_KEY_DEBUG 0x01 /*!< \brief Use debug private key */ +/**@{*/ + +/**@{*/ /** \name Minimum number of used channels * */ @@ -992,6 +1170,45 @@ extern "C" { #define HCI_MIN_NUM_OF_USED_CHAN 8 /*!< \brief Minimum number of used channels */ /**@}*/ +/** \name Synchronization timeout for the periodic advertising +* +*/ +/**@{*/ +#define HCI_SYNC_MIN_TIMEOUT 0x000A /*!< \brief Minimum synchronization timeout */ +#define HCI_SYNC_MAX_TIMEOUT 0x4000 /*!< \brief Maximum synchronization timeout */ +/**@}*/ + +/** \name Maximum synchronization skip +* +*/ +/**@{*/ +#define HCI_SYNC_MAX_SKIP 0x01F3 /*!< \brief Maximum synchronization skip */ +/**@}*/ + +/** \name Maximum synchronization handle +* +*/ +/**@{*/ +#define HCI_SYNC_MAX_HANDLE 0x0EFF /*!< \brief Maximum synchronization handle */ +/**@}*/ + +/** \name Periodic sync transfer receive mode +* +*/ +/**@{*/ +#define HCI_SYNC_TRSF_MODE_OFF 0x00 /*!< \brief Periodic sync transfer receive is disabled */ +#define HCI_SYNC_TRSF_MODE_REP_DISABLED 0x01, /*!< \brief Periodic sync transfer receive is enabled, report event is disabled */ +#define HCI_SYNC_TRSF_MODE_REP_ENABLED 0x02, /*!< \brief Periodic sync transfer receive is enabled, report event is enabled */ +/**@}*/ + +/** \name Periodic advertising create sync options bits +* +*/ +/**@{*/ +#define HCI_OPTIONS_FILT_POLICY_BIT (1<<0) /*!< \brief filter policy bit */ +#define HCI_OPTIONS_INIT_RPT_ENABLE_BIT (1<<1) /*!< \brief initial periodic advertisement reporting bit */ +/**@}*/ + /** \name Misc command parameters * */ @@ -1001,7 +1218,7 @@ extern "C" { #define HCI_TX_PWR_MIN -30 /*!< \brief Minimum tx power dBm */ #define HCI_TX_PWR_MAX 20 /*!< \brief Maximum tx power dBm */ #define HCI_TX_PWR_NO_PREFERENCE 127 /*!< \brief Tx power no preference */ -#define HCI_VERSION 9 /*!< \brief HCI specification version */ +#define HCI_VERSION 6 /*!< \brief HCI specification version */ #define HCI_RSSI_MIN -127 /*!< \brief Minimum RSSI dBm */ #define HCI_RSSI_MAX 20 /*!< \brief Maximum RSSI dBm */ #define HCI_ADDR_TYPE_PUBLIC 0 /*!< \brief Public device address */ @@ -1049,6 +1266,44 @@ extern "C" { #define HCI_PHY_OPTIONS_S8_PREFERRED 0x02 /*!< \brief S=8 coding preferred when transmitting on LE Coded PHY */ /**@}*/ +/** \name CTE Slot Durations +* +*/ +/**@{*/ +#define HCI_CTE_SLOT_DURATION_NONE 0x00 /*!< \brief No switching and sampling */ +#define HCI_CTE_SLOT_DURATION_1_US 0x01 /*!< \brief Switching and sampling slots are 1 us each */ +#define HCI_CTE_SLOT_DURATION_2_US 0x02 /*!< \brief Switching and sampling slots are 2 us each */ +/**@}*/ + +/** \name Permitted CTE Type bits +* +*/ +/**@{*/ +#define HCI_CTE_TYPE_PERMIT_AOA_RSP_BIT (1<<0) /*!< \brief Allow AoA Constant Tone Extension Response */ +#define HCI_CTE_TYPE_PERMIT_AOD_RSP_1_US_BIT (1<<1) /*!< \brief Allow AoD Constant Tone Extension Response with 1 us slots */ +#define HCI_CTE_TYPE_PERMIT_AOD_RSP_2_US_BIT (1<<2) /*!< \brief Allow AoD Constant Tone Extension Response with 2 us slots */ +/**@}*/ + +/** \name Requested CTE Types +* +*/ +/**@{*/ +#define HCI_CTE_TYPE_REQ_AOA 0x00 /*!< \brief AoA Constant Tone Extension */ +#define HCI_CTE_TYPE_REQ_AOD_1_US 0x01 /*!< \brief AoD Constant Tone Extension with 1 us slots */ +#define HCI_CTE_TYPE_REQ_AOD_2_US 0x02 /*!< \brief AoD Constant Tone Extension with 2 us slots */ +/**@}*/ + +/** \name Bluetooth core specification versions + * + */ +/**@{*/ +#define HCI_VER_BT_CORE_SPEC_4_0 0x06 /*!< Bluetooth core specification 4.0 */ +#define HCI_VER_BT_CORE_SPEC_4_1 0x07 /*!< Bluetooth core specification 4.1 */ +#define HCI_VER_BT_CORE_SPEC_4_2 0x08 /*!< Bluetooth core specification 4.2 */ +#define HCI_VER_BT_CORE_SPEC_5_0 0x09 /*!< Bluetooth core specification 5.0 */ +#define HCI_VER_BT_CORE_SPEC_5_1 0x0A /*!< Bluetooth core specification 5.1 */ +/**@}*/ + /** \name Parameter lengths * */ @@ -1060,9 +1315,10 @@ extern "C" { #define HCI_ADV_DATA_LEN 31 /*!< \brief Length of advertising data */ #define HCI_SCAN_DATA_LEN 31 /*!< \brief Length of scan response data */ #define HCI_EXT_ADV_DATA_LEN 251 /*!< \brief Length of extended advertising data */ +#define HCI_EXT_ADV_CONN_DATA_LEN 191 /*!< \brief Length of extended connectable advertising data */ #define HCI_PER_ADV_DATA_LEN 252 /*!< \brief Length of periodic advertising data */ #define HCI_EXT_ADV_RPT_DATA_LEN 229 /*!< \brief Length of extended advertising report data */ -#define HCI_PER_ADV_RPT_DATA_LEN 248 /*!< \brief Length of periodic advertising report data */ +#define HCI_PER_ADV_RPT_DATA_LEN 247 /*!< \brief Length of periodic advertising report data */ #define HCI_CHAN_MAP_LEN 5 /*!< \brief Length of channel map byte array */ #define HCI_KEY_LEN 16 /*!< \brief Length of encryption key */ #define HCI_ENCRYPT_DATA_LEN 16 /*!< \brief Length of data used in encryption */ @@ -1075,6 +1331,24 @@ extern "C" { #define HCI_PER_ADV_RPT_DATA_LEN_OFFSET 6 /*!< \brief Length field offset of periodic advertising report data */ /**@}*/ +/** \name Number of Antenna IDs in Switching Pattern +* +*/ +/**@{*/ +#define HCI_MIN_NUM_ANTENNA_IDS 2 /*!< \brief Minimum number of Antenna IDs in switching pattern */ +#define HCI_MAX_NUM_ANTENNA_IDS 75 /*!< \brief Maximum number of Antenna IDs in switching pattern */ +/**@}*/ + +/** \name IQ Report Sample Counts +* +*/ +/**@{*/ +#define HCI_IQ_RPT_SAMPLE_CNT_MIN 9 /*!< \brief Minimum number of sample pairs in IQ report */ +#define HCI_IQ_RPT_SAMPLE_CNT_MAX 82 /*!< \brief Maximum number of sample pairs in IQ report */ + +#define HCI_CONN_IQ_RPT_SAMPLE_CNT_OFFSET 12 /*!< \brief Sample count field offset of connection IQ report */ +/**@}*/ + /** \name Company ID * */ @@ -1086,7 +1360,7 @@ extern "C" { * */ /**@{*/ -#define HCI_LOCAL_VER_MANUFACTURER_POS 4 +#define HCI_LOCAL_VER_MANUFACTURER_POS 4 /*!< \brief Manufacturer location in local version */ /**@}*/ /* \} */ /* STACK_HCI_API */ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/ll_defs.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_defs.h similarity index 78% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/ll_defs.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_defs.h index 33e169d83534664e55fc9052b01409b2678bdb43..89405d3bb169bc17d1041ccbd7dd092305a69dd9 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/ll_defs.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_defs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Link layer constant definitions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link layer constant definitions. */ /*************************************************************************************************/ @@ -59,31 +62,6 @@ extern "C" { #define LL_RAND_ADDR_TYPE_RPA UINT64_C(0x400000000000) /*!< Resolvable Private Address type. */ #define LL_RAND_ADDR_TYPE_NRPA UINT64_C(0x000000000000) /*!< Non-Resolvable Private Address type. */ -#define LL_MAX_NUM_PHYS (3) /*!< \brief Maximum number of scanning or initiating PHYs */ - -/** - * \brief PHY Definitions taken from LE Read PHY Commmand and LE Set PHY Command */ -#define LL_PHY_LE_PREF_TX (1) /*!< \brief Host preference for TX */ -#define LL_PHY_LE_PREF_RX (2) /*!< \brief Host preference for RX */ - -#define LL_PHY_LE_1M (1) /*!< \brief LE 1M PHY */ -#define LL_PHY_LE_2M (2) /*!< \brief LE 2M PHY */ -#define LL_PHY_LE_CODED (3) /*!< \brief LE Coded PHY */ -#define LL_PHY_LE_S8 (4) /*!< \brief LE Coded PHY S8 */ -#define LL_PHY_LE_S2 (5) /*!< \brief LE Coded PHY S2 */ - -#define LL_PHY_LE_CODED_PREF_NONE (0) /*!< \brief LE Coded PHY Options, no preference */ -#define LL_PHY_LE_CODED_PREF_S2 (1) /*!< \brief LE Coded PHY Options, pefer S2 */ -#define LL_PHY_LE_CODED_PREF_S8 (2) /*!< \brief LE Coded PHY Options, prefer S8 */ - -#define LL_PHY_LE_1M_BIT (0x1) /*!< \brief LE 1M PHY bit mask */ -#define LL_PHY_LE_2M_BIT (0x2) /*!< \brief LE 2M PHY bit mask */ -#define LL_PHY_LE_CODED_BIT (0x4) /*!< \brief LE Coded PHY bit mask */ - -/** - * \brief If defined, silently discards legacy advertisements. */ -#undef LL_DISCARD_LEGACY_ADVERTISEMENTS /*!< \brief If defined, silently discards legacy advertisements. */ - /*** Advertising PDU ***/ /*! \brief Advertising channel PDU types. */ @@ -105,7 +83,7 @@ enum LL_PDU_AUX_SCAN_RSP = 7, /*!< Auxiliary scan response PDU. */ LL_PDU_AUX_SYNC_IND = 7, /*!< Auxiliary synchronize PDU. */ LL_PDU_AUX_CHAIN_IND = 7, /*!< Auxiliary chain PDU. */ - LL_PDU_AUX_CONNECT_RSP = 8, /*!< Auxiliary connect response PDU. */ + LL_PDU_AUX_CONNECT_RSP = 8 /*!< Auxiliary connect response PDU. */ }; #define LL_SCAN_REQ_PDU_LEN 12 /*!< Size of a scan request PDU. */ @@ -117,15 +95,6 @@ enum #define LL_NUM_CHAN_ADV 3 /*!< Total number of advertising channels. */ #define LL_ADVBU_MAX_LEN 31 /*!< Maximum advertising channel host data length. */ -/*** - * Maximum advertising channel host data length. - * \todo Need to readjust according to spec. */ -#define LL_ADV_AUX_U_MAX_LEN 31 - -/*! - * Maximum ACAD field length (63 less flags field). - * \sa BLUETOOTH SPECIFICATION Version 5.0, Vol 6, Part B, Section 2.3.4 */ -#define LL_ADVB_ACAD_MAX_LEN (63-1) #define LL_ADVB_MAX_LEN 39 /*!< Maximum advertising channel PDU length. */ #define LL_ADVB_MIN_LEN (LL_ADVB_MAX_LEN - LL_ADVBU_MAX_LEN) /*!< Minimum advertising channel packet length. */ #define LL_ADVB_MAX_TIME_1M ((LL_BLE_US_PER_BYTE_1M * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_1M) @@ -137,34 +106,11 @@ enum #define LL_ADVB_MAX_TIME_S8 ((LL_BLE_US_PER_BYTE_CODED_S8 * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_CODED_S8) /*!< Maximum time for a Coded S8 advertising channel PDU. */ -#define LL_ADVB_PKT_MAX_USEC LL_ADVB_MAX_TIME_1M /*!< Maximum time in microseconds for an advertising packet. */ -/*** - * Maximum data channel PDU length. - * \sa BLUETOOTH SPECIFICATION Version 5.0, Vol 6, Part B, Section 2.3 */ -#define LL_ADV_AUX_MAX_LEN 258 -#define LL_ADV_AUX_MIN_LEN (LL_ADV_AUX_MAX_LEN - LL_ADV_AUX_U_MAX_LEN) /*!< Minimum auxillary advertising packet length. */ -#define LL_ADV_AUX_MAX_TIME_S8 (LL_BLE_US_PER_BYTE_CODED_S8 * LL_ADV_AUX_MAX_LEN) -#define LL_ADV_AUX_MIN_TIME_2M (LL_BLE_US_PER_BYTE_2M * LL_ADV_AUX_MIN_LEN) -#define LL_ADV_AUX_PKT_MAX_USEC (LL_ADV_AUX_MAX_TIME_S8) - +#define LL_ADV_PKT_MAX_USEC LL_ADVB_MAX_TIME_1M /*!< Maximum time in microseconds for an advertising packet. */ #define LL_SCAN_REQ_MAX_USEC ((8 * (LL_ADV_PREFIX_LEN + LL_SCAN_PREFIX_LEN)) + LL_MIN_PKT_TIME_US_1M) /*!< Maximum time in microseconds for a scan request packet. */ #define LL_SCAN_RSP_MAX_USEC LL_ADVB_MAX_TIME_1M /*!< Maximum time in microseconds for a scan response packet. */ -#define LL_SCAN_MIN_TICKS 0x0004 /*! Minimum scan interval and window is 2.5 ms */ -#define LL_SCAN_MAX_TICKS 0x4000 /*! Maximum scan interval and window is 10,240 ms */ - -/*! Time required to process aux ptr and reschedule a new BOD. */ -#define LL_AUX_ADV_SCH_DELAY_USEC (0) /*< \todo Need to measure delay. */ - -/*! Minimum scan interval and window is 2.5 ms - * \todo Determine minimum time for auxillary operation. */ -#define LL_AUX_SCAN_MIN_TICKS 0x0004 - -/*! Maximum scan interval and window is 10,240 ms - * \todo Determine maximum time for auxillary operation. */ -#define LL_AUX_SCAN_MAX_TICKS 0x4000 - #define LL_ADV_HDR_LEN 2 /*!< Advertising channel header length. */ #define LL_ADV_HDR_TYPE_OFFS 0 /*!< Advertising header type offset. */ #define LL_ADV_HDR_TYPE_MSK 0x0F /*!< Advertising header type mask. */ @@ -189,33 +135,9 @@ enum LL_EXT_HDR_ADI_BIT = (1 << 3), /*!< Extended header AdvDataInfo bit. */ LL_EXT_HDR_AUX_PTR_BIT = (1 << 4), /*!< Extended header AuxPtr bit. */ LL_EXT_HDR_SYNC_INFO_BIT = (1 << 5), /*!< Extended header SyncInfo bit. */ - LL_EXT_HDR_TX_PWR_BIT = (1 << 6), /*!< Extended header TxPower bit. */ + LL_EXT_HDR_TX_PWR_BIT = (1 << 6) /*!< Extended header TxPower bit. */ }; -/** \name Advertising event properties type bits - * - */ -/**@{*/ -#define LL_ADV_PROP_CONN_ADV_BIT (1<<0) /*!< \brief Connectable advertising bit */ -#define LL_ADV_PROP_SCAN_ADV_BIT (1<<1) /*!< \brief Scannable advertising bit */ -#define LL_ADV_PROP_DIRECT_ADV_BIT (1<<2) /*!< \brief Directed advertising bit */ -#define LL_ADV_PROP_CONN_DIRECT_ADV_BIT (1<<3) /*!< \brief High duty cycle connectable directed advertising bit */ -#define LL_ADV_PROP_USE_LEG_PDU_BIT (1<<4) /*!< \brief Use legacy advertising PDUs bit */ -#define LL_ADV_PROP_OMIT_ADV_ADDR_BIT (1<<5) /*!< \brief Omit advertiser's address from all PDUs (anonymous advertising) bit */ -#define LL_ADV_PROP_INC_TX_PWR_BIT (1<<6) /*!< \brief Include TxPower in extended header of advertising PDU bit */ -/**@}*/ - -/** \name Advertising event properties for legacy PDUs - * - */ -/**@{*/ -#define LL_ADV_PROP_LEG_CONN_UNDIRECT 0x13 /*!< \brief Connectable and scannable undirected advertising (00010011b) */ -#define LL_ADV_PROP_LEG_CONN_DIRECT 0x1D /*!< \brief Connectable directed high duty cycle advertising (00011101b) */ -#define LL_ADV_PROP_LEG_SCAN_UNDIRECT 0x12 /*!< \brief Scannable undirected advertising (00010010b) */ -#define LL_ADV_PROP_LEG_NONCONN_UNDIRECT 0x10 /*!< \brief Non-connectable and non-scannable undirected advertising (00010000b) */ -#define LL_ADV_PROP_LEG_CONN_DIRECT_LO_DUTY 0x15 /*!< \brief Connectable directed low duty cycle advertising (00010101b) */ -/**@}*/ - #define LL_MAX_ADV_HANDLE 0xEF /*!< Maximum advertising handle. */ #define LL_MAX_ADV_SID 0x0F /*!< Maximum advertising SID */ @@ -322,7 +244,7 @@ enum LL_LLID_EMPTY_PDU = 0x01, /*!< Empty PDU. */ LL_LLID_CONT_PDU = 0x01, /*!< Data PDU: continuation fragment of an L2CAP message. */ LL_LLID_START_PDU = 0x02, /*!< Data PDU: start of an L2CAP message or a complete L2CAP message with no fragmentation. */ - LL_LLID_CTRL_PDU = 0x03, /*!< Control PDU. */ + LL_LLID_CTRL_PDU = 0x03 /*!< Control PDU. */ }; /*** Encryption ***/ @@ -335,7 +257,6 @@ enum #define LL_KEY_LEN 16 /*!< Encryption key length. */ #define LL_SKD_LEN LL_KEY_LEN /*!< Session key diversifier length. */ #define LL_IV_LEN 8 /*!< Initialization vector length. */ -#define LL_ENCRYPT_DATA_LEN 16 /*!< Number of bytes in the encryption block */ #define LL_DEF_AUTH_TO_MS 30000 /*!< Default authentication timeout in milliseconds. */ @@ -428,4 +349,3 @@ enum #endif #endif /* LL_DEFS_H */ -/* vim: set noexpandtab ts=2 sw=2: */ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/ll_math.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_math.h similarity index 81% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/ll_math.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_math.h index 145c1f2564ee4b7bdbfbb0af6e93d9f3c89788a6..abcf79d19db68a396d105704f42351d4c4fed2b3 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/ll_math.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/ll_math.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Link Layer math utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Link Layer math utilities. */ /*************************************************************************************************/ #ifndef LL_MATH_H @@ -116,18 +119,6 @@ void LlMathAesEcb(const uint8_t *pKey, uint8_t *pOut, const uint8_t *pIn); /*************************************************************************************************/ void LlMathEccSetServiceCback(LlMathEccServiceCback_t cback); -/*************************************************************************************************/ -/*! - * \brief Generate a P-256 public key pair. - * - * \param pPrivKey Return pointer for private key. - * \param pPubKey Return pointer for public key. - * - * \return None. - */ -/*************************************************************************************************/ -void LlMathEccGenerateP256KeyPair(uint8_t *pPrivKey, uint8_t *pPubKey); - /*************************************************************************************************/ /*! * \brief Start generating P-256 key pair. @@ -169,19 +160,6 @@ bool_t LlMathEccGenerateP256KeyPairContinue(void); /*************************************************************************************************/ void LlMathEccGenerateP256KeyPairComplete(uint8_t *pPubKey, uint8_t *pPrivKey); -/*************************************************************************************************/ -/*! - * \brief Generate a Diffie-Hellman key. - * - * \param pPubKey Public key. - * \param pPrivKey Private key. - * \param pDhKey Return pointer for computed DH Key. - * - * \return False if there is an error with the public key, True if success. - */ -/*************************************************************************************************/ -bool_t LlMathEccGenerateDhKey(const uint8_t *pPubKey, const uint8_t *pPrivKey, uint8_t *pDhKey); - /*************************************************************************************************/ /*! * \brief Start generating Diffie-Hellman key. diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_154_api.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_154_api.h similarity index 65% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/platform_154_api.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_154_api.h index ed423f0a757b2c38a831f2b8a136753146470b5a..af86f51d01e2ead25d4d0ce47d0757119a3f03b7 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_154_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_154_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Platform interface file: mac154-specific. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Platform interface file: mac154-specific. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_api.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_api.h similarity index 93% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/platform_api.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_api.h index 056682be51d1976d354ba46aaae959f583ad6722..8539fdf225d53dc708ee43bf2e06e4e336a5876d 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Baseband interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband interface file. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_ble_api.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_ble_api.h similarity index 84% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/platform_ble_api.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_ble_api.h index be4cee631732db19df2daa096d4919e1597f8254..ca7b532fda5daa19c91911e7907759bbced75eaf 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/platform_ble_api.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/platform_ble_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Platform interface file: ble-specific. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Platform interface file: ble-specific. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/radio_drv.h b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/radio_drv.h similarity index 94% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/radio_drv.h rename to lib/sdk/Libraries/BTLE/link_layer/platform/common/include/radio_drv.h index c5e01d4fd8dc631be87ed5efdcbf3e231daf29ff..d14268a7f17864c0ed0509601c912fe14ff6e679 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/radio_drv.h +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/include/radio_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Radio driver interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Radio driver interface file. */ /*************************************************************************************************/ diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_pdufilt.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_pdufilt.c new file mode 100644 index 0000000000000000000000000000000000000000..a0749ee19b59fd5c36324bf350a1a8d9e6125e48 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_pdufilt.c @@ -0,0 +1,754 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE device filtering implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_ble_api.h" +#include "bb_ble_api_pdufilt.h" +#include "bb_ble_api_reslist.h" +#include "bb_ble_api_whitelist.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "util/bda.h" +#include "util/bstream.h" +#include "ll_defs.h" +#include "cfg_mac_ble.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Mask of extended PDUs. */ +#define BB_EXT_PDU_FILT_MASK ((1 << LL_PDU_ADV_EXT_IND) | \ + (1 << LL_PDU_AUX_ADV_IND) | \ + (1 << LL_PDU_AUX_SCAN_RSP) | \ + (1 << LL_PDU_AUX_SYNC_IND) | \ + (1 << LL_PDU_AUX_CHAIN_IND) | \ + (1 << LL_PDU_AUX_CONNECT_RSP)) + +/*! \brief Tri-state result. */ +enum +{ + BB_BLE_PDU_FILT_UNKNOWN, + BB_BLE_PDU_FILT_OK, + BB_BLE_PDU_FILT_NOT_OK +}; + +#define BB_ADV_HDR_TX_ADD_SHIFT 6 /*!< ADV header Tx Address type field shift. */ +#define BB_ADV_HDR_RX_ADD_SHIFT 7 /*!< ADV header Rx Address type field shift. */ + +/*! \brief Increment statistics counter. */ +#define BB_INC_PDUFILT_STAT(s) bbBlePduFiltStats.s++ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief PDU filter statistics. */ +BbBlePduFiltStats_t bbBlePduFiltStats = { 0 }; + +#if (LL_ENABLE_TESTER) +/*! \brief Enable PDU filter bypass. */ +bool_t bbBlePduFiltEnableBypass = FALSE; +#endif + +/*************************************************************************************************/ +/*! + * \brief Resolve peer address. + * + * \param peerAddrResEna TRUE if peer address resolution is enabled. + * \param forceRes TRUE if address resolution should be forced. + * \param pPeerAddrRand TRUE if peer address random (and storage for TRUE for peer ID address). + * \param pPeerAddr Peer address (and storage for peer ID address). + * + * \return Tri-state result (OK, NOT_OK, UNKNOWN). + */ +/*************************************************************************************************/ +static uint8_t bbBlePduFiltResolvePeer(bool_t peerAddrResEna, bool_t forceRes, + uint8_t *pPeerAddrRand, uint64_t *pPeerAddr) +{ + if (peerAddrResEna) + { + /* Do not check for RPAs in resolving list. */ + if (*pPeerAddrRand && BDA64_ADDR_IS_RPA(*pPeerAddr)) + { + uint64_t rpa = *pPeerAddr; + + /* Resolve peer address. */ + if (forceRes) + { + /* The identity address or RPA will be accepted based upon match. */ + (void)BbBleResListResolvePeer(rpa, pPeerAddrRand, pPeerAddr); + return BB_BLE_PDU_FILT_OK; + } + + /* Pre-resolve peer address. */ + else if (BbBleResListCheckResolvePeer(rpa, pPeerAddrRand, pPeerAddr)) + { + /* The identity address will be accepted based upon match. */ + return BB_BLE_PDU_FILT_OK; + } + + else + { + /* + * This address possibly is resolvable. Match (in case the match is a RPA) or allow + * re-evaluation at task level. + */ + BB_INC_PDUFILT_STAT(passPeerAddrResOpt); + return BB_BLE_PDU_FILT_UNKNOWN; + } + } + else + { + switch (BbBleResListPeerStatus(*pPeerAddrRand, *pPeerAddr)) + { + /*** other than RPA that cannot have RPA ***/ + + case BB_BLE_RESLIST_STATUS_ZERO_IRK: + case BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST: + /* The address will be accepted based upon match. */ + return BB_BLE_PDU_FILT_OK; + + /*** other than RPA that can have RPA ***/ + + case BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED: + case BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED: + { + uint8_t privMode; + + /* Refuse to accept peer identity address. */ + if (!BbBleResListGetPrivacyMode(*pPeerAddrRand, *pPeerAddr, &privMode) || + (privMode == BB_BLE_RESLIST_PRIV_MODE_NETWORK)) + { + BB_INC_PDUFILT_STAT(failPeerPrivAddrReq); + return BB_BLE_PDU_FILT_NOT_OK; + } + + /* The address will be accepted based upon match. */ + else + { + return BB_BLE_PDU_FILT_OK; + } + } + } + } + } + + /* Address will be accepted based upon match. */ + return BB_BLE_PDU_FILT_OK; +} + +/*************************************************************************************************/ +/*! + * \brief Match peer address. + * + * \param addrMatchEna TRUE if address match enabled. + * \param idAddrRand TRUE if address random. + * \param idAddr Address. + * \param addrMatchRand TRUE if match random. + * \param addrMatch Match. + * + * \return Tri-state result (OK, NOT_OK, UNKNOWN). + */ +/*************************************************************************************************/ +bool_t bbBlePduFiltMatchPeer(bool_t addrMatchEna, bool_t idAddrRand, uint64_t idAddr, + bool_t addrMatchRand, uint64_t addrMatch) +{ + if (addrMatchEna) + { + if ((idAddr != addrMatch) || (idAddrRand != addrMatchRand)) + { + BB_INC_PDUFILT_STAT(failPeerAddrMatch); + return BB_BLE_PDU_FILT_NOT_OK; + } + else + { + BB_INC_PDUFILT_STAT(passPeerAddrMatch); + return BB_BLE_PDU_FILT_OK; + } + } + return BB_BLE_PDU_FILT_UNKNOWN; +} + +/*************************************************************************************************/ +/*! + * \brief Whitelist peer address. + * + * \param peerWhiteListEna TRUE if peer address whitelist enabled. + * \param peerIdAddrRand TRUE if peer address random. + * \param peerIdAddr Peer address. + * + * \return Tri-state result (OK, NOT_OK, UNKNOWN). + */ +/*************************************************************************************************/ +bool_t bbBlePduFiltWhiteList(bool_t peerWhiteListEna, bool_t peerIdAddrRand, + uint64_t peerIdAddr) +{ + if (peerWhiteListEna) + { + if ((peerIdAddr == 0) && /* Tx address is empty(AdvA is not present). */ + (BbBleWhiteListIsAnonymousAllowed() == TRUE)) /* Anonymous advertising is allowed. */ + { + BB_INC_PDUFILT_STAT(passWlFilt); + return BB_BLE_PDU_FILT_OK; + } + + if (!BbBleWhiteListCheckAddr(peerIdAddrRand, peerIdAddr)) + { + BB_INC_PDUFILT_STAT(failWlFilt); + return BB_BLE_PDU_FILT_NOT_OK; + } + else + { + BB_INC_PDUFILT_STAT(passWlFilt); + return BB_BLE_PDU_FILT_OK; + } + } + return BB_BLE_PDU_FILT_UNKNOWN; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve local address. + * + * \param localAddrResEna TRUE if local address resolution is enabled. + * \param forceRes TRUE if address resolution should be forced. + * \param localAddrRand TRUE if local address random. + * \param localAddr Local address. + * \param peerAddrRand TRUE if peer address random. + * \param peerAddr Peer address. + * + * \return Tri-state result (OK, NOT_OK, UNKNOWN). + */ +/*************************************************************************************************/ +uint8_t bbBlePduFiltResolveLocal(bool_t localAddrResEna, bool_t forceRes, + uint8_t localAddrRand, uint64_t localAddr, + uint8_t peerAddrRand, uint64_t peerAddr) +{ + if (localAddrResEna) + { + /* Do not check for RPAs in resolving list. */ + if (localAddrRand && BDA64_ADDR_IS_RPA(localAddr)) + { + if (forceRes) + { + /* Resolve address if possible. The check on success will be done in the subsequent check call. */ + (void)BbBleResListResolveLocal(localAddr, &peerAddrRand, &peerAddr); + } + + /* Pre-resolve local address. */ + if (BbBleResListCheckResolveLocal(localAddr, peerAddrRand, peerAddr)) + { + /* The address is resolved and passes filter. */ + return BB_BLE_PDU_FILT_OK; + } + else + { + /* + * This address possibly is resolvable. Match (in case the match is a RPA) or allow + * re-evaluation at task level. + */ + return BB_BLE_PDU_FILT_UNKNOWN; + } + } + else + { + switch (BbBleResListLocalStatus(peerAddrRand, peerAddr)) + { + /*** other than RPA that cannot have RPA ***/ + + case BB_BLE_RESLIST_STATUS_ZERO_IRK: + case BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST: + /* Address will be accepted based upon match. */ + return BB_BLE_PDU_FILT_UNKNOWN; + + /*** other than RPA that can have RPA ***/ + + case BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED: + case BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED: + /* Refuse to accept local identity address. */ + BB_INC_PDUFILT_STAT(failLocalPrivAddrReq); + return BB_BLE_PDU_FILT_NOT_OK; + } + } + } + + /* Address will be accepted based upon match. */ + return BB_BLE_PDU_FILT_UNKNOWN; +} + +/*************************************************************************************************/ +/*! + * \brief Match local address. + * + * \param addrMatchEna TRUE if address match enabled. + * \param idAddrRand TRUE if address random. + * \param idAddr Address. + * \param addrMatchRand TRUE if match random. + * \param addrMatch Match. + * + * \return Tri-state result (OK, NOT_OK, UNKNOWN). + */ +/*************************************************************************************************/ +bool_t bbBlePduFiltMatchLocal(bool_t addrMatchEna, bool_t idAddrRand, uint64_t idAddr, + bool_t addrMatchRand, uint64_t addrMatch) +{ + if (addrMatchEna) + { + if ((idAddr != addrMatch) || (idAddrRand != addrMatchRand)) + { + BB_INC_PDUFILT_STAT(failLocalAddrMatch); + return BB_BLE_PDU_FILT_NOT_OK; + } + else + { + BB_INC_PDUFILT_STAT(passLocalAddrMatch); + return BB_BLE_PDU_FILT_OK; + } + } + return BB_BLE_PDU_FILT_UNKNOWN; +} + +/*************************************************************************************************/ +/*! + * \brief Check if PDU is allowed, i.e., should not be ignored. + * + * \param pBuf PDU buffer. + * \param pFiltParams Filter parameters. + * \param forceRes TRUE if address resolution should be forced. + * \param pFiltResults Storage for filter results. + * + * \return TRUE if PDU is allowed, FALSE if PDU should be ignored. + */ +/*************************************************************************************************/ +bool_t BbBlePduFiltCheck(const uint8_t *pBuf, const bbBlePduFiltParams_t *pFiltParams, + bool_t forceRes, bbBlePduFiltResults_t *pFiltResults) +{ + bool_t peerAddrRand; + uint64_t peerAddr; + uint8_t result, pduType, pduLen, matchResult; + +#if (LL_ENABLE_TESTER) + if (bbBlePduFiltEnableBypass) + { + pFiltResults->peerAddr = BstreamToBda64(pBuf + LL_ADV_HDR_LEN); + pFiltResults->peerAddrRand = ((pBuf[0] >> BB_ADV_HDR_TX_ADD_SHIFT) & 1); + pFiltResults->peerMatch = TRUE; + return TRUE; + } +#endif + + /*** Filter PDU by PDU type. ***/ + + pduType = pBuf[0] & LL_ADV_HDR_TYPE_MSK; + pduLen = pBuf[1] & LL_ADV_HDR_LEN_MSK; + + if ((pFiltParams->pduTypeFilt & (1 << pduType)) == 0) + { + BB_INC_PDUFILT_STAT(failPduTypeFilt); + return FALSE; + } + BB_INC_PDUFILT_STAT(passPduTypeFilt); + + if (BB_EXT_PDU_FILT_MASK & (1 << pduType)) + { + /* Client handles filtering for extended packets. */ + return TRUE; + } + + pFiltResults->pduType = pduType; + pFiltResults->pduLen = pduLen; + + /*** Peer address resolution. ***/ + + peerAddrRand = ((pBuf[0] >> BB_ADV_HDR_TX_ADD_SHIFT) & 1); + peerAddr = BstreamToBda64(pBuf + LL_ADV_HDR_LEN); + + pFiltResults->peerAddr = pFiltResults->peerIdAddr = peerAddr; + pFiltResults->peerAddrRand = pFiltResults->peerIdAddrRand = peerAddrRand; + + result = BB_BLE_PDU_FILT_UNKNOWN; + + /* Resolve peer address to pass through filters. */ + switch (bbBlePduFiltResolvePeer(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_RES_ENA), + forceRes, + &pFiltResults->peerIdAddrRand, + &pFiltResults->peerIdAddr)) + { + case BB_BLE_PDU_FILT_OK: + result = BB_BLE_PDU_FILT_OK; + break; + case BB_BLE_PDU_FILT_NOT_OK: + return FALSE; + case BB_BLE_PDU_FILT_UNKNOWN: + /* Unknown resolution status may be re-evaluated at task level. */ + result = BB_BLE_PDU_FILT_UNKNOWN; + break; + } + + /*** Address match OR whitelist (should be exclusive). ***/ + + matchResult = WSF_MAX(bbBlePduFiltMatchPeer(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_MATCH_ENA), + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr, + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_MATCH_RAND), + pFiltParams->peerAddrMatch), + bbBlePduFiltWhiteList((pFiltParams->wlPduTypeFilt & (1 << pduType)) != 0, + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr)); + + /* Filter PDU by match. */ + switch (matchResult) + { + case BB_BLE_PDU_FILT_NOT_OK: + if (result == BB_BLE_PDU_FILT_OK) /* Address was resolved but match failed. */ + { + return FALSE; + } + break; + case BB_BLE_PDU_FILT_OK: + /* Address matched; lack of resolution is irrelevant. */ + result = BB_BLE_PDU_FILT_OK; + break; + case BB_BLE_PDU_FILT_UNKNOWN: + if (result == BB_BLE_PDU_FILT_UNKNOWN) + { + /* Address was not resolved and match is not required, not filter the PDU. */ + result = BB_BLE_PDU_FILT_OK; + } + break; + } + + /* + * The peer matched if + * ((address was resolved) AND (match did not fail)) OR + * ((address does not violate network privacy) AND (match succeeded)). + * Otherwise, the resolution status will be re-evaluated at task level. + */ + pFiltResults->peerMatch = (result == BB_BLE_PDU_FILT_OK); + + /*** Local address. ***/ + + /* The address matches by default. */ + pFiltResults->localMatch = TRUE; + + switch (pduType) + { + case LL_PDU_ADV_DIRECT_IND: + case LL_PDU_SCAN_REQ: + case LL_PDU_CONNECT_IND: + { + bool_t localAddrRand = ((pBuf[0] >> BB_ADV_HDR_RX_ADD_SHIFT) & 1); + uint64_t localAddr = BstreamToBda64(pBuf + LL_ADV_HDR_LEN + BDA_ADDR_LEN); + + /* + * Note: Local address resolution and address match should be effectively exclusive. Modes + * in which the local address is evaluated as a RPA then matched successfully against + * the ID address require address resolution enabled and a RPA programmed as the random + * address. The result will be predictable; nevertheless, the scenario is unexpected. + * + * The extended scanner filter policy is a sometime exception to the exclusivity of + * resolution and match; however, resolution is not required. + */ + + /* Test local address resolution before testing match. */ + switch (bbBlePduFiltResolveLocal(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_RES_ENA), + forceRes, + localAddrRand, + localAddr, + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr)) + { + case BB_BLE_PDU_FILT_OK: + /* The address is resolved and does not need to be compared to the local ID address. */ + return TRUE; + case BB_BLE_PDU_FILT_NOT_OK: + /* Reject local address if resolution is required but impossible. */ + return FALSE; + case BB_BLE_PDU_FILT_UNKNOWN: + /* Otherwise pass address through match. */ + break; + } + + /* Test local address match. */ + switch (bbBlePduFiltMatchLocal(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_MATCH_ENA), + localAddrRand, + localAddr, + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_MATCH_RAND), + pFiltParams->localAddrMatch)) + { + case BB_BLE_PDU_FILT_NOT_OK: + /* If local address resolution is optional, allow this PDU. */ + if (localAddrRand && BDA64_ADDR_IS_RPA(localAddr) && + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_RES_OPT)) + { + BB_INC_PDUFILT_STAT(passLocalAddrResOpt); + pFiltResults->localMatch = FALSE; + return TRUE; + } + /* Otherwise ignore this PDU. */ + return FALSE; + case BB_BLE_PDU_FILT_OK: + case BB_BLE_PDU_FILT_UNKNOWN: + /* If address matched or match was not enabled, allow this PDU. */ + break; + } + break; + } + + default: + /* If no address, allow this PDU. */ + break; + } + + /* PDU should be allowed. */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Check if PDU is allowed, i.e., should not be ignored. + * + * \param pExtFiltParams Extended filter parameters. + * \param pFiltParams Filter parameters. + * \param forceRes TRUE if address resolution should be forced. + * \param pFiltResults Storage for filter results. + * + * \return TRUE if PDU is allowed, FALSE if PDU should be ignored. + */ +/*************************************************************************************************/ +bool_t BbBleExtPduFiltCheck(const bbBlePduExtFiltParams_t *pExtFiltParams, + const bbBlePduFiltParams_t *pFiltParams, + bool_t forceRes, bbBlePduFiltResults_t *pFiltResults) +{ + uint8_t result, matchResult; + +#if (LL_ENABLE_TESTER) + if (bbBlePduFiltEnableBypass) + { + pFiltResults->peerAddr = pExtFiltParams->peerAddr; + pFiltResults->peerAddrRand = pExtFiltParams->peerAddrRand; + pFiltResults->peerMatch = TRUE; + return TRUE; + } +#endif + + /*** Filter PDU by PDU type. ***/ + if ((pFiltParams->pduTypeFilt & (1 << pExtFiltParams->pduType)) == 0) + { + BB_INC_PDUFILT_STAT(failPduTypeFilt); + return FALSE; + } + BB_INC_PDUFILT_STAT(passPduTypeFilt); + + /*** Peer address resolution. ***/ + + pFiltResults->peerAddr = pFiltResults->peerIdAddr = pExtFiltParams->peerAddr; + pFiltResults->peerAddrRand = pFiltResults->peerIdAddrRand = pExtFiltParams->peerAddrRand; + + result = BB_BLE_PDU_FILT_UNKNOWN; + + /* Resolve peer address to pass through filters. */ + switch (bbBlePduFiltResolvePeer(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_RES_ENA), + forceRes, + &pFiltResults->peerIdAddrRand, + &pFiltResults->peerIdAddr)) + { + case BB_BLE_PDU_FILT_OK: + result = BB_BLE_PDU_FILT_OK; + break; + case BB_BLE_PDU_FILT_NOT_OK: + return FALSE; + case BB_BLE_PDU_FILT_UNKNOWN: + /* Unknown resolution status may be re-evaluated at task level. */ + result = BB_BLE_PDU_FILT_UNKNOWN; + break; + } + + /*** Address match OR whitelist (should be exclusive). ***/ + + matchResult = WSF_MAX(bbBlePduFiltMatchPeer(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_MATCH_ENA), + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr, + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, PEER_ADDR_MATCH_RAND), + pFiltParams->peerAddrMatch), + bbBlePduFiltWhiteList((pFiltParams->wlPduTypeFilt & (1 << pExtFiltParams->pduType)) != 0, + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr)); + + /* Filter PDU by match. */ + switch (matchResult) + { + case BB_BLE_PDU_FILT_NOT_OK: + if (result == BB_BLE_PDU_FILT_OK) /* Address was resolved but match failed. */ + { + return FALSE; + } + break; + case BB_BLE_PDU_FILT_OK: + /* Address matched; lack of resolution is irrelevant. */ + result = BB_BLE_PDU_FILT_OK; + break; + case BB_BLE_PDU_FILT_UNKNOWN: + if (result == BB_BLE_PDU_FILT_UNKNOWN) + { + /* Address was not resolved and match is not required, not filter the PDU. */ + result = BB_BLE_PDU_FILT_OK; + } + break; + } + + /* + * The peer matched if + * ((address was resolved) AND (match did not fail)) OR + * ((address does not violate network privacy) AND (match succeeded)). + * Otherwise, the resolution status will be re-evaluated at task level. + */ + pFiltResults->peerMatch = (result == BB_BLE_PDU_FILT_OK); + + /*** Local address. ***/ + + /* The address matches by default. */ + pFiltResults->localMatch = TRUE; + + if (pExtFiltParams->extHdrFlags & LL_EXT_HDR_TGT_ADDR_BIT) + { + bool_t localAddrRand = pExtFiltParams->localAddrRand; + uint64_t localAddr = pExtFiltParams->localAddr; + + /* + * Note: Local address resolution and address match should be effectively exclusive. Modes + * in which the local address is evaluated as a RPA then matched successfully against + * the ID address require address resolution enabled and a RPA programmed as the random + * address. The result will be predictable; nevertheless, the scenario is unexpected. + * + * The extended scanner filter policy is a sometime exception to the exclusivity of + * resolution and match; however, resolution is not required. + */ + + /* Test local address resolution before testing match. */ + switch (bbBlePduFiltResolveLocal(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_RES_ENA), + forceRes, + localAddrRand, + localAddr, + pFiltResults->peerIdAddrRand, + pFiltResults->peerIdAddr)) + { + case BB_BLE_PDU_FILT_OK: + /* The address is resolved and does not need to be compared to the local ID address. */ + return TRUE; + case BB_BLE_PDU_FILT_NOT_OK: + /* Reject local address if resolution is required but impossible. */ + return FALSE; + case BB_BLE_PDU_FILT_UNKNOWN: + /* Otherwise pass address through match. */ + break; + } + + /* Test local address match. */ + switch (bbBlePduFiltMatchLocal(BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_MATCH_ENA), + localAddrRand, + localAddr, + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_MATCH_RAND), + pFiltParams->localAddrMatch)) + { + case BB_BLE_PDU_FILT_NOT_OK: + /* If local address resolution is optional, allow this PDU. */ + if (localAddrRand && BDA64_ADDR_IS_RPA(localAddr) && + BB_BLE_PDU_FILT_FLAG_IS_SET(pFiltParams, LOCAL_ADDR_RES_OPT)) + { + BB_INC_PDUFILT_STAT(passLocalAddrResOpt); + pFiltResults->localMatch = FALSE; + return TRUE; + } + + /* Otherwise ignore this PDU. */ + return FALSE; + case BB_BLE_PDU_FILT_OK: + case BB_BLE_PDU_FILT_UNKNOWN: + /* If address matched or match was not enabled, allow this PDU. */ + break; + } + } + + /* PDU should be allowed. */ + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Get PDU filter statistics. + * + * \param pStats PDU filter statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleGetPduFiltStats(BbBlePduFiltStats_t *pStats) +{ + *pStats = bbBlePduFiltStats; +} + +/*************************************************************************************************/ +/*! + * \brief Get the peer ID address. + * + * \param pFiltResults Filter results. + * \param pPeerIdAddr Storage for peer ID address. + * \param pPeerIdAddrType Storage for peer ID address type; + * + * \return None. + */ +/*************************************************************************************************/ +void BbBlePduFiltResultsGetPeerIdAddr(const bbBlePduFiltResults_t *pFiltResults, uint64_t *pPeerIdAddr, uint8_t *pPeerIdAddrType) +{ + const unsigned int addrIdBit = 1 << 1; + + *pPeerIdAddrType = pFiltResults->peerIdAddrRand; + if ((pFiltResults->peerIdAddrRand != pFiltResults->peerAddrRand) || + (pFiltResults->peerIdAddr != pFiltResults->peerAddr)) + { + *pPeerIdAddrType |= addrIdBit; + } + *pPeerIdAddr = pFiltResults->peerIdAddr; +} + +/*************************************************************************************************/ +/*! + * \brief Get the peer RPA. + * + * \param pFiltResults Filter results. + * \param pPeerRpa Storage for peer RPA or 0. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBlePduFiltResultsGetPeerRpa(const bbBlePduFiltResults_t *pFiltResults, uint64_t *pPeerRpa) +{ + *pPeerRpa = 0; + if ((pFiltResults->peerIdAddrRand != pFiltResults->peerAddrRand) || + (pFiltResults->peerIdAddr != pFiltResults->peerAddr)) + { + *pPeerRpa = pFiltResults->peerAddr; + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_periodiclist.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_periodiclist.c new file mode 100644 index 0000000000000000000000000000000000000000..63accd524a3e79efbe0b1dda63f50497a264a108 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_periodiclist.c @@ -0,0 +1,224 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE whitelist implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "util/bda.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Periodic list filter table entry. */ +typedef struct +{ + uint64_t addr; /*!< Address. */ + uint8_t addrType; /*!< Address type. */ + uint8_t SID; /*!< Set ID. */ +} bbBlePeriodicListEntry_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +static bbBlePeriodicListEntry_t *pBbBlePeriodicListFilt; /*!< Periodic list filter. */ +static uint8_t bbBlePeriodicListNumEntries; /*!< Number of valid periodic list entries. */ +static uint8_t bbBlePeriodicListNumEntriesMax; /*!< Maximum number of periodic list entries. */ + +/*************************************************************************************************/ +/*! + * \brief Initialize periodic list. + * + * \param numEntries Number of periodic list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the white list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitPeriodicList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + + bbBlePeriodicListNumEntries = 0; + bbBlePeriodicListNumEntriesMax = 0; + + /* Allocate memory. */ + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & (uint32_t)~0x3) + sizeof(uint32_t)); + } + pBbBlePeriodicListFilt = (bbBlePeriodicListEntry_t *)pAvailMem; + pAvailMem += sizeof(bbBlePeriodicListEntry_t) * numEntries; + + /* Check memory allocation. */ + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + WSF_ASSERT(FALSE); + return 0; + } + + bbBlePeriodicListNumEntriesMax = numEntries; + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Check if address is periodic listed. + * + * \param addrType Address type. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * \return TRUE if periodic listed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListCheckAddr(uint8_t addrType, uint64_t addr, uint8_t SID) +{ + uint8_t i; + + for (i = 0; i < bbBlePeriodicListNumEntries; i++) + { + if ((pBbBlePeriodicListFilt[i].addrType == addrType) && + (pBbBlePeriodicListFilt[i].addr == addr) && + (pBbBlePeriodicListFilt[i].SID == SID)) + { + /* Peer is in periodic list, allow PDU to pass through the filter. */ + return TRUE; + } + } + + /* Peer is not in periodic list, filter out PDU. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get periodic list size. + * + * \return Total number of periodic list entries. + * + * Read the periodic list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBlePeriodicListGetSize(void) +{ + return bbBlePeriodicListNumEntriesMax; +} + +/*************************************************************************************************/ +/*! + * \brief Clear all periodic list entries. + * + * \return None. + * + * Clear all periodic list entries stored in the BB. + * + * \note No resource synchronization is required to modify the periodic list resource as + * the LL modifies the periodic list only when advertising events are disabled. + */ +/*************************************************************************************************/ +void BbBlePeriodicListClear(void) +{ + bbBlePeriodicListNumEntries = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Add device to the periodic list. + * + * \param addrType Address type. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * \return TRUE if successful, FALSE if list full. + * + * Adds the given address to the periodic list stored in the BB. + * + * \note No resource synchronization is required to modify the periodic list resource as + * the LL modifies the periodic list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListAdd(uint8_t addrType, uint64_t addr, uint8_t SID) +{ + if (bbBlePeriodicListNumEntries < bbBlePeriodicListNumEntriesMax) + { + pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries].addrType = addrType; + pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries].addr = addr; + pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries].SID = SID; + + bbBlePeriodicListNumEntries++; + return TRUE; + } + + /* List full. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from the periodic list. + * + * \param addrType Address type. + * \param addr Bluetooth device address. + * \param SID Set ID. + * + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Removes the given address from the periodic list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBlePeriodicListRemove(uint8_t addrType, uint64_t addr, uint8_t SID) +{ + uint8_t i; + + for (i = 0; i < bbBlePeriodicListNumEntries; i++) + { + if ((pBbBlePeriodicListFilt[i].addrType == addrType) && + (pBbBlePeriodicListFilt[i].addr == addr) && + (pBbBlePeriodicListFilt[i].SID == SID)) + { + /* If there is more than one entry, move the last entry into this slot. */ + if ((bbBlePeriodicListNumEntries > 1) && (i != bbBlePeriodicListNumEntries - 1)) + { + pBbBlePeriodicListFilt[i].addrType = pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries - 1].addrType; + pBbBlePeriodicListFilt[i].addr = pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries - 1].addr; + pBbBlePeriodicListFilt[i].SID = pBbBlePeriodicListFilt[bbBlePeriodicListNumEntries - 1].SID; + } + bbBlePeriodicListNumEntries--; + return TRUE; + } + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_reslist.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_reslist.c new file mode 100644 index 0000000000000000000000000000000000000000..ae003dd4179d827b833d383294252bfd2a1bf69f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_reslist.c @@ -0,0 +1,874 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE resolving list implementation file. + */ +/*************************************************************************************************/ + +#include "bb_api.h" +#include "bb_ble_api.h" +#include "bb_ble_api_reslist.h" +#include "bb_ble_api_pdufilt.h" +#include "bb_ble_drv.h" +#include "wsf_assert.h" +#include "ll_math.h" +#include "util/bda.h" +#include "util/bstream.h" +#include "ll_defs.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! RPA high address word for invalid address. */ +#define BB_BLE_RESLIST_RPA_INVALID 0 + +/*! \brief Increment statistics counter. */ +#define BB_INC_STAT(s) s++ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Resolving list table entry. */ +typedef struct +{ + uint8_t peerIrk[LL_KEY_LEN]; /*!< Peer IRK. */ + uint8_t localIrk[LL_KEY_LEN]; /*!< Local IRK. */ + uint64_t peerIdentityAddr; /*!< Peer identity address. */ + uint64_t peerRpa; /*!< Peer resolvable private address. */ + uint64_t localRpa; /*!< Local resolvable private address. */ + uint64_t localRpaPeer; /*!< Local resolvable private address from peer. */ + bool_t peerIrkZero; /*!< Indicates that peer IRK is zero. */ + bool_t localIrkZero; /*!< Indicates that local IRK is zero. */ + bool_t peerRpaGenerated; /*!< Indicates that peer RPA was locally generated. */ + uint8_t privMode; /*!< Privacy mode. */ +} bbBleResListEntry_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +static bbBleResListEntry_t *pBbBleResListTbl; /*!< Resolving list. */ +static uint8_t bbBleResListNumEntries; /*!< Number of valid resolving list entries. */ +static uint8_t bbBleResListNumEntriesMax; /*!< Maximum number of resolving list entries. */ + +/*! \brief Device filter statistics. */ +extern BbBlePduFiltStats_t bbBlePduFiltStats; + +/*! \brief Address resolution needed callback. */ +static bbBleResListAddrResNeeded_t bbBleResListAddrResNeededCback; + +/*************************************************************************************************/ +/*! + * \brief Initialize resolving list. + * + * \param numEntries Number of resolving list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the resolving list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitResolvingList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + + bbBleResListNumEntries = 0; + bbBleResListNumEntriesMax = 0; + + /* Allocate memory. */ + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & (uint32_t)~0x3) + sizeof(uint32_t)); + } + pBbBleResListTbl = (bbBleResListEntry_t *)pAvailMem; + pAvailMem += sizeof(bbBleResListEntry_t) * numEntries; + + /* Check memory allocation. */ + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + WSF_ASSERT(FALSE); + return 0; + } + + bbBleResListNumEntriesMax = numEntries; + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Set address resolution needed callback. + * + * \param cback Callback. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleResListSetAddrResNeededCback(bbBleResListAddrResNeeded_t cback) +{ + bbBleResListAddrResNeededCback = cback; +} + +/*************************************************************************************************/ +/*! + * \brief Find entry in resolving list. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return Pointer to entry or NULL if it does not exist. + * + * Find entry in resolving list. + */ +/*************************************************************************************************/ +static bbBleResListEntry_t *bbBleFindResolvingListEntry(uint8_t peerAddrType, uint64_t peerIdentityAddr) +{ + uint8_t i; + + peerIdentityAddr |= (uint64_t)peerAddrType << 48; + + for (i = 0; i < bbBleResListNumEntries; i++) + { + if (pBbBleResListTbl[i].peerIdentityAddr == peerIdentityAddr) + { + return &pBbBleResListTbl[i]; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Generate a random address hash. + * + * \param pIrk IRK. + * \param r Random value. + * + * \return Random address hash. + * + * random address hash. + */ +/*************************************************************************************************/ +static uint32_t bbGenerateHash(const uint8_t *pIrk, uint32_t r) +{ + uint8_t rprime[LL_KEY_LEN]; + uint32_t hash; + + /* r' = padding | r */ + memset(rprime, 0, sizeof(rprime)); + rprime[0] = ((r >> 0) & 0xFF); + rprime[1] = ((r >> 8) & 0xFF); + rprime[2] = ((r >> 16) & 0xFF); + + /* r' = e(k, r') */ + LlMathAesEcb(pIrk, rprime, rprime); + + /* ah(k, r) = e(k, r') mod 2^24 */ + hash = (rprime[0] << 0) | + (rprime[1] << 8) | + (rprime[2] << 16); + return hash; +} + +/*************************************************************************************************/ +/*! + * \brief Generate a RPA. + * + * \param pIrk IRK. + * + * \return RPA. + * + * Generate a RPA. + */ +/*************************************************************************************************/ +static uint64_t bbGenerateRpa(const uint8_t *pIrk) +{ + uint32_t prand; + uint32_t hash; + uint64_t rpa; + + BbBleDrvRand((uint8_t *)&prand, (sizeof(uint32_t) / sizeof(uint8_t))); + + prand = (prand & 0x003FFFFF) | 0x00400000; + hash = bbGenerateHash(pIrk, prand); + rpa = ((uint64_t)prand << 24) | hash; + return rpa; +} + +/*************************************************************************************************/ +/*! + * \brief Verify a RPA was generated from an IRK. + * + * \param pIrk IRK. + * \param rpa Resolvable private address to verify. + * + * \return TRUE if the RPA was generated from this IRK. + * + * Verify a RPA was generated from an IRK. + */ +/*************************************************************************************************/ +static bool_t bbVerifyRpa(const uint8_t *pIrk, uint64_t rpa) +{ + uint32_t prand; + uint32_t hash; + uint32_t localHash; + + prand = (rpa >> 24) & UINT64_C(0xFFFFFF); + hash = (rpa >> 0) & UINT64_C(0xFFFFFF); + localHash = bbGenerateHash(pIrk, prand); + return (hash == localHash); +} + +/*************************************************************************************************/ +/*! + * \brief Get resolving list size. + * + * \return Total number of resolving list entries. + * + * Get the resolving list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBleResListGetSize(void) +{ + return bbBleResListNumEntriesMax; +} + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list. + * + * \return None. + * + * Clear all resolving list entries stored in the BB. + */ +/*************************************************************************************************/ +void BbBleResListClear(void) +{ + bbBleResListNumEntries = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pPeerIrk Peer IRK. + * \param pLocalIrk Local IRK. + * + * \return TRUE if successful, FALSE if list full. + * + * Add device to resolving list. + */ +/*************************************************************************************************/ +bool_t BbBleResListAdd(uint8_t peerAddrType, uint64_t peerIdentityAddr, const uint8_t *pPeerIrk, + const uint8_t *pLocalIrk) +{ + bbBleResListEntry_t *pEntry; + + /* Check whether this entry already exists. */ + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry == NULL) + { + /* Otherwise add new entry. */ + if (bbBleResListNumEntries < bbBleResListNumEntriesMax) + { + pEntry = &pBbBleResListTbl[bbBleResListNumEntries]; + bbBleResListNumEntries++; + } + } + + /* Initialize entry. */ + if (pEntry != NULL) + { + uint8_t i; + + peerIdentityAddr |= ((uint64_t)peerAddrType << 48); + pEntry->peerIdentityAddr = peerIdentityAddr; + + memcpy(pEntry->peerIrk, pPeerIrk, sizeof(pEntry->peerIrk)); + pEntry->peerIrkZero = TRUE; + for (i = 0; i < sizeof(pEntry->peerIrk); i++) + { + if (pEntry->peerIrk[i] != 0) + { + pEntry->peerIrkZero = FALSE; + break; + } + } + + memcpy(pEntry->localIrk, pLocalIrk, sizeof(pEntry->localIrk)); + pEntry->localIrkZero = TRUE; + for (i = 0; i < sizeof(pEntry->localIrk); i++) + { + if (pEntry->localIrk[i] != 0) + { + pEntry->localIrkZero = FALSE; + break; + } + } + + pEntry->peerRpa = BB_BLE_RESLIST_RPA_INVALID; + pEntry->localRpa = BB_BLE_RESLIST_RPA_INVALID; + pEntry->localRpaPeer = BB_BLE_RESLIST_RPA_INVALID; + pEntry->peerRpaGenerated = FALSE; + pEntry->privMode = BB_BLE_RESLIST_PRIV_MODE_NETWORK; + + /* Generate a local RPA now. */ + if (!pEntry->localIrkZero) + { + pEntry->localRpa = bbGenerateRpa(pEntry->localIrk); + } + + return TRUE; + } + + /* List full. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Remove device from resolving list. + */ +/*************************************************************************************************/ +bool_t BbBleResListRemove(uint8_t peerAddrType, uint64_t peerIdentityAddr) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + if (bbBleResListNumEntries > 1) + { + /* If there is more than one entry, move the last entry into this slot. */ + memcpy(pEntry, &pBbBleResListTbl[bbBleResListNumEntries - 1], sizeof(*pEntry)); + } + bbBleResListNumEntries--; + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode of a device. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param privMode Privacy mode. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Set privacy mode of a device. + */ +/*************************************************************************************************/ +bool_t BbBleResListSetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t privMode) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + pEntry->privMode = privMode; + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get privacy mode of a device. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pPrivMode Storage for privacy mode. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Get privacy mode of a device. + */ +/*************************************************************************************************/ +bool_t BbBleResListGetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t *pPrivMode) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + *pPrivMode = pEntry->privMode; + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Read peer resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Get the peer resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListReadPeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + if (pEntry->peerRpa != BB_BLE_RESLIST_RPA_INVALID) + { + *pRpa = pEntry->peerRpa; + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Read local resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for local resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Get the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListReadLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + if (pEntry->localRpa != BB_BLE_RESLIST_RPA_INVALID) + { + *pRpa = pEntry->localRpa; + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Update local resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for local resolvable private address + * + * \return TRUE if successful, FALSE if address not in list. + * + * Update the local resolvable private address that is currently being used for the peer identity + * address. + */ +/*************************************************************************************************/ +bool_t BbBleResListUpdateLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + pEntry->localRpa = *pRpa; + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Generate peer resolvable address. + * + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * \param pRpa Storage for peer resolvable private address + * + * \return TRUE if successful, FALSE if address not in list or peer IRK is zero. + * + * Generate a peer resolvable address for a peer. + */ +/*************************************************************************************************/ +bool_t BbBleResListGeneratePeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + if (pEntry != NULL) + { + /* There will never be a RPA if the IRK is zero. */ + if (pEntry->peerIrkZero) + { + return FALSE; + } + /* Generate a new RPA only if one is not generated locally. */ + if (!pEntry->peerRpaGenerated) + { + pEntry->peerRpa = bbGenerateRpa(pEntry->peerIrk); + pEntry->peerRpaGenerated = TRUE; + } + *pRpa = pEntry->peerRpa; + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether a peer address has been resolved. + * + * \param rpa Peer resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + * Check whether a peer address has been resolved. Because of timing constraints, addresses should + * not be resolved in this function; instead, the resolution callback should be invoked to schedule + * the operation later. + */ +/*************************************************************************************************/ +bool_t BbBleResListCheckResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr) +{ + uint8_t i; + bool_t resCback = FALSE; /* Only call callback if we have a non-empty resolving list. */ + + for (i = 0; i < bbBleResListNumEntries; i++) + { + bbBleResListEntry_t *pEntry = &pBbBleResListTbl[i]; + + if (!pEntry->peerIrkZero) + { + /* Check whether this RPA is the identical to the cached value. */ + if (rpa == pEntry->peerRpa) + { + *pPeerAddrType = (pEntry->peerIdentityAddr >> 48) & 0x1; + *pPeerIdentityAddr = pEntry->peerIdentityAddr & UINT64_C(0xFFFFFFFFFFFF); + return TRUE; + } + resCback = TRUE; + } + } + + if (resCback && bbBleResListAddrResNeededCback) + { + BB_INC_STAT(bbBlePduFiltStats.peerResAddrPend); + bbBleResListAddrResNeededCback(rpa, TRUE, *pPeerAddrType, *pPeerIdentityAddr); + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether a local address has been resolved. + * + * \param rpa Local resolvable private address + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + * Check whether a local address has been resolved. Because of timing constraints, addresses should + * not be resolved in this function; instead, the resolution callback should be invoked to schedule + * the operation later. + */ +/*************************************************************************************************/ +bool_t BbBleResListCheckResolveLocal(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr) +{ + bbBleResListEntry_t *pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + + if (pEntry != NULL) + { + if (!pEntry->localIrkZero) + { + /* Check whether this RPA is the identical to the cached value. */ + if (rpa == pEntry->localRpaPeer) + { + return TRUE; + } + else + { + if (bbBleResListAddrResNeededCback) + { + BB_INC_STAT(bbBlePduFiltStats.localResAddrPend); + bbBleResListAddrResNeededCback(rpa, FALSE, peerAddrType, peerIdentityAddr); + } + } + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check whether a local address has been resolved. + * + * \param rpa Local resolvable private address + * \param peerAddrType Peer identity address type. + * \param peerIdentityAddr Peer identity address. + * + * \return TRUE if successful, FALSE if address has not been resolved. + * + */ +/*************************************************************************************************/ +bool_t BbBleResListIsLocalResolved(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr) +{ + bbBleResListEntry_t *pEntry = bbBleFindResolvingListEntry(peerAddrType, peerIdentityAddr); + + if (pEntry != NULL) + { + if (!pEntry->localIrkZero) + { + /* Check whether this RPA is the identical to the cached value. */ + if (rpa == pEntry->localRpaPeer) + { + return TRUE; + } + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve peer resolvable address. + * + * \param rpa Peer resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address could not be resolved. + * + * Resolve a peer resolvable address. + */ +/*************************************************************************************************/ +bool_t BbBleResListResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr) +{ + uint8_t i; + + for (i = 0; i < bbBleResListNumEntries; i++) + { + bbBleResListEntry_t *pEntry = &pBbBleResListTbl[i]; + + if (!pEntry->peerIrkZero) + { + bool_t found = FALSE; + + /* Check whether this RPA is the identical to the cached value. */ + if (rpa == pEntry->peerRpa) + { + found = TRUE; + } + else if (bbVerifyRpa(pEntry->peerIrk, rpa)) + { + /* Cache this RPA. */ + pEntry->peerRpa = rpa; + pEntry->peerRpaGenerated = FALSE; + found = TRUE; + BB_INC_STAT(bbBlePduFiltStats.passPeerRpaVerify); + } + + if (found) + { + *pPeerAddrType = (pEntry->peerIdentityAddr >> 48) & 0x1; + *pPeerIdentityAddr = pEntry->peerIdentityAddr & UINT64_C(0xFFFFFFFFFFFF); + return TRUE; + } + } + } + + BB_INC_STAT(bbBlePduFiltStats.failPeerRpaVerify); + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve local resolvable address. + * + * \param rpa Local resolvable private address + * \param pPeerAddrType Storage for peer identity address type. + * \param pPeerIdentityAddr Storage for peer identity address. + * + * \return TRUE if successful, FALSE if address could not be resolved. + * + * Resolve a local resolvable address. + */ +/*************************************************************************************************/ +bool_t BbBleResListResolveLocal(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr) +{ + bbBleResListEntry_t *pEntry = bbBleFindResolvingListEntry(*pPeerAddrType, *pPeerIdentityAddr); + + if (pEntry != NULL) + { + if (!pEntry->localIrkZero) + { + /* Check whether this RPA is the identical to the cached value. */ + if (rpa == pEntry->localRpaPeer) + { + return TRUE; + } + else if (bbVerifyRpa(pEntry->localIrk, rpa)) + { + pEntry->localRpaPeer = rpa; + BB_INC_STAT(bbBlePduFiltStats.passLocalRpaVerify); + return TRUE; + } + } + } + + BB_INC_STAT(bbBlePduFiltStats.failLocalRpaVerify); + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get status of peer address in resolving list. + * + * \param peerAddrRand TRUE if peer identity address is random. + * \param peerIdentityAddr Peer identity address. + * + * \return Peer address status. + * + * Get the peer resolvable private address status + */ +/*************************************************************************************************/ +bool_t BbBleResListPeerStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrRand, peerIdentityAddr); + if (pEntry != NULL) + { + if (pEntry->peerRpa != BB_BLE_RESLIST_RPA_INVALID) + { + return BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED; + } + else if (pEntry->peerIrkZero) + { + return BB_BLE_RESLIST_STATUS_ZERO_IRK; + } + else + { + return BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED; + } + } + + return BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST; +} + +/*************************************************************************************************/ +/*! + * \brief Get status of local address in resolving list. + * + * \param peerAddrRand TRUE if peer identity address is random. + * \param peerIdentityAddr Peer identity address. + * + * \return Local address status. + * + * Get the peer resolvable private address status + */ +/*************************************************************************************************/ +bool_t BbBleResListLocalStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr) +{ + bbBleResListEntry_t *pEntry; + + pEntry = bbBleFindResolvingListEntry(peerAddrRand, peerIdentityAddr); + if (pEntry != NULL) + { + if (pEntry->localRpa != BB_BLE_RESLIST_RPA_INVALID) + { + return BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED; + } + else if (pEntry->localIrkZero) + { + return BB_BLE_RESLIST_STATUS_ZERO_IRK; + } + else + { + return BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED; + } + } + + return BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST; +} + +/*************************************************************************************************/ +/*! + * \brief Handle timeout of local resolvable addresses. + * + * \return None. + * + * A new local resolvable address will be generated for each entry in the resolving list. + */ +/*************************************************************************************************/ +void BbBleResListHandleTimeout(void) +{ + uint8_t i; + + for (i = 0; i < bbBleResListNumEntries; i++) + { + bbBleResListEntry_t *pEntry = &pBbBleResListTbl[i]; + + if (!pEntry->localIrkZero) + { + pEntry->localRpa = bbGenerateRpa(pEntry->localIrk); + } + if (!pEntry->peerIrkZero && pEntry->peerRpaGenerated) + { + pEntry->peerRpa = bbGenerateRpa(pEntry->peerIrk); + } + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_whitelist.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_whitelist.c new file mode 100644 index 0000000000000000000000000000000000000000..8155621bbdd5cd15873fe90fd56b29e1eb6f7234 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/bb/ble/bb_ble_whitelist.c @@ -0,0 +1,254 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Generic BLE whitelist implementation file. + */ +/*************************************************************************************************/ + +#include "bb_ble_api.h" +#include "wsf_assert.h" +#include "util/bda.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief White list filter table entry. */ +typedef struct +{ + uint64_t addr; /*!< Address. */ +} bbBleWhiteListEntry_t; + +/************************************************************************************************** + Globals +**************************************************************************************************/ + +static bbBleWhiteListEntry_t *pBbBleWhiteListFilt; /*!< White list filter. */ +static uint8_t bbBleWhiteListNumEntries; /*!< Number of valid white list entries. */ +static uint8_t bbBleWhiteListNumEntriesMax; /*!< Maximum number of white list entries. */ +static bool_t bbBleWhiteListAllowAnonymous; /*!< Allow anonymous peer address. */ + +/*************************************************************************************************/ +/*! + * \brief Initialize white list. + * + * \param numEntries Number of white list entries to provide. + * \param pFreeMem Pointer to free memory. + * \param freeMemSize Size of pFreeMem. + * + * \return Amount of free memory consumed. + * + * This function initializes the white list. + * + * \note This function must be called once before initializing the LL. + */ +/*************************************************************************************************/ +uint16_t BbBleInitWhiteList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize) +{ + uint8_t *pAvailMem = pFreeMem; + + bbBleWhiteListNumEntries = 0; + bbBleWhiteListNumEntriesMax = 0; + bbBleWhiteListAllowAnonymous = FALSE; + + /* Allocate memory. */ + if (((uint32_t)pAvailMem) & 3) + { + /* Align to next word. */ + pAvailMem = (uint8_t *)(((uint32_t)pAvailMem & (uint32_t)~0x3) + sizeof(uint32_t)); + } + pBbBleWhiteListFilt = (bbBleWhiteListEntry_t *)pAvailMem; + pAvailMem += sizeof(bbBleWhiteListEntry_t) * numEntries; + + /* Check memory allocation. */ + if (((uint32_t)(pAvailMem - pFreeMem)) > freeMemSize) + { + WSF_ASSERT(FALSE); + return 0; + } + + bbBleWhiteListNumEntriesMax = numEntries; + return (pAvailMem - pFreeMem); +} + +/*************************************************************************************************/ +/*! + * \brief Check if address is white listed. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if white listed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListCheckAddr(bool_t randAddr, uint64_t addr) +{ + uint8_t i; + + addr |= (uint64_t)randAddr << 48; + + for (i = 0; i < bbBleWhiteListNumEntries; i++) + { + if (addr == pBbBleWhiteListFilt[i].addr) + { + /* Peer is in white list, allow PDU to pass through the filter. */ + return TRUE; + } + } + + /* Peer is not in white list, filter out PDU. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get white list size. + * + * \return Total number of white list entries. + * + * Read the white list capacity supported by the BB. + */ +/*************************************************************************************************/ +uint8_t BbBleWhiteListGetSize(void) +{ + return bbBleWhiteListNumEntriesMax; +} + +/*************************************************************************************************/ +/*! + * \brief Clear all white list entries. + * + * \return None. + * + * Clear all white list entries stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +void BbBleWhiteListClear(void) +{ + bbBleWhiteListNumEntries = 0; + bbBleWhiteListAllowAnonymous = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Add device to the white list. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if successful, FALSE if list full. + * + * Adds the given address to the white list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListAdd(bool_t randAddr, uint64_t addr) +{ + if (bbBleWhiteListNumEntries < bbBleWhiteListNumEntriesMax) + { + addr |= (uint64_t)randAddr << 48; + pBbBleWhiteListFilt[bbBleWhiteListNumEntries].addr = addr; + + bbBleWhiteListNumEntries++; + return TRUE; + } + + /* List full. */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from the white list. + * + * \param randAddr TRUE if random address, FALSE if public. + * \param addr Bluetooth device address. + * + * \return TRUE if successful, FALSE if address not in the list. + * + * Removes the given address from the white list stored in the BB. + * + * \note No resource synchronization is required to modify the white list resource as + * the LL modifies the white list only when advertising events are disabled. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListRemove(bool_t randAddr, uint64_t addr) +{ + uint8_t i; + + addr |= (uint64_t)randAddr << 48; + + for (i = 0; i < bbBleWhiteListNumEntries; i++) + { + if (pBbBleWhiteListFilt[i].addr == addr) + { + /* If there is more than one entry, move the last entry into this slot. */ + if (bbBleWhiteListNumEntries > 1) + { + pBbBleWhiteListFilt[i].addr = pBbBleWhiteListFilt[bbBleWhiteListNumEntries - 1].addr; + } + bbBleWhiteListNumEntries--; + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Add anonymous device to the white list. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleWhiteListAddAnonymous(void) +{ + bbBleWhiteListAllowAnonymous = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Remove anonymous device from the white list. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleWhiteListRemoveAnonymous(void) +{ + bbBleWhiteListAllowAnonymous = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get allow anonymous peers. + * + * \return TRUE if anonymous allowed, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t BbBleWhiteListIsAnonymousAllowed(void) +{ + return bbBleWhiteListAllowAnonymous; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr.c new file mode 100644 index 0000000000000000000000000000000000000000..f0b153b19aa16daa1bad1c94e0537097c7833d4d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr.c @@ -0,0 +1,252 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI transport module implementation file. + */ +/*************************************************************************************************/ + +#include "chci_tr.h" +#include "chci_drv.h" +#include "chci_api.h" +#include "hci_defs.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Transport control block. */ +typedef struct +{ + wsfHandlerId_t handlerId; /*!< Handler ID. */ + uint8_t *pDataPending; /*!< Data packet in progress. */ + uint8_t typePending; /*!< Data type in progress. */ + uint8_t protPending; /*!< Protocol in progress. */ + uint8_t nextAvailMask; /*!< Next available mask. */ + + ChciTrSendHwErrorCback_t sendHwErrorCback; /*!< Send HW error callback. */ + + struct + { + ChciTrRecvCback_t recvCback; /*!< Message received callback. */ + ChciTrSendCompleteCback_t sendCompleteCback; /*!< Message send complete callback. */ + ChciTrServiceCback_t serviceCback; /*!< Service callback. */ + } protCbacks[CHCI_TR_PROT_NUM]; /*!< Callback array indexed by protocol ID. */ +} chciTrCtrlBlk_t; + +/*! \brief Send handler. */ +typedef void (*chciTrSendHandler_t)(uint8_t *pBuf); + +/*! \brief Transport events. */ +enum +{ + CHCI_TR_EVT_SEND_CMPL = (1 << 0) /*!< Send complete. */ +}; + + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Current event data in progress. */ +chciTrCtrlBlk_t chciTrCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize the transport handler. + * + * \param handlerId Handler ID. + * + * \return None. + */ +/*************************************************************************************************/ +void ChciTrHandlerInit(wsfHandlerId_t handlerId) +{ + memset(&chciTrCb, 0, sizeof(chciTrCb)); + chciTrCb.handlerId = handlerId; + + chciDrvInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Controller HCI transport message dispatch handler. + * + * \param event WSF event. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void ChciTrHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + if (chciTrCb.pDataPending == NULL) + { + uint8_t protCount = 0; + uint8_t prot = chciTrCb.protPending; /* last protocol serviced */ + + do + { + uint8_t type = 0; + uint8_t *pData = NULL; + uint16_t len = 0; + + prot = (prot + 1 >= CHCI_TR_PROT_NUM) ? 0 : (prot + 1); + + if ((chciTrCb.protCbacks[prot].serviceCback != NULL) && + chciTrCb.protCbacks[prot].serviceCback(&type, &len, &pData)) + { + chciTrCb.pDataPending = pData; + chciTrCb.typePending = type; + chciTrCb.protPending = prot; + + if (chciDrvWrite(prot, type, len, pData) >= len) + { + chciTrSendComplete(); + } + break; + } + } while (++protCount < CHCI_TR_PROT_NUM); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set callbacks for a protocol. + * + * \param prot Protocol. + * \param recvCback Message received callback. + * \param sendCompleteCback Message send complete callback. + * \param serviceCback Service callback. + * + * \return None. + */ +/*************************************************************************************************/ +void ChciTrSetCbacks(uint8_t prot, ChciTrRecvCback_t recvCback, ChciTrSendCompleteCback_t sendCompleteCback, + ChciTrServiceCback_t serviceCback) +{ + if (prot < CHCI_TR_PROT_NUM) + { + chciTrCb.protCbacks[prot].recvCback = recvCback; + chciTrCb.protCbacks[prot].sendCompleteCback = sendCompleteCback; + chciTrCb.protCbacks[prot].serviceCback = serviceCback; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set send hardware error callback. + * + * \param sendHwErrorCback Send hardware error callback. + * + * \return None. + */ +/*************************************************************************************************/ +void ChciTrSetSendHwErrorCback(ChciTrSendHwErrorCback_t sendHwErrorCback) +{ + chciTrCb.sendHwErrorCback = sendHwErrorCback; +} + +/*************************************************************************************************/ +/*! + * \brief Flag protocol for needing service. + * + * \param prot Protocol. + * + * \return None. + */ +/*************************************************************************************************/ +void ChciTrNeedsService(uint8_t prot) +{ + if (chciTrCb.pDataPending == NULL) + { + ChciTrHandler(CHCI_TR_EVT_SEND_CMPL, NULL); + } +} + +/*************************************************************************************************/ +/*! + * \brief Signal the completion of a message write. + * + * \return None. + * + * This routine is used for asynchronous write operations. When the driver has completed the + * use of the write buffer, this routine is called to free the buffer and release flow control. + */ +/*************************************************************************************************/ +void chciTrSendComplete(void) +{ + uint8_t *pBuf = chciTrCb.pDataPending; + uint8_t type = chciTrCb.typePending; + uint8_t prot = chciTrCb.protPending; + + WSF_ASSERT(chciTrCb.protCbacks[prot].sendCompleteCback != NULL); + + /* Protocol will free buffer. */ + chciTrCb.pDataPending = NULL; + chciTrCb.protCbacks[prot].sendCompleteCback(type, pBuf); + WsfSetEvent(chciTrCb.handlerId, CHCI_TR_EVT_SEND_CMPL); +} + +/*************************************************************************************************/ +/*! + * \brief Signal the completion of a message receive. + * + * \param prot Protocol. + * \param type Message type. + * \param pBuf Message. + * + * \return None. + */ +/*************************************************************************************************/ +void chciTrRecv(uint8_t prot, uint8_t type, uint8_t *pBuf) +{ + if (prot < CHCI_TR_PROT_NUM) + { + if (chciTrCb.protCbacks[prot].recvCback != NULL) + { + /* Protocol will free buffer. */ + chciTrCb.protCbacks[prot].recvCback(type, pBuf); + return; + } + } + + /* Free buffer that cannot be handled. */ + WsfMsgFree(pBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Signal a hardware error. + * + * \param code Error code. + * + * \return None. + */ +/*************************************************************************************************/ +void chciTrHwError(uint8_t code) +{ + if (chciTrCb.sendHwErrorCback != NULL) + { + chciTrCb.sendHwErrorCback(code); + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr_serial.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr_serial.c new file mode 100644 index 0000000000000000000000000000000000000000..f3707730cba3c79e2107e6b15d0960cf9afb7877 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/chci/chci_tr_serial.c @@ -0,0 +1,205 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI serial transport module implementation file. + */ +/*************************************************************************************************/ + +#include "chci_api.h" +#include "chci_tr.h" +#include "chci_tr_serial.h" +#include "hci_defs.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include <string.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum HCI header size. */ +#define LHCI_HDR_LEN_MAX HCI_ACL_HDR_LEN + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Receive state. */ +typedef enum +{ + CHCI_RX_STATE_IDLE, /*!< Idle state. */ + CHCI_RX_STATE_HEADER, /*!< Header parse state. */ + CHCI_RX_STATE_DATA, /*!< Data parse state. */ + CHCI_RX_STATE_COMPLETE /*!< Complete state. */ +} chciRxState_t; + +/*************************************************************************************************/ +/*! + * \brief Receive function. Gets called by external code when bytes are received. + * + * \param pBuf Pointer to buffer of incoming bytes. + * \param len Number of bytes in incoming buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void chciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len) +{ + static uint8_t stateRx = CHCI_RX_STATE_IDLE; + static uint8_t pktRx; + static uint16_t iRx; + static uint8_t hdrRx[LHCI_HDR_LEN_MAX]; + static uint8_t *pPktRx; + static uint8_t *pDataRx; + + uint8_t dataByte; + + /* loop until all bytes of incoming buffer are handled */ + while (len--) + { + /* read single byte from incoming buffer and advance to next byte */ + dataByte = *pBuf++; + + /* --- Idle State --- */ + if (stateRx == CHCI_RX_STATE_IDLE) + { + switch (dataByte) + { + case HCI_CMD_TYPE: + case HCI_ACL_TYPE: + /* save the packet type */ + pktRx = dataByte; + iRx = 0; + stateRx = CHCI_RX_STATE_HEADER; + break; + + default: + /* invalid byte received */ + chciTrHwError(CHCI_TR_CODE_INVALID_DATA); + break; + } + } + + /* --- Header State --- */ + else if (stateRx == CHCI_RX_STATE_HEADER) + { + uint8_t hdrLen = 0; + uint16_t dataLen = 0; + + /* copy current byte into the temp header buffer */ + hdrRx[iRx++] = dataByte; + + /* determine header length based on packet type */ + switch (pktRx) + { + case HCI_CMD_TYPE: + hdrLen = HCI_CMD_HDR_LEN; + break; + case HCI_ACL_TYPE: + hdrLen = HCI_ACL_HDR_LEN; + break; + default: + break; + } + + /* see if entire header has been read */ + if (iRx == hdrLen) + { + /* extract data length from header */ + switch (pktRx) + { + case HCI_CMD_TYPE: + dataLen = hdrRx[2]; + break; + case HCI_ACL_TYPE: + BYTES_TO_UINT16(dataLen, &hdrRx[2]); + break; + default: + break; + } + + /* allocate data buffer to hold entire packet */ + if ((pPktRx = (uint8_t *)WsfMsgAlloc(hdrLen + dataLen + CHCI_BUF_TAILROOM)) != NULL) + { + memcpy(pPktRx, hdrRx, hdrLen); + + pDataRx = pPktRx + hdrLen; + + /* save number of bytes left to read */ + iRx = dataLen; + if (iRx == 0) + { + stateRx = CHCI_RX_STATE_COMPLETE; + } + else + { + stateRx = CHCI_RX_STATE_DATA; + } + } + else + { + /* allocate failed */ + chciTrHwError(CHCI_TR_CODE_OUT_OF_MEMORY); + + /* reset state machine */ + stateRx = CHCI_RX_STATE_IDLE; + continue; + } + } + } + + /* --- Data State --- */ + else if (stateRx == CHCI_RX_STATE_DATA) + { + /* write incoming byte to allocated buffer */ + *pDataRx++ = dataByte; + + /* determine if entire packet has been read */ + iRx--; + if (iRx == 0) + { + stateRx = CHCI_RX_STATE_COMPLETE; + } + } + + /* --- Complete State --- */ + /* ( Note Well! There is no else-if construct by design. ) */ + if (stateRx == CHCI_RX_STATE_COMPLETE) + { + /* deliver data */ + if (pPktRx != NULL) + { + switch (pktRx) + { + case HCI_CMD_TYPE: + chciTrRecv(CHCI_TR_PROT_BLE, CHCI_TR_TYPE_CMD, pPktRx); + break; + case HCI_ACL_TYPE: + chciTrRecv(CHCI_TR_PROT_BLE, CHCI_TR_TYPE_DATA, pPktRx); + break; + default: + break; + } + } + + /* reset state machine */ + stateRx = CHCI_RX_STATE_IDLE; + } + } +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/lhci_cmd_vs_ext.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/lhci_cmd_vs_ext.c new file mode 100644 index 0000000000000000000000000000000000000000..1e4f4944893f7a4a9393d47f2548e62d16f805e0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/lhci_cmd_vs_ext.c @@ -0,0 +1,40 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Extended vendor specific HCI command module implementation file. + */ +/*************************************************************************************************/ + +#include "lhci_api.h" + +/*************************************************************************************************/ +/*! + * \brief Decode extended vendor specific HCI command packet. + * + * \param pHdr Unpacked command header. + * \param pBuf Packed HCI packet buffer. + * + * Command processing for vendor specific commands. + * + * \return TRUE if opcode handled, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t lhciVsExtDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/ll_math_ecc.c b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/ll_math_ecc.c new file mode 100644 index 0000000000000000000000000000000000000000..7d8c8c228bbc25f8f82dcaed0b19b76222d1e2e4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/common/sources/ll/ll_math_ecc.c @@ -0,0 +1,269 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ECC math utilities implementation file. + */ +/*************************************************************************************************/ + +#include <string.h> + +#include "bb_ble_drv.h" +#include "ll_math.h" +#include "ll_defs.h" +#include "wsf_assert.h" + +#include "uECC_ll.h" + +/************************************************************************************************** + Variables +**************************************************************************************************/ + +/*! \brief ECC service callback. */ +static LlMathEccServiceCback_t llMathEccServiceCback = NULL; + +/*************************************************************************************************/ +/*! + * \brief Random number generator used by uECC. + * + * \param pDest Buffer to hold random number + * \param size Size of pDest in bytes . + * + * \return TRUE if successful. + */ +/*************************************************************************************************/ +static int llMathEccRng(uint8_t *pDest, unsigned size) +{ + BbBleDrvRand(pDest, size); + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Copy octets to another buffer, reversing order. + * + * \param pDest Destination buffer. + * \param pSrc Source buffer. + * \param len Length of data, in octets. + * + * \return None. + */ +/*************************************************************************************************/ +static void llMathEccReverseCopy(uint8_t *pDest, const uint8_t *pSrc, uint16_t len) +{ + pSrc += len - 1; + while (len-- > 0) + { + *pDest++ = *pSrc--; + } +} + +/*************************************************************************************************/ +/*! + * \brief Reverse order of octets in buffer. + * + * \param p Buffer. + * \param len Length of data, in octets. + * + * \return None. + */ +/*************************************************************************************************/ +static void llMathEccReverse(uint8_t *p, uint16_t len) +{ + uint8_t *pStart = p; + uint8_t *pEnd = p + len - 1; + uint8_t temp; + + len /= 2; + while (len-- > 0) + { + temp = *pStart; + *pStart++ = *pEnd; + *pEnd-- = temp; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set service callback for ECC generation. + * + * \param cback Callback to invoke when driver needs servicing. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccSetServiceCback(LlMathEccServiceCback_t cback) +{ + llMathEccServiceCback = cback; +} + +/*************************************************************************************************/ +/*! + * \brief Start generating P-256 key pair. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccGenerateP256KeyPairStart(void) +{ + uint8_t privKey[LL_ECC_KEY_LEN]; + + WSF_ASSERT(llMathEccServiceCback != NULL); + + /* Generate private key. */ + llMathEccRng(privKey, sizeof(privKey)); + + /* Start public key generation. */ + uECC_set_rng(llMathEccRng); + uECC_make_key_start(privKey); + + llMathEccServiceCback(LL_MATH_ECC_OP_GENERATE_P256_KEY_PAIR); +} + +/*************************************************************************************************/ +/*! + * \brief Start generating P-256 public key with a specified private key. + * + * \param pPrivKey Private key. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccGenerateP256PublicKeyStart(const uint8_t *pPrivKey) +{ + uint8_t privKey[LL_ECC_KEY_LEN]; + + WSF_ASSERT(llMathEccServiceCback != NULL); + + /* Reverse private key (to big endian). */ + llMathEccReverseCopy(privKey, pPrivKey, LL_ECC_KEY_LEN); + + /* Start public key generation. */ + uECC_set_rng(llMathEccRng); + uECC_make_key_start(privKey); + + llMathEccServiceCback(LL_MATH_ECC_OP_GENERATE_P256_KEY_PAIR); +} + +/*************************************************************************************************/ +/*! + * \brief Continue generating P-256 key pair. + * + * \return TRUE if key generation complete. + */ +/*************************************************************************************************/ +bool_t LlMathEccGenerateP256KeyPairContinue(void) +{ + WSF_ASSERT(llMathEccServiceCback != NULL); + + if (uECC_make_key_continue()) + { + return TRUE; + } + + llMathEccServiceCback(LL_MATH_ECC_OP_GENERATE_P256_KEY_PAIR); + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get results from generating P-256 key pair. + * + * \param pPubKey Storage for public key. + * \param pPrivKey Storage for private key. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccGenerateP256KeyPairComplete(uint8_t *pPubKey, uint8_t *pPrivKey) +{ + /* Complete key generation. */ + uECC_make_key_complete(pPubKey, pPrivKey); + + /* Reverse keys (to little endian). */ + llMathEccReverse(pPubKey, LL_ECC_KEY_LEN); + llMathEccReverse(pPubKey + LL_ECC_KEY_LEN, LL_ECC_KEY_LEN); + llMathEccReverse(pPrivKey, LL_ECC_KEY_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Start generating Diffie-Hellman key. + * + * \param pPubKey Public key. + * \param pPrivKey Private key. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccGenerateDhKeyStart(const uint8_t *pPubKey, const uint8_t *pPrivKey) +{ + uint8_t pubKey[LL_ECC_KEY_LEN * 2]; + uint8_t privKey[LL_ECC_KEY_LEN]; + + WSF_ASSERT(llMathEccServiceCback != NULL); + + /* Reverse keys (to big endian). */ + llMathEccReverseCopy(pubKey, pPubKey, LL_ECC_KEY_LEN); + llMathEccReverseCopy(pubKey + LL_ECC_KEY_LEN, pPubKey + LL_ECC_KEY_LEN, LL_ECC_KEY_LEN); + llMathEccReverseCopy(privKey, pPrivKey, LL_ECC_KEY_LEN); + + /* Start shared secret generation. */ + uECC_set_rng(llMathEccRng); + uECC_shared_secret_start(pubKey, privKey); + + llMathEccServiceCback(LL_MATH_ECC_OP_GENERATE_DH_KEY); +} + +/*************************************************************************************************/ +/*! + * \brief Continue generating Diffie-Hellman key. + * + * \return TRUE if Diffie-Hellman key generation complete. + */ +/*************************************************************************************************/ +bool_t LlMathEccGenerateDhKeyContinue(void) +{ + WSF_ASSERT(llMathEccServiceCback != NULL); + + if (uECC_shared_secret_continue()) + { + return TRUE; + } + + llMathEccServiceCback(LL_MATH_ECC_OP_GENERATE_DH_KEY); + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get results from generating Diffie-Hellman key. + * + * \param pDhKey Storage for Diffie-Hellman key. + * + * \return None. + */ +/*************************************************************************************************/ +void LlMathEccGenerateDhKeyComplete(uint8_t *pDhKey) +{ + /* Complete shared secret generation. */ + uECC_shared_secret_complete(pDhKey); + + /* Reverse shared secret (to little endian). */ + llMathEccReverse(pDhKey, LL_ECC_KEY_LEN); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/bb_ble_drv_vs.h b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/bb_ble_drv_vs.h new file mode 100644 index 0000000000000000000000000000000000000000..b92d63245ad10a31070fa328411870b9fe2e9fb7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/bb_ble_drv_vs.h @@ -0,0 +1,63 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Vendor Specific Baseband driver interface file. + */ +/*************************************************************************************************/ + +#ifndef BB_BLE_DRV_VS_H +#define BB_BLE_DRV_VS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + + +/*************************************************************************************************/ +/*! + * \brief Calibrate the baseband layer for BLE operation. + * + * \return None. + * + * This routine should block until the BB hardware is completely initialized. + */ +/*************************************************************************************************/ +void BbBleDrvCalibrate(void); + +/*************************************************************************************************/ +/*! + * \brief Set the TX power for BLE operations + * + * \param power Power setting in dBm. + * + * \return None. + */ +/*************************************************************************************************/ +void BbBleDrvSetTxPower(int8_t power); + + + +#ifdef __cplusplus +}; +#endif + +#endif /* BB_BLE_DRV_VS_H */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/chci_drv.c b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/chci_drv.c new file mode 100644 index 0000000000000000000000000000000000000000..8048eecc70fc425d1fda171a02af9725e36b6ee3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/chci_drv.c @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-05 10:22:48 -0500 (Wed, 05 Jun 2019) $ + * $Revision: 43683 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Controller HCI interface to the Host + */ +/*************************************************************************************************/ + +#include "hci_defs.h" +#include "chci_api.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ +extern void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len); + +/*************************************************************************************************/ +void chciDrvInit(void) +{ + +} + +/*************************************************************************************************/ +uint16_t chciDrvWrite(uint8_t prot, uint8_t type, uint16_t len, uint8_t *pData) +{ + // Convert CHCI_TR_TYPE to HCI_TYPE + uint8_t hciType = (type == CHCI_TR_TYPE_EVT) ? HCI_EVT_TYPE : HCI_ACL_TYPE; + + // Write to Host HCI handler + hciTrSerialRxIncoming(&hciType, 1); + hciTrSerialRxIncoming(pData, len); + return len; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/lhci_vs.c b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/lhci_vs.c new file mode 100644 index 0000000000000000000000000000000000000000..65c044b6f59bb3655651d051821c6432cada292c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/lhci_vs.c @@ -0,0 +1,312 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-18 15:15:00 -0500 (Tue, 18 Jun 2019) $ + * $Revision: 44064 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief + */ +/*************************************************************************************************/ + +#include "lhci_int.h" +#include "bb_ble_api.h" +#include "bb_ble_drv_vs.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ +#define LHCI_OPCODE_VS_SET_DEF_TX_POWER HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DD) /*!< Set default transmit power. */ +#define LHCI_OPCODE_VS_CALIBRATE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DE) /*!< Run AFE calibration. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Build and send a command complete event packet. + * + * \param pCmdHdr Command HCI header. + * \param status Status value. + * \param paramLen Parameter length of the command status event. + * + * \return None. + */ +/*************************************************************************************************/ +static void lhciVsCommonSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen) +{ + uint8_t *pEvtBuf; + uint8_t *pBuf; + + if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL) + { + return; + } + + pBuf = pEvtBuf; + pBuf += lhciPackCmdCompleteEvtStatus(pEvtBuf, status); + + switch (pCmdHdr->opCode) + { + /* --- command completion with status only parameter --- */ + case LHCI_OPCODE_VS_SET_BD_ADDR: + case LHCI_OPCODE_VS_SET_DEF_TX_POWER: + case LHCI_OPCODE_VS_SET_CONN_TX_PWR: + case LHCI_OPCODE_VS_SET_LOCAL_FEAT: + case LHCI_OPCODE_VS_CALIBRATE: + default: + break; + + case LHCI_OPCODE_VS_GET_ADV_STATS: + { + BbBleAdvPktStats_t stats; + BbBleGetAdvStats(&stats); + UINT32_TO_BSTREAM(pBuf, stats.txAdv); + UINT32_TO_BSTREAM(pBuf, stats.rxReq); + UINT32_TO_BSTREAM(pBuf, stats.rxReqCrc); + UINT32_TO_BSTREAM(pBuf, stats.rxReqTimeout); + UINT32_TO_BSTREAM(pBuf, stats.txRsp); + UINT32_TO_BSTREAM(pBuf, stats.errAdv); + UINT16_TO_BSTREAM(pBuf, stats.rxSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.txSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.rxIsrUsec); + UINT16_TO_BSTREAM(pBuf, stats.txIsrUsec); + break; + } + case LHCI_OPCODE_VS_GET_SCAN_STATS: + { + BbBleScanPktStats_t stats; + BbBleGetScanStats(&stats); + UINT32_TO_BSTREAM(pBuf, stats.rxAdv); + UINT32_TO_BSTREAM(pBuf, stats.rxAdvCrc); + UINT32_TO_BSTREAM(pBuf, stats.rxAdvTimeout); + UINT32_TO_BSTREAM(pBuf, stats.txReq); + UINT32_TO_BSTREAM(pBuf, stats.rxRsp); + UINT32_TO_BSTREAM(pBuf, stats.rxRspCrc); + UINT32_TO_BSTREAM(pBuf, stats.rxRspTimeout); + UINT32_TO_BSTREAM(pBuf, stats.errScan); + UINT16_TO_BSTREAM(pBuf, stats.rxSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.txSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.rxIsrUsec); + UINT16_TO_BSTREAM(pBuf, stats.txIsrUsec); + break; + } + case LHCI_OPCODE_VS_GET_CONN_STATS: + { + BbBleDataPktStats_t stats; + BbBleGetConnStats(&stats); + UINT32_TO_BSTREAM(pBuf, stats.rxData); + UINT32_TO_BSTREAM(pBuf, stats.rxDataCrc); + UINT32_TO_BSTREAM(pBuf, stats.rxDataTimeout); + UINT32_TO_BSTREAM(pBuf, stats.txData); + UINT32_TO_BSTREAM(pBuf, stats.errData); + UINT16_TO_BSTREAM(pBuf, stats.rxSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.txSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.rxIsrUsec); + UINT16_TO_BSTREAM(pBuf, stats.txIsrUsec); + break; + } + case LHCI_OPCODE_VS_GET_TEST_STATS: + { + BbBleDataPktStats_t stats; + BbBleGetTestStats(&stats); + UINT32_TO_BSTREAM(pBuf, stats.rxData); + UINT32_TO_BSTREAM(pBuf, stats.rxDataCrc); + UINT32_TO_BSTREAM(pBuf, stats.rxDataTimeout); + UINT32_TO_BSTREAM(pBuf, stats.txData); + UINT32_TO_BSTREAM(pBuf, stats.errData); + UINT16_TO_BSTREAM(pBuf, stats.rxSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.txSetupUsec); + UINT16_TO_BSTREAM(pBuf, stats.rxIsrUsec); + UINT16_TO_BSTREAM(pBuf, stats.txIsrUsec); + break; + } + } + + lhciSendCmdCmplEvt(pEvtBuf); +} + + +/*************************************************************************************************/ +bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch(pHdr->opCode) { + + case LHCI_OPCODE_VS_SET_BD_ADDR: + LlSetBdAddr(pBuf); + break; + case LHCI_OPCODE_VS_SET_DEF_TX_POWER: + { + int8_t power; + BSTREAM_TO_INT8(power, pBuf); + BbBleDrvSetTxPower(power); + break; + } + case LHCI_OPCODE_VS_SET_LOCAL_FEAT: + status = LlSetFeatures(pBuf); + break; + case LHCI_OPCODE_VS_GET_TEST_STATS: + paramLen += sizeof(BbBleDataPktStats_t); + break; + case LHCI_OPCODE_VS_CALIBRATE: + BbBleDrvCalibrate(); + break; + + default: + return FALSE; + } + + lhciVsCommonSendCmdCmplEvt(pHdr, status, paramLen); + return TRUE; +} + +/*************************************************************************************************/ +bool_t lhciConnVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch(pHdr->opCode) { + + case LHCI_OPCODE_VS_SET_CONN_TX_PWR: + { + uint16_t handle; + int8_t level; + BSTREAM_TO_UINT16(handle, pBuf); + BSTREAM_TO_INT8 (level, pBuf); + status = LlSetTxPowerLevel(handle, level); + break; + } + case LHCI_OPCODE_VS_GET_CONN_STATS: + paramLen += sizeof(BbBleDataPktStats_t); + break; + + /* --- default --- */ + + default: + return FALSE; + } + + lhciVsCommonSendCmdCmplEvt(pHdr, status, paramLen); + return TRUE; +} + +/*************************************************************************************************/ +bool_t lhciMstConnVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} + +/*************************************************************************************************/ +bool_t lhciMstScanVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch(pHdr->opCode) { + + /* --- local device management --- */ + + case LHCI_OPCODE_VS_GET_SCAN_STATS: + paramLen += sizeof(BbBleScanPktStats_t); + break; + + /* --- default --- */ + + default: + return FALSE; + } + + lhciVsCommonSendCmdCmplEvt(pHdr, status, paramLen); + return TRUE; +} + +/*************************************************************************************************/ +bool_t lhciSlvAdvVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + uint8_t status = HCI_SUCCESS; + uint8_t paramLen = 0; + + switch(pHdr->opCode) { + + /* --- local device management --- */ + + case LHCI_OPCODE_VS_SET_ADV_TX_PWR: + LlSetAdvTxPower(pBuf[0]); + break; + case LHCI_OPCODE_VS_GET_ADV_STATS: + paramLen += sizeof(BbBleAdvPktStats_t); + break; + + /* --- default --- */ + + default: + return FALSE; + } + + lhciVsCommonSendCmdCmplEvt(pHdr, status, paramLen); + return TRUE; +} + +/*************************************************************************************************/ +bool_t lhciSlvEncVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} + +/*************************************************************************************************/ +bool_t lhciScVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} + +/*************************************************************************************************/ +bool_t lhciMstExtScanVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} + +/*************************************************************************************************/ +bool_t lhciSlvExtAdvVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) +{ + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_math_aes.c b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_math_aes.c new file mode 100644 index 0000000000000000000000000000000000000000..aaa5451bf6f4ed295ccacbcac837127dd353575c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_math_aes.c @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-05 10:22:48 -0500 (Wed, 05 Jun 2019) $ + * $Revision: 43683 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief + */ +/*************************************************************************************************/ + +#include <string.h> +#include "ll_math.h" +#include "max32665.h" +#include "gcr_regs.h" +#include "tpu_regs.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ +#define MXC_F_TPU_CTRL_DONE_FLAGS (MXC_F_TPU_CTRL_DMA_DONE | MXC_F_TPU_CTRL_GLS_DONE | MXC_F_TPU_CTRL_HSH_DONE | MXC_F_TPU_CTRL_CPH_DONE | MXC_F_TPU_CTRL_MAA_DONE) +#define AES_BLOCK_SIZE 16 + +/*************************************************************************************************/ +void LlMathAesEcb(const uint8_t *pKey, uint8_t *pOut, const uint8_t *pIn) +{ + /* Save the state of the crypto clock enable bit */ + uint32_t perckcn0 = MXC_GCR->perckcn0; + + /* Save the state of the HIRC EN */ + uint32_t clkcn = MXC_GCR->clkcn; + + // Use 32-bit array for alignment and easy data movement + // SDMA will not do a 32-bit copy with un-aligned pointers + // TPU requires 32-bit copy + uint32_t temp_32[4]; + + /* Enable CRYPTO clock */ + if ((MXC_GCR->clkcn & MXC_F_GCR_CLKCN_HIRC_EN) == 0) { + MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_HIRC_EN; + } + + /* Disable CRYPTO clock gate */ + if (MXC_GCR->perckcn0 & MXC_F_GCR_PERCKCN0_CRYPTOD) { + MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_CRYPTOD); + } + + /* Reset Crypto block and clear state */ + MXC_TPU->ctrl = MXC_F_TPU_CTRL_RST; + + /* Set the legacy bit */ + MXC_TPU->ctrl |= MXC_F_TPU_CTRL_FLAG_MODE; + + /* Byte swap the input and output */ + MXC_TPU->ctrl |= MXC_F_TPU_CTRL_BSO; + MXC_TPU->ctrl |= MXC_F_TPU_CTRL_BSI; + + MXC_TPU->cipher_ctrl = (MXC_S_TPU_CIPHER_CTRL_MODE_ECB | + MXC_S_TPU_CIPHER_CTRL_CIPHER_AES128 | MXC_S_TPU_CIPHER_CTRL_SRC_CIPHERKEY); + + /* Clear all done flags */ + MXC_TPU->ctrl |= MXC_F_TPU_CTRL_DONE_FLAGS; + + /* Load the Key */ + memcpy(temp_32, pKey, AES_BLOCK_SIZE); + MXC_TPU->cipher_key[0] = temp_32[3]; + MXC_TPU->cipher_key[1] = temp_32[2]; + MXC_TPU->cipher_key[2] = temp_32[1]; + MXC_TPU->cipher_key[3] = temp_32[0]; + + /* Wait until ready for data */ + while (!(MXC_TPU->ctrl & MXC_F_TPU_CTRL_RDY)); + + /* Copy data to start the operation */ + memcpy(temp_32, pIn, AES_BLOCK_SIZE); + MXC_TPU->din[0] = temp_32[3]; + MXC_TPU->din[1] = temp_32[2]; + MXC_TPU->din[2] = temp_32[1]; + MXC_TPU->din[3] = temp_32[0]; + + /* Wait until operation is complete */ + while (!(MXC_TPU->ctrl & MXC_F_TPU_CTRL_CPH_DONE)); + + /* Clear all done flags */ + MXC_TPU->ctrl |= MXC_F_TPU_CTRL_DONE_FLAGS; + + /* Copy data out */ + temp_32[3] = MXC_TPU->dout[0]; + temp_32[2] = MXC_TPU->dout[1]; + temp_32[1] = MXC_TPU->dout[2]; + temp_32[0] = MXC_TPU->dout[3]; + memcpy(pOut, temp_32, AES_BLOCK_SIZE); + + /* Restore clock settings */ + MXC_GCR->perckcn0 = perckcn0; + MXC_GCR->clkcn = clkcn; +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_tester.c b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_tester.c new file mode 100644 index 0000000000000000000000000000000000000000..e1e724fa53142aef5a61b8fcbd7c12b034b94e31 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/platform/max32665/ll_tester.c @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-05 10:22:48 -0500 (Wed, 05 Jun 2019) $ + * $Revision: 43683 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief API used for DTM + */ +/*************************************************************************************************/ + +#ifdef LL_ENABLE_TESTER + +#include "ll_tester_api.h" +#include "lctr_int_conn.h" +#include "wsf_trace.h" +#include "wsf_assert.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ +llTesterCtrlBlock_t llTesterCb; + +/*************************************************************************************************/ +void LlTesterInit(void) +{ + +} + +/*************************************************************************************************/ +void LctrForceTxAcl(uint8_t *pAclBuf) +{ + LL_TRACE_ERR0("LctrForceTxAcl not yet implemented"); + WSF_ASSERT(0); +} + +/*************************************************************************************************/ +void LctrProcessRxTxAck(lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t **pNextRxBuf, bool_t *pTxPduIsAcked) +{ + LL_TRACE_ERR0("LctrProcessRxTxAck not yet implemented"); + WSF_ASSERT(0); +} + +#endif /* #ifdef LL_ENABLE_TESTER */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/LICENSE.txt b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab099ae5a519b92de9ec903422de6457aa9e0310 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/LICENSE.txt @@ -0,0 +1,21 @@ +Copyright (c) 2014, Kenneth MacKay +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form 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. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/README.txt b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..24f1231c1e88308401c8ebd1384958c9232da47e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/README.txt @@ -0,0 +1,208 @@ +micro-ecc +========== + +A small and fast ECDH and ECDSA implementation for 8-bit, 32-bit, and 64-bit processors. + +The old version of micro-ecc can be found in the "old" branch. + +Features +-------- + + * Resistant to known side-channel attacks. + * Written in C, with optional GCC inline assembly for AVR, ARM and Thumb platforms. + * Supports 8, 32, and 64-bit architectures. + * Small code size. + * No dynamic memory allocation. + * Support for 4 standard curves: secp160r1, secp192r1, secp256r1, and secp256k1. + * BSD 2-clause license. + +Usage Notes +----------- +### Point Representation ### +Compressed points are represented in the standard format as defined in http://www.secg.org/collateral/sec1_final.pdf; uncompressed points are represented in standard format, but without the `0x04` prefix. `uECC_make_key()`, `uECC_shared_secret()`, `uECC_sign()`, and `uECC_verify()` only handle uncompressed points; you can use `uECC_compress()` and `uECC_decompress()` to convert between compressed and uncompressed point representations. + +Private keys are represented in the standard format. + +### Using the Code ### + +I recommend just copying (or symlink) uECC.h, uECC.c, and the appropriate asm\_<arch>\_.inc (if any) into your project. Then just `#include "uECC.h"` to use the micro-ecc functions. + +For use with Arduino, you can just create a symlink to the `uECC` directory in your Arduino `libraries` directory. You can then use uECC just like any other Arduino library (uECC should show up in the **Sketch**=>**Import Library** submenu). + +See uECC.h for documentation for each function. + +### Compilation Notes ### + + * Should compile with any C/C++ compiler that supports stdint.h (this includes Visual Studio 2013). + * If you want to change the defaults for `uECC_CURVE` and `uECC_ASM`, you must change them in your Makefile or similar so that uECC.c is compiled with the desired values (ie, compile uECC.c with `-DuECC_CURVE=uECC_secp256r1` or whatever). + * When compiling for a Thumb-1 platform with inline assembly enabled (ie, `uECC_ASM` is defined to `uECC_asm_small` or `uECC_asm_fast`), you must use the `-fomit-frame-pointer` GCC option (this is enabled by default when compiling with `-O1` or higher). + * When compiling for an ARM/Thumb-2 platform with fast inline assembly enabled (ie, `uECC_ASM` is defined to `uECC_asm_fast`), you must use the `-fomit-frame-pointer` GCC option (this is enabled by default when compiling with `-O1` or higher). + * When compiling for AVR with inline assembly enabled, you must have optimizations enabled (compile with `-O1` or higher). + * When building for Windows, you will need to link in the `advapi32.lib` system library. + +ARM Performance +--------------- + +All tests were built using gcc 4.8.2 with `-O3`, and were run on a Raspberry Pi B+. `uECC_ASM` was defined to `uECC_asm_fast` and `ECC_SQUARE_FUNC` was defined to `1` in all cases. All times are in milliseconds. + +<table> + <tr> + <th></th> + <th>secp160r1</th> + <th>secp192r1</th> + <th>secp256r1</th> + <th>secp256k1</th> + </tr> + <tr> + <td><em>ECDH:</em></td> + <td>2.3</td> + <td>2.7</td> + <td>7.9</td> + <td>6.5</td> + </tr> + <tr> + <td><em>ECDSA sign:</em></td> + <td>2.8</td> + <td>3.1</td> + <td>8.6</td> + <td>7.2</td> + </tr> + <tr> + <td><em>ECDSA verify:</em></td> + <td>2.7</td> + <td>3.2</td> + <td>9.2</td> + <td>7.0</td> + </tr> +</table> + +AVR Performance +--------------- + +All tests were built using avr-gcc 4.8.1 with `-Os`, and were run on a 16 MHz ATmega256RFR2. Code size refers to the space used by micro-ecc code and data. + +#### ECDH (fast) #### + +In these tests, `uECC_ASM` was defined to `uECC_asm_fast` and `ECC_SQUARE_FUNC` was defined to `1` in all cases. + +<table> + <tr> + <th></th> + <th>secp160r1</th> + <th>secp192r1</th> + <th>secp256r1</th> + <th>secp256k1</th> + </tr> + <tr> + <td><em>ECDH time (ms):</em></td> + <td>470</td> + <td>810</td> + <td>2220</td> + <td>1615</td> + </tr> + <tr> + <td><em>Code size (bytes):</em></td> + <td>10768</td> + <td>13112</td> + <td>20886</td> + <td>21126</td> + </tr> +</table> + +#### ECDH (small) #### + +In these tests, `uECC_ASM` was defined to `uECC_asm_small` and `ECC_SQUARE_FUNC` was defined to `0` in all cases. + +<table> + <tr> + <th></th> + <th>secp160r1</th> + <th>secp192r1</th> + <th>secp256r1</th> + <th>secp256k1</th> + </tr> + <tr> + <td><em>ECDH time (ms):</em></td> + <td>1250</td> + <td>1810</td> + <td>4790</td> + <td>4700</td> + </tr> + <tr> + <td><em>Code size (bytes):</em></td> + <td>3244</td> + <td>3400</td> + <td>5274</td> + <td>3426</td> + </tr> +</table> + +#### ECDSA (fast) #### + +In these tests, `uECC_ASM` was defined to `uECC_asm_fast` and `ECC_SQUARE_FUNC` was defined to `1` in all cases. + +<table> + <tr> + <th></th> + <th>secp160r1</th> + <th>secp192r1</th> + <th>secp256r1</th> + <th>secp256k1</th> + </tr> + <tr> + <td><em>ECDSA sign time (ms):</em></td> + <td>555</td> + <td>902</td> + <td>2386</td> + <td>1773</td> + </tr> + <tr> + <td><em>ECDSA verify time (ms):</em></td> + <td>590</td> + <td>990</td> + <td>2650</td> + <td>1800</td> + </tr> + <tr> + <td><em>Code size (bytes):</em></td> + <td>13246</td> + <td>14798</td> + <td>22594</td> + <td>22826</td> + </tr> +</table> + +#### ECDSA (small) #### + +In these tests, `uECC_ASM` was defined to `uECC_asm_small` and `ECC_SQUARE_FUNC` was defined to `0` in all cases. + +<table> + <tr> + <th></th> + <th>secp160r1</th> + <th>secp192r1</th> + <th>secp256r1</th> + <th>secp256k1</th> + </tr> + <tr> + <td><em>ECDSA sign time (ms):</em></td> + <td>1359</td> + <td>1931</td> + <td>4998</td> + <td>4904</td> + </tr> + <tr> + <td><em>ECDSA verify time (ms):</em></td> + <td>1515</td> + <td>2160</td> + <td>5700</td> + <td>5220</td> + </tr> + <tr> + <td><em>Code size (bytes):</em></td> + <td>5690</td> + <td>5054</td> + <td>6980</td> + <td>5080</td> + </tr> +</table> diff --git a/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/asm_arm.inc b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/asm_arm.inc new file mode 100644 index 0000000000000000000000000000000000000000..c5f9672be62de8987161675cf04ab0b8c1fc9971 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/asm_arm.inc @@ -0,0 +1,2455 @@ +#define DEC_5 4 +#define DEC_6 5 +#define DEC_7 6 +#define DEC_8 7 + +#define DEC(N) uECC_CONCAT(DEC_, N) + +#define REPEAT_1(stuff) stuff +#define REPEAT_2(stuff) REPEAT_1(stuff) stuff +#define REPEAT_3(stuff) REPEAT_2(stuff) stuff +#define REPEAT_4(stuff) REPEAT_3(stuff) stuff +#define REPEAT_5(stuff) REPEAT_4(stuff) stuff +#define REPEAT_6(stuff) REPEAT_5(stuff) stuff +#define REPEAT_7(stuff) REPEAT_6(stuff) stuff +#define REPEAT_8(stuff) REPEAT_7(stuff) stuff + +#define REPEAT(N, stuff) uECC_CONCAT(REPEAT_, N)(stuff) + +#define STR2(thing) #thing +#define STR(thing) STR2(thing) + +#if (uECC_ASM == uECC_asm_fast) + +static uint32_t vli_add(uint32_t *result, const uint32_t *left, const uint32_t *right) { + uint32_t carry = 0; + uint32_t left_word; + uint32_t right_word; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia %[lptr]!, {%[left]} \n\t" /* Load left word. */ + "ldmia %[rptr]!, {%[right]} \n\t" /* Load right word. */ + "adds %[left], %[right] \n\t" /* Add first word. */ + "stmia %[dptr]!, {%[left]} \n\t" /* Store result word. */ + + /* Now we just do the remaining words with the carry bit (using ADC) */ + REPEAT(DEC(uECC_WORDS), + "ldmia %[lptr]!, {%[left]} \n\t" + "ldmia %[rptr]!, {%[right]} \n\t" + "adcs %[left], %[right] \n\t" + "stmia %[dptr]!, {%[left]} \n\t") + + "adcs %[carry], %[carry] \n\t" /* Store carry bit. */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + #if (uECC_PLATFORM == uECC_arm_thumb) + : [dptr] "+l" (result), [lptr] "+l" (left), [rptr] "+l" (right), + [carry] "+l" (carry), [left] "=l" (left_word), [right] "=l" (right_word) + #else + : [dptr] "+r" (result), [lptr] "+r" (left), [rptr] "+r" (right), + [carry] "+r" (carry), [left] "=r" (left_word), [right] "=r" (right_word) + #endif + : + : "cc", "memory" + ); + return carry; +} +#define asm_add 1 + +static uint32_t vli_sub(uint32_t *result, const uint32_t *left, const uint32_t *right) { + uint32_t carry = 0; + uint32_t left_word; + uint32_t right_word; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia %[lptr]!, {%[left]} \n\t" /* Load left word. */ + "ldmia %[rptr]!, {%[right]} \n\t" /* Load right word. */ + "subs %[left], %[right] \n\t" /* Subtract. */ + "stmia %[dptr]!, {%[left]} \n\t" /* Store result word. */ + + /* Now we just do the remaining words with the carry bit (using SBC) */ + REPEAT(DEC(uECC_WORDS), + "ldmia %[lptr]!, {%[left]} \n\t" + "ldmia %[rptr]!, {%[right]} \n\t" + "sbcs %[left], %[right] \n\t" + "stmia %[dptr]!, {%[left]} \n\t") + + "adcs %[carry], %[carry] \n\t" /* Store carry bit. */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + #if (uECC_PLATFORM == uECC_arm_thumb) + : [dptr] "+l" (result), [lptr] "+l" (left), [rptr] "+l" (right), + [carry] "+l" (carry), [left] "=l" (left_word), [right] "=l" (right_word) + #else + : [dptr] "+r" (result), [lptr] "+r" (left), [rptr] "+r" (right), + [carry] "+r" (carry), [left] "=r" (left_word), [right] "=r" (right_word) + #endif + : + : "cc", "memory" + ); + return !carry; // note that on ARM, carry flag set means "no borrow" when subtracting + // (for some reason...) +} +#define asm_sub 1 + +#if (uECC_PLATFORM != uECC_arm_thumb) +#if (uECC_WORDS == 5) +static void vli_mult(uint32_t *result, const uint32_t *left, const uint32_t *right) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + register const uint32_t *r2 __asm__("r2") = right; + + __asm__ volatile ( + ".syntax unified \n\t" + "add r0, 12 \n\t" + "add r2, 12 \n\t" + "ldmia r1!, {r3,r4} \n\t" + "ldmia r2!, {r6,r7} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adc r10, r14 \n\t" + "stmia r0!, {r9, r10} \n\t" + + "sub r0, 28 \n\t" + "sub r2, 20 \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + "ldmia r1!, {r5} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r4, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r5, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r4, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "umull r14, r9, r4, r7 \n\t" + "adds r10, r14 \n\t" + "adc r11, r9 \n\t" + "stmia r0!, {r10, r11} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1), "+r" (r2) + : + : "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_mult 1 +#endif /* (uECC_WORDS == 5) */ + +#if (uECC_WORDS == 6) +static void vli_mult(uint32_t *result, const uint32_t *left, const uint32_t *right) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + register const uint32_t *r2 __asm__("r2") = right; + + __asm__ volatile ( + ".syntax unified \n\t" + "add r0, 12 \n\t" + "add r2, 12 \n\t" + "ldmia r1!, {r3,r4,r5} \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "mov r12, #0 \n\t" + "umull r14, r9, r4, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "umull r9, r10, r5, r8 \n\t" + "adds r11, r9 \n\t" + "adc r12, r10 \n\t" + "stmia r0!, {r11, r12} \n\t" + + "sub r0, 36 \n\t" + "sub r2, 24 \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r4, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r5, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r4, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r1!, {r5} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r2!, {r8} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r3, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r4, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "mov r14, #0 \n\t" + "umull r9, r10, r4, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r5, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "umull r10, r11, r5, r8 \n\t" + "adds r12, r10 \n\t" + "adc r14, r11 \n\t" + "stmia r0!, {r12, r14} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1), "+r" (r2) + : + : "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_mult 1 +#endif /* (uECC_WORDS == 6) */ + +#if (uECC_WORDS == 7) +static void vli_mult(uint32_t *result, const uint32_t *left, const uint32_t *right) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + register const uint32_t *r2 __asm__("r2") = right; + + __asm__ volatile ( + ".syntax unified \n\t" + "add r0, 24 \n\t" + "add r2, 24 \n\t" + "ldmia r1!, {r3} \n\t" + "ldmia r2!, {r6} \n\t" + + "umull r9, r10, r3, r6 \n\t" + "stmia r0!, {r9, r10} \n\t" + + "sub r0, 20 \n\t" + "sub r2, 16 \n\t" + "ldmia r2!, {r6, r7, r8} \n\t" + "ldmia r1!, {r4, r5} \n\t" + + "umull r9, r10, r3, r6 \n\t" + "stmia r0!, {r9} \n\t" + + "mov r14, #0 \n\t" + "umull r9, r12, r3, r7 \n\t" + "adds r10, r9 \n\t" + "adc r12, #0 \n\t" + "umull r9, r11, r4, r6 \n\t" + "adds r10, r9 \n\t" + "adcs r12, r11 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "mov r12, #0 \n\t" + "umull r14, r9, r5, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "umull r9, r10, r3, r6 \n\t" + "adds r11, r9 \n\t" + "adc r12, r10 \n\t" + "stmia r0!, {r11, r12} \n\t" + + "sub r0, 44 \n\t" + "sub r1, 16 \n\t" + "sub r2, 28 \n\t" + "ldmia r1!, {r3,r4,r5} \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + + "umull r9, r10, r3, r6 \n\t" + "stmia r0!, {r9} \n\t" + + "mov r14, #0 \n\t" + "umull r9, r12, r3, r7 \n\t" + "adds r10, r9 \n\t" + "adc r12, #0 \n\t" + "umull r9, r11, r4, r6 \n\t" + "adds r10, r9 \n\t" + "adcs r12, r11 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r5, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r1!, {r5} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r3, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r4, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r4, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r5, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r4, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r5, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r3, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r4, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r5, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r2!, {r8} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r4, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r3, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r4, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "mov r14, #0 \n\t" + "umull r9, r10, r5, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "umull r10, r11, r3, r6 \n\t" + "adds r12, r10 \n\t" + "adc r14, r11 \n\t" + "stmia r0!, {r12, r14} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1), "+r" (r2) + : + : "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_mult 1 +#endif /* (uECC_WORDS == 7) */ + +#if (uECC_WORDS == 8) +static void vli_mult(uint32_t *result, const uint32_t *left, const uint32_t *right) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + register const uint32_t *r2 __asm__("r2") = right; + + __asm__ volatile ( + ".syntax unified \n\t" + "add r0, 24 \n\t" + "add r2, 24 \n\t" + "ldmia r1!, {r3,r4} \n\t" + "ldmia r2!, {r6,r7} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adc r10, r14 \n\t" + "stmia r0!, {r9, r10} \n\t" + + "sub r0, 28 \n\t" + "sub r2, 20 \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + "ldmia r1!, {r5} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r4, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r5, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r4, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "umull r14, r9, r4, r7 \n\t" + "adds r10, r14 \n\t" + "adc r11, r9 \n\t" + "stmia r0!, {r10, r11} \n\t" + + "sub r0, 52 \n\t" + "sub r1, 20 \n\t" + "sub r2, 32 \n\t" + "ldmia r1!, {r3,r4,r5} \n\t" + "ldmia r2!, {r6,r7,r8} \n\t" + + "umull r11, r12, r3, r6 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r9, r3, r7 \n\t" + "adds r12, r11 \n\t" + "adc r9, #0 \n\t" + "umull r11, r14, r4, r6 \n\t" + "adds r12, r11 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r11, #0 \n\t" + "umull r12, r14, r3, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r5, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r4, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r5, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r5, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r4, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r1!, {r5} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r3, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r5, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r4, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r5, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r1!, {r4} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r5, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r3, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r12, #0 \n\t" + "umull r14, r9, r5, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r3, r8 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r4, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r10, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r14, #0 \n\t" + "umull r9, r10, r5, r7 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r3, r6 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "umull r9, r10, r4, r8 \n\t" + "adds r11, r9 \n\t" + "adcs r12, r10 \n\t" + "adc r14, #0 \n\t" + "ldr r9, [r0] \n\t" + "adds r11, r9 \n\t" + "adcs r12, #0 \n\t" + "adc r14, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "ldmia r2!, {r8} \n\t" + "mov r9, #0 \n\t" + "umull r10, r11, r5, r8 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r3, r7 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "umull r10, r11, r4, r6 \n\t" + "adds r12, r10 \n\t" + "adcs r14, r11 \n\t" + "adc r9, #0 \n\t" + "ldr r10, [r0] \n\t" + "adds r12, r10 \n\t" + "adcs r14, #0 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "ldmia r2!, {r6} \n\t" + "mov r10, #0 \n\t" + "umull r11, r12, r5, r6 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r8 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r4, r7 \n\t" + "adds r14, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "ldr r11, [r0] \n\t" + "adds r14, r11 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r14} \n\t" + + "ldmia r2!, {r7} \n\t" + "mov r11, #0 \n\t" + "umull r12, r14, r5, r7 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r3, r6 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "umull r12, r14, r4, r8 \n\t" + "adds r9, r12 \n\t" + "adcs r10, r14 \n\t" + "adc r11, #0 \n\t" + "ldr r12, [r0] \n\t" + "adds r9, r12 \n\t" + "adcs r10, #0 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "mov r12, #0 \n\t" + "umull r14, r9, r3, r7 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "umull r14, r9, r4, r6 \n\t" + "adds r10, r14 \n\t" + "adcs r11, r9 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r10} \n\t" + + "umull r9, r10, r4, r7 \n\t" + "adds r11, r9 \n\t" + "adc r12, r10 \n\t" + "stmia r0!, {r11, r12} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1), "+r" (r2) + : + : "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_mult 1 +#endif /* (uECC_WORDS == 8) */ + +#if uECC_SQUARE_FUNC +#if (uECC_WORDS == 5) +static void vli_square(uint32_t *result, const uint32_t *left) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia r1!, {r2,r3,r4,r5,r6} \n\t" + + "umull r11, r12, r2, r2 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r2, r3 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11, #0 \n\t" + "adc r9, #0 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r12, r2, r4 \n\t" + "adds r11, r11 \n\t" + "adcs r12, r12 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r3 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r5 \n\t" + "umull r1, r14, r3, r4 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r2, r6 \n\t" + "umull r1, r14, r3, r5 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "umull r1, r14, r4, r4 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r3, r6 \n\t" + "umull r1, r14, r4, r5 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r8, #0 \n\t" + "umull r1, r10, r4, r6 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r8, #0 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "umull r1, r10, r5, r5 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r11, #0 \n\t" + "umull r1, r10, r5, r6 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r11, #0 \n\t" + "adds r12, r1 \n\t" + "adcs r8, r10 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r1, r10, r6, r6 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r10 \n\t" + "stmia r0!, {r8, r11} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1) + : + : "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_square 1 +#endif /* (uECC_WORDS == 5) */ + +#if (uECC_WORDS == 6) +static void vli_square(uint32_t *result, const uint32_t *left) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia r1!, {r2,r3,r4,r5,r6,r7} \n\t" + + "umull r11, r12, r2, r2 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r2, r3 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11, #0 \n\t" + "adc r9, #0 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r12, r2, r4 \n\t" + "adds r11, r11 \n\t" + "adcs r12, r12 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r3 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r5 \n\t" + "umull r1, r14, r3, r4 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r2, r6 \n\t" + "umull r1, r14, r3, r5 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "umull r1, r14, r4, r4 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r7 \n\t" + "umull r1, r14, r3, r6 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "umull r1, r14, r4, r5 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r3, r7 \n\t" + "umull r1, r14, r4, r6 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "umull r1, r14, r5, r5 \n\t" + "adds r8, r1 \n\t" + "adcs r9, r14 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r4, r7 \n\t" + "umull r1, r14, r5, r6 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r14 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r8, #0 \n\t" + "umull r1, r10, r5, r7 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r8, #0 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "umull r1, r10, r6, r6 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r11, #0 \n\t" + "umull r1, r10, r6, r7 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r11, #0 \n\t" + "adds r12, r1 \n\t" + "adcs r8, r10 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r1, r10, r7, r7 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r10 \n\t" + "stmia r0!, {r8, r11} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1) + : + : "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_square 1 +#endif /* (uECC_WORDS == 6) */ + +#if (uECC_WORDS == 7) +static void vli_square(uint32_t *result, const uint32_t *left) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia r1!, {r2} \n\t" + "add r1, 20 \n\t" + "ldmia r1!, {r5} \n\t" + "add r0, 24 \n\t" + "umull r8, r9, r2, r5 \n\t" + "stmia r0!, {r8, r9} \n\t" + "sub r0, 32 \n\t" + "sub r1, 28 \n\t" + + "ldmia r1!, {r2, r3, r4, r5, r6, r7} \n\t" + + "umull r11, r12, r2, r2 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r2, r3 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11, #0 \n\t" + "adc r9, #0 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r12, r2, r4 \n\t" + "adds r11, r11 \n\t" + "adcs r12, r12 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r3 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r5 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r3, r4 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r2, r6 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r3, r5 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r4, r4 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r7 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r3, r6 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r4, r5 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "ldmia r1!, {r2} \n\t" + "mov r10, #0 \n\t" + "umull r8, r9, r3, r7 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r4, r6 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r5, r5 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r3, r2 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r4, r7 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r5, r6 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r4, r2 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r5, r7 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r6, r6 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r5, r2 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r6, r7 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r8, #0 \n\t" + "umull r1, r10, r6, r2 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r8, #0 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "umull r1, r10, r7, r7 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r11, #0 \n\t" + "umull r1, r10, r7, r2 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r11, #0 \n\t" + "adds r12, r1 \n\t" + "adcs r8, r10 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r1, r10, r2, r2 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r10 \n\t" + "stmia r0!, {r8, r11} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1) + : + : "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_square 1 +#endif /* (uECC_WORDS == 7) */ + +#if (uECC_WORDS == 8) +static void vli_square(uint32_t *result, const uint32_t *left) { + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + + __asm__ volatile ( + ".syntax unified \n\t" + "ldmia r1!, {r2, r3} \n\t" + "add r1, 16 \n\t" + "ldmia r1!, {r5, r6} \n\t" + "add r0, 24 \n\t" + + "umull r8, r9, r2, r5 \n\t" + "stmia r0!, {r8} \n\t" + + "umull r12, r10, r2, r6 \n\t" + "adds r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r9} \n\t" + + "umull r8, r9, r3, r6 \n\t" + "adds r10, r8 \n\t" + "adc r11, r9, #0 \n\t" + "stmia r0!, {r10, r11} \n\t" + + "sub r0, 40 \n\t" + "sub r1, 32 \n\t" + "ldmia r1!, {r2,r3,r4,r5,r6,r7} \n\t" + + "umull r11, r12, r2, r2 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r9, #0 \n\t" + "umull r10, r11, r2, r3 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11, #0 \n\t" + "adc r9, #0 \n\t" + "adds r12, r10 \n\t" + "adcs r8, r11 \n\t" + "adc r9, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "mov r10, #0 \n\t" + "umull r11, r12, r2, r4 \n\t" + "adds r11, r11 \n\t" + "adcs r12, r12 \n\t" + "adc r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "umull r11, r12, r3, r3 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r5 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r3, r4 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r2, r6 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r3, r5 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r4, r4 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r2, r7 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r3, r6 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r4, r5 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "ldmia r1!, {r2} \n\t" + "mov r10, #0 \n\t" + "umull r8, r9, r3, r7 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r4, r6 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r5, r5 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r3, r2 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r4, r7 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r5, r6 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "ldmia r1!, {r3} \n\t" + "mov r10, #0 \n\t" + "umull r8, r9, r4, r2 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r5, r7 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r9, #0 \n\t" + "adc r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r6, r6 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r4, r3 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r5, r2 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r6, r7 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "ldr r14, [r0] \n\t" + "adds r8, r14 \n\t" + "adcs r11, #0 \n\t" + "adc r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r10, #0 \n\t" + "umull r8, r9, r5, r3 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r6, r2 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r9, r9 \n\t" + "adc r10, r10 \n\t" + "mov r14, r9 \n\t" + "umlal r8, r9, r7, r7 \n\t" + "cmp r14, r9 \n\t" + "it hi \n\t" + "adchi r10, #0 \n\t" + "adds r8, r11 \n\t" + "adcs r9, r12 \n\t" + "adc r10, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r12, #0 \n\t" + "umull r8, r11, r6, r3 \n\t" + "mov r14, r11 \n\t" + "umlal r8, r11, r7, r2 \n\t" + "cmp r14, r11 \n\t" + "it hi \n\t" + "adchi r12, #0 \n\t" + "adds r8, r8 \n\t" + "adcs r11, r11 \n\t" + "adc r12, r12 \n\t" + "adds r8, r9 \n\t" + "adcs r11, r10 \n\t" + "adc r12, #0 \n\t" + "stmia r0!, {r8} \n\t" + + "mov r8, #0 \n\t" + "umull r1, r10, r7, r3 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r8, #0 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "umull r1, r10, r2, r2 \n\t" + "adds r11, r1 \n\t" + "adcs r12, r10 \n\t" + "adc r8, #0 \n\t" + "stmia r0!, {r11} \n\t" + + "mov r11, #0 \n\t" + "umull r1, r10, r2, r3 \n\t" + "adds r1, r1 \n\t" + "adcs r10, r10 \n\t" + "adc r11, #0 \n\t" + "adds r12, r1 \n\t" + "adcs r8, r10 \n\t" + "adc r11, #0 \n\t" + "stmia r0!, {r12} \n\t" + + "umull r1, r10, r3, r3 \n\t" + "adds r8, r1 \n\t" + "adcs r11, r10 \n\t" + "stmia r0!, {r8, r11} \n\t" + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : "+r" (r0), "+r" (r1) + : + : "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r14", "cc", "memory" + ); +} +#define asm_square 1 +#endif /* (uECC_WORDS == 8) */ +#endif /* uECC_SQUARE_FUNC */ + +#endif /* (uECC_PLATFORM != uECC_arm_thumb) */ +#endif /* (uECC_ASM == uECC_asm_fast) */ + +#if !defined(asm_add) || !asm_add +static uint32_t vli_add(uint32_t *result, const uint32_t *left, const uint32_t *right) { + uint32_t counter = uECC_WORDS; + uint32_t carry = 0; + uint32_t left_word; + uint32_t right_word; + + __asm__ volatile ( + ".syntax unified \n\t" + "1: \n\t" + "ldmia %[lptr]!, {%[left]} \n\t" /* Load left word. */ + "ldmia %[rptr]!, {%[right]} \n\t" /* Load right word. */ + "lsrs %[carry], #1 \n\t" /* Set up carry flag (carry = 0 after this). */ + "adcs %[left], %[right] \n\t" /* Add with carry. */ + "adcs %[carry], %[carry] \n\t" /* Store carry bit. */ + "stmia %[dptr]!, {%[left]} \n\t" /* Store result word. */ + "subs %[ctr], #1 \n\t" /* Decrement counter. */ + "bne 1b \n\t" /* Loop until counter == 0. */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + #if (uECC_PLATFORM == uECC_arm_thumb) + : [dptr] "+l" (result), [lptr] "+l" (left), [rptr] "+l" (right), + [ctr] "+l" (counter), [carry] "+l" (carry), + [left] "=l" (left_word), [right] "=l" (right_word) + #else + : [dptr] "+r" (result), [lptr] "+r" (left), [rptr] "+r" (right), + [ctr] "+r" (counter), [carry] "+r" (carry), + [left] "=r" (left_word), [right] "=r" (right_word) + #endif + : + : "cc", "memory" + ); + return carry; +} +#define asm_add 1 +#endif + +#if !defined(asm_sub) || !asm_sub +static uint32_t vli_sub(uint32_t *result, const uint32_t *left, const uint32_t *right) { + uint32_t counter = uECC_WORDS; + uint32_t carry = 1; /* carry = 1 initially (means don't borrow) */ + uint32_t left_word; + uint32_t right_word; + + __asm__ volatile ( + ".syntax unified \n\t" + "1: \n\t" + "ldmia %[lptr]!, {%[left]} \n\t" /* Load left word. */ + "ldmia %[rptr]!, {%[right]} \n\t" /* Load right word. */ + "lsrs %[carry], #1 \n\t" /* Set up carry flag (carry = 0 after this). */ + "sbcs %[left], %[right] \n\t" /* Subtract with borrow. */ + "adcs %[carry], %[carry] \n\t" /* Store carry bit. */ + "stmia %[dptr]!, {%[left]} \n\t" /* Store result word. */ + "subs %[ctr], #1 \n\t" /* Decrement counter. */ + "bne 1b \n\t" /* Loop until counter == 0. */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + #if (uECC_PLATFORM == uECC_arm_thumb) + : [dptr] "+l" (result), [lptr] "+l" (left), [rptr] "+l" (right), + [ctr] "+l" (counter), [carry] "+l" (carry), + [left] "=l" (left_word), [right] "=l" (right_word) + #else + : [dptr] "+r" (result), [lptr] "+r" (left), [rptr] "+r" (right), + [ctr] "+r" (counter), [carry] "+r" (carry), + [left] "=r" (left_word), [right] "=r" (right_word) + #endif + : + : "cc", "memory" + ); + return !carry; +} +#define asm_sub 1 +#endif + +#if !defined(asm_mult) || !asm_mult +static void vli_mult(uint32_t *result, const uint32_t *left, const uint32_t *right) { +#if (uECC_PLATFORM != uECC_arm_thumb) + uint32_t c0 = 0; + uint32_t c1 = 0; + uint32_t c2 = 0; + uint32_t k = 0; + uint32_t i; + uint32_t t0, t1; + + __asm__ volatile ( + ".syntax unified \n\t" + + "1: \n\t" /* outer loop (k < uECC_WORDS) */ + "movs %[i], #0 \n\t" /* i = 0 */ + "b 3f \n\t" + + "2: \n\t" /* outer loop (k >= uECC_WORDS) */ + "movs %[i], %[k] \n\t" /* i = k */ + "subs %[i], %[eccdm1] \n\t" /* i = k - (uECC_WORDS - 1) (times 4) */ + + "3: \n\t" /* inner loop */ + "subs %[t0], %[k], %[i] \n\t" /* t0 = k-i */ + + "ldr %[t1], [%[right], %[t0]] \n\t" /* t1 = right[k - i] */ + "ldr %[t0], [%[left], %[i]] \n\t" /* t0 = left[i] */ + + "umull %[t0], %[t1], %[t0], %[t1] \n\t" /* (t0, t1) = left[i] * right[k - i] */ + + "adds %[c0], %[t0] \n\t" /* add low word to c0 */ + "adcs %[c1], %[t1] \n\t" /* add high word to c1, including carry */ + "adcs %[c2], #0 \n\t" /* add carry to c2 */ + + "adds %[i], #4 \n\t" /* i += 4 */ + "cmp %[i], %[eccd] \n\t" /* i < uECC_WORDS (times 4)? */ + "bge 4f \n\t" /* if not, exit the loop */ + "cmp %[i], %[k] \n\t" /* i <= k? */ + "ble 3b \n\t" /* if so, continue looping */ + + "4: \n\t" /* end inner loop */ + + "str %[c0], [%[result], %[k]] \n\t" /* result[k] = c0 */ + "mov %[c0], %[c1] \n\t" /* c0 = c1 */ + "mov %[c1], %[c2] \n\t" /* c1 = c2 */ + "movs %[c2], #0 \n\t" /* c2 = 0 */ + "adds %[k], #4 \n\t" /* k += 4 */ + "cmp %[k], %[eccd] \n\t" /* k < uECC_WORDS (times 4) ? */ + "blt 1b \n\t" /* if not, loop back, start with i = 0 */ + "cmp %[k], %[eccd2m1] \n\t" /* k < uECC_WORDS * 2 - 1 (times 4) ? */ + "blt 2b \n\t" /* if not, loop back, start with i = (k + 1) - uECC_WORDS */ + /* end outer loop */ + + "str %[c0], [%[result], %[k]] \n\t" /* result[uECC_WORDS * 2 - 1] = c0 */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : [c0] "+r" (c0), [c1] "+r" (c1), [c2] "+r" (c2), + [k] "+r" (k), [i] "=&r" (i), [t0] "=&r" (t0), [t1] "=&r" (t1) + : [result] "r" (result), [left] "r" (left), [right] "r" (right), + [eccd] "I" (uECC_WORDS * 4), [eccdm1] "I" ((uECC_WORDS-1) * 4), + [eccd2m1] "I" ((uECC_WORDS * 2 - 1) * 4) + : "cc", "memory" + ); + +#else /* Thumb-1 */ + + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + register const uint32_t *r2 __asm__("r2") = right; + + __asm__ volatile ( + ".syntax unified \n\t" + "movs r3, #0 \n\t" /* c0 = 0 */ + "movs r4, #0 \n\t" /* c1 = 0 */ + "movs r5, #0 \n\t" /* c2 = 0 */ + "movs r6, #0 \n\t" /* k = 0 */ + + "push {r0} \n\t" /* keep result on the stack */ + + "1: \n\t" /* outer loop (k < uECC_WORDS) */ + "movs r7, #0 \n\t" /* r7 = i = 0 */ + "b 3f \n\t" + + "2: \n\t" /* outer loop (k >= uECC_WORDS) */ + "movs r7, r6 \n\t" /* r7 = k */ + "subs r7, %[eccdm1] \n\t" /* r7 = i = k - (uECC_WORDS - 1) (times 4) */ + + "3: \n\t" /* inner loop */ + "push {r3, r4, r5, r6} \n\t" /* push things, r3 (c0) is at the top of stack. */ + "subs r0, r6, r7 \n\t" /* r0 = k - i */ + + "ldr r4, [r2, r0] \n\t" /* r4 = right[k - i] */ + "ldr r0, [r1, r7] \n\t" /* r0 = left[i] */ + + "lsrs r3, r0, #16 \n\t" /* r3 = a1 */ + "uxth r0, r0 \n\t" /* r0 = a0 */ + + "lsrs r5, r4, #16 \n\t" /* r5 = b1 */ + "uxth r4, r4 \n\t" /* r4 = b0 */ + + "movs r6, r3 \n\t" /* r6 = a1 */ + "muls r6, r5, r6 \n\t" /* r6 = a1 * b1 */ + "muls r3, r4, r3 \n\t" /* r3 = b0 * a1 */ + "muls r5, r0, r5 \n\t" /* r5 = a0 * b1 */ + "muls r0, r4, r0 \n\t" /* r0 = a0 * b0 */ + + "movs r4, #0 \n\t" /* r4 = 0 */ + "adds r3, r5 \n\t" /* r3 = b0 * a1 + a0 * b1 */ + "adcs r4, r4 \n\t" /* r4 = carry */ + "lsls r4, #16 \n\t" /* r4 = carry << 16 */ + "adds r6, r4 \n\t" /* r6 = a1 * b1 + carry */ + + "lsls r4, r3, #16 \n\t" /* r4 = (b0 * a1 + a0 * b1) << 16 */ + "lsrs r3, #16 \n\t" /* r3 = (b0 * a1 + a0 * b1) >> 16 */ + "adds r0, r4 \n\t" /* r0 = low word = a0 * b0 + ((b0 * a1 + a0 * b1) << 16) */ + "adcs r6, r3 \n\t" /* r6 = high word = a1 * b1 + carry + ((b0 * a1 + a0 * b1) >> 16) */ + + "pop {r3, r4, r5} \n\t" /* r3 = c0, r4 = c1, r5 = c2 */ + "adds r3, r0 \n\t" /* add low word to c0 */ + "adcs r4, r6 \n\t" /* add high word to c1, including carry */ + "movs r0, #0 \n\t" /* r0 = 0 (does not affect carry bit) */ + "adcs r5, r0 \n\t" /* add carry to c2 */ + + "pop {r6} \n\t" /* r6 = k */ + + "adds r7, #4 \n\t" /* i += 4 */ + "cmp r7, %[eccd] \n\t" /* i < uECC_WORDS (times 4)? */ + "bge 4f \n\t" /* if not, exit the loop */ + "cmp r7, r6 \n\t" /* i <= k? */ + "ble 3b \n\t" /* if so, continue looping */ + + "4: \n\t" /* end inner loop */ + + "ldr r0, [sp, #0] \n\t" /* r0 = result */ + + "str r3, [r0, r6] \n\t" /* result[k] = c0 */ + "mov r3, r4 \n\t" /* c0 = c1 */ + "mov r4, r5 \n\t" /* c1 = c2 */ + "movs r5, #0 \n\t" /* c2 = 0 */ + "adds r6, #4 \n\t" /* k += 4 */ + "cmp r6, %[eccd] \n\t" /* k < uECC_WORDS (times 4) ? */ + "blt 1b \n\t" /* if not, loop back, start with i = 0 */ + "cmp r6, %[eccd2m1] \n\t" /* k < uECC_WORDS * 2 - 1 (times 4) ? */ + "blt 2b \n\t" /* if not, loop back, start with i = (k + 1) - uECC_WORDS */ + /* end outer loop */ + + "str r3, [r0, r6] \n\t" /* result[uECC_WORDS * 2 - 1] = c0 */ + "pop {r0} \n\t" /* pop result off the stack */ + + ".syntax divided \n\t" + : + : [r0] "l" (r0), [r1] "l" (r1), [r2] "l" (r2), [eccd] "I" (uECC_WORDS * 4), [eccdm1] "I" ((uECC_WORDS-1) * 4), [eccd2m1] "I" ((uECC_WORDS * 2 - 1) * 4) + : "r3", "r4", "r5", "r6", "r7", "cc", "memory" + ); +#endif +} +#define asm_mult 1 +#endif /* !asm_mult */ + +#if uECC_SQUARE_FUNC +#if !defined(asm_square) || !asm_square +static void vli_square(uint32_t *result, const uint32_t *left) { +#if (uECC_PLATFORM != uECC_arm_thumb) + uint32_t c0 = 0; + uint32_t c1 = 0; + uint32_t c2 = 0; + uint32_t k = 0; + uint32_t i, tt; + uint32_t t0, t1; + + __asm__ volatile ( + ".syntax unified \n\t" + + "1: \n\t" /* outer loop (k < uECC_WORDS) */ + "movs %[i], #0 \n\t" /* i = 0 */ + "b 3f \n\t" + + "2: \n\t" /* outer loop (k >= uECC_WORDS) */ + "movs %[i], %[k] \n\t" /* i = k */ + "subs %[i], %[eccdm1] \n\t" /* i = k - (uECC_WORDS - 1) (times 4) */ + + "3: \n\t" /* inner loop */ + "subs %[tt], %[k], %[i] \n\t" /* tt = k-i */ + + "ldr %[t1], [%[left], %[tt]] \n\t" /* t1 = left[k - i] */ + "ldr %[t0], [%[left], %[i]] \n\t" /* t0 = left[i] */ + + "umull %[t0], %[t1], %[t0], %[t1] \n\t" /* (t0, t1) = left[i] * right[k - i] */ + + "cmp %[i], %[tt] \n\t" /* (i < k - i) ? */ + "bge 4f \n\t" /* if i >= k - i, skip */ + "lsls %[t1], #1 \n\t" /* high word << 1 */ + "adc %[c2], #0 \n\t" /* add carry bit to c2 */ + "lsls %[t0], #1 \n\t" /* low word << 1 */ + "adc %[t1], #0 \n\t" /* add carry bit to high word */ + + "4: \n\t" + + "adds %[c0], %[t0] \n\t" /* add low word to c0 */ + "adcs %[c1], %[t1] \n\t" /* add high word to c1, including carry */ + "adc %[c2], #0 \n\t" /* add carry to c2 */ + + "adds %[i], #4 \n\t" /* i += 4 */ + "cmp %[i], %[k] \n\t" /* i <= k? */ + "bge 5f \n\t" /* if not, exit the loop */ + "subs %[tt], %[k], %[i] \n\t" /* tt = k - i */ + "cmp %[i], %[tt] \n\t" /* i <= k - i? */ + "ble 3b \n\t" /* if so, continue looping */ + + "5: \n\t" /* end inner loop */ + + "str %[c0], [%[result], %[k]] \n\t" /* result[k] = c0 */ + "mov %[c0], %[c1] \n\t" /* c0 = c1 */ + "mov %[c1], %[c2] \n\t" /* c1 = c2 */ + "movs %[c2], #0 \n\t" /* c2 = 0 */ + "adds %[k], #4 \n\t" /* k += 4 */ + "cmp %[k], %[eccd] \n\t" /* k < uECC_WORDS (times 4) ? */ + "blt 1b \n\t" /* if not, loop back, start with i = 0 */ + "cmp %[k], %[eccd2m1] \n\t" /* k < uECC_WORDS * 2 - 1 (times 4) ? */ + "blt 2b \n\t" /* if not, loop back, start with i = (k + 1) - uECC_WORDS */ + /* end outer loop */ + + "str %[c0], [%[result], %[k]] \n\t" /* result[uECC_WORDS * 2 - 1] = c0 */ + #if (uECC_PLATFORM != uECC_arm_thumb2) + ".syntax divided \n\t" + #endif + : [c0] "+r" (c0), [c1] "+r" (c1), [c2] "+r" (c2), + [k] "+r" (k), [i] "=&r" (i), [tt] "=&r" (tt), [t0] "=&r" (t0), [t1] "=&r" (t1) + : [result] "r" (result), [left] "r" (left), + [eccd] "I" (uECC_WORDS * 4), [eccdm1] "I" ((uECC_WORDS-1) * 4), + [eccd2m1] "I" ((uECC_WORDS * 2 - 1) * 4) + : "cc", "memory" + ); + +#else + + register uint32_t *r0 __asm__("r0") = result; + register const uint32_t *r1 __asm__("r1") = left; + + __asm__ volatile ( + ".syntax unified \n\t" + "movs r2, #0 \n\t" /* c0 = 0 */ + "movs r3, #0 \n\t" /* c1 = 0 */ + "movs r4, #0 \n\t" /* c2 = 0 */ + "movs r5, #0 \n\t" /* k = 0 */ + + "push {r0} \n\t" /* keep result on the stack */ + + "1: \n\t" /* outer loop (k < uECC_WORDS) */ + "movs r6, #0 \n\t" /* r6 = i = 0 */ + "b 3f \n\t" + + "2: \n\t" /* outer loop (k >= uECC_WORDS) */ + "movs r6, r5 \n\t" /* r6 = k */ + "subs r6, %[eccdm1] \n\t" /* r6 = i = k - (uECC_WORDS - 1) (times 4) */ + + "3: \n\t" /* inner loop */ + "push {r2, r3, r4, r5} \n\t" /* push things, r2 (c0) is at the top of stack. */ + "subs r7, r5, r6 \n\t" /* r7 = k - i */ + + "ldr r3, [r1, r7] \n\t" /* r3 = left[k - i] */ + "ldr r0, [r1, r6] \n\t" /* r0 = left[i] */ + + "lsrs r2, r0, #16 \n\t" /* r2 = a1 */ + "uxth r0, r0 \n\t" /* r0 = a0 */ + + "lsrs r4, r3, #16 \n\t" /* r4 = b1 */ + "uxth r3, r3 \n\t" /* r3 = b0 */ + + "movs r5, r2 \n\t" /* r5 = a1 */ + "muls r5, r4, r5 \n\t" /* r5 = a1 * b1 */ + "muls r2, r3, r2 \n\t" /* r2 = b0 * a1 */ + "muls r4, r0, r4 \n\t" /* r4 = a0 * b1 */ + "muls r0, r3, r0 \n\t" /* r0 = a0 * b0 */ + + "movs r3, #0 \n\t" /* r3 = 0 */ + "adds r2, r4 \n\t" /* r2 = b0 * a1 + a0 * b1 */ + "adcs r3, r3 \n\t" /* r3 = carry */ + "lsls r3, #16 \n\t" /* r3 = carry << 16 */ + "adds r5, r3 \n\t" /* r5 = a1 * b1 + carry */ + + "lsls r3, r2, #16 \n\t" /* r3 = (b0 * a1 + a0 * b1) << 16 */ + "lsrs r2, #16 \n\t" /* r2 = (b0 * a1 + a0 * b1) >> 16 */ + "adds r0, r3 \n\t" /* r0 = low word = a0 * b0 + ((b0 * a1 + a0 * b1) << 16) */ + "adcs r5, r2 \n\t" /* r5 = high word = a1 * b1 + carry + ((b0 * a1 + a0 * b1) >> 16) */ + + "movs r3, #0 \n\t" /* r3 = 0 */ + "cmp r6, r7 \n\t" /* (i < k - i) ? */ + "mov r7, r3 \n\t" /* r7 = 0 (does not affect condition)*/ + "bge 4f \n\t" /* if i >= k - i, skip */ + "lsls r5, #1 \n\t" /* high word << 1 */ + "adcs r7, r3 \n\t" /* r7 = carry bit for c2 */ + "lsls r0, #1 \n\t" /* low word << 1 */ + "adcs r5, r3 \n\t" /* add carry from shift to high word */ + + "4: \n\t" + "pop {r2, r3, r4} \n\t" /* r2 = c0, r3 = c1, r4 = c2 */ + "adds r2, r0 \n\t" /* add low word to c0 */ + "adcs r3, r5 \n\t" /* add high word to c1, including carry */ + "movs r0, #0 \n\t" /* r0 = 0 (does not affect carry bit) */ + "adcs r4, r0 \n\t" /* add carry to c2 */ + "adds r4, r7 \n\t" /* add carry from doubling (if any) */ + + "pop {r5} \n\t" /* r5 = k */ + + "adds r6, #4 \n\t" /* i += 4 */ + "cmp r6, r5 \n\t" /* i <= k? */ + "bge 5f \n\t" /* if not, exit the loop */ + "subs r7, r5, r6 \n\t" /* r7 = k - i */ + "cmp r6, r7 \n\t" /* i <= k - i? */ + "ble 3b \n\t" /* if so, continue looping */ + + "5: \n\t" /* end inner loop */ + + "ldr r0, [sp, #0] \n\t" /* r0 = result */ + + "str r2, [r0, r5] \n\t" /* result[k] = c0 */ + "mov r2, r3 \n\t" /* c0 = c1 */ + "mov r3, r4 \n\t" /* c1 = c2 */ + "movs r4, #0 \n\t" /* c2 = 0 */ + "adds r5, #4 \n\t" /* k += 4 */ + "cmp r5, %[eccd] \n\t" /* k < uECC_WORDS (times 4) ? */ + "blt 1b \n\t" /* if not, loop back, start with i = 0 */ + "cmp r5, %[eccd2m1] \n\t" /* k < uECC_WORDS * 2 - 1 (times 4) ? */ + "blt 2b \n\t" /* if not, loop back, start with i = (k + 1) - uECC_WORDS */ + /* end outer loop */ + + "str r2, [r0, r5] \n\t" /* result[uECC_WORDS * 2 - 1] = c0 */ + "pop {r0} \n\t" /* pop result off the stack */ + + ".syntax divided \n\t" + : [r0] "+l" (r0), [r1] "+l" (r1) + : [eccd] "I" (uECC_WORDS * 4), [eccdm1] "I" ((uECC_WORDS-1) * 4), + [eccd2m1] "I" ((uECC_WORDS * 2 - 1) * 4) + : "r2", "r3", "r4", "r5", "r6", "r7", "cc", "memory" + ); +#endif +} +#define asm_square 1 +#endif /* !asm_square */ +#endif /* uECC_SQUARE_FUNC */ diff --git a/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.c b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.c new file mode 100644 index 0000000000000000000000000000000000000000..7ab6f882765a5796e50ddd6de58c8f2a1f264f7c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.c @@ -0,0 +1,1038 @@ +/* Copyright 2014, Kenneth MacKay. Licensed under the BSD 2-clause license. */ + +#include <string.h> +#include "uECC_ll.h" + +#ifndef uECC_PLATFORM + #if defined(__AVR__) && __AVR__ + #define uECC_PLATFORM uECC_avr + #elif defined(__thumb2__) || defined(_M_ARMT) /* I think MSVC only supports Thumb-2 targets */ + #define uECC_PLATFORM uECC_arm_thumb2 + #elif defined(__thumb__) + #define uECC_PLATFORM uECC_arm_thumb + #elif defined(__arm__) || defined(_M_ARM) + #define uECC_PLATFORM uECC_arm + #elif defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__I86__) + #define uECC_PLATFORM uECC_x86 + #elif defined(__amd64__) || defined(_M_X64) + #define uECC_PLATFORM uECC_x86_64 + #else + #define uECC_PLATFORM uECC_arch_other + #endif +#endif + +#define uECC_WORD_SIZE 4 + +#if __STDC_VERSION__ >= 199901L + #define RESTRICT restrict +#else + #define RESTRICT +#endif + +#define SUPPORTS_INT128 0 + +#define MAX_TRIES 64 + +/* #if uECC_WORD_SIZE == 4 */ +typedef uint32_t uECC_word_t; +typedef uint64_t uECC_dword_t; +typedef unsigned wordcount_t; +typedef int swordcount_t; +typedef int bitcount_t; +typedef int cmpresult_t; + +#define HIGH_BIT_SET 0x80000000 +#define uECC_WORD_BITS 32 +#define uECC_WORD_BITS_SHIFT 5 +#define uECC_WORD_BITS_MASK 0x01F + +#define uECC_WORDS_1 5 +#define uECC_WORDS_2 6 +#define uECC_WORDS_3 8 +#define uECC_WORDS_4 8 +#define uECC_WORDS_5 7 + +#define uECC_N_WORDS_1 6 +#define uECC_N_WORDS_2 6 +#define uECC_N_WORDS_3 8 +#define uECC_N_WORDS_4 8 +#define uECC_N_WORDS_5 7 + +#define Curve_P_1 {0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} +#define Curve_P_2 {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} +#define Curve_P_3 {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, \ + 0x00000000, 0x00000000, 0x00000001, 0xFFFFFFFF} +#define Curve_P_4 {0xFFFFFC2F, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, \ + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} +#define Curve_P_5 {0x00000001, 0x00000000, 0x00000000, 0xFFFFFFFF, \ + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} + +#define Curve_B_1 {0xC565FA45, 0x81D4D4AD, 0x65ACF89F, 0x54BD7A8B, 0x1C97BEFC} +#define Curve_B_2 {0xC146B9B1, 0xFEB8DEEC, 0x72243049, 0x0FA7E9AB, 0xE59C80E7, 0x64210519} +#define Curve_B_3 {0x27D2604B, 0x3BCE3C3E, 0xCC53B0F6, 0x651D06B0, \ + 0x769886BC, 0xB3EBBD55, 0xAA3A93E7, 0x5AC635D8} +#define Curve_B_4 {0x00000007, 0x00000000, 0x00000000, 0x00000000, \ + 0x00000000, 0x00000000, 0x00000000, 0x00000000} +#define Curve_B_5 {0x2355FFB4, 0x270B3943, 0xD7BFD8BA, 0x5044B0B7, \ + 0xF5413256, 0x0C04B3AB, 0xB4050A85} + +#define Curve_G_1 { \ + {0x13CBFC82, 0x68C38BB9, 0x46646989, 0x8EF57328, 0x4A96B568}, \ + {0x7AC5FB32, 0x04235137, 0x59DCC912, 0x3168947D, 0x23A62855}} + +#define Curve_G_2 { \ + {0x82FF1012, 0xF4FF0AFD, 0x43A18800, 0x7CBF20EB, 0xB03090F6, 0x188DA80E}, \ + {0x1E794811, 0x73F977A1, 0x6B24CDD5, 0x631011ED, 0xFFC8DA78, 0x07192B95}} + +#define Curve_G_3 { \ + {0xD898C296, 0xF4A13945, 0x2DEB33A0, 0x77037D81, \ + 0x63A440F2, 0xF8BCE6E5, 0xE12C4247, 0x6B17D1F2}, \ + {0x37BF51F5, 0xCBB64068, 0x6B315ECE, 0x2BCE3357, \ + 0x7C0F9E16, 0x8EE7EB4A, 0xFE1A7F9B, 0x4FE342E2}} + +#define Curve_G_4 { \ + {0x16F81798, 0x59F2815B, 0x2DCE28D9, 0x029BFCDB, \ + 0xCE870B07, 0x55A06295, 0xF9DCBBAC, 0x79BE667E}, \ + {0xFB10D4B8, 0x9C47D08F, 0xA6855419, 0xFD17B448, \ + 0x0E1108A8, 0x5DA4FBFC, 0x26A3C465, 0x483ADA77}} + +#define Curve_G_5 { \ + {0x115C1D21, 0x343280D6, 0x56C21122, 0x4A03C1D3, \ + 0x321390B9, 0x6BB4BF7F, 0xB70E0CBD}, \ + {0x85007E34, 0x44D58199, 0x5A074764, 0xCD4375A0, \ + 0x4C22DFE6, 0xB5F723FB, 0xBD376388}} + +#define Curve_N_1 {0xCA752257, 0xF927AED3, 0x0001F4C8, 0x00000000, 0x00000000, 0x00000001} +#define Curve_N_2 {0xB4D22831, 0x146BC9B1, 0x99DEF836, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} +#define Curve_N_3 {0xFC632551, 0xF3B9CAC2, 0xA7179E84, 0xBCE6FAAD, \ + 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF} +#define Curve_N_4 {0xD0364141, 0xBFD25E8C, 0xAF48A03B, 0xBAAEDCE6, \ + 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} +#define Curve_N_5 {0x5C5C2A3D, 0x13DD2945, 0xE0B8F03E, 0xFFFF16A2, \ + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} + +/* #endif */ + +#define uECC_WORDS uECC_CONCAT(uECC_WORDS_, uECC_CURVE) +#define uECC_N_WORDS uECC_CONCAT(uECC_N_WORDS_, uECC_CURVE) + +typedef struct EccPoint { + uECC_word_t x[uECC_WORDS]; + uECC_word_t y[uECC_WORDS]; +} EccPoint; + +static const uECC_word_t curve_p[uECC_WORDS] = uECC_CONCAT(Curve_P_, uECC_CURVE); +static const EccPoint curve_G = uECC_CONCAT(Curve_G_, uECC_CURVE); +static const uECC_word_t curve_n[uECC_N_WORDS] = uECC_CONCAT(Curve_N_, uECC_CURVE); + +static void vli_clear(uECC_word_t *vli); +static uECC_word_t vli_isZero(const uECC_word_t *vli); +static uECC_word_t vli_testBit(const uECC_word_t *vli, bitcount_t bit); +static void vli_set(uECC_word_t *dest, const uECC_word_t *src); +static cmpresult_t vli_cmp(const uECC_word_t *left, const uECC_word_t *right); +static void vli_rshift1(uECC_word_t *vli); +static uECC_word_t vli_add(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right); +static uECC_word_t vli_sub(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right); +static void vli_mult(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right); +static void vli_modAdd(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right, + const uECC_word_t *mod); +static void vli_modSub(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right, + const uECC_word_t *mod); +static void vli_mmod_fast(uECC_word_t *RESTRICT result, uECC_word_t *RESTRICT product); +static void vli_modMult_fast(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right); +static void vli_modInv(uECC_word_t *result, const uECC_word_t *input, const uECC_word_t *mod); +#if uECC_SQUARE_FUNC +static void vli_square(uECC_word_t *result, const uECC_word_t *left); +static void vli_modSquare_fast(uECC_word_t *result, const uECC_word_t *left); +#endif + +static int default_RNG(uint8_t *dest, unsigned size) { + return 0; +} + + +static uECC_RNG_Function g_rng_function = &default_RNG; + +void uECC_set_rng(uECC_RNG_Function rng_function) { + g_rng_function = rng_function; +} + +#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */ + #if (uECC_ASM && (uECC_PLATFORM == uECC_arm || uECC_PLATFORM == uECC_arm_thumb || \ + uECC_PLATFORM == uECC_arm_thumb2)) + #include "asm_arm.inc" + #endif +#endif + +#if !defined(asm_clear) || !asm_clear +static void vli_clear(uECC_word_t *vli) { + wordcount_t i; + for (i = 0; i < uECC_WORDS; ++i) { + vli[i] = 0; + } +} +#endif + +/* Returns 1 if vli == 0, 0 otherwise. */ +#if !defined(asm_isZero) || !asm_isZero +static uECC_word_t vli_isZero(const uECC_word_t *vli) { + wordcount_t i; + for (i = 0; i < uECC_WORDS; ++i) { + if (vli[i]) { + return 0; + } + } + return 1; +} +#endif + +/* Returns nonzero if bit 'bit' of vli is set. */ +#if !defined(asm_testBit) || !asm_testBit +static uECC_word_t vli_testBit(const uECC_word_t *vli, bitcount_t bit) { + return (vli[bit >> uECC_WORD_BITS_SHIFT] & ((uECC_word_t)1 << (bit & uECC_WORD_BITS_MASK))); +} +#endif + +/* Sets dest = src. */ +#if !defined(asm_set) || !asm_set +static void vli_set(uECC_word_t *dest, const uECC_word_t *src) { + wordcount_t i; + for (i = 0; i < uECC_WORDS; ++i) { + dest[i] = src[i]; + } +} +#endif + +/* Returns sign of left - right. */ +#if !defined(asm_cmp) || !asm_cmp +static cmpresult_t vli_cmp(const uECC_word_t *left, const uECC_word_t *right) { + swordcount_t i; + for (i = uECC_WORDS - 1; i >= 0; --i) { + if (left[i] > right[i]) { + return 1; + } else if (left[i] < right[i]) { + return -1; + } + } + return 0; +} +#endif + +/* Computes vli = vli >> 1. */ +#if !defined(asm_rshift1) || !asm_rshift1 +static void vli_rshift1(uECC_word_t *vli) { + uECC_word_t *end = vli; + uECC_word_t carry = 0; + + vli += uECC_WORDS; + while (vli-- > end) { + uECC_word_t temp = *vli; + *vli = (temp >> 1) | carry; + carry = temp << (uECC_WORD_BITS - 1); + } +} +#endif + +/* Computes result = left + right, returning carry. Can modify in place. */ +#if !defined(asm_add) || !asm_add +static uECC_word_t vli_add(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right) { + uECC_word_t carry = 0; + wordcount_t i; + for (i = 0; i < uECC_WORDS; ++i) { + uECC_word_t sum = left[i] + right[i] + carry; + if (sum != left[i]) { + carry = (sum < left[i]); + } + result[i] = sum; + } + return carry; +} +#endif + +/* Computes result = left - right, returning borrow. Can modify in place. */ +#if !defined(asm_sub) || !asm_sub +static uECC_word_t vli_sub(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right) { + uECC_word_t borrow = 0; + wordcount_t i; + for (i = 0; i < uECC_WORDS; ++i) { + uECC_word_t diff = left[i] - right[i] - borrow; + if (diff != left[i]) { + borrow = (diff > left[i]); + } + result[i] = diff; + } + return borrow; +} +#endif + +#if (!asm_mult || (uECC_SQUARE_FUNC && !asm_square) || uECC_CURVE == uECC_secp256k1) +static void muladd(uECC_word_t a, + uECC_word_t b, + uECC_word_t *r0, + uECC_word_t *r1, + uECC_word_t *r2) { + uECC_dword_t p = (uECC_dword_t)a * b; + uECC_dword_t r01 = ((uECC_dword_t)(*r1) << uECC_WORD_BITS) | *r0; + r01 += p; + *r2 += (r01 < p); + *r1 = r01 >> uECC_WORD_BITS; + *r0 = (uECC_word_t)r01; +} +#define muladd_exists 1 +#endif + +#if !asm_mult +static void vli_mult(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right) { + uECC_word_t r0 = 0; + uECC_word_t r1 = 0; + uECC_word_t r2 = 0; + wordcount_t i, k; + + /* Compute each digit of result in sequence, maintaining the carries. */ + for (k = 0; k < uECC_WORDS; ++k) { + for (i = 0; i <= k; ++i) { + muladd(left[i], right[k - i], &r0, &r1, &r2); + } + result[k] = r0; + r0 = r1; + r1 = r2; + r2 = 0; + } + for (k = uECC_WORDS; k < uECC_WORDS * 2 - 1; ++k) { + for (i = (k + 1) - uECC_WORDS; i < uECC_WORDS; ++i) { + muladd(left[i], right[k - i], &r0, &r1, &r2); + } + result[k] = r0; + r0 = r1; + r1 = r2; + r2 = 0; + } + result[uECC_WORDS * 2 - 1] = r0; +} +#endif + +#if uECC_SQUARE_FUNC + +#if !asm_square +static void mul2add(uECC_word_t a, + uECC_word_t b, + uECC_word_t *r0, + uECC_word_t *r1, + uECC_word_t *r2) { + uECC_dword_t p = (uECC_dword_t)a * b; + uECC_dword_t r01 = ((uECC_dword_t)(*r1) << uECC_WORD_BITS) | *r0; + *r2 += (p >> (uECC_WORD_BITS * 2 - 1)); + p *= 2; + r01 += p; + *r2 += (r01 < p); + *r1 = r01 >> uECC_WORD_BITS; + *r0 = (uECC_word_t)r01; +} + +static void vli_square(uECC_word_t *result, const uECC_word_t *left) { + uECC_word_t r0 = 0; + uECC_word_t r1 = 0; + uECC_word_t r2 = 0; + + wordcount_t i, k; + + for (k = 0; k < uECC_WORDS * 2 - 1; ++k) { + uECC_word_t min = (k < uECC_WORDS ? 0 : (k + 1) - uECC_WORDS); + for (i = min; i <= k && i <= k - i; ++i) { + if (i < k-i) { + mul2add(left[i], left[k - i], &r0, &r1, &r2); + } else { + muladd(left[i], left[k - i], &r0, &r1, &r2); + } + } + result[k] = r0; + r0 = r1; + r1 = r2; + r2 = 0; + } + + result[uECC_WORDS * 2 - 1] = r0; +} +#endif + +#else /* uECC_SQUARE_FUNC */ + +#define vli_square(result, left, size) vli_mult((result), (left), (left), (size)) + +#endif /* uECC_SQUARE_FUNC */ + + +/* Computes result = (left + right) % mod. + Assumes that left < mod and right < mod, and that result does not overlap mod. */ +#if !defined(asm_modAdd) || !asm_modAdd +static void vli_modAdd(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right, + const uECC_word_t *mod) { + uECC_word_t carry = vli_add(result, left, right); + if (carry || vli_cmp(result, mod) >= 0) { + /* result > mod (result = mod + remainder), so subtract mod to get remainder. */ + vli_sub(result, result, mod); + } +} +#endif + +/* Computes result = (left - right) % mod. + Assumes that left < mod and right < mod, and that result does not overlap mod. */ +#if !defined(asm_modSub) || !asm_modSub +static void vli_modSub(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right, + const uECC_word_t *mod) { + uECC_word_t l_borrow = vli_sub(result, left, right); + if (l_borrow) { + /* In this case, result == -diff == (max int) - diff. Since -x % d == d - x, + we can get the correct result from result + mod (with overflow). */ + vli_add(result, result, mod); + } +} +#endif + +#if !defined(asm_modSub_fast) || !asm_modSub_fast + #define vli_modSub_fast(result, left, right) vli_modSub((result), (left), (right), curve_p) +#endif + +#if !defined(asm_mmod_fast) || !asm_mmod_fast + +#if uECC_CURVE == uECC_secp256r1 + +/* Computes result = product % curve_p + from http://www.nsa.gov/ia/_files/nist-routines.pdf */ +#if uECC_WORD_SIZE == 4 +static void vli_mmod_fast(uint32_t *RESTRICT result, uint32_t *RESTRICT product) { + uint32_t tmp[uECC_WORDS]; + int carry; + + /* t */ + vli_set(result, product); + + /* s1 */ + tmp[0] = tmp[1] = tmp[2] = 0; + tmp[3] = product[11]; + tmp[4] = product[12]; + tmp[5] = product[13]; + tmp[6] = product[14]; + tmp[7] = product[15]; + carry = vli_add(tmp, tmp, tmp); + carry += vli_add(result, result, tmp); + + /* s2 */ + tmp[3] = product[12]; + tmp[4] = product[13]; + tmp[5] = product[14]; + tmp[6] = product[15]; + tmp[7] = 0; + carry += vli_add(tmp, tmp, tmp); + carry += vli_add(result, result, tmp); + + /* s3 */ + tmp[0] = product[8]; + tmp[1] = product[9]; + tmp[2] = product[10]; + tmp[3] = tmp[4] = tmp[5] = 0; + tmp[6] = product[14]; + tmp[7] = product[15]; + carry += vli_add(result, result, tmp); + + /* s4 */ + tmp[0] = product[9]; + tmp[1] = product[10]; + tmp[2] = product[11]; + tmp[3] = product[13]; + tmp[4] = product[14]; + tmp[5] = product[15]; + tmp[6] = product[13]; + tmp[7] = product[8]; + carry += vli_add(result, result, tmp); + + /* d1 */ + tmp[0] = product[11]; + tmp[1] = product[12]; + tmp[2] = product[13]; + tmp[3] = tmp[4] = tmp[5] = 0; + tmp[6] = product[8]; + tmp[7] = product[10]; + carry -= vli_sub(result, result, tmp); + + /* d2 */ + tmp[0] = product[12]; + tmp[1] = product[13]; + tmp[2] = product[14]; + tmp[3] = product[15]; + tmp[4] = tmp[5] = 0; + tmp[6] = product[9]; + tmp[7] = product[11]; + carry -= vli_sub(result, result, tmp); + + /* d3 */ + tmp[0] = product[13]; + tmp[1] = product[14]; + tmp[2] = product[15]; + tmp[3] = product[8]; + tmp[4] = product[9]; + tmp[5] = product[10]; + tmp[6] = 0; + tmp[7] = product[12]; + carry -= vli_sub(result, result, tmp); + + /* d4 */ + tmp[0] = product[14]; + tmp[1] = product[15]; + tmp[2] = 0; + tmp[3] = product[9]; + tmp[4] = product[10]; + tmp[5] = product[11]; + tmp[6] = 0; + tmp[7] = product[13]; + carry -= vli_sub(result, result, tmp); + + if (carry < 0) { + do { + carry += vli_add(result, result, curve_p); + } while (carry < 0); + } else { + while (carry || vli_cmp(curve_p, result) != 1) { + carry -= vli_sub(result, result, curve_p); + } + } +} +#endif /* uECC_WORD_SIZE */ +#endif /* uECC_CURVE */ +#endif /* !asm_mmod_fast */ + +/* Computes result = (left * right) % curve_p. */ +static void vli_modMult_fast(uECC_word_t *result, + const uECC_word_t *left, + const uECC_word_t *right) { + uECC_word_t product[2 * uECC_WORDS]; + vli_mult(product, left, right); + vli_mmod_fast(result, product); +} + +#if uECC_SQUARE_FUNC + +/* Computes result = left^2 % curve_p. */ +static void vli_modSquare_fast(uECC_word_t *result, const uECC_word_t *left) { + uECC_word_t product[2 * uECC_WORDS]; + vli_square(product, left); + vli_mmod_fast(result, product); +} + +#else /* uECC_SQUARE_FUNC */ + +#define vli_modSquare_fast(result, left) vli_modMult_fast((result), (left), (left)) + +#endif /* uECC_SQUARE_FUNC */ + + +#define EVEN(vli) (!(vli[0] & 1)) +/* Computes result = (1 / input) % mod. All VLIs are the same size. + See "From Euclid's GCD to Montgomery Multiplication to the Great Divide" + https://labs.oracle.com/techrep/2001/smli_tr-2001-95.pdf */ +#if !defined(asm_modInv) || !asm_modInv +static void vli_modInv(uECC_word_t *result, const uECC_word_t *input, const uECC_word_t *mod) { + uECC_word_t a[uECC_WORDS], b[uECC_WORDS], u[uECC_WORDS], v[uECC_WORDS]; + uECC_word_t carry; + cmpresult_t cmpResult; + + if (vli_isZero(input)) { + vli_clear(result); + return; + } + + vli_set(a, input); + vli_set(b, mod); + vli_clear(u); + u[0] = 1; + vli_clear(v); + while ((cmpResult = vli_cmp(a, b)) != 0) { + carry = 0; + if (EVEN(a)) { + vli_rshift1(a); + if (!EVEN(u)) { + carry = vli_add(u, u, mod); + } + vli_rshift1(u); + if (carry) { + u[uECC_WORDS - 1] |= HIGH_BIT_SET; + } + } else if (EVEN(b)) { + vli_rshift1(b); + if (!EVEN(v)) { + carry = vli_add(v, v, mod); + } + vli_rshift1(v); + if (carry) { + v[uECC_WORDS - 1] |= HIGH_BIT_SET; + } + } else if (cmpResult > 0) { + vli_sub(a, a, b); + vli_rshift1(a); + if (vli_cmp(u, v) < 0) { + vli_add(u, u, mod); + } + vli_sub(u, u, v); + if (!EVEN(u)) { + carry = vli_add(u, u, mod); + } + vli_rshift1(u); + if (carry) { + u[uECC_WORDS - 1] |= HIGH_BIT_SET; + } + } else { + vli_sub(b, b, a); + vli_rshift1(b); + if (vli_cmp(v, u) < 0) { + vli_add(v, v, mod); + } + vli_sub(v, v, u); + if (!EVEN(v)) { + carry = vli_add(v, v, mod); + } + vli_rshift1(v); + if (carry) { + v[uECC_WORDS - 1] |= HIGH_BIT_SET; + } + } + } + vli_set(result, u); +} +#endif /* !asm_modInv */ + +/* ------ Point operations ------ */ + +/* Returns 1 if 'point' is the point at infinity, 0 otherwise. */ +static cmpresult_t EccPoint_isZero(const EccPoint *point) { + return (vli_isZero(point->x) && vli_isZero(point->y)); +} + +/* Point multiplication algorithm using Montgomery's ladder with co-Z coordinates. +From http://eprint.iacr.org/2011/338.pdf +*/ + +/* Double in place */ +static void EccPoint_double_jacobian(uECC_word_t * RESTRICT X1, + uECC_word_t * RESTRICT Y1, + uECC_word_t * RESTRICT Z1) { + /* t1 = X, t2 = Y, t3 = Z */ + uECC_word_t t4[uECC_WORDS]; + uECC_word_t t5[uECC_WORDS]; + + if (vli_isZero(Z1)) { + return; + } + + vli_modSquare_fast(t4, Y1); /* t4 = y1^2 */ + vli_modMult_fast(t5, X1, t4); /* t5 = x1*y1^2 = A */ + vli_modSquare_fast(t4, t4); /* t4 = y1^4 */ + vli_modMult_fast(Y1, Y1, Z1); /* t2 = y1*z1 = z3 */ + vli_modSquare_fast(Z1, Z1); /* t3 = z1^2 */ + + vli_modAdd(X1, X1, Z1, curve_p); /* t1 = x1 + z1^2 */ + vli_modAdd(Z1, Z1, Z1, curve_p); /* t3 = 2*z1^2 */ + vli_modSub_fast(Z1, X1, Z1); /* t3 = x1 - z1^2 */ + vli_modMult_fast(X1, X1, Z1); /* t1 = x1^2 - z1^4 */ + + vli_modAdd(Z1, X1, X1, curve_p); /* t3 = 2*(x1^2 - z1^4) */ + vli_modAdd(X1, X1, Z1, curve_p); /* t1 = 3*(x1^2 - z1^4) */ + if (vli_testBit(X1, 0)) { + uECC_word_t l_carry = vli_add(X1, X1, curve_p); + vli_rshift1(X1); + X1[uECC_WORDS - 1] |= l_carry << (uECC_WORD_BITS - 1); + } else { + vli_rshift1(X1); + } + /* t1 = 3/2*(x1^2 - z1^4) = B */ + + vli_modSquare_fast(Z1, X1); /* t3 = B^2 */ + vli_modSub_fast(Z1, Z1, t5); /* t3 = B^2 - A */ + vli_modSub_fast(Z1, Z1, t5); /* t3 = B^2 - 2A = x3 */ + vli_modSub_fast(t5, t5, Z1); /* t5 = A - x3 */ + vli_modMult_fast(X1, X1, t5); /* t1 = B * (A - x3) */ + vli_modSub_fast(t4, X1, t4); /* t4 = B * (A - x3) - y1^4 = y3 */ + + vli_set(X1, Z1); + vli_set(Z1, Y1); + vli_set(Y1, t4); +} + +/* Modify (x1, y1) => (x1 * z^2, y1 * z^3) */ +static void apply_z(uECC_word_t * RESTRICT X1, + uECC_word_t * RESTRICT Y1, + const uECC_word_t * RESTRICT Z) { + uECC_word_t t1[uECC_WORDS]; + + vli_modSquare_fast(t1, Z); /* z^2 */ + vli_modMult_fast(X1, X1, t1); /* x1 * z^2 */ + vli_modMult_fast(t1, t1, Z); /* z^3 */ + vli_modMult_fast(Y1, Y1, t1); /* y1 * z^3 */ +} + +/* P = (x1, y1) => 2P, (x2, y2) => P' */ +static void XYcZ_initial_double(uECC_word_t * RESTRICT X1, + uECC_word_t * RESTRICT Y1, + uECC_word_t * RESTRICT X2, + uECC_word_t * RESTRICT Y2, + const uECC_word_t * RESTRICT initial_Z) { + uECC_word_t z[uECC_WORDS]; + if (initial_Z) { + vli_set(z, initial_Z); + } else { + vli_clear(z); + z[0] = 1; + } + + vli_set(X2, X1); + vli_set(Y2, Y1); + + apply_z(X1, Y1, z); + EccPoint_double_jacobian(X1, Y1, z); + apply_z(X2, Y2, z); +} + +/* Input P = (x1, y1, Z), Q = (x2, y2, Z) + Output P' = (x1', y1', Z3), P + Q = (x3, y3, Z3) + or P => P', Q => P + Q +*/ +static void XYcZ_add(uECC_word_t * RESTRICT X1, + uECC_word_t * RESTRICT Y1, + uECC_word_t * RESTRICT X2, + uECC_word_t * RESTRICT Y2) { + /* t1 = X1, t2 = Y1, t3 = X2, t4 = Y2 */ + uECC_word_t t5[uECC_WORDS]; + + vli_modSub_fast(t5, X2, X1); /* t5 = x2 - x1 */ + vli_modSquare_fast(t5, t5); /* t5 = (x2 - x1)^2 = A */ + vli_modMult_fast(X1, X1, t5); /* t1 = x1*A = B */ + vli_modMult_fast(X2, X2, t5); /* t3 = x2*A = C */ + vli_modSub_fast(Y2, Y2, Y1); /* t4 = y2 - y1 */ + vli_modSquare_fast(t5, Y2); /* t5 = (y2 - y1)^2 = D */ + + vli_modSub_fast(t5, t5, X1); /* t5 = D - B */ + vli_modSub_fast(t5, t5, X2); /* t5 = D - B - C = x3 */ + vli_modSub_fast(X2, X2, X1); /* t3 = C - B */ + vli_modMult_fast(Y1, Y1, X2); /* t2 = y1*(C - B) */ + vli_modSub_fast(X2, X1, t5); /* t3 = B - x3 */ + vli_modMult_fast(Y2, Y2, X2); /* t4 = (y2 - y1)*(B - x3) */ + vli_modSub_fast(Y2, Y2, Y1); /* t4 = y3 */ + + vli_set(X2, t5); +} + +/* Input P = (x1, y1, Z), Q = (x2, y2, Z) + Output P + Q = (x3, y3, Z3), P - Q = (x3', y3', Z3) + or P => P - Q, Q => P + Q +*/ +static void XYcZ_addC(uECC_word_t * RESTRICT X1, + uECC_word_t * RESTRICT Y1, + uECC_word_t * RESTRICT X2, + uECC_word_t * RESTRICT Y2) { + /* t1 = X1, t2 = Y1, t3 = X2, t4 = Y2 */ + uECC_word_t t5[uECC_WORDS]; + uECC_word_t t6[uECC_WORDS]; + uECC_word_t t7[uECC_WORDS]; + + vli_modSub_fast(t5, X2, X1); /* t5 = x2 - x1 */ + vli_modSquare_fast(t5, t5); /* t5 = (x2 - x1)^2 = A */ + vli_modMult_fast(X1, X1, t5); /* t1 = x1*A = B */ + vli_modMult_fast(X2, X2, t5); /* t3 = x2*A = C */ + vli_modAdd(t5, Y2, Y1, curve_p); /* t5 = y2 + y1 */ + vli_modSub_fast(Y2, Y2, Y1); /* t4 = y2 - y1 */ + + vli_modSub_fast(t6, X2, X1); /* t6 = C - B */ + vli_modMult_fast(Y1, Y1, t6); /* t2 = y1 * (C - B) = E */ + vli_modAdd(t6, X1, X2, curve_p); /* t6 = B + C */ + vli_modSquare_fast(X2, Y2); /* t3 = (y2 - y1)^2 = D */ + vli_modSub_fast(X2, X2, t6); /* t3 = D - (B + C) = x3 */ + + vli_modSub_fast(t7, X1, X2); /* t7 = B - x3 */ + vli_modMult_fast(Y2, Y2, t7); /* t4 = (y2 - y1)*(B - x3) */ + vli_modSub_fast(Y2, Y2, Y1); /* t4 = (y2 - y1)*(B - x3) - E = y3 */ + + vli_modSquare_fast(t7, t5); /* t7 = (y2 + y1)^2 = F */ + vli_modSub_fast(t7, t7, t6); /* t7 = F - (B + C) = x3' */ + vli_modSub_fast(t6, t7, X1); /* t6 = x3' - B */ + vli_modMult_fast(t6, t6, t5); /* t6 = (y2 + y1)*(x3' - B) */ + vli_modSub_fast(Y1, t6, Y1); /* t2 = (y2 + y1)*(x3' - B) - E = y3' */ + + vli_set(X1, t7); +} + +enum +{ + ECC_POINT_MULT_STATE_INIT, + ECC_POINT_MULT_STATE_BIT_ADDC, + ECC_POINT_MULT_STATE_BIT_ADD, + ECC_POINT_MULT_STATE_EXIT_ADDC, + ECC_POINT_MULT_STATE_EXIT_ADD, + ECC_POINT_MULT_STATE_COMPLETE +}; + +typedef struct +{ + uint8_t state; + uECC_word_t Rx[2][uECC_WORDS]; + uECC_word_t Ry[2][uECC_WORDS]; + bitcount_t i; +} EccPointMultCtx; + +static int EccPoint_mult(EccPointMultCtx *pCtx, + EccPoint * RESTRICT result, + const EccPoint * RESTRICT point, + const uECC_word_t * RESTRICT scalar, + const uECC_word_t * RESTRICT initialZ, + bitcount_t numBits) { + uECC_word_t nb; + uECC_word_t z[uECC_WORDS]; + + switch (pCtx->state) { + case ECC_POINT_MULT_STATE_INIT: + vli_set(pCtx->Rx[1], point->x); + vli_set(pCtx->Ry[1], point->y); + + XYcZ_initial_double(pCtx->Rx[1], pCtx->Ry[1], pCtx->Rx[0], pCtx->Ry[0], initialZ); + + pCtx->i = numBits - 2; + pCtx->state = ECC_POINT_MULT_STATE_BIT_ADDC; + return 0; + + case ECC_POINT_MULT_STATE_BIT_ADDC: + nb = !vli_testBit(scalar, pCtx->i); + XYcZ_addC(pCtx->Rx[1 - nb], pCtx->Ry[1 - nb], pCtx->Rx[nb], pCtx->Ry[nb]); + + pCtx->state = ECC_POINT_MULT_STATE_BIT_ADD; + return 0; + + case ECC_POINT_MULT_STATE_BIT_ADD: + nb = !vli_testBit(scalar, pCtx->i); + XYcZ_add(pCtx->Rx[nb], pCtx->Ry[nb], pCtx->Rx[1 - nb], pCtx->Ry[1 - nb]); + + pCtx->i--; + pCtx->state = (pCtx->i > 0) ? ECC_POINT_MULT_STATE_BIT_ADDC : ECC_POINT_MULT_STATE_EXIT_ADDC; + return 0; + + case ECC_POINT_MULT_STATE_EXIT_ADDC: + nb = !vli_testBit(scalar, 0); + XYcZ_addC(pCtx->Rx[1 - nb], pCtx->Ry[1 - nb], pCtx->Rx[nb], pCtx->Ry[nb]); + + pCtx->state = ECC_POINT_MULT_STATE_EXIT_ADD; + return 0; + + case ECC_POINT_MULT_STATE_EXIT_ADD: + nb = !vli_testBit(scalar, 0); + + /* Find final 1/Z value. */ + vli_modSub_fast(z, pCtx->Rx[1], pCtx->Rx[0]); /* X1 - X0 */ + vli_modMult_fast(z, z, pCtx->Ry[1 - nb]); /* Yb * (X1 - X0) */ + vli_modMult_fast(z, z, point->x); /* xP * Yb * (X1 - X0) */ + vli_modInv(z, z, curve_p); /* 1 / (xP * Yb * (X1 - X0)) */ + vli_modMult_fast(z, z, point->y); /* yP / (xP * Yb * (X1 - X0)) */ + vli_modMult_fast(z, z, pCtx->Rx[1 - nb]); /* Xb * yP / (xP * Yb * (X1 - X0)) */ + /* End 1/Z calculation */ + + XYcZ_add(pCtx->Rx[nb], pCtx->Ry[nb], pCtx->Rx[1 - nb], pCtx->Ry[1 - nb]); + apply_z(pCtx->Rx[0], pCtx->Ry[0], z); + + vli_set(result->x, pCtx->Rx[0]); + vli_set(result->y, pCtx->Ry[0]); + + pCtx->state = ECC_POINT_MULT_STATE_COMPLETE; + return 1; + + case ECC_POINT_MULT_STATE_COMPLETE: + default: + return 1; + } +} + +#if uECC_WORD_SIZE == 4 + +static void vli_nativeToBytes(uint8_t *bytes, const uint32_t *native) { + unsigned i; + for (i = 0; i < uECC_WORDS; ++i) { + uint8_t *digit = bytes + 4 * (uECC_WORDS - 1 - i); + digit[0] = (uint8_t)(native[i] >> 24); + digit[1] = (uint8_t)(native[i] >> 16); + digit[2] = (uint8_t)(native[i] >> 8); + digit[3] = (uint8_t)(native[i]); + } +} + +static void vli_bytesToNative(uint32_t *native, const uint8_t *bytes) { + unsigned i; + for (i = 0; i < uECC_WORDS; ++i) { + const uint8_t *digit = bytes + 4 * (uECC_WORDS - 1 - i); + native[i] = ((uint32_t)digit[0] << 24) | ((uint32_t)digit[1] << 16) | + ((uint32_t)digit[2] << 8) | (uint32_t)digit[3]; + } +} + +#endif /* uECC_WORD_SIZE */ + +enum +{ + ECC_MAKE_KEY_STATE_INIT, + ECC_MAKE_KEY_STATE_ECC_POINT_MULT, + ECC_MAKE_KEY_STATE_EXIT, + ECC_MAKE_KEY_STATE_COMPLETE +}; + +typedef struct EccMakeKeyCtx { + uint8_t state; + uECC_word_t private[uECC_WORDS]; + EccPoint public; + uECC_word_t tmp1[uECC_WORDS]; + uECC_word_t tmp2[uECC_WORDS]; + uECC_word_t *p2[2]; + uECC_word_t carry; + + EccPointMultCtx pointMultCtx; +} EccMakeKeyCtx; + +typedef struct EccSharedSecretCtx { + uECC_word_t random[uECC_WORDS]; + uECC_word_t *initial_Z; + EccPoint public; + EccPoint product; + uECC_word_t private[uECC_WORDS]; + uECC_word_t tmp[uECC_WORDS]; + uECC_word_t *p2[2]; + uECC_word_t carry; + + EccPointMultCtx pointMultCtx; +} EccSharedSecretCtx; + +typedef union EccCtx { + EccMakeKeyCtx makeKey; + EccSharedSecretCtx sharedSecret; +} EccCtx; + +static EccCtx uECC_ctx; + +/************************************************************************************************** + Make Key +**************************************************************************************************/ + +void uECC_make_key_start(const uint8_t private_key[uECC_BYTES]) { + memset(&uECC_ctx, 0, sizeof(uECC_ctx)); + uECC_ctx.makeKey.state = ECC_MAKE_KEY_STATE_INIT; + vli_bytesToNative(uECC_ctx.makeKey.private, private_key); +} + +int uECC_make_key_continue(void) { + switch (uECC_ctx.makeKey.state) { + case ECC_MAKE_KEY_STATE_INIT: + /* Make sure the private key is in the range [1, n-1]. */ + if (vli_isZero(uECC_ctx.makeKey.private)) { + return 0; + } + + if (vli_cmp(curve_n, uECC_ctx.makeKey.private) != 1) { + return 0; + } + + // Regularize the bitcount for the private key so that attackers cannot use a side channel + // attack to learn the number of leading zeros. + uECC_ctx.makeKey.p2[0] = uECC_ctx.makeKey.tmp1; + uECC_ctx.makeKey.p2[1] = uECC_ctx.makeKey.tmp2; + uECC_ctx.makeKey.carry = vli_add(uECC_ctx.makeKey.tmp1, uECC_ctx.makeKey.private, curve_n); + vli_add(uECC_ctx.makeKey.tmp2, uECC_ctx.makeKey.tmp1, curve_n); + + uECC_ctx.makeKey.pointMultCtx.state = 0; + uECC_ctx.makeKey.state = ECC_MAKE_KEY_STATE_ECC_POINT_MULT; + return 0; + + case ECC_MAKE_KEY_STATE_ECC_POINT_MULT: + if (EccPoint_mult(&uECC_ctx.makeKey.pointMultCtx, + &uECC_ctx.makeKey.public, + &curve_G, + uECC_ctx.makeKey.p2[!uECC_ctx.makeKey.carry], + 0, + (uECC_BYTES * 8) + 1)) { + uECC_ctx.makeKey.state = ECC_MAKE_KEY_STATE_EXIT; + } + return 0; + + case ECC_MAKE_KEY_STATE_EXIT: + if (EccPoint_isZero(&uECC_ctx.makeKey.public)) { + uECC_ctx.makeKey.state = ECC_MAKE_KEY_STATE_INIT; + return 0; + } + + uECC_ctx.makeKey.state = ECC_MAKE_KEY_STATE_COMPLETE; + return 1; + + case ECC_MAKE_KEY_STATE_COMPLETE: + default: + return 1; + } +} + +void uECC_make_key_complete(uint8_t public_key[uECC_BYTES*2], uint8_t private_key[uECC_BYTES]) { + vli_nativeToBytes(private_key, uECC_ctx.makeKey.private); + vli_nativeToBytes(public_key, uECC_ctx.makeKey.public.x); + vli_nativeToBytes(public_key + uECC_BYTES, uECC_ctx.makeKey.public.y); +} + +/************************************************************************************************** + Shared Secret +**************************************************************************************************/ + +void uECC_shared_secret_start(const uint8_t public_key[uECC_BYTES*2], + const uint8_t private_key[uECC_BYTES]) { + uECC_word_t tries; + + memset(&uECC_ctx, 0, sizeof(uECC_ctx)); + + // Try to get a random initial Z value to improve protection against side-channel + // attacks. If the RNG fails every time (eg it was not defined), we continue so that + // uECC_shared_secret() can still work without an RNG defined. + uECC_ctx.sharedSecret.initial_Z = NULL; + for (tries = 0; tries < MAX_TRIES; ++tries) { + if (g_rng_function((uint8_t *)uECC_ctx.sharedSecret.random, sizeof(uECC_ctx.sharedSecret.random)) && !vli_isZero(uECC_ctx.sharedSecret.random)) { + uECC_ctx.sharedSecret.initial_Z = uECC_ctx.sharedSecret.random; + break; + } + } + + vli_bytesToNative(uECC_ctx.sharedSecret.private, private_key); + vli_bytesToNative(uECC_ctx.sharedSecret.public.x, public_key); + vli_bytesToNative(uECC_ctx.sharedSecret.public.y, public_key + uECC_BYTES); + + // Regularize the bitcount for the private key so that attackers cannot use a side channel + // attack to learn the number of leading zeros. + uECC_ctx.sharedSecret.p2[0] = uECC_ctx.sharedSecret.private; + uECC_ctx.sharedSecret.p2[1] = uECC_ctx.sharedSecret.tmp; + uECC_ctx.sharedSecret.carry = vli_add(uECC_ctx.sharedSecret.private, uECC_ctx.sharedSecret.private, curve_n); + vli_add(uECC_ctx.sharedSecret.tmp, uECC_ctx.sharedSecret.private, curve_n); + + uECC_ctx.sharedSecret.pointMultCtx.state = 0; +} + +int uECC_shared_secret_continue(void) { + return EccPoint_mult(&uECC_ctx.sharedSecret.pointMultCtx, + &uECC_ctx.sharedSecret.product, + &uECC_ctx.sharedSecret.public, + uECC_ctx.sharedSecret.p2[!uECC_ctx.sharedSecret.carry], + uECC_ctx.sharedSecret.initial_Z, + (uECC_BYTES * 8) + 1); +} + +void uECC_shared_secret_complete(uint8_t secret[uECC_BYTES]) { + vli_nativeToBytes(secret, uECC_ctx.sharedSecret.product.x); +} diff --git a/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.h b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.h new file mode 100644 index 0000000000000000000000000000000000000000..69351bee2ca1db571570aab7a27c055eb669bd4d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/link_layer/thirdparty/uecc/uECC_ll.h @@ -0,0 +1,138 @@ +/* Copyright 2014, Kenneth MacKay. Licensed under the BSD 2-clause license. */ + +#ifndef _MICRO_ECC_LL_H_ +#define _MICRO_ECC_LL_H_ + +#include "wsf_types.h" + +/* Platform selection options. +If uECC_PLATFORM is not defined, the code will try to guess it based on compiler macros. +Possible values for uECC_PLATFORM are defined below: */ +#define uECC_arch_other 0 +#define uECC_x86 1 +#define uECC_x86_64 2 +#define uECC_arm 3 +#define uECC_arm_thumb 4 +#define uECC_avr 5 +#define uECC_arm_thumb2 6 + +/* If desired, you can define uECC_WORD_SIZE as appropriate for your platform (1, 4, or 8 bytes). +If uECC_WORD_SIZE is not explicitly defined then it will be automatically set based on your +platform. */ + +/* Inline assembly options. +uECC_asm_none - Use standard C99 only. +uECC_asm_small - Use GCC inline assembly for the target platform (if available), optimized for + minimum size. +uECC_asm_fast - Use GCC inline assembly optimized for maximum speed. */ +#define uECC_asm_none 0 +#define uECC_asm_small 1 +#define uECC_asm_fast 2 +#ifndef uECC_ASM + #ifndef __CC_ARM + #define uECC_ASM uECC_asm_fast + #else // DG: ARMCC 5, unlike GCC, IAR and CLANG, doesn't support GNU-style inline assembly + #define uECC_ASM uECC_asm_none + #endif +#endif + +/* Curve selection options. */ +#define uECC_secp160r1 1 +#define uECC_secp192r1 2 +#define uECC_secp256r1 3 +#define uECC_secp256k1 4 +#define uECC_secp224r1 5 +#ifndef uECC_CURVE + #define uECC_CURVE uECC_secp256r1 +#endif + +/* uECC_SQUARE_FUNC - If enabled (defined as nonzero), this will cause a specific function to be +used for (scalar) squaring instead of the generic multiplication function. This will make things +faster by about 8% but increases the code size. */ +#ifndef uECC_SQUARE_FUNC + #define uECC_SQUARE_FUNC 1 +#endif + +#define uECC_CONCAT1(a, b) a##b +#define uECC_CONCAT(a, b) uECC_CONCAT1(a, b) + +#define uECC_size_1 20 /* secp160r1 */ +#define uECC_size_2 24 /* secp192r1 */ +#define uECC_size_3 32 /* secp256r1 */ +#define uECC_size_4 32 /* secp256k1 */ +#define uECC_size_5 28 /* secp224r1 */ + +#define uECC_BYTES uECC_CONCAT(uECC_size_, uECC_CURVE) + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* uECC_RNG_Function type +The RNG function should fill 'size' random bytes into 'dest'. It should return 1 if +'dest' was filled with random data, or 0 if the random data could not be generated. +The filled-in values should be either truly random, or from a cryptographically-secure PRNG. + +A correctly functioning RNG function must be set (using uECC_set_rng()) before calling +uECC_make_key() or uECC_sign(). + +Setting a correctly functioning RNG function improves the resistance to side-channel attacks +for uECC_shared_secret() and uECC_sign_deterministic(). + +A correct RNG function is set by default when building for Windows, Linux, or OS X. +If you are building on another POSIX-compliant system that supports /dev/random or /dev/urandom, +you can define uECC_POSIX to use the predefined RNG. For embedded platforms there is no predefined +RNG function; you must provide your own. +*/ +typedef int (*uECC_RNG_Function)(uint8_t *dest, unsigned size); + +/* uECC_set_rng() function. +Set the function that will be used to generate random bytes. The RNG function should +return 1 if the random data was generated, or 0 if the random data could not be generated. + +On platforms where there is no predefined RNG function (eg embedded platforms), this must +be called before uECC_make_key() or uECC_sign() are used. + +Inputs: + rng_function - The function that will be used to generate random bytes. +*/ +void uECC_set_rng(uECC_RNG_Function rng_function); + +/* uECC_make_key() function. +Create a public/private key pair. + +Outputs: + public_key - Will be filled in with the public key. + private_key - Will be filled in with the private key. + +Returns 1 if the key pair was generated successfully, 0 if an error occurred. +*/ +void uECC_make_key_start(const uint8_t private_key[uECC_BYTES]); +int uECC_make_key_continue(void); +void uECC_make_key_complete(uint8_t public_key[uECC_BYTES*2], uint8_t private_key[uECC_BYTES]); + +/* uECC_shared_secret() function. +Compute a shared secret given your secret key and someone else's public key. +Note: It is recommended that you hash the result of uECC_shared_secret() before using it for +symmetric encryption or HMAC. + +Inputs: + public_key - The public key of the remote party. + private_key - Your private key. + +Outputs: + secret - Will be filled in with the shared secret value. + +Returns 1 if the shared secret was generated successfully, 0 if an error occurred. +*/ +void uECC_shared_secret_start(const uint8_t public_key[uECC_BYTES*2], + const uint8_t private_key[uECC_BYTES]); +int uECC_shared_secret_continue(void); +void uECC_shared_secret_complete(uint8_t secret[uECC_BYTES]); + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + +#endif /* _MICRO_ECC_LL_H_ */ diff --git a/lib/sdk/Libraries/BTLE/meson.build b/lib/sdk/Libraries/BTLE/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..b80f44af67413181f8e89fd75159b4f861a1f354 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/meson.build @@ -0,0 +1,430 @@ +includes = include_directories( + 'wsf/include', + 'stack/ble-host/include', + 'stack/ble-host/sources/stack/cfg', + 'stack/ble-profiles/include/app', + 'stack/ble-profiles/sources/apps/app', + 'stack/ble-profiles/sources/services', + 'stack/ble-profiles/sources/profiles', + 'stack/ble-profiles/sources/profiles/include', + 'stack/ble-profiles/sources/apps', + 'stack/ble-host/sources/stack/dm', + 'link_layer/controller/sources/ble/include/', + 'stack/ble-host/sources/hci/dual_chip', + 'stack/ble-host/sources/stack/hci', + 'link_layer/platform/common/include', + 'link_layer/controller/include/ble/', + 'wsf/include/util', + 'link_layer/controller/include/common/', + 'stack/ble-host/sources/stack/smp/', + 'stack/ble-host/sources/sec/common', + 'link_layer/controller/sources/ble/lhci/', + 'link_layer/thirdparty/uecc/', + 'stack/platform/max32665/', +) + +sources = files( +'stack/ble-profiles/sources/apps/dats/dats_main.c', +'stack/ble-profiles/sources/apps/uribeacon/uribeacon_main.c', +'stack/ble-profiles/sources/apps/tag/tag_main.c', +'stack/ble-profiles/sources/apps/tag/tag_main_wdxs.c', +'stack/ble-profiles/sources/apps/medc/medc_htp.c', +'stack/ble-profiles/sources/apps/medc/medc_main.c', +'stack/ble-profiles/sources/apps/medc/medc_wsp.c', +'stack/ble-profiles/sources/apps/medc/medc_glp.c', +'stack/ble-profiles/sources/apps/medc/medc_hrp.c', +'stack/ble-profiles/sources/apps/medc/medc_plx.c', +'stack/ble-profiles/sources/apps/medc/medc_blp.c', +'stack/ble-profiles/sources/apps/meds/meds_wsp.c', +'stack/ble-profiles/sources/apps/meds/meds_main.c', +'stack/ble-profiles/sources/apps/meds/meds_blp.c', +'stack/ble-profiles/sources/apps/meds/meds_htp.c', +'stack/ble-profiles/sources/apps/meds/meds_plx.c', +'stack/ble-profiles/sources/apps/meds/meds_glp.c', +'stack/ble-profiles/sources/apps/hidapp/hidapp_main.c', +'stack/ble-profiles/sources/apps/watch/watch_main.c', +'stack/ble-profiles/sources/apps/datc/datc_main.c', +'stack/ble-profiles/sources/apps/gluc/gluc_main.c', +'stack/ble-profiles/sources/apps/fit/fit_main.c', +'stack/ble-profiles/sources/apps/cycling/cycling_main.c', +'stack/ble-profiles/sources/apps/sensor/sensor_main.c', +'stack/ble-profiles/sources/apps/app/app_disc.c', +'stack/ble-profiles/sources/apps/app/app_slave.c', +'stack/ble-profiles/sources/apps/app/app_master.c', +'stack/ble-profiles/sources/apps/app/app_master_ae.c', +'stack/ble-profiles/sources/apps/app/app_slave_leg.c', +'stack/ble-profiles/sources/apps/app/app_slave_ae.c', +'stack/ble-profiles/sources/apps/app/app_main.c', +'stack/ble-profiles/sources/apps/app/app_server.c', +'stack/ble-profiles/sources/apps/app/app_master_leg.c', +'stack/ble-profiles/sources/apps/app/common/app_db.c', +'stack/ble-profiles/sources/apps/app/common/app_ui.c', +'stack/ble-profiles/sources/apps/app/common/app_hw.c', +'stack/ble-profiles/sources/apps/app/app_terminal.c', +'stack/ble-profiles/sources/apps/wdxs/wdxs_oad.c', +'stack/ble-profiles/sources/profiles/htps/htps_main.c', +'stack/ble-profiles/sources/profiles/hid/hid_main.c', +'stack/ble-profiles/sources/profiles/wspc/wspc_main.c', +'stack/ble-profiles/sources/profiles/hrpc/hrpc_main.c', +'stack/ble-profiles/sources/profiles/uribeacon/uricfg_main.c', +'stack/ble-profiles/sources/profiles/gap/gap_main.c', +'stack/ble-profiles/sources/profiles/glps/glps_db.c', +'stack/ble-profiles/sources/profiles/glps/glps_main.c', +'stack/ble-profiles/sources/profiles/fmpl/fmpl_main.c', +'stack/ble-profiles/sources/profiles/anpc/anpc_main.c', +'stack/ble-profiles/sources/profiles/wsps/wsps_main.c', +'stack/ble-profiles/sources/profiles/wdxc/wdxc_ft.c', +'stack/ble-profiles/sources/profiles/wdxc/wdxc_main.c', +'stack/ble-profiles/sources/profiles/wdxc/wdxc_stream.c', +'stack/ble-profiles/sources/profiles/htpc/htpc_main.c', +'stack/ble-profiles/sources/profiles/hrps/hrps_main.c', +'stack/ble-profiles/sources/profiles/plxpc/plxpc_main.c', +'stack/ble-profiles/sources/profiles/blpc/blpc_main.c', +'stack/ble-profiles/sources/profiles/cscp/cscps_main.c', +'stack/ble-profiles/sources/profiles/cpp/cpps_main.c', +'stack/ble-profiles/sources/profiles/glpc/glpc_main.c', +'stack/ble-profiles/sources/profiles/gatt/gatt_main.c', +'stack/ble-profiles/sources/profiles/sensor/gyro_main.c', +'stack/ble-profiles/sources/profiles/sensor/temp_main.c', +'stack/ble-profiles/sources/profiles/rscp/rscps_main.c', +'stack/ble-profiles/sources/profiles/blps/blps_main.c', +'stack/ble-profiles/sources/profiles/plxps/plxps_db.c', +'stack/ble-profiles/sources/profiles/plxps/plxps_main.c', +'stack/ble-profiles/sources/profiles/dis/dis_main.c', +'stack/ble-profiles/sources/profiles/tipc/tipc_main.c', +'stack/ble-profiles/sources/profiles/bas/bas_main.c', +'stack/ble-profiles/sources/profiles/udsc/udsc_main.c', +'stack/ble-profiles/sources/profiles/scpps/scpps_main.c', +'stack/ble-profiles/sources/profiles/wpc/wpc_main.c', +'stack/ble-profiles/sources/profiles/paspc/paspc_main.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_au.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_phy.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_ft.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_dc.c', +'stack/ble-profiles/sources/profiles/wdxs/wdxs_main.c', +'stack/ble-profiles/sources/services/svc_gls.c', +'stack/ble-profiles/sources/services/svc_cps.c', +'stack/ble-profiles/sources/services/svc_time.c', +'stack/ble-profiles/sources/services/svc_wp.c', +'stack/ble-profiles/sources/services/svc_alert.c', +'stack/ble-profiles/sources/services/svc_rscs.c', +'stack/ble-profiles/sources/services/svc_hts.c', +'stack/ble-profiles/sources/services/svc_temp.c', +'stack/ble-profiles/sources/services/svc_core.c', +'stack/ble-profiles/sources/services/svc_hid.c', +'stack/ble-profiles/sources/services/svc_scpss.c', +'stack/ble-profiles/sources/services/svc_hrs.c', +'stack/ble-profiles/sources/services/svc_plxs.c', +'stack/ble-profiles/sources/services/svc_cscs.c', +'stack/ble-profiles/sources/services/svc_ipss.c', +'stack/ble-profiles/sources/services/svc_wdxs.c', +'stack/ble-profiles/sources/services/svc_uricfg.c', +'stack/ble-profiles/sources/services/svc_dis.c', +'stack/ble-profiles/sources/services/svc_px.c', +'stack/ble-profiles/sources/services/svc_batt.c', +'stack/ble-profiles/sources/services/svc_wss.c', +'stack/ble-profiles/sources/services/svc_gyro.c', +'stack/ble-profiles/sources/services/svc_bps.c', +'stack/platform/max32665/hci_vs.c', +'stack/platform/max32665/hci_drv.c', +#'stack/platform/max32665/hci_drv_sdma.c', +'stack/platform/max32665/hci_tr.c', +'stack/platform/max32665/wsf_cs.c', +'stack/platform/max32665/wsf_os.c', +'stack/ble-host/sources/stack/dm/dm_adv.c', +'stack/ble-host/sources/stack/dm/dm_main.c', +'stack/ble-host/sources/stack/dm/dm_conn_master_ae.c', +'stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c', +'stack/ble-host/sources/stack/dm/dm_dev_priv.c', +'stack/ble-host/sources/stack/dm/dm_dev.c', +'stack/ble-host/sources/stack/dm/dm_conn.c', +'stack/ble-host/sources/stack/dm/dm_conn_slave.c', +'stack/ble-host/sources/stack/dm/dm_scan_leg.c', +'stack/ble-host/sources/stack/dm/dm_scan_ae.c', +'stack/ble-host/sources/stack/dm/dm_conn_sm.c', +'stack/ble-host/sources/stack/dm/dm_sec_master.c', +'stack/ble-host/sources/stack/dm/dm_scan.c', +'stack/ble-host/sources/stack/dm/dm_phy.c', +'stack/ble-host/sources/stack/dm/dm_sec_slave.c', +'stack/ble-host/sources/stack/dm/dm_priv.c', +'stack/ble-host/sources/stack/dm/dm_sync_ae.c', +'stack/ble-host/sources/stack/dm/dm_conn_master_leg.c', +'stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c', +'stack/ble-host/sources/stack/dm/dm_adv_ae.c', +'stack/ble-host/sources/stack/dm/dm_conn_cte.c', +'stack/ble-host/sources/stack/dm/dm_sec_lesc.c', +'stack/ble-host/sources/stack/dm/dm_adv_leg.c', +'stack/ble-host/sources/stack/dm/dm_past.c', +'stack/ble-host/sources/stack/dm/dm_conn_master.c', +'stack/ble-host/sources/stack/dm/dm_sec.c', +'stack/ble-host/sources/stack/l2c/l2c_coc.c', +'stack/ble-host/sources/stack/l2c/l2c_main.c', +'stack/ble-host/sources/stack/l2c/l2c_slave.c', +'stack/ble-host/sources/stack/l2c/l2c_master.c', +'stack/ble-host/sources/stack/att/attc_proc.c', +'stack/ble-host/sources/stack/att/attc_main.c', +'stack/ble-host/sources/stack/att/att_uuid.c', +'stack/ble-host/sources/stack/att/atts_proc.c', +'stack/ble-host/sources/stack/att/atts_read.c', +'stack/ble-host/sources/stack/att/atts_csf.c', +'stack/ble-host/sources/stack/att/atts_write.c', +'stack/ble-host/sources/stack/att/atts_ind.c', +'stack/ble-host/sources/stack/att/atts_sign.c', +'stack/ble-host/sources/stack/att/attc_read.c', +'stack/ble-host/sources/stack/att/atts_dyn.c', +'stack/ble-host/sources/stack/att/att_main.c', +'stack/ble-host/sources/stack/att/attc_disc.c', +'stack/ble-host/sources/stack/att/atts_ccc.c', +'stack/ble-host/sources/stack/att/attc_sign.c', +'stack/ble-host/sources/stack/att/atts_main.c', +'stack/ble-host/sources/stack/att/attc_write.c', +'stack/ble-host/sources/stack/hci/hci_main.c', +'stack/ble-host/sources/stack/cfg/cfg_stack.c', +'stack/ble-host/sources/stack/smp/smpi_sm.c', +'stack/ble-host/sources/stack/smp/smpr_sc_act.c', +'stack/ble-host/sources/stack/smp/smp_db.c', +'stack/ble-host/sources/stack/smp/smp_non.c', +'stack/ble-host/sources/stack/smp/smpr_sc_sm.c', +'stack/ble-host/sources/stack/smp/smpi_sc_act.c', +'stack/ble-host/sources/stack/smp/smp_main.c', +'stack/ble-host/sources/stack/smp/smpi_act.c', +'stack/ble-host/sources/stack/smp/smp_sc_act.c', +'stack/ble-host/sources/stack/smp/smpr_sm.c', +'stack/ble-host/sources/stack/smp/smp_act.c', +'stack/ble-host/sources/stack/smp/smpr_act.c', +'stack/ble-host/sources/stack/smp/smp_sc_main.c', +'stack/ble-host/sources/stack/smp/smpi_sc_sm.c', +'stack/ble-host/sources/hci/common/hci_core.c', +'stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c', +'stack/ble-host/sources/hci/dual_chip/hci_evt.c', +'stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c', +'stack/ble-host/sources/hci/dual_chip/hci_cmd.c', +'stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c', +'stack/ble-host/sources/hci/dual_chip/hci_core_ps.c', +'stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c', +'stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c', +'stack/ble-host/sources/sec/pal/sec_ccm.c', +'stack/ble-host/sources/sec/common/sec_ccm_hci.c', +'stack/ble-host/sources/sec/common/sec_aes.c', +'stack/ble-host/sources/sec/common/sec_cmac_hci.c', +'stack/ble-host/sources/sec/common/sec_main.c', +'stack/ble-host/sources/sec/common/sec_ecc_hci.c', +'wsf/sources/util/crc32.c', +'wsf/sources/util/prand.c', +'wsf/sources/util/bstream.c', +'wsf/sources/util/terminal.c', +'wsf/sources/util/fcs.c', +'wsf/sources/util/calc128.c', +'wsf/sources/util/bda.c', +'wsf/sources/util/wstr.c', +'wsf/sources/util/print.c', +'wsf/sources/port/baremetal/wsf_msg.c', +'wsf/sources/port/baremetal/wsf_bufio.c', +'wsf/sources/port/baremetal/wsf_detoken.c', +'wsf/sources/port/baremetal/wsf_efs.c', +'wsf/sources/port/baremetal/wsf_queue.c', +'wsf/sources/port/baremetal/wsf_nvm.c', +'wsf/sources/port/baremetal/wsf_timer.c', +'wsf/sources/port/baremetal/wsf_buf.c', +'wsf/sources/port/baremetal/wsf_trace.c', +'wsf/sources/port/baremetal/wsf_assert.c', +'wsf/sources/port/baremetal/wsf_heap.c', +'link_layer/platform/max32665/lhci_vs.c', +'link_layer/platform/max32665/chci_drv.c', +'link_layer/platform/max32665/ll_tester.c', +'link_layer/platform/max32665/ll_math_aes.c', +'link_layer/platform/common/sources/bb/ble/bb_ble_pdufilt.c', +'link_layer/platform/common/sources/bb/ble/bb_ble_periodiclist.c', +'link_layer/platform/common/sources/bb/ble/bb_ble_reslist.c', +'link_layer/platform/common/sources/bb/ble/bb_ble_whitelist.c', +'link_layer/platform/common/sources/ll/ll_math_ecc.c', +'link_layer/platform/common/sources/ll/lhci_cmd_vs_ext.c', +'link_layer/platform/common/sources/chci/chci_tr_serial.c', +'link_layer/platform/common/sources/chci/chci_tr.c', +'link_layer/thirdparty/uecc/uECC_ll.c', +'link_layer/controller/sources/ble/bb/bb_ble_adv_master.c', +'link_layer/controller/sources/ble/bb/bb_ble_adv_slave.c', +'link_layer/controller/sources/ble/bb/bb_ble_conn_master.c', +'link_layer/controller/sources/ble/bb/bb_ble_adv_slave_ae.c', +'link_layer/controller/sources/ble/bb/bb_ble_conn.c', +'link_layer/controller/sources/ble/bb/bb_ble_conn_slave.c', +'link_layer/controller/sources/ble/bb/bb_ble_main.c', +'link_layer/controller/sources/ble/bb/bb_ble_test.c', +'link_layer/controller/sources/ble/bb/bb_ble_adv_master_ae.c', +'link_layer/controller/sources/ble/ll/ll_init_enc_slave.c', +'link_layer/controller/sources/ble/ll/ll_init_init_master.c', +'link_layer/controller/sources/ble/ll/ll_init_sc.c', +'link_layer/controller/sources/ble/ll/ll_init_master_phy.c', +'link_layer/controller/sources/ble/ll/ll_main_phy.c', +'link_layer/controller/sources/ble/ll/ll_main_conn_slave.c', +'link_layer/controller/sources/ble/ll/ll_init_conn_cs2.c', +'link_layer/controller/sources/ble/ll/ll_main.c', +'link_layer/controller/sources/ble/ll/ll_main_sc.c', +'link_layer/controller/sources/ble/ll/ll_main_diag.c', +'link_layer/controller/sources/ble/ll/ll_init_adv_slave_ae.c', +'link_layer/controller/sources/ble/ll/ll_init_adv_slave.c', +'link_layer/controller/sources/ble/ll/ll_main_adv_slave.c', +'link_layer/controller/sources/ble/ll/ll_main_priv.c', +'link_layer/controller/sources/ble/ll/ll_main_adv_slave_ae.c', +'link_layer/controller/sources/ble/ll/ll_init_slave_phy.c', +'link_layer/controller/sources/ble/ll/ll_main_conn_master_ae.c', +'link_layer/controller/sources/ble/ll/ll_init.c', +'link_layer/controller/sources/ble/ll/ll_main_enc_slave.c', +'link_layer/controller/sources/ble/ll/ll_main_enc_master.c', +'link_layer/controller/sources/ble/ll/ll_main_dtm.c', +'link_layer/controller/sources/ble/ll/ll_init_adv_master_ae.c', +'link_layer/controller/sources/ble/ll/ll_init_adv_master.c', +'link_layer/controller/sources/ble/ll/ll_init_init_master_ae.c', +'link_layer/controller/sources/ble/ll/ll_init_enc_master.c', +'link_layer/controller/sources/ble/ll/ll_math.c', +'link_layer/controller/sources/ble/ll/ll_init_priv.c', +'link_layer/controller/sources/ble/ll/ll_main_conn.c', +'link_layer/controller/sources/ble/ll/ll_main_conn_master.c', +'link_layer/controller/sources/ble/ll/ll_main_adv_master_ae.c', +'link_layer/controller/sources/ble/ll/ll_main_adv_master.c', +'link_layer/controller/sources/ble/ll/ll_init_conn_master.c', +'link_layer/controller/sources/ble/ll/ll_init_conn_slave.c', +'link_layer/controller/sources/ble/lmgr/lmgr_events.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_priv.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_slave.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_master.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_sc.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c', +'link_layer/controller/sources/ble/lmgr/lmgr_main_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_pdu_enc.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_main_enc_master.c', +'link_layer/controller/sources/ble/lctr/lctr_main_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_init_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_conn_master.c', +'link_layer/controller/sources/ble/lctr/lctr_act_enc.c', +'link_layer/controller/sources/ble/lctr/lctr_main_adv_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_conn_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c', +'link_layer/controller/sources/ble/lctr/lctr_main.c', +'link_layer/controller/sources/ble/lctr/lctr_main_adv_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_main_init_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_init_master.c', +'link_layer/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_act_phy.c', +'link_layer/controller/sources/ble/lctr/lctr_main_init_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_main_sc.c', +'link_layer/controller/sources/ble/lctr/lctr_act_conn_master.c', +'link_layer/controller/sources/ble/lctr/lctr_act_adv_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_adv_master.c', +'link_layer/controller/sources/ble/lctr/lctr_main_priv.c', +'link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_adv_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_pdu_adv_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_adv_master.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_act_init_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_act_init_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_conn_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_main_slave_phy.c', +'link_layer/controller/sources/ble/lctr/lctr_act_adv_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_main_conn_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_act_enc_master.c', +'link_layer/controller/sources/ble/lctr/lctr_act_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_conn_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_main_conn_master.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c', +'link_layer/controller/sources/ble/lctr/lctr_act_conn_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c', +'link_layer/controller/sources/ble/lctr/lctr_main_enc_slave.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_init_master.c', +'link_layer/controller/sources/ble/lctr/lctr_isr_init_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_main_adv_master_ae.c', +#'link_layer/controller/sources/ble/lctr/lctr_main_tester.c', +'link_layer/controller/sources/ble/lctr/lctr_main_master_phy.c', +'link_layer/controller/sources/ble/lctr/lctr_pdu_conn.c', +'link_layer/controller/sources/ble/lctr/lctr_main_conn_data.c', +'link_layer/controller/sources/ble/lctr/lctr_act_adv_master_ae.c', +'link_layer/controller/sources/ble/lctr/lctr_main_conn_cs2.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_adv_priv.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_sc.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_enc_slave.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_phy.c', +'link_layer/controller/sources/ble/lhci/lhci_init.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_conn_priv.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_conn.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_conn_cs2.c', +'link_layer/controller/sources/ble/lhci/lhci_init_adv_slave.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_init_adv_master_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_sc.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_conn_priv.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_vs.c', +'link_layer/controller/sources/ble/lhci/lhci_evt.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave.c', +'link_layer/controller/sources/ble/lhci/lhci_init_enc_slave.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_adv_slave.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_adv_master.c', +'link_layer/controller/sources/ble/lhci/lhci_init_conn_priv.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_conn_master.c', +'link_layer/controller/sources/ble/lhci/lhci_init_adv_priv.c', +'link_layer/controller/sources/ble/lhci/lhci_init_conn_master_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_phy.c', +'link_layer/controller/sources/ble/lhci/lhci_init_phy.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_enc_master.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_adv_master.c', +'link_layer/controller/sources/ble/lhci/lhci_main.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_conn.c', +'link_layer/controller/sources/ble/lhci/lhci_init_adv_master.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_enc_master.c', +'link_layer/controller/sources/ble/lhci/lhci_init_sc.c', +'link_layer/controller/sources/ble/lhci/lhci_init_conn_cs2.c', +'link_layer/controller/sources/ble/lhci/lhci_init_conn.c', +'link_layer/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_conn_master.c', +'link_layer/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c', +'link_layer/controller/sources/ble/lhci/lhci_init_conn_master.c', +'link_layer/controller/sources/ble/lhci/lhci_init_enc_master.c', +'link_layer/controller/sources/ble/lhci/lhci_cmd_enc_slave.c', +'link_layer/controller/sources/ble/sch/sch_ble.c', +'link_layer/controller/sources/ble/sch/sch_rm.c', +'link_layer/controller/sources/ble/init/init_ctr.c', +'link_layer/controller/sources/ble/init/init_ext.c', +'link_layer/controller/sources/ble/init/init_ctr_ext.c', +'link_layer/controller/sources/ble/init/init.c', +'link_layer/controller/sources/common/bb/bb_main.c', +'link_layer/controller/sources/common/sch/sch_main.c', +'link_layer/controller/sources/common/sch/sch_list.c', +) + +lib = static_library( + 'ble', + sources, + include_directories: includes, + dependencies: periphdriver, + c_args: ['-w', + '-DLHCI_ENABLE_VS=TRUE', + '-DBB_CLK_RATE_HZ=1600000', + '-DLCTR_CONN_NO_TIFS_REASSEMBLY=1', + '-DBB_ENABLE_INLINE_ENC_TX=1', + '-DBB_ENABLE_INLINE_DEC_RX=1', + '-DFORCE_PMU_WAKEUP=1'] +) + +ble = declare_dependency( + include_directories: includes, + link_with: lib, + dependencies: periphdriver, +) diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_api.h similarity index 80% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/att_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/att_api.h index 23137504a6d611e48e0aa9afb8e726f57c2c2656..0138ea019d14c696078fc62a213537e9be38c893 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Attribute protocol client and server API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Attribute protocol client and server API. */ /*************************************************************************************************/ #ifndef ATT_API_H @@ -29,30 +32,27 @@ extern "C" { #endif - - /************************************************************************************************** Macros **************************************************************************************************/ /*! \addtogroup STACK_ATTS_API * \{ */ - /** \name ATT Server Attribute Settings * Settings that may be set on each attribute. */ /**@{*/ -#define ATTS_SET_UUID_128 0x01 /*!< \brief Set if the UUID is 128 bits in length */ -#define ATTS_SET_WRITE_CBACK 0x02 /*!< \brief Set if the group callback is executed when - this attribute is written by a client device */ -#define ATTS_SET_READ_CBACK 0x04 /*!< \brief Set if the group callback is executed when - this attribute is read by a client device */ -#define ATTS_SET_VARIABLE_LEN 0x08 /*!< \brief Set if the attribute has a variable length */ -#define ATTS_SET_ALLOW_OFFSET 0x10 /*!< \brief Set if writes are allowed with an offset */ -#define ATTS_SET_CCC 0x20 /*!< \brief Set if the attribute is a client characteristic - configuration descriptor */ -#define ATTS_SET_ALLOW_SIGNED 0x40 /*!< \brief Set if signed writes are allowed */ -#define ATTS_SET_REQ_SIGNED 0x80 /*!< \brief Set if signed writes are required if link - is not encrypted */ +#define ATTS_SET_UUID_128 0x01 /*!< \brief Set if the UUID is 128 bits in length */ +#define ATTS_SET_WRITE_CBACK 0x02 /*!< \brief Set if the group callback is executed when + this attribute is written by a client device */ +#define ATTS_SET_READ_CBACK 0x04 /*!< \brief Set if the group callback is executed when + this attribute is read by a client device */ +#define ATTS_SET_VARIABLE_LEN 0x08 /*!< \brief Set if the attribute has a variable length */ +#define ATTS_SET_ALLOW_OFFSET 0x10 /*!< \brief Set if writes are allowed with an offset */ +#define ATTS_SET_CCC 0x20 /*!< \brief Set if the attribute is a client characteristic + configuration descriptor */ +#define ATTS_SET_ALLOW_SIGNED 0x40 /*!< \brief Set if signed writes are allowed */ +#define ATTS_SET_REQ_SIGNED 0x80 /*!< \brief Set if signed writes are required if link + is not encrypted */ /**@}*/ /** \name ATT Server Attribute Permissions @@ -60,40 +60,36 @@ extern "C" { * These values can be set in any combination. */ /**@{*/ -#define ATTS_PERMIT_READ 0x01 /*!< \brief Set if attribute can be read */ -#define ATTS_PERMIT_READ_AUTH 0x02 /*!< \brief Set if attribute read requires authentication */ -#define ATTS_PERMIT_READ_AUTHORIZ 0x04 /*!< \brief Set if attribute read requires authorization */ -#define ATTS_PERMIT_READ_ENC 0x08 /*!< \brief Set if attribute read requires encryption */ -#define ATTS_PERMIT_WRITE 0x10 /*!< \brief Set if attribute can be written */ -#define ATTS_PERMIT_WRITE_AUTH 0x20 /*!< \brief Set if attribute write requires authentication */ -#define ATTS_PERMIT_WRITE_AUTHORIZ 0x40 /*!< \brief Set if attribute write requires authorization */ -#define ATTS_PERMIT_WRITE_ENC 0x80 /*!< \brief Set if attribute write requires encryption */ +#define ATTS_PERMIT_READ 0x01 /*!< \brief Set if attribute can be read */ +#define ATTS_PERMIT_READ_AUTH 0x02 /*!< \brief Set if attribute read requires authentication */ +#define ATTS_PERMIT_READ_AUTHORIZ 0x04 /*!< \brief Set if attribute read requires authorization */ +#define ATTS_PERMIT_READ_ENC 0x08 /*!< \brief Set if attribute read requires encryption */ +#define ATTS_PERMIT_WRITE 0x10 /*!< \brief Set if attribute can be written */ +#define ATTS_PERMIT_WRITE_AUTH 0x20 /*!< \brief Set if attribute write requires authentication */ +#define ATTS_PERMIT_WRITE_AUTHORIZ 0x40 /*!< \brief Set if attribute write requires authorization */ +#define ATTS_PERMIT_WRITE_ENC 0x80 /*!< \brief Set if attribute write requires encryption */ /**@}*/ - /*! \} */ /* STACK_ATTS_API */ /*! \addtogroup STACK_ATTC_API * \{ */ - /** \name ATT Client Discovery and Configuration Settings * Settings used to configurate ATT Discovery procedure for ATT Clients. */ /**@{*/ -#define ATTC_SET_UUID_128 0x01 /*!< \brief Set if the UUID is 128 bits in length */ -#define ATTC_SET_REQUIRED 0x02 /*!< \brief Set if characteristic must be discovered */ -#define ATTC_SET_DESCRIPTOR 0x04 /*!< \brief Set if this is a characteristic descriptor */ +#define ATTC_SET_UUID_128 0x01 /*!< \brief Set if the UUID is 128 bits in length */ +#define ATTC_SET_REQUIRED 0x02 /*!< \brief Set if characteristic must be discovered */ +#define ATTC_SET_DESCRIPTOR 0x04 /*!< \brief Set if this is a characteristic descriptor */ /**@}*/ - /*! \} */ /* STACK_ATTC_API */ /*! \addtogroup STACK_ATT_API * \{ */ - /** \name ATT Callback Events * Events related to ATT transactions. */ /**@{*/ -#define ATT_CBACK_START 0x02 /*!< \brief ATT callback event starting value */ +#define ATT_CBACK_START 0x02 /*!< \brief ATT callback event starting value */ /*! \brief ATT client callback events */ enum /*!< \brief Internal note: event values match method values */ @@ -114,12 +110,27 @@ enum /*!< \brief Internal note: event val /* ATT server callback events */ ATTS_HANDLE_VALUE_CNF, /*!< \brief Handle value confirmation */ ATTS_CCC_STATE_IND, /*!< \brief Client chracteristic configuration state change */ + ATTS_DB_HASH_CALC_CMPL_IND, /*!< \brief Database hash calculation complete */ /* ATT common callback events */ ATT_MTU_UPDATE_IND /*!< \brief Negotiated MTU value */ }; /*! \brief ATT callback events */ -#define ATT_CBACK_END ATT_MTU_UPDATE_IND /*!< \brief ATT callback event ending value */ +#define ATT_CBACK_END ATT_MTU_UPDATE_IND /*!< \brief ATT callback event ending value */ +/**@}*/ + +/** \name ATT Client Awareness of Database Change + * Status of a client's awareness of a database change. + */ +/**@{*/ +/*! \brief client's awareness to database change. */ +enum attClientAwareStates +{ + ATTS_CLIENT_CHANGE_AWARE = 0, /*!< Client Aware. */ + ATTS_CLIENT_CHANGE_PENDING_AWARE, /*!< Client Aware pending ATT Request. For internal stack use only. */ + ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING, /*!< Client Aware, Database Hash read pending hash update completion. For internal stack use only. */ + ATTS_CLIENT_CHANGE_UNAWARE /*!< Client Unaware. */ +}; /**@}*/ /************************************************************************************************** @@ -167,12 +178,10 @@ typedef struct * \return None. */ typedef void (*attCback_t)(attEvt_t *pEvt); - /*! \} */ /* STACK_ATT_API */ /*! \addtogroup STACK_ATTS_API * \{ */ - /** * \name Attribute Server Data Types * @@ -188,6 +197,13 @@ typedef struct uint8_t settings; /*!< \brief Attribute settings */ uint8_t permissions; /*!< \brief Attribute permissions */ } attsAttr_t; + +/*! \brief Client supported features record structure. */ +typedef struct +{ + uint8_t csf; /*!< Client supported features characteristic value */ + uint8_t changeAwareState; /*!< Client awareness of GATT database changes */ +} attsCsfRec_t; /**@}*/ /** \name ATT Server Callbacks @@ -249,6 +265,19 @@ typedef uint8_t (*attsWriteCback_t)(dmConnId_t connId, uint16_t handle, uint8_t * the \ref ATT_ERR_AUTH is typically returned. */ typedef uint8_t (*attsAuthorCback_t)(dmConnId_t connId, uint8_t permit, uint16_t handle); + +/*! \brief ATTS client supported features write callback type + * + * This callback function is executed when the client supported features record for + * this client has been updated. + * + * \param connId DM Connection ID. + * \param changeAwareState The state of awareness to a change, see ::attClientAwareStates. + * \param pCsf Pointer to the client supported features value. + * + * \return None. + */ +typedef void (*attsCsfWriteCback_t)(dmConnId_t connId, uint8_t changeAwareState, uint8_t *pCsf); /**@}*/ /** @@ -284,12 +313,10 @@ typedef struct uint8_t idx; /*!< \brief CCCD settings index */ } attsCccEvt_t; /**@}*/ - /*! \} */ /* STACK_ATTS_API */ /*! \addtogroup STACK_ATTC_API * \{ */ - /** * \name ATT Client Data Types */ @@ -324,12 +351,10 @@ typedef struct uint8_t endHdlIdx; /*!< \brief Internal use only */ } attcDiscCb_t; /**@}*/ - /*! \} */ /* STACK_ATTC_API */ /*! \addtogroup STACK_ATTS_API * \{ */ - /** \name ATT Server Callbacks * */ @@ -346,7 +371,6 @@ typedef struct */ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt); /**@}*/ - /*! \} */ /* STACK_ATTS_API */ /************************************************************************************************** @@ -355,7 +379,6 @@ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt); /*! \addtogroup STACK_INIT * \{ */ - /** \name ATT Configuration Structure * Pointer to structure containing initialization details of the ATT Subsystem. To be configured * by Application. @@ -364,7 +387,6 @@ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt); /*! \brief Configuration pointer */ extern attCfg_t *pAttCfg; /**@}*/ - /*! \} */ /* STACK_INIT */ /************************************************************************************************** @@ -373,12 +395,10 @@ extern attCfg_t *pAttCfg; /*! \addtogroup STACK_ATT_API * \{ */ - /** \name ATT Setup Functions * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Register a callback with ATT. This callback will be used for messages from both ATTC @@ -402,7 +422,6 @@ void AttRegister(attCback_t cback); */ /*************************************************************************************************/ void AttConnRegister(dmCback_t cback); - /**@}*/ /** \name ATT Parameter Functions @@ -410,7 +429,6 @@ void AttConnRegister(dmCback_t cback); * Client or server. */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Get the attribute protocol MTU of a connection. @@ -421,14 +439,12 @@ void AttConnRegister(dmCback_t cback); */ /*************************************************************************************************/ uint16_t AttGetMtu(dmConnId_t connId); - /**@}*/ /** \name ATT Message Passing Functions * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Allocate an ATT message buffer to be sent with the ATT attribute protocol @@ -453,18 +469,15 @@ void *AttMsgAlloc(uint16_t len, uint8_t opcode); */ /*************************************************************************************************/ void AttMsgFree(void *pMsg, uint8_t opcode); - /**@}*/ /*! \} */ /* STACK_ATT_API */ /*! \addtogroup STACK_ATTS_API * \{ */ - /** \name ATT Server Functions * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Initialize ATT server. @@ -525,6 +538,28 @@ void AttsAddGroup(attsGroup_t *pGroup); /*************************************************************************************************/ void AttsRemoveGroup(uint16_t startHandle); +/*************************************************************************************************/ +/*! +* \brief Calculate database hash from the GATT database. +* +* \return None. +*/ +/*************************************************************************************************/ +void AttsCalculateDbHash(void); + +/*************************************************************************************************/ +/*! + * \brief Create hash from the database string. + * + * \param pKey Key for hashing. + * \param pMsg Plaintext to hash. + * \param msgLen Length of Plaintext data. + * + * \return \ref TRUE if successful, \ref FALSE if not. + */ +/*************************************************************************************************/ +bool_t AttsHashDatabaseString(uint8_t *pKey, uint8_t *pMsg, uint16_t msgLen); + /*************************************************************************************************/ /*! * \brief Set an attribute value in the attribute server. @@ -710,6 +745,23 @@ uint16_t AttsCccEnabled(dmConnId_t connId, uint8_t idx); /*************************************************************************************************/ uint8_t AttsGetCccTableLen(void); +/*************************************************************************************************/ +/*! + * \brief Send a response to a pending write request. For use with ATT_RSP_PENDING. + * + * \param connId Connection ID. + * \param handle Attribute handle. + * \param status Status of the write request. + * + * \return None. + * + * \note When a higher layer returns ATT_RSP_PENDING to an ATT write callback indicating the + * response status is pending, the higher layer must subsequently call this function + * with the status of the write request. + */ +/*************************************************************************************************/ +void AttsContinueWriteReq(dmConnId_t connId, uint16_t handle, uint8_t status); + /*************************************************************************************************/ /*! * \brief Set the peer's data signing key on this connection. This function @@ -719,11 +771,12 @@ uint8_t AttsGetCccTableLen(void); * * \param connId DM connection ID. * \param pCsrk Pointer to data signing key (CSRK). + * \param authenticated True if CSRK is authenticated and false otherwise. * * \return None. */ /*************************************************************************************************/ -void AttsSetCsrk(dmConnId_t connId, uint8_t *pCsrk); +void AttsSetCsrk(dmConnId_t connId, uint8_t *pCsrk, bool_t authenticated); /*************************************************************************************************/ /*! @@ -754,14 +807,101 @@ void AttsSetSignCounter(dmConnId_t connId, uint32_t signCounter); /*************************************************************************************************/ uint32_t AttsGetSignCounter(dmConnId_t connId); -/**@}*/ +/*************************************************************************************************/ +/*! + * \brief Initialize ATTS client supported features module. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfInit(void); +/*************************************************************************************************/ +/*! + * \brief Initialize the client supported features for a connection. + * + * \param connId DM connection ID. + * \param changeAwareState The state of awareness to a change in the database. + * \param pCsf Pointer to the client supported features value to cache. \ref NULL or + * buffer of length \ref ATT_CSF_LEN. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfConnOpen(dmConnId_t connId, uint8_t changeAwareState, uint8_t *pCsf); + +/*************************************************************************************************/ +/*! + * \brief GATT write of client supported feature characteristic value. + * + * \param connId DM connection ID. + * \param offset offset into csf characteristic. + * \param valueLen length of write in bytes. + * \param pValue Pointer to client's supported features characteristic value. + * + * \return \ref ATT_SUCCESS is successful, \ref ATT_ERR_VALUE_NOT_ALLOWED if any supported + * features are flipped from 1 to 0. + */ +/*************************************************************************************************/ +uint8_t AttsCsfWriteFeatures(dmConnId_t connId, uint16_t offset, uint16_t valueLen, + uint8_t *pValue); + +/*************************************************************************************************/ +/*! + * \brief Get client supported feature record. + * + * \param connId DM connection ID. + * \param pCsfOut Output parameter for client supported features buffer. + * \param pCsfOutLen Length of output parameter buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfGetFeatures(dmConnId_t connId, uint8_t *pCsfOut, uint8_t pCsfOutLen); + +/*************************************************************************************************/ +/*! + * \brief Get client state of awareness to a change in the database. + * + * \param connId DM connection ID. + * + * \return Client's change-aware state. + */ +/*************************************************************************************************/ +uint8_t AttsCsfGetChangeAwareState(dmConnId_t connId); + +/*************************************************************************************************/ +/*! + * \brief Update a client's state of awareness to a change in the database. + * + * \param connId DM connection ID. if \ref DM_CONN_ID_NONE, sets the state for all connected + * clients. + * \param state The state of awareness to a change, see \ref attClientAwareStates. + * + * \return None. + * + * \note A callback to application is not needed as it is expected the caller (i.e. the + * application) will have updated all persistent records prior to calling this function. + */ +/*************************************************************************************************/ +void AttsCsfSetClientsChangeAwarenessState(dmConnId_t connId, uint8_t state); + +/*************************************************************************************************/ +/*! + * \brief Register callback. + * + * \param writeCback Application callback for when client supported features record is updated. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfRegister(attsCsfWriteCback_t writeCback); +/**@}*/ /** \name ATT Server Dynamic Service Subsystem Functions * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Initialize the Dynamic ATT Service subsystem. @@ -841,14 +981,12 @@ void AttsDynAddAttr(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValu /*************************************************************************************************/ void AttsDynAddAttrConst(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValue, const uint16_t len, uint8_t settings, uint8_t permissions); - /**@}*/ /** \name ATT Server Testing * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief For testing purposes only. @@ -859,19 +997,15 @@ void AttsDynAddAttrConst(void *pSvcHandle, const uint8_t *pUuid, const uint8_t * */ /*************************************************************************************************/ void AttsErrorTest(uint8_t status); - /**@}*/ - /*! \} */ /* STACK_ATTS_API */ /*! \addtogroup STACK_ATTC_API * \{ */ - /** \name ATT Client Functions * */ /**@{*/ - /*************************************************************************************************/ /*! * \brief Initialize ATT client. @@ -1197,8 +1331,28 @@ uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb); /*************************************************************************************************/ void AttcMtuReq(dmConnId_t connId, uint16_t mtu); -/**@}*/ +/*************************************************************************************************/ +/*! + * \brief Set automatic Indication Confirmations sent from this ATT Client. + * + * \param enable \ref TRUE to enable automatic confirmations (default), \ref FALSE to disable. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcSetAutoConfirm(bool_t enable); +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol indication confirmation. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcIndConfirm(dmConnId_t connId); +/**@}*/ /*! \} */ /* STACK_ATTC_API */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_defs.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_defs.h similarity index 90% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/att_defs.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/att_defs.h index 9a469af46b28eebf78507293935dd2ecbf73e31e..90baa88bdbfddcb0a7a725d15dcbdd3f792f60bb 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_defs.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_defs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Attribute protocol constants and definitions from the Bluetooth specification. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Attribute protocol constants and definitions from the Bluetooth specification. */ /*************************************************************************************************/ #ifndef ATT_DEFS_H @@ -78,6 +81,9 @@ extern "C" { #define ATT_ERR_ENC 0x0F /*!< \brief Insufficient encryption */ #define ATT_ERR_GROUP_TYPE 0x10 /*!< \brief Unsupported group type */ #define ATT_ERR_RESOURCES 0x11 /*!< \brief Insufficient resources */ +#define ATT_ERR_DATABASE_OUT_OF_SYNC 0x12 /*!< \brief Client out of synch with database */ +#define ATT_ERR_VALUE_NOT_ALLOWED 0x13 /*!< \brief Value not allowed */ +#define ATT_ERR_WRITE_REJ 0xFC /*!< \brief Write request rejected */ #define ATT_ERR_CCCD 0xFD /*!< \brief CCCD improperly configured */ #define ATT_ERR_IN_PROGRESS 0xFE /*!< \brief Procedure already in progress */ #define ATT_ERR_RANGE 0xFF /*!< \brief Value out of range */ @@ -96,6 +102,7 @@ extern "C" { #define ATT_ERR_REQ_NOT_FOUND 0x76 /*!< \brief Required characteristic not found */ #define ATT_ERR_MTU_EXCEEDED 0x77 /*!< \brief Attribute PDU length exceeded MTU size */ #define ATT_CONTINUING 0x78 /*!< \brief Procedure continuing */ +#define ATT_RSP_PENDING 0x79 /*!< \brief Responsed delayed pending higher layer */ /**@}*/ /** \name ATT Application Error Codes @@ -299,6 +306,23 @@ extern "C" { #define ATT_FORMAT_STRUCT 0x1B /*!< \brief Opaque structure */ /**@}*/ +/** \name GATT Database Hash +* GATT database hash values +*/ +/**@{*/ +#define ATT_DATABASE_HASH_LEN 16 /*!< \brief Database hash length. */ +/**@}*/ + +/** \name GATT Client Supported Features +* Flags of features supported by the GATT Client +*/ +/**@{*/ +#define ATTS_CSF_ROBUST_CACHING 1 /*!< \brief Robust caching. */ +#define ATTS_CSF_OCT0_FEATURES ATTS_CSF_ROBUST_CACHING /*!< \brief Mask of all client supported features. */ + +#define ATT_CSF_LEN 1 /*!< \brief Length of client supported features array. */ +/**@}*/ + /*! \} */ /* STACK_ATT_API */ #ifdef __cplusplus diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_handler.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_handler.h similarity index 68% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/att_handler.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/att_handler.h index 5747319d925fd23b93242e86a28082bef01ab571..edb2add9b325c04770a50e02f612224d226ce537 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_handler.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_handler.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Interface to ATT event handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Interface to ATT event handler. */ /*************************************************************************************************/ #ifndef ATT_HANDLER_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_uuid.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_uuid.h similarity index 90% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/att_uuid.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/att_uuid.h index d32c7a4b9efd1b8393e774cc4f179408cee91cf4..b51cabdf90253bb654ac4bdb88ae4e6384a75752 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/att_uuid.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/att_uuid.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Attribute protocol UUIDs from the Bluetooth specification. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2011-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Attribute protocol UUIDs from the Bluetooth specification. */ /*************************************************************************************************/ #ifndef ATT_UUID_H @@ -63,6 +66,9 @@ extern "C" { #define ATT_UUID_WEIGHT_SCALE_SERVICE 0x181D /*!< \brief Weight Scale Service */ #define ATT_UUID_IP_SUPPORT_SERVICE 0x1820 /*!< \brief IP Support Service */ #define ATT_UUID_PULSE_OXIMITER_SERVICE 0x1822 /*!< \brief Pulse Oximeter Service */ +#define ATT_UUID_MESH_PRV_SERVICE 0x1827 /*!< \brief Mesh Provisioning Service */ +#define ATT_UUID_MESH_PROXY_SERVICE 0x1828 /*!< \brief Mesh Proxy Service */ +#define ATT_UUID_CONSTANT_TONE_SERVICE 0x7F7F /*!< \brief Constant Tone Extension */ /**@}*/ @@ -195,6 +201,18 @@ extern "C" { #define ATT_UUID_WEIGHT_SCALE_FEATURE 0x2A9E /*!< \brief Weight Scale Feature */ #define ATT_UUID_USER_CONTROL_POINT 0x2A9F /*!< \brief User Control Point */ #define ATT_UUID_RPAO 0x2AC9 /*!< \brief Resolvable Prviate Address Only */ +#define ATT_UUID_MESH_PRV_DATA_IN 0x2ADB /*!< \brief Mesh Provisioning Data In */ +#define ATT_UUID_MESH_PRV_DATA_OUT 0x2ADC /*!< \brief Mesh Provisioning Data Out */ +#define ATT_UUID_MESH_PROXY_DATA_IN 0x2ADD /*!< \brief Mesh Proxy Data In */ +#define ATT_UUID_MESH_PROXY_DATA_OUT 0x2ADE /*!< \brief Mesh Proxy Data Out */ +#define ATT_UUID_CLIENT_SUPPORTED_FEATURES 0x2B29 /*!< \brief Client Supported Features */ +#define ATT_UUID_DATABASE_HASH 0x2B2A /*!< \brief Database Hash */ +#define ATT_UUID_CTE_ENABLE 0x7F80 /*!< \brief Constant Tone Extension enable */ +#define ATT_UUID_CTE_MIN_LEN 0x7F81 /*!< \brief Constant Tone Extension minimum length */ +#define ATT_UUID_CTE_TX_CNT 0x7F82 /*!< \brief Constant Tone Extension transmit count */ +#define ATT_UUID_CTE_TX_DURATION 0x7F83 /*!< \brief Constant Tone Extension transmit duration */ +#define ATT_UUID_CTE_INTERVAL 0x7F84 /*!< \brief Constant Tone Extension interval */ +#define ATT_UUID_CTE_PHY 0x7F85 /*!< \brief Constant Tone Extension PHY */ /**@}*/ /** \name GATT Unit UUIDs @@ -324,10 +342,10 @@ extern "C" { #define ATT_UUID_ARM_BUILD(part) UINT16_TO_BYTES(part), ATT_UUID_ARM_BASE -/** \name Partial proprietary service P1 UUID */ +/** \brief Partial proprietary service P1 UUID */ #define ATT_UUID_P1_SERVICE_PART 0x1001 -/** \name Partial proprietary characteristic data D1 UUID */ +/** \brief Partial proprietary characteristic data D1 UUID */ #define ATT_UUID_D1_DATA_PART 0x0001 /*! \brief Proprietary services */ @@ -367,6 +385,8 @@ extern const uint8_t attHidSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Human Inter extern const uint8_t attSpsSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Scan Parameter Service */ extern const uint8_t attPlxsSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Pulse Oximeter Service */ extern const uint8_t attUdsSvcUuid[ATT_16_UUID_LEN]; /*!< \brief User Data Service */ +extern const uint8_t attMprvSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Provisioning Service */ +extern const uint8_t attMprxSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Proxy Service */ /**@}*/ /** \name GATT UUID Variables @@ -495,9 +515,22 @@ extern const uint8_t attRpaoChUuid[ATT_16_UUID_LEN]; /*!< \brief Resolvable extern const uint8_t attDbciChUuid[ATT_16_UUID_LEN]; /*!< \brief Database Change Increment */ extern const uint8_t attUiChUuid[ATT_16_UUID_LEN]; /*!< \brief User Index */ extern const uint8_t attUcpChUuid[ATT_16_UUID_LEN]; /*!< \brief User Control Point */ -extern const uint8_t attWssSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Weight scale service */ -extern const uint8_t attWmChUuid[ATT_16_UUID_LEN]; /*!< \brief Weight measurement */ -extern const uint8_t attWsfChUuid[ATT_16_UUID_LEN]; /*!< \brief Weight scale feature */ +extern const uint8_t attMprvDinChUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Provisioning Data In */ +extern const uint8_t attMprvDoutChUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Provisioning Data Out */ +extern const uint8_t attMprxDinChUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Proxy Data In */ +extern const uint8_t attMprxDoutChUuid[ATT_16_UUID_LEN]; /*!< \brief Mesh Proxy Data Out */ +extern const uint8_t attWssSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Weight scale service */ +extern const uint8_t attWmChUuid[ATT_16_UUID_LEN]; /*!< \brief Weight measurement */ +extern const uint8_t attWsfChUuid[ATT_16_UUID_LEN]; /*!< \brief Weight scale feature */ +extern const uint8_t attGattCsfChUuid[ATT_16_UUID_LEN]; /*!< \brief Client supported features */ +extern const uint8_t attGattDbhChUuid[ATT_16_UUID_LEN]; /*!< \brief Database hash */ +extern const uint8_t attCteSvcUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension service */ +extern const uint8_t attCteEnChUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension enable */ +extern const uint8_t attCteMinLenChUuid[ATT_16_UUID_LEN];/*!< \brief Constant Tone Extension minimum length */ +extern const uint8_t attCteTxCntChUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension minimum transmit count */ +extern const uint8_t attCteTxDurChUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension transmit duration */ +extern const uint8_t attCteIntChUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension interval */ +extern const uint8_t attCtePhyChUuid[ATT_16_UUID_LEN]; /*!< \brief Constant Tone Extension PHY */ /**@}*/ /*! \} */ /* STACK_ATT_API */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/dm_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_api.h similarity index 80% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/dm_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_api.h index 4586fa03d0e98eaef9d9c8a49064c670f1498b60..b2ddb03d7ef6ce4a881fc79505d3efb0572a5214 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/dm_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Device Manager subsystem API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device Manager subsystem API. */ /*************************************************************************************************/ #ifndef DM_API_H @@ -361,7 +364,11 @@ extern "C" { /*! \brief Set the type of random address */ #define DM_RAND_ADDR_SET(addr, type) {(addr)[5] = ((addr)[5] & 0x3F) | (type);} -/*! \brief Check for Resolvable Random Address */ +/*! \brief Check for Static Address */ +#define DM_RAND_ADDR_SA(addr, type) (((type) == DM_ADDR_RANDOM) && \ + (DM_RAND_ADDR_GET((addr)) == DM_RAND_ADDR_STATIC)) + +/*! \brief Check for Resolvable Private Address */ #define DM_RAND_ADDR_RPA(addr, type) (((type) == DM_ADDR_RANDOM) && \ (DM_RAND_ADDR_GET((addr)) == DM_RAND_ADDR_RESOLV)) /**@}*/ @@ -457,6 +464,7 @@ enum DM_SEC_COMPARE_IND, /*!< \brief Result of Just Works/Numeric Comparison Compare Value Calculation */ DM_SEC_KEYPRESS_IND, /*!< \brief Keypress indication from peer in passkey security */ DM_PRIV_RESOLVED_ADDR_IND, /*!< \brief Private address resolved */ + DM_PRIV_GENERATE_ADDR_IND, /*!< \brief Private resolvable address generated */ DM_CONN_READ_RSSI_IND, /*!< \brief Connection RSSI read */ DM_PRIV_ADD_DEV_TO_RES_LIST_IND, /*!< \brief Device added to resolving list */ DM_PRIV_REM_DEV_FROM_RES_LIST_IND, /*!< \brief Device removed from resolving list */ @@ -480,11 +488,26 @@ enum DM_PER_ADV_SET_START_IND, /*!< \brief Periodic advertising set started */ DM_PER_ADV_SET_STOP_IND, /*!< \brief Periodic advertising set stopped */ DM_PER_ADV_SYNC_EST_IND, /*!< \brief Periodic advertising sync established */ + DM_PER_ADV_SYNC_EST_FAIL_IND, /*!< \brief Periodic advertising sync establishment failed */ DM_PER_ADV_SYNC_LOST_IND, /*!< \brief Periodic advertising sync lost */ + DM_PER_ADV_SYNC_TRSF_EST_IND, /*!< \brief Periodic advertising sync transfer established */ + DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND, /*!< \brief Periodic advertising sync transfer establishment failed */ + DM_PER_ADV_SYNC_TRSF_IND, /*!< \brief Periodic advertising sync info transferred */ + DM_PER_ADV_SET_INFO_TRSF_IND, /*!< \brief Periodic advertising set sync info transferred */ DM_PER_ADV_REPORT_IND, /*!< \brief Periodic advertising data received from peer device */ DM_REMOTE_FEATURES_IND, /*!< \brief Remote features from peer device */ - DM_READ_LOCAL_VER_INFO_IND, /*!< \brief Local LL version information read */ DM_READ_REMOTE_VER_INFO_IND, /*!< \brief Remote LL version information read */ + DM_CONN_IQ_REPORT_IND, /*!< \brief IQ samples from CTE of received packet from peer device */ + DM_CTE_REQ_FAIL_IND, /*!< \brief CTE request failed */ + DM_CONN_CTE_RX_SAMPLE_START_IND, /*!< \brief Sampling received CTE started */ + DM_CONN_CTE_RX_SAMPLE_STOP_IND, /*!< \brief Sampling received CTE stopped */ + DM_CONN_CTE_TX_CFG_IND, /*!< \brief Connection CTE transmit parameters configured */ + DM_CONN_CTE_REQ_START_IND, /*!< \brief Initiating connection CTE request started */ + DM_CONN_CTE_REQ_STOP_IND, /*!< \brief Initiating connection CTE request stopped */ + DM_CONN_CTE_RSP_START_IND, /*!< \brief Responding to connection CTE request started */ + DM_CONN_CTE_RSP_STOP_IND, /*!< \brief Responding to connection CTE request stopped */ + DM_READ_ANTENNA_INFO_IND, /*!< \brief Antenna information read */ + DM_L2C_CMD_REJ_IND, /*!< \brief L2CAP Command Reject */ DM_ERROR_IND, /*!< \brief General error */ DM_HW_ERROR_IND, /*!< \brief Hardware error */ DM_VENDOR_SPEC_IND /*!< \brief Vendor specific event */ @@ -602,6 +625,13 @@ typedef struct uint8_t notificationType; /*!< \brief Type of keypress notification */ } dmSecKeypressIndEvt_t; +/*! \brief Data type for \ref DM_PRIV_GENERATE_ADDR_IND. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Header */ + bdAddr_t addr; /*!< \brief Resolvable private address */ +} dmPrivGenAddrIndEvt_t; + /*! \brief Data type for \ref DM_SEC_CALC_OOB_IND. */ typedef struct { @@ -640,6 +670,14 @@ typedef struct uint8_t advHandle; /*!< \brief Advertising handle */ } dmPerAdvSetStopEvt_t; +/*! \brief Data structure for \ref DM_L2C_CMD_REJ_IND. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Header */ + uint16_t reason; /*!< \brief Rejection reason */ + uint16_t handle; /*!< \brief Connection handle */ +} dmL2cCmdRejEvt_t; + /*! \brief Union of DM callback event data types. * * \note the following events use only the common \ref wsfMsgHdr_t header: @@ -657,62 +695,78 @@ typedef struct */ typedef union { - wsfMsgHdr_t hdr; /*!< \brief Common header */ - /* common header used by DM_RESET_CMPL_IND */ - /* common header used by DM_ADV_START_IND */ - /* common header used by DM_ADV_STOP_IND */ - dmAdvNewAddrIndEvt_t advNewAddr; /*!< \brief handles \ref DM_ADV_NEW_ADDR_IND */ - /* common header used by DM_SCAN_START_IND */ - /* common header used by DM_SCAN_STOP_IND */ - hciLeAdvReportEvt_t scanReport; /*!< \brief handles \ref DM_SCAN_REPORT_IND */ - hciLeConnCmplEvt_t connOpen; /*!< \brief handles \ref DM_CONN_OPEN_IND */ - hciDisconnectCmplEvt_t connClose; /*!< \brief handles \ref DM_CONN_CLOSE_IND */ - hciLeConnUpdateCmplEvt_t connUpdate; /*!< \brief handles \ref DM_CONN_UPDATE_IND */ - dmSecPairCmplIndEvt_t pairCmpl; /*!< \brief handles \ref DM_SEC_PAIR_CMPL_IND */ - /* common header used by DM_SEC_PAIR_FAIL_IND */ - dmSecEncryptIndEvt_t encryptInd; /*!< \brief handles \ref DM_SEC_ENCRYPT_IND */ - /* common header used by DM_SEC_ENCRYPT_FAIL_IND */ - dmSecAuthReqIndEvt_t authReq; /*!< \brief handles \ref DM_SEC_AUTH_REQ_IND */ - dmSecKeyIndEvt_t keyInd; /*!< \brief handles \ref DM_SEC_KEY_IND */ - hciLeLtkReqEvt_t ltkReqInd; /*!< \brief handles \ref DM_SEC_LTK_REQ_IND */ - dmSecPairIndEvt_t pairInd; /*!< \brief handles \ref DM_SEC_PAIR_IND */ - dmSecSlaveIndEvt_t slaveInd; /*!< \brief handles \ref DM_SEC_SLAVE_REQ_IND */ - dmSecOobCalcIndEvt_t oobCalcInd; /*!< \brief handles \ref DM_SEC_CALC_OOB_IND */ - secEccMsg_t eccMsg; /*!< \brief handles \ref DM_SEC_ECC_KEY_IND */ - dmSecCnfIndEvt_t cnfInd; /*!< \brief handles \ref DM_SEC_COMPARE_IND */ - dmSecKeypressIndEvt_t keypressInd; /*!< \brief handles \ref DM_SEC_KEYPRESS_IND */ - /* common header used by DM_PRIV_RESOLVED_ADDR_IND */ - hciReadRssiCmdCmplEvt_t readRssi; /*!< \brief handles \ref DM_CONN_READ_RSSI_IND */ - hciLeAddDevToResListCmdCmplEvt_t addDevToResList; /*!< \brief handles \ref DM_PRIV_ADD_DEV_TO_RES_LIST_IND */ - hciLeRemDevFromResListCmdCmplEvt_t remDevFromResList;/*!< \brief handles \ref DM_PRIV_REM_DEV_FROM_RES_LIST_IND */ - hciLeClearResListCmdCmplEvt_t clearResList; /*!< \brief handles \ref DM_PRIV_CLEAR_RES_LIST_IND */ - hciLeReadPeerResAddrCmdCmplEvt_t readPeerResAddr; /*!< \brief handles \ref DM_PRIV_READ_PEER_RES_ADDR_IND */ - hciLeReadLocalResAddrCmdCmplEvt_t readLocalResAddr; /*!< \brief handles \ref DM_PRIV_READ_LOCAL_RES_ADDR_IND */ - hciLeSetAddrResEnableCmdCmplEvt_t setAddrResEnable; /*!< \brief handles \ref DM_PRIV_SET_ADDR_RES_ENABLE_IND */ - hciLeRemConnParamReqEvt_t remConnParamReq; /*!< \brief handles \ref DM_REM_CONN_PARAM_REQ_IND */ - hciLeDataLenChangeEvt_t dataLenChange; /*!< \brief handles \ref DM_CONN_DATA_LEN_CHANGE_IND */ - hciWriteAuthPayloadToCmdCmplEvt_t writeAuthTo; /*!< \brief handles \ref DM_CONN_WRITE_AUTH_TO_IND */ - hciAuthPayloadToExpiredEvt_t authToExpired; /*!< \brief handles \ref DM_CONN_AUTH_TO_EXPIRED_IND */ - hciLeReadPhyCmdCmplEvt_t readPhy; /*!< \brief handles \ref DM_PHY_READ_IND */ - hciLeSetDefPhyCmdCmplEvt_t setDefPhy; /*!< \brief handles \ref DM_PHY_SET_DEF_IND */ - hciLePhyUpdateEvt_t phyUpdate; /*!< \brief handles \ref DM_PHY_UPDATE_IND */ - dmAdvSetStartEvt_t advSetStart; /*!< \brief handles \ref DM_ADV_SET_START_IND */ - hciLeAdvSetTermEvt_t advSetStop; /*!< \brief handles \ref DM_ADV_SET_STOP_IND */ - hciLeScanReqRcvdEvt_t scanReqRcvd; /*!< \brief handles \ref DM_SCAN_REQ_RCVD_IND */ - /* common header used by DM_EXT_SCAN_START_IND */ - /* common header used by DM_EXT_SCAN_STOP_IND */ - hciLeExtAdvReportEvt_t extScanReport; /*!< \brief handles \ref DM_EXT_SCAN_REPORT_IND */ - dmPerAdvSetStartEvt_t perAdvSetStart; /*!< \brief handles \ref DM_PER_ADV_SET_START_IND */ - dmPerAdvSetStopEvt_t perAdvSetStop; /*!< \brief handles \ref DM_PER_ADV_SET_STOP_IND */ - hciLePerAdvSyncEstEvt_t perAdvSyncEst; /*!< \brief handles \ref DM_PER_ADV_SYNC_EST_IND */ - hciLePerAdvSyncLostEvt_t perAdvSyncLost; /*!< \brief handles \ref DM_PER_ADV_SYNC_LOST_IND */ - hciLePerAdvReportEvt_t perAdvReport; /*!< \brief handles \ref DM_PER_ADV_REPORT_IND */ - hciLeReadRemoteFeatCmplEvt_t readRemoteFeat; /*!< \brief handles \ref DM_REMOTE_FEATURES_IND */ - hciReadLocalVerInfo_t readLocVerInfo; /*!< \brief handles \ref DM_READ_LOCAL_VER_INFO_IND */ - hciReadRemoteVerInfoCmplEvt_t readRemVerInfo; /*!< \brief handles \ref DM_READ_REMOTE_VER_INFO_IND */ - /* common header used by DM_ERROR_IND */ - hciHwErrorEvt_t hwError; /*!< \brief handles \ref DM_HW_ERROR_IND */ - hciVendorSpecEvt_t vendorSpec; /*!< \brief handles \ref DM_VENDOR_SPEC_IND */ + wsfMsgHdr_t hdr; /*!< \brief Common header */ + /* common header used by DM_RESET_CMPL_IND */ + /* common header used by DM_ADV_START_IND */ + /* common header used by DM_ADV_STOP_IND */ + dmAdvNewAddrIndEvt_t advNewAddr; /*!< \brief handles \ref DM_ADV_NEW_ADDR_IND */ + /* common header used by DM_SCAN_START_IND */ + /* common header used by DM_SCAN_STOP_IND */ + hciLeAdvReportEvt_t scanReport; /*!< \brief handles \ref DM_SCAN_REPORT_IND */ + hciLeConnCmplEvt_t connOpen; /*!< \brief handles \ref DM_CONN_OPEN_IND */ + hciDisconnectCmplEvt_t connClose; /*!< \brief handles \ref DM_CONN_CLOSE_IND */ + hciLeConnUpdateCmplEvt_t connUpdate; /*!< \brief handles \ref DM_CONN_UPDATE_IND */ + dmSecPairCmplIndEvt_t pairCmpl; /*!< \brief handles \ref DM_SEC_PAIR_CMPL_IND */ + /* common header used by DM_SEC_PAIR_FAIL_IND */ + dmSecEncryptIndEvt_t encryptInd; /*!< \brief handles \ref DM_SEC_ENCRYPT_IND */ + /* common header used by DM_SEC_ENCRYPT_FAIL_IND */ + dmSecAuthReqIndEvt_t authReq; /*!< \brief handles \ref DM_SEC_AUTH_REQ_IND */ + dmSecKeyIndEvt_t keyInd; /*!< \brief handles \ref DM_SEC_KEY_IND */ + hciLeLtkReqEvt_t ltkReqInd; /*!< \brief handles \ref DM_SEC_LTK_REQ_IND */ + dmSecPairIndEvt_t pairInd; /*!< \brief handles \ref DM_SEC_PAIR_IND */ + dmSecSlaveIndEvt_t slaveInd; /*!< \brief handles \ref DM_SEC_SLAVE_REQ_IND */ + dmSecOobCalcIndEvt_t oobCalcInd; /*!< \brief handles \ref DM_SEC_CALC_OOB_IND */ + secEccMsg_t eccMsg; /*!< \brief handles \ref DM_SEC_ECC_KEY_IND */ + dmSecCnfIndEvt_t cnfInd; /*!< \brief handles \ref DM_SEC_COMPARE_IND */ + dmSecKeypressIndEvt_t keypressInd; /*!< \brief handles \ref DM_SEC_KEYPRESS_IND */ + /* common header used by DM_PRIV_RESOLVED_ADDR_IND */ + dmPrivGenAddrIndEvt_t genAddr; /*!< \brief handles \ref DM_PRIV_GENERATE_ADDR_IND */ + hciReadRssiCmdCmplEvt_t readRssi; /*!< \brief handles \ref DM_CONN_READ_RSSI_IND */ + hciLeAddDevToResListCmdCmplEvt_t addDevToResList; /*!< \brief handles \ref DM_PRIV_ADD_DEV_TO_RES_LIST_IND */ + hciLeRemDevFromResListCmdCmplEvt_t remDevFromResList; /*!< \brief handles \ref DM_PRIV_REM_DEV_FROM_RES_LIST_IND */ + hciLeClearResListCmdCmplEvt_t clearResList; /*!< \brief handles \ref DM_PRIV_CLEAR_RES_LIST_IND */ + hciLeReadPeerResAddrCmdCmplEvt_t readPeerResAddr; /*!< \brief handles \ref DM_PRIV_READ_PEER_RES_ADDR_IND */ + hciLeReadLocalResAddrCmdCmplEvt_t readLocalResAddr; /*!< \brief handles \ref DM_PRIV_READ_LOCAL_RES_ADDR_IND */ + hciLeSetAddrResEnableCmdCmplEvt_t setAddrResEnable; /*!< \brief handles \ref DM_PRIV_SET_ADDR_RES_ENABLE_IND */ + hciLeRemConnParamReqEvt_t remConnParamReq; /*!< \brief handles \ref DM_REM_CONN_PARAM_REQ_IND */ + hciLeDataLenChangeEvt_t dataLenChange; /*!< \brief handles \ref DM_CONN_DATA_LEN_CHANGE_IND */ + hciWriteAuthPayloadToCmdCmplEvt_t writeAuthTo; /*!< \brief handles \ref DM_CONN_WRITE_AUTH_TO_IND */ + hciAuthPayloadToExpiredEvt_t authToExpired; /*!< \brief handles \ref DM_CONN_AUTH_TO_EXPIRED_IND */ + hciLeReadPhyCmdCmplEvt_t readPhy; /*!< \brief handles \ref DM_PHY_READ_IND */ + hciLeSetDefPhyCmdCmplEvt_t setDefPhy; /*!< \brief handles \ref DM_PHY_SET_DEF_IND */ + hciLePhyUpdateEvt_t phyUpdate; /*!< \brief handles \ref DM_PHY_UPDATE_IND */ + dmAdvSetStartEvt_t advSetStart; /*!< \brief handles \ref DM_ADV_SET_START_IND */ + hciLeAdvSetTermEvt_t advSetStop; /*!< \brief handles \ref DM_ADV_SET_STOP_IND */ + hciLeScanReqRcvdEvt_t scanReqRcvd; /*!< \brief handles \ref DM_SCAN_REQ_RCVD_IND */ + /* common header used by DM_EXT_SCAN_START_IND */ + /* common header used by DM_EXT_SCAN_STOP_IND */ + hciLeExtAdvReportEvt_t extScanReport; /*!< \brief handles \ref DM_EXT_SCAN_REPORT_IND */ + dmPerAdvSetStartEvt_t perAdvSetStart; /*!< \brief handles \ref DM_PER_ADV_SET_START_IND */ + dmPerAdvSetStopEvt_t perAdvSetStop; /*!< \brief handles \ref DM_PER_ADV_SET_STOP_IND */ + hciLePerAdvSyncEstEvt_t perAdvSyncEst; /*!< \brief handles \ref DM_PER_ADV_SYNC_EST_IND */ + hciLePerAdvSyncEstEvt_t perAdvSyncEstFail; /*!< \brief handles \ref DM_PER_ADV_SYNC_EST_FAIL_IND */ + hciLePerAdvSyncLostEvt_t perAdvSyncLost; /*!< \brief handles \ref DM_PER_ADV_SYNC_LOST_IND */ + HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsfEst; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_EST_IND */ + HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsEstFail; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND */ + hciLePerAdvSyncTrsfCmdCmplEvt_t perAdvSyncTrsf; /*!< \brief handles \ref DM_PER_ADV_SYNC_TRSF_IND */ + hciLePerAdvSetInfoTrsfCmdCmplEvt_t perAdvSetInfoTrsf; /*!< \brief handles \ref DM_PER_ADV_SET_INFO_TRSF_IND */ + hciLePerAdvReportEvt_t perAdvReport; /*!< \brief handles \ref DM_PER_ADV_REPORT_IND */ + hciLeReadRemoteFeatCmplEvt_t readRemoteFeat; /*!< \brief handles \ref DM_REMOTE_FEATURES_IND */ + hciReadRemoteVerInfoCmplEvt_t readRemVerInfo; /*!< \brief handles \ref DM_READ_REMOTE_VER_INFO_IND */ + hciLeConnIQReportEvt_t connIQReport; /*!< \brief handles \ref DM_CONN_IQ_REPORT_IND */ + hciLeCteReqFailedEvt_t cteReqFail; /*!< \brief handles \ref DM_CTE_REQ_FAIL_IND */ + hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStart; /*!< \brief handles \ref DM_CONN_CTE_RX_SAMPLE_START_IND */ + hciLeSetConnCteRxParamsCmdCmplEvt_t connCteRxSampleStop; /*!< \brief handles \ref DM_CONN_CTE_RX_SAMPLE_STOP_IND */ + hciLeSetConnCteTxParamsCmdCmplEvt_t connCteTxCfg; /*!< \brief handles \ref DM_CONN_CTE_TX_CFG_IND */ + hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStart; /*!< \brief handles \ref DM_CONN_CTE_REQ_START_IND */ + hciLeConnCteReqEnableCmdCmplEvt_t connCteReqStop; /*!< \brief handles \ref DM_CONN_CTE_REQ_STOP_IND */ + hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStart; /*!< \brief handles \ref DM_CONN_CTE_RSP_START_IND */ + hciLeConnCteRspEnableCmdCmplEvt_t connCteRspStop; /*!< \brief handles \ref DM_CONN_CTE_RSP_STOP_IND */ + hciLeReadAntennaInfoCmdCmplEvt_t readAntennaInfo; /*!< \brief handles \ref DM_READ_ANTENNA_INFO_IND */ + dmL2cCmdRejEvt_t l2cCmdRej; /*!< \brief handles \ref DM_L2C_CMD_REJ_IND */ + /* common header used by DM_ERROR_IND */ + hciHwErrorEvt_t hwError; /*!< \brief handles \ref DM_HW_ERROR_IND */ + hciVendorSpecEvt_t vendorSpec; /*!< \brief handles \ref DM_VENDOR_SPEC_IND */ } dmEvt_t; /*! \brief Data type for DmSecSetOob(). */ @@ -878,6 +932,18 @@ void DmAdvRemoveAdvSet(uint8_t advHandle); /*************************************************************************************************/ void DmAdvClearAdvSets(void); +/*************************************************************************************************/ +/*! + * \brief Set the random device address for a given advertising set. + * + * \param advHandle Advertising handle. + * \param pAddr Random device address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr); + /*************************************************************************************************/ /*! * \brief Set the minimum and maximum advertising intervals. @@ -957,18 +1023,6 @@ bool_t DmAdvSetAdValue(uint8_t adType, uint8_t len, uint8_t *pValue, uint16_t *p bool_t DmAdvSetName(uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, uint8_t *pAdvData, uint16_t advDataBufLen); -/*************************************************************************************************/ -/*! - * \brief Set the random device address for a given advertising set. - * - * \param advHandle Advertising handle. - * \param pAddr Random device address. - * - * \return None. - */ -/*************************************************************************************************/ -void DmAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr); - /*************************************************************************************************/ /*! * \brief Initialize device privacy module. @@ -1151,6 +1205,19 @@ void DmPerAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t inter /*************************************************************************************************/ void DmPerAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr); +/*************************************************************************************************/ +/*! + * \brief Get the maximum advertising data length supported by Controller for a given advertising + * type. + * + * \param advType Advertising type. + * \param useLegacyPdu Whether to use legacy advertising PDUs with extended advertising. + * + * \return Maximum advertising data length. + */ +/*************************************************************************************************/ +uint16_t DmExtMaxAdvDataLen(uint8_t advType, bool_t useLegacyPdu); + /**@}*/ /** \name DM Privacy Functions @@ -1188,17 +1255,6 @@ void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param); * is called with a DM_PRIV_ADD_DEV_TO_RES_LIST_IND event. The client must wait * to receive this event before executing this function again. * - * Note: This command cannot be used when address translation is enabled in the LL and: - * - Advertising is enabled - * - Scanning is enabled - * - Create connection command is outstanding - * - * Note: If the local or peer IRK associated with the peer Identity Address is all - * zeros then the LL will use or accept the local or peer Identity Address. - * - * Note: 'enableLlPriv' should be set to TRUE when the last device is being added - * to resolving list to enable address resolution in LL. - * * \param addrType Peer identity address type. * \param pIdentityAddr Peer identity address. * \param pPeerIrk The peer's identity resolving key. @@ -1207,6 +1263,17 @@ void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param); * \param param client-defined parameter returned with callback event. * * \return None. + * + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + * + * \Note If the local or peer IRK associated with the peer Identity Address is all zeros then + * the Controller will use or accept the local or peer Identity Address respectively. + * + * \Note Parameter 'enableLlPriv' should be set to TRUE when the last device is being added + * to resolving list to enable address resolution in the Controller. */ /*************************************************************************************************/ void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pPeerIrk, @@ -1218,16 +1285,16 @@ void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8 * is called with a DM_PRIV_REM_DEV_FROM_RES_LIST_IND event. The client must wait to * receive this event before executing this function again. * - * Note: This command cannot be used when address translation is enabled in the LL and: - * - Advertising is enabled - * - Scanning is enabled - * - Create connection command is outstanding - * * \param addrType Peer identity address type. * \param pIdentityAddr Peer identity address. * \param param client-defined parameter returned with callback event. * * \return None. + * + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. */ /*************************************************************************************************/ void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint16_t param); @@ -1238,15 +1305,15 @@ void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uin * DM_PRIV_CLEAR_RES_LIST_IND event. The client must wait to receive this event before * executing this function again. * - * Note: This command cannot be used when address translation is enabled in the LL and: - * - Advertising is enabled - * - Scanning is enabled - * - Create connection command is outstanding + * \return None. * - * Note: Address resolution in LL will be disabled when resolving list's cleared - * successfully. + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. * - * \return None. + * \Note Address resolution in Controller will be disabled when resolving list's cleared + * successfully. */ /*************************************************************************************************/ void DmPrivClearResList(void); @@ -1285,14 +1352,14 @@ void DmPrivReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAdd * function is called with a DM_PRIV_SET_ADDR_RES_ENABLE_IND event. The client must * wait to receive this event before executing this function again. * - * Note: This command can be used at any time except when: - * - Advertising is enabled - * - Scanning is enabled - * - Create connection command is outstanding - * * \param enable Set to TRUE to enable address resolution or FALSE to disable it. * * \return None. + * + * \Note This command can be used at any time except when: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. */ /*************************************************************************************************/ void DmPrivSetAddrResEnable(bool_t enable); @@ -1317,10 +1384,27 @@ void DmPrivSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout); * \param mode Privacy mode (by default, network privacy mode is used). * * \return None. + * + * \Note This command can be used at any time except when: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. */ /*************************************************************************************************/ void DmPrivSetPrivacyMode(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t mode); +/*************************************************************************************************/ +/*! + * \brief Generate a Resolvable Private Address (RPA). + * + * \param pIrk The identity resolving key. + * \param param Client-defined parameter returned with callback event. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivGenerateAddr(uint8_t *pIrk, uint16_t param); + /*************************************************************************************************/ /*! * \brief Whether LL Privacy is enabled. @@ -1355,6 +1439,24 @@ void DmScanInit(void); /*************************************************************************************************/ void DmExtScanInit(void); +/*************************************************************************************************/ +/*! + * \brief Initialize DM Periodic Advertising Sync Transfer (PAST) module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize DM Connection Constant Tone Extension (CTE) module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteInit(void); + /*************************************************************************************************/ /*! * \brief Whether DM scanning is in legacy mode. @@ -1462,6 +1564,17 @@ dmSyncId_t DmSyncStart(uint8_t advSid, uint8_t advAddrType, const uint8_t *pAdvA /*************************************************************************************************/ void DmSyncStop(dmSyncId_t syncId); +/*************************************************************************************************/ +/*! + * \brief DM enable or disable initial periodic advertisement reporting. + * + * \param enable TRUE to enable initial reporting, FALSE to disable initial reporting. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSyncInitialRptEnable(bool_t enable); + /*************************************************************************************************/ /*! * \brief Add device to periodic advertiser list. @@ -1497,6 +1610,187 @@ void DmRemoveDeviceFromPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_ /*************************************************************************************************/ void DmClearPerAdvList(void); +/*************************************************************************************************/ +/*! + * \brief Enable or disable reports for the periodic advertising identified by the sync id. + * + * \param syncId Sync identifier. + * \param enable TRUE to enable reporting, FALSE to disable reporting. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastRptRcvEnable(dmSyncId_t syncId, bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Send synchronization information about the periodic advertising identified by the + * sync id to a connected device. + * + * \param connId Connection identifier. + * \param serviceData Value provided by the Host. + * \param syncId Sync identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastSyncTrsf(dmConnId_t connId, uint16_t serviceData, dmSyncId_t syncId); + +/*************************************************************************************************/ +/*! + * \brief Send synchronization information about the periodic advertising in an advertising + * set to a connected device. + * + * \param connId Connection identifier. + * \param serviceData Value provided by the Host. + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastSetInfoTrsf(dmConnId_t connId, uint16_t serviceData, uint8_t advHandle); + +/*************************************************************************************************/ +/*! + * \brief Specify how the Controller should process periodic advertising synchronization + * information received from the device identified by the connnection handle. + * + * \param connId Connection identifier. + * \param mode Action to be taken when periodic advertising info is received. + * \param skip Number of consecutive periodic advertising packets that the receiver + * may skip after successfully receiving a periodic advertising packet. + * \param syncTimeout Maximum permitted time between successful receives. If this time is + * exceeded, synchronization is lost. + * \param cteType Whether to only synchronize to periodic advertising with certain + * types of Constant Tone Extension. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastConfig(dmConnId_t connId, uint8_t mode, uint16_t skip, uint16_t syncTimeout, + uint8_t cteType); + +/*************************************************************************************************/ +/*! + * \brief Specify the initial value for the mode, skip, timeout, and Constant Tone Extension type + * to be used for all subsequent connections over the LE transport. + * + * \param mode Action to be taken when periodic advertising info is received. + * \param skip Number of consecutive periodic advertising packets that the receiver + * may skip after successfully receiving a periodic advertising packet. + * \param syncTimeout Maximum permitted time between successful receives. If this time is + * exceeded, synchronization is lost. + * \param cteType Whether to only synchronize to periodic advertising with certain + * types of Constant Tone Extension. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastDefaultConfig(uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType); + +/*************************************************************************************************/ +/*! + * \brief Enable sampling received CTE fields on the specified connection, and configure the + * antenna switching pattern, and switching and sampling slot durations to be used. + * + * \param connId Connection identifier. + * \param slotDurations Switching and sampling slot durations to be used while receiving CTE. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRxSampleStart(dmConnId_t connId, uint8_t slotDurations, uint8_t switchPatternLen, + uint8_t *pAntennaIDs); + +/*************************************************************************************************/ +/*! + * \brief Disable sampling received CTE fields on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRxSampleStop(dmConnId_t connId); + +/*************************************************************************************************/ +/*! + * \brief Configure the antenna switching pattern, and permitted CTE types used for transmitting + * CTEs requested by the peer device on the specified connection. + * + * \param connId Connection identifier. + * \param cteTypeBits Permitted CTE type bits used for transmitting CTEs requested by peer. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteTxConfig(dmConnId_t connId, uint8_t cteTypeBits, uint8_t switchPatternLen, + uint8_t *pAntennaIDs); + +/*************************************************************************************************/ +/*! + * \brief Initiate the CTE Request procedure on the specified connection. + * + * \param connId Connection identifier. + * \param cteReqInt CTE request interval. + * \param reqCteLen Minimum length of CTE being requested in 8 us units. + * \param reqCteType Requested CTE type. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteReqStart(dmConnId_t connId, uint16_t cteReqInt, uint8_t reqCteLen, + uint8_t reqCteType); + +/*************************************************************************************************/ +/*! + * \brief Stop initiating the CTE Request procedure on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteReqStop(dmConnId_t connId); + +/*************************************************************************************************/ +/*! + * \brief Start responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRspStart(dmConnId_t connId); + +/*************************************************************************************************/ +/*! + * \brief Stop responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRspStop(dmConnId_t connId); + +/*************************************************************************************************/ +/*! + * \brief Read the switching rates, the sampling rates, the number of antennae, and the maximum + * length of a transmitted Constant Tone Extension supported by the Controller. + * + * \return None. + * + * \note The antenna info will be returned with DM indication \ref DM_READ_ANTENNA_INFO_IND. + */ +/*************************************************************************************************/ +void DmReadAntennaInfo(void); + /**@}*/ /** \name DM Connection Functions @@ -2223,6 +2517,18 @@ uint16_t DmSizeOfEvt(dmEvt_t *pDmEvt); /*************************************************************************************************/ void DmL2cConnUpdateCnf(uint16_t handle, uint16_t reason); +/*************************************************************************************************/ +/*! + * \brief For internal use only. L2C calls this function to send the result of an L2CAP + * Command Reject up to the application. + * + * \param handle Connection handle. + * \param result Connection update result code. + * \return None. + */ +/*************************************************************************************************/ +void DmL2cCmdRejInd(uint16_t handle, uint16_t result); + /*************************************************************************************************/ /*! * \brief For internal use only. L2C calls this function when it receives a connection update @@ -2231,6 +2537,7 @@ void DmL2cConnUpdateCnf(uint16_t handle, uint16_t reason); * \param identifier Identifier value. * \param handle Connection handle. * \param pConnSpec Connection spec parameters. + * * \return None. */ /*************************************************************************************************/ @@ -2388,6 +2695,17 @@ uint8_t *DmSecGetLocalIrk(void); /*************************************************************************************************/ void DmReadRemoteFeatures(dmConnId_t connId); +/*************************************************************************************************/ +/*! + * \brief Read the version info of the remote device. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmReadRemoteVerInfo(dmConnId_t connId); + /**@}*/ /*! \} */ /* STACK_DM_API */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/dm_handler.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_handler.h similarity index 68% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/dm_handler.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_handler.h index b700dd521293fbcaccc9603d7db75dda81d850a4..926afa36c18956b86aba0ce34065634285fe3381 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/dm_handler.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/dm_handler.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Interface to DM event handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Interface to DM event handler. */ /*************************************************************************************************/ #ifndef DM_HANDLER_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_api.h similarity index 73% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_api.h index 5b1978ab243f535482f7bbcbfd562a5ac5efd0c3..d0aa82fe83676e9e043fea8465249a4f2d5cf147 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI subsystem API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI subsystem API. */ /*************************************************************************************************/ #ifndef HCI_API_H @@ -39,72 +42,79 @@ extern "C" { /** \name HCI Internal Event Codes * Proprietary HCI event codes for handling HCI events in callbacks. - * NOTE: The length and order of this list must match the events in dm_main.c - * NOTE: The first event, RESET_SEQ, is set to zero to match the original #define event list. */ /**@{*/ -enum -{ - HCI_RESET_SEQ_CMPL_CBACK_EVT = 0, /*!< \brief Reset sequence complete */ - HCI_LE_CONN_CMPL_CBACK_EVT, /*!< \brief LE connection complete */ - HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT, /*!< \brief LE enhanced connection complete */ - HCI_DISCONNECT_CMPL_CBACK_EVT, /*!< \brief LE disconnect complete */ - HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT, /*!< \brief LE connection update complete */ - HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT, /*!< \brief LE create connection cancel command complete */ - HCI_LE_ADV_REPORT_CBACK_EVT, /*!< \brief LE advertising report */ - HCI_READ_RSSI_CMD_CMPL_CBACK_EVT, /*!< \brief Read RSSI command complete */ - HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT, /*!< \brief LE Read channel map command complete */ - HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT, /*!< \brief Read transmit power level command complete */ - HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT, /*!< \brief Read remote version information complete */ - HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT, /*!< \brief LE read remote features complete */ - HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT, /*!< \brief LE LTK request reply command complete */ - HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT, /*!< \brief LE LTK request negative reply command complete */ - HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT, /*!< \brief Encryption key refresh complete */ - HCI_ENC_CHANGE_CBACK_EVT, /*!< \brief Encryption change */ - HCI_LE_LTK_REQ_CBACK_EVT, /*!< \brief LE LTK request */ - HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT, /*!< \brief Vendor specific command status */ - HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT, /*!< \brief Vendor specific command complete */ - HCI_VENDOR_SPEC_CBACK_EVT, /*!< \brief Vendor specific */ - HCI_HW_ERROR_CBACK_EVT, /*!< \brief Hardware error */ - HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT, /*!< \brief LE add device to resolving list command complete */ - HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT, /*!< \brief LE remove device from resolving command complete */ - HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT, /*!< \brief LE clear resolving list command complete */ - HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT, /*!< \brief LE read peer resolving address command complete */ - HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT, /*!< \brief LE read local resolving address command complete */ - HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT, /*!< \brief LE set address resolving enable command complete */ - HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT, /*!< \brief LE encrypt command complete */ - HCI_LE_RAND_CMD_CMPL_CBACK_EVT, /*!< \brief LE rand command complete */ - HCI_LE_REM_CONN_PARAM_REP_CMD_CMPL_CBACK_EVT, /*!< \brief LE remote connection parameter request reply complete */ - HCI_LE_REM_CONN_PARAM_NEG_REP_CMD_CMPL_CBACK_EVT, /*!< \brief LE remote connection parameter request negative reply complete */ - HCI_LE_READ_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT, /*!< \brief LE read suggested default data length command complete */ - HCI_LE_WRITE_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT, /*!< \brief LE write suggested default data length command complete */ - HCI_LE_SET_DATA_LEN_CMD_CMPL_CBACK_EVT, /*!< \brief LE set data length command complete */ - HCI_LE_READ_MAX_DATA_LEN_CMD_CMPL_CBACK_EVT, /*!< \brief LE read maximum data length command complete */ - HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT, /*!< \brief LE remote connection parameter request */ - HCI_LE_DATA_LEN_CHANGE_CBACK_EVT, /*!< \brief LE data length change */ - HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT, /*!< \brief LE read local P-256 public key */ - HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT, /*!< \brief LE generate DHKey complete */ - HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT, /*!< \brief Write authenticated payload timeout command complete */ - HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT, /*!< \brief Authenticated payload timeout expired event */ - HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT, /*!< \brief LE read phy command complete */ - HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT, /*!< \brief LE set default phy command complete */ - HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT, /*!< \brief LE phy update complete */ - HCI_LE_EXT_ADV_REPORT_CBACK_EVT, /*!< \brief LE extended advertising report */ - HCI_LE_SCAN_TIMEOUT_CBACK_EVT, /*!< \brief LE scan timeout event */ - HCI_LE_ADV_SET_TERM_CBACK_EVT, /*!< \brief LE advertising set terminated event */ - HCI_LE_SCAN_REQ_RCVD_CBACK_EVT, /*!< \brief LE scan request received event */ - HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT, /*!< \brief LE periodic advertising sync established event */ - HCI_LE_PER_ADV_REPORT_CBACK_EVT, /*!< \brief LE periodic advertising report event */ - HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT, /*!< \brief LE periodic advertising synch lost event */ - HCI_LE_CH_SEL_ALGO_CBACK_EVT, /*!< \brief LE channel selection algorithm event */ - HCI_LE_SCAN_ENABLE_CMPL_CBACK_EVT, /*!< \brief LE scan enable complete event */ - HCI_LE_ADV_ENABLE_CMPL_CBACK_EVT, /*!< \brief LE advertise enable complete event */ - HCI_LE_EXT_SCAN_ENABLE_CMPL_CBACK_EVT, /*!< \brief LE extended scan enable complete event */ - HCI_LE_EXT_ADV_ENABLE_CMPL_CBACK_EVT, /*!< \brief LE extended advertise enable complete event */ - HCI_LE_PER_ADV_ENABLE_CMPL_CBACK_EVT, /*!< \brief LE periodic advertise enable complete event */ - HCI_READ_LOCAL_VER_INFO_CMPL_CBACK_EVT, /*!< \brief Read local version info complete event */ - HCI_EVENT_COUNT -}; +#define HCI_RESET_SEQ_CMPL_CBACK_EVT 0 /*!< \brief Reset sequence complete */ +#define HCI_LE_CONN_CMPL_CBACK_EVT 1 /*!< \brief LE connection complete */ +#define HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT 2 /*!< \brief LE enhanced connection complete */ +#define HCI_DISCONNECT_CMPL_CBACK_EVT 3 /*!< \brief LE disconnect complete */ +#define HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT 4 /*!< \brief LE connection update complete */ +#define HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT 5 /*!< \brief LE create connection cancel command complete */ +#define HCI_LE_ADV_REPORT_CBACK_EVT 6 /*!< \brief LE advertising report */ +#define HCI_READ_RSSI_CMD_CMPL_CBACK_EVT 7 /*!< \brief Read RSSI command complete */ +#define HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT 8 /*!< \brief LE Read channel map command complete */ +#define HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT 9 /*!< \brief Read transmit power level command complete */ +#define HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT 10 /*!< \brief Read remote version information complete */ +#define HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT 11 /*!< \brief LE read remote features complete */ +#define HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT 12 /*!< \brief LE LTK request reply command complete */ +#define HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT 13 /*!< \brief LE LTK request negative reply command complete */ +#define HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT 14 /*!< \brief Encryption key refresh complete */ +#define HCI_ENC_CHANGE_CBACK_EVT 15 /*!< \brief Encryption change */ +#define HCI_LE_LTK_REQ_CBACK_EVT 16 /*!< \brief LE LTK request */ +#define HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT 17 /*!< \brief Vendor specific command status */ +#define HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT 18 /*!< \brief Vendor specific command complete */ +#define HCI_VENDOR_SPEC_CBACK_EVT 19 /*!< \brief Vendor specific */ +#define HCI_HW_ERROR_CBACK_EVT 20 /*!< \brief Hardware error */ +#define HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT 21 /*!< \brief LE add device to resolving list command complete */ +#define HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT 22 /*!< \brief LE remove device from resolving command complete */ +#define HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT 23 /*!< \brief LE clear resolving list command complete */ +#define HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT 24 /*!< \brief LE read peer resolving address command complete */ +#define HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT 25 /*!< \brief LE read local resolving address command complete */ +#define HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT 26 /*!< \brief LE set address resolving enable command complete */ +#define HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT 27 /*!< \brief LE encrypt command complete */ +#define HCI_LE_RAND_CMD_CMPL_CBACK_EVT 28 /*!< \brief LE rand command complete */ +#define HCI_LE_REM_CONN_PARAM_REP_CMD_CMPL_CBACK_EVT 29 /*!< \brief LE remote connection parameter request reply complete */ +#define HCI_LE_REM_CONN_PARAM_NEG_REP_CMD_CMPL_CBACK_EVT 30 /*!< \brief LE remote connection parameter request negative reply complete */ +#define HCI_LE_READ_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT 31 /*!< \brief LE read suggested default data length command complete */ +#define HCI_LE_WRITE_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT 32 /*!< \brief LE write suggested default data length command complete */ +#define HCI_LE_SET_DATA_LEN_CMD_CMPL_CBACK_EVT 33 /*!< \brief LE set data length command complete */ +#define HCI_LE_READ_MAX_DATA_LEN_CMD_CMPL_CBACK_EVT 34 /*!< \brief LE read maximum data length command complete */ +#define HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT 35 /*!< \brief LE remote connection parameter request */ +#define HCI_LE_DATA_LEN_CHANGE_CBACK_EVT 36 /*!< \brief LE data length change */ +#define HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT 37 /*!< \brief LE read local P-256 public key */ +#define HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT 38 /*!< \brief LE generate DHKey complete */ +#define HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT 39 /*!< \brief Write authenticated payload timeout command complete */ +#define HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT 40 /*!< \brief Authenticated payload timeout expired event */ +#define HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT 41 /*!< \brief LE read phy command complete */ +#define HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT 42 /*!< \brief LE set default phy command complete */ +#define HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT 43 /*!< \brief LE phy update complete */ +#define HCI_LE_EXT_ADV_REPORT_CBACK_EVT 44 /*!< \brief LE extended advertising report */ +#define HCI_LE_SCAN_TIMEOUT_CBACK_EVT 45 /*!< \brief LE scan timeout event */ +#define HCI_LE_ADV_SET_TERM_CBACK_EVT 46 /*!< \brief LE advertising set terminated event */ +#define HCI_LE_SCAN_REQ_RCVD_CBACK_EVT 47 /*!< \brief LE scan request received event */ +#define HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT 48 /*!< \brief LE periodic advertising sync established event */ +#define HCI_LE_PER_ADV_REPORT_CBACK_EVT 49 /*!< \brief LE periodic advertising report event */ +#define HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT 50 /*!< \brief LE periodic advertising synch lost event */ +#define HCI_LE_CH_SEL_ALGO_CBACK_EVT 51 /*!< \brief LE channel selection algorithm event */ +#define HCI_LE_SCAN_ENABLE_CMD_CMPL_CBACK_EVT 52 /*!< \brief LE scan enable command complete */ +#define HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT 53 /*!< \brief LE advertise enable command complete */ +#define HCI_LE_EXT_SCAN_ENABLE_CMD_CMPL_CBACK_EVT 54 /*!< \brief LE extended scan enable command complete */ +#define HCI_LE_EXT_ADV_ENABLE_CMD_CMPL_CBACK_EVT 55 /*!< \brief LE extended advertise enable command complete */ +#define HCI_LE_PER_ADV_ENABLE_CMD_CMPL_CBACK_EVT 56 /*!< \brief LE periodic advertise enable command complete */ +#define HCI_LE_SET_RAND_ADDR_CMD_CMPL_CBACK_EVT 57 /*!< \brief LE set random address command complete */ +#define HCI_LE_PER_SYNC_TRSF_RCVD_CBACK_EVT 58 /*!< \brief LE periodic advertising sync transfer received event */ +#define HCI_LE_PER_ADV_SYNC_TRSF_CMD_CMPL_CBACK_EVT 59 /*!< \brief LE periodic advertising sync transfer command complete */ +#define HCI_LE_PER_ADV_SET_INFO_TRSF_CMD_CMPL_CBACK_EVT 60 /*!< \brief LE set periodic advertising set info transfer command complete */ +#define HCI_LE_CONN_IQ_REPORT_CBACK_EVT 61 /*!< \brief LE connection IQ report event */ +#define HCI_LE_CTE_REQ_FAILED_CBACK_EVT 62 /*!< \brief LE CTE request failed event */ +#define HCI_LE_SET_CONN_CTE_RX_PARAMS_CMD_CMPL_CBACK_EVT 63 /*!< \brief LE set connection CTE receive parameters command complete */ +#define HCI_LE_SET_CONN_CTE_TX_PARAMS_CMD_CMPL_CBACK_EVT 64 /*!< \brief LE set connection CTE transmit parameters command complete */ +#define HCI_LE_CONN_CTE_REQ_ENABLE_CMD_CMPL_CBACK_EVT 65 /*!< \brief LE connection CTE request enable command complete */ +#define HCI_LE_CONN_CTE_RSP_ENABLE_CMD_CMPL_CBACK_EVT 66 /*!< \brief LE connection CTE response enable command complete */ +#define HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT 67 /*!< \brief LE read antenna information command complete */ +#define HCI_CIS_EST_CBACK_EVT 68 /*!< \brief CIS established event */ +#define HCI_CIS_REQ_CBACK_EVT 69 /*!< \brief CIS request event */ +#define HCI_REQ_PEER_SCA_CBACK_EVT 70 /*!< \brief Request peer SCA complete */ /**@}*/ /************************************************************************************************** @@ -251,6 +261,22 @@ typedef struct uint16_t syncHandle; /*!< \brief Sync handle. */ } hciLePerAdvSyncLostEvt_t; +/*! \brief LE periodic advertising sync transfer received */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t connHandle; /*!< \brief Connection handle. */ + uint16_t serviceData; /*!< \brief Service data. */ + uint16_t syncHandle; /*!< \brief Sync handle. */ + uint8_t advSid; /*!< \brief Advertising SID. */ + uint8_t advAddrType; /*!< \brief Advertiser address type. */ + bdAddr_t advAddr; /*!< \brief Advertiser address. */ + uint8_t advPhy; /*!< \brief Advertiser PHY. */ + uint16_t perAdvInterval; /*!< \brief Periodic advertising interval. */ + uint8_t clockAccuracy; /*!< \brief Advertiser clock accuracy. */ +} HciLePerAdvSyncTrsfRcvdEvt_t; + /*! \brief LE channel selection algorithm */ typedef struct { @@ -568,74 +594,166 @@ typedef struct uint8_t rxPhy; /*!< \brief Rx PHY. */ } hciLePhyUpdateEvt_t; -/*! \brief Read local version information complete event */ +/*! \brief LE periodic advertising sync transfer command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLePerAdvSyncTrsfCmdCmplEvt_t; + +/*! \brief LE set periodic advertising set info transfer command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLePerAdvSetInfoTrsfCmdCmplEvt_t; + +/*! \brief LE connection IQ report */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint16_t handle; /*!< \brief Connection handle. */ + uint8_t rxPhy; /*!< \brief Rx Phy. */ + uint8_t dataChIdx; /*!< \brief Data Channel Index. */ + int16_t rssi; /*!< \brief RSSI. */ + uint8_t rssiAntennaId; /*!< \brief RSSI Antenna ID. */ + uint8_t cteType; /*!< \brief CTE Type. */ + uint8_t slotDurations; /*!< \brief Slot Durations. */ + uint8_t pktStatus; /*!< \brief Packet Status. */ + uint16_t connEvtCnt; /*!< \brief Connection Event Counter. */ + uint8_t sampleCnt; /*!< \brief Sample Count. */ + int8_t *pISample; /*!< \brief List of I Samples. */ + int8_t *pQSample; /*!< \brief List of Q Samples. */ +} hciLeConnIQReportEvt_t; + +/*! \brief LE CTE request failed event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLeCteReqFailedEvt_t; + +/*! \brief LE set connection CTE receive parameters command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLeSetConnCteRxParamsCmdCmplEvt_t; + +/*! \brief LE set connection CTE transmit parameters command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLeSetConnCteTxParamsCmdCmplEvt_t; + +/*! \brief LE connection CTE request enable command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLeConnCteReqEnableCmdCmplEvt_t; + +/*! \brief LE connection CTE response enable command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint16_t handle; /*!< \brief Connection handle. */ +} hciLeConnCteRspEnableCmdCmplEvt_t; + +/*! \brief LE read antenna information command complete event */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + uint8_t status; /*!< \brief Status. */ + uint8_t switchSampleRates; /*!< \brief Supported Switching Sampling Rates. */ + uint8_t numAntennae; /*!< \brief Number of Antennae. */ + uint8_t switchPatternMaxLen; /*!< \brief Max Length of Switching Pattern. */ + uint8_t cteMaxLen; /*!< \brief Max CTE Length. */ +} hciLeReadAntennaInfoCmdCmplEvt_t; + +/*! \brief Local version information */ typedef struct { - wsfMsgHdr_t hdr; /*!< \brief Event header. */ - uint8_t status; /*!< \brief Status. */ uint8_t hciVersion; /*!< \brief HCI version. */ uint16_t hciRevision; /*!< \brief HCI revision. */ uint8_t lmpVersion; /*!< \brief LMP version. */ uint16_t manufacturerName; /*!< \brief Manufacturer name. */ uint16_t lmpSubversion; /*!< \brief LMP Sub-version. */ -} hciReadLocalVerInfo_t; +} hciLocalVerInfo_t; /*! \brief Union of all event types */ typedef union { - wsfMsgHdr_t hdr; /*!< \brief Event header. */ - wsfMsgHdr_t resetSeqCmpl; /*!< \brief Reset sequence complete. */ - hciLeConnCmplEvt_t leConnCmpl; /*!< \brief LE connection complete. */ - hciDisconnectCmplEvt_t disconnectCmpl; /*!< \brief Disconnect complete. */ - hciLeConnUpdateCmplEvt_t leConnUpdateCmpl; /*!< \brief LE connection update complete. */ - hciLeCreateConnCancelCmdCmplEvt_t leCreateConnCancelCmdCmpl; /*!< \brief LE create connection cancel command complete. */ - hciLeAdvReportEvt_t leAdvReport; /*!< \brief LE advertising report. */ - hciReadRssiCmdCmplEvt_t readRssiCmdCmpl; /*!< \brief Read RSSI command complete. */ - hciReadChanMapCmdCmplEvt_t readChanMapCmdCmpl; /*!< \brief Read channel map command complete. */ - hciReadTxPwrLvlCmdCmplEvt_t readTxPwrLvlCmdCmpl; /*!< \brief Read Tx power level command complete. */ - hciReadRemoteVerInfoCmplEvt_t readRemoteVerInfoCmpl; /*!< \brief Read remote version information complete. */ - hciLeReadRemoteFeatCmplEvt_t leReadRemoteFeatCmpl; /*!< \brief LE read remote feature complete. */ - hciLeLtkReqReplCmdCmplEvt_t leLtkReqReplCmdCmpl; /*!< \brief LE LTK request reply command complete. */ - hciLeLtkReqNegReplCmdCmplEvt_t leLtkReqNegReplCmdCmpl; /*!< \brief LE LT request negative reply command complete. */ - hciEncKeyRefreshCmpl_t encKeyRefreshCmpl; /*!< \brief Encryption key refresh complete. */ - hciEncChangeEvt_t encChange; /*!< \brief Encryption change. */ - hciLeLtkReqEvt_t leLtkReq; /*!< \brief LE LTK request. */ - hciVendorSpecCmdStatusEvt_t vendorSpecCmdStatus; /*!< \brief Vendor specific command status. */ - hciVendorSpecCmdCmplEvt_t vendorSpecCmdCmpl; /*!< \brief Vendor specific command complete. */ - hciVendorSpecEvt_t vendorSpec; /*!< \brief Vendor specific. */ - hciHwErrorEvt_t hwError; /*!< \brief Hardware error. */ - hciLeEncryptCmdCmplEvt_t leEncryptCmdCmpl; /*!< \brief LE encrypt command complete. */ - hciLeRandCmdCmplEvt_t leRandCmdCmpl; /*!< \brief LE random command complete. */ - hciLeReadPeerResAddrCmdCmplEvt_t leReadPeerResAddrCmdCmpl; /*!< \brief LE read peer resolvable address command complete. */ - hciLeReadLocalResAddrCmdCmplEvt_t leReadLocalResAddrCmdCmpl; /*!< \brief LE read local resolvable address command complete. */ - hciLeSetAddrResEnableCmdCmplEvt_t leSetAddrResEnableCmdCmpl; /*!< \brief LE set address resolution enable command complete. */ - hciLeAddDevToResListCmdCmplEvt_t leAddDevToResListCmdCmpl; /*!< \brief LE add device to resolving list command complete. */ - hciLeRemDevFromResListCmdCmplEvt_t leRemDevFromResListCmdCmpl; /*!< \brief LE remove device from resolving list command complete. */ - hciLeClearResListCmdCmplEvt_t leClearResListCmdCmpl; /*!< \brief LE clear resolving list command complete. */ - hciLeRemConnParamRepEvt_t leRemConnParamRepCmdCmpl; /*!< \brief LE Remo Connection Parameter Reply Command Complete. */ - hciLeRemConnParamNegRepEvt_t leRemConnParamNegRepCmdCmpl; /*!< \brief LE Remote Connection Parameter Negative Reply Command Complete. */ - hciLeReadDefDataLenEvt_t leReadDefDataLenCmdCmpl; /*!< \brief LE read default data length command complete. */ - hciLeWriteDefDataLenEvt_t leWriteDefDataLenCmdCmpl; /*!< \brief LE write default data length command complete. */ - hciLeSetDataLenEvt_t leSetDataLenCmdCmpl; /*!< \brief LE set data length command complete. */ - hciLeReadMaxDataLenEvt_t leReadMaxDataLenCmdCmpl; /*!< \brief LE read max data length command complete. */ - hciLeRemConnParamReqEvt_t leRemConnParamReq; /*!< \brief LE remote connection parameter request. */ - hciLeDataLenChangeEvt_t leDataLenChange; /*!< \brief LE data length change. */ - hciLeP256CmplEvt_t leP256; /*!< \brief LE P-256 */ - hciLeGenDhKeyEvt_t leGenDHKey; /*!< \brief LE generate Diffie-Hellman key. */ - hciWriteAuthPayloadToCmdCmplEvt_t writeAuthPayloadToCmdCmpl; /*!< \brief Write authenticated payload to command complete. */ - hciAuthPayloadToExpiredEvt_t authPayloadToExpired; /*!< \brief Authenticated payload to expired. */ - hciLeReadPhyCmdCmplEvt_t leReadPhyCmdCmpl; /*!< \brief LE read PHY command complete. */ - hciLeSetDefPhyCmdCmplEvt_t leSetDefPhyCmdCmpl; /*!< \brief LE set default PHY command complete. */ - hciLePhyUpdateEvt_t lePhyUpdate; /*!< \brief LE PHY update. */ - hciLeExtAdvReportEvt_t leExtAdvReport; /*!< \brief LE extended advertising report. */ - hciLeScanTimeoutEvt_t leScanTimeout; /*!< \brief LE scan timeout. */ - hciLeAdvSetTermEvt_t leAdvSetTerm; /*!< \brief LE advertising set terminated. */ - hciLeScanReqRcvdEvt_t leScanReqRcvd; /*!< \brief LE scan request received. */ - hciLePerAdvSyncEstEvt_t lePerAdvSyncEst; /*!< \brief LE periodic advertising synchronization established. */ - hciLePerAdvReportEvt_t lePerAdvReport; /*!< \brief LE periodic advertising report. */ - hciLePerAdvSyncLostEvt_t lePerAdvSyncLost; /*!< \brief LE periodic advertising synchronization lost. */ - hciLeChSelAlgoEvt_t leChSelAlgo; /*!< \brief LE channel select algorithm. */ - hciReadLocalVerInfo_t readLocalVerInfo; /*!< \brief Read local version information. */ + wsfMsgHdr_t hdr; /*!< \brief Event header. */ + wsfMsgHdr_t resetSeqCmpl; /*!< \brief Reset sequence complete. */ + hciLeConnCmplEvt_t leConnCmpl; /*!< \brief LE connection complete. */ + hciDisconnectCmplEvt_t disconnectCmpl; /*!< \brief Disconnect complete. */ + hciLeConnUpdateCmplEvt_t leConnUpdateCmpl; /*!< \brief LE connection update complete. */ + hciLeCreateConnCancelCmdCmplEvt_t leCreateConnCancelCmdCmpl; /*!< \brief LE create connection cancel command complete. */ + hciLeAdvReportEvt_t leAdvReport; /*!< \brief LE advertising report. */ + hciReadRssiCmdCmplEvt_t readRssiCmdCmpl; /*!< \brief Read RSSI command complete. */ + hciReadChanMapCmdCmplEvt_t readChanMapCmdCmpl; /*!< \brief Read channel map command complete. */ + hciReadTxPwrLvlCmdCmplEvt_t readTxPwrLvlCmdCmpl; /*!< \brief Read Tx power level command complete. */ + hciReadRemoteVerInfoCmplEvt_t readRemoteVerInfoCmpl; /*!< \brief Read remote version information complete. */ + hciLeReadRemoteFeatCmplEvt_t leReadRemoteFeatCmpl; /*!< \brief LE read remote feature complete. */ + hciLeLtkReqReplCmdCmplEvt_t leLtkReqReplCmdCmpl; /*!< \brief LE LTK request reply command complete. */ + hciLeLtkReqNegReplCmdCmplEvt_t leLtkReqNegReplCmdCmpl; /*!< \brief LE LT request negative reply command complete. */ + hciEncKeyRefreshCmpl_t encKeyRefreshCmpl; /*!< \brief Encryption key refresh complete. */ + hciEncChangeEvt_t encChange; /*!< \brief Encryption change. */ + hciLeLtkReqEvt_t leLtkReq; /*!< \brief LE LTK request. */ + hciVendorSpecCmdStatusEvt_t vendorSpecCmdStatus; /*!< \brief Vendor specific command status. */ + hciVendorSpecCmdCmplEvt_t vendorSpecCmdCmpl; /*!< \brief Vendor specific command complete. */ + hciVendorSpecEvt_t vendorSpec; /*!< \brief Vendor specific. */ + hciHwErrorEvt_t hwError; /*!< \brief Hardware error. */ + hciLeEncryptCmdCmplEvt_t leEncryptCmdCmpl; /*!< \brief LE encrypt command complete. */ + hciLeRandCmdCmplEvt_t leRandCmdCmpl; /*!< \brief LE random command complete. */ + hciLeReadPeerResAddrCmdCmplEvt_t leReadPeerResAddrCmdCmpl; /*!< \brief LE read peer resolvable address command complete. */ + hciLeReadLocalResAddrCmdCmplEvt_t leReadLocalResAddrCmdCmpl; /*!< \brief LE read local resolvable address command complete. */ + hciLeSetAddrResEnableCmdCmplEvt_t leSetAddrResEnableCmdCmpl; /*!< \brief LE set address resolution enable command complete. */ + hciLeAddDevToResListCmdCmplEvt_t leAddDevToResListCmdCmpl; /*!< \brief LE add device to resolving list command complete. */ + hciLeRemDevFromResListCmdCmplEvt_t leRemDevFromResListCmdCmpl; /*!< \brief LE remove device from resolving list command complete. */ + hciLeClearResListCmdCmplEvt_t leClearResListCmdCmpl; /*!< \brief LE clear resolving list command complete. */ + hciLeRemConnParamRepEvt_t leRemConnParamRepCmdCmpl; /*!< \brief LE Remo Connection Parameter Reply Command Complete. */ + hciLeRemConnParamNegRepEvt_t leRemConnParamNegRepCmdCmpl; /*!< \brief LE Remote Connection Parameter Negative Reply Command Complete. */ + hciLeReadDefDataLenEvt_t leReadDefDataLenCmdCmpl; /*!< \brief LE read default data length command complete. */ + hciLeWriteDefDataLenEvt_t leWriteDefDataLenCmdCmpl; /*!< \brief LE write default data length command complete. */ + hciLeSetDataLenEvt_t leSetDataLenCmdCmpl; /*!< \brief LE set data length command complete. */ + hciLeReadMaxDataLenEvt_t leReadMaxDataLenCmdCmpl; /*!< \brief LE read max data length command complete. */ + hciLeRemConnParamReqEvt_t leRemConnParamReq; /*!< \brief LE remote connection parameter request. */ + hciLeDataLenChangeEvt_t leDataLenChange; /*!< \brief LE data length change. */ + hciLeP256CmplEvt_t leP256; /*!< \brief LE P-256 */ + hciLeGenDhKeyEvt_t leGenDHKey; /*!< \brief LE generate Diffie-Hellman key. */ + hciWriteAuthPayloadToCmdCmplEvt_t writeAuthPayloadToCmdCmpl; /*!< \brief Write authenticated payload to command complete. */ + hciAuthPayloadToExpiredEvt_t authPayloadToExpired; /*!< \brief Authenticated payload to expired. */ + hciLeReadPhyCmdCmplEvt_t leReadPhyCmdCmpl; /*!< \brief LE read PHY command complete. */ + hciLeSetDefPhyCmdCmplEvt_t leSetDefPhyCmdCmpl; /*!< \brief LE set default PHY command complete. */ + hciLePhyUpdateEvt_t lePhyUpdate; /*!< \brief LE PHY update. */ + hciLeExtAdvReportEvt_t leExtAdvReport; /*!< \brief LE extended advertising report. */ + hciLeScanTimeoutEvt_t leScanTimeout; /*!< \brief LE scan timeout. */ + hciLeAdvSetTermEvt_t leAdvSetTerm; /*!< \brief LE advertising set terminated. */ + hciLeScanReqRcvdEvt_t leScanReqRcvd; /*!< \brief LE scan request received. */ + hciLePerAdvSyncEstEvt_t lePerAdvSyncEst; /*!< \brief LE periodic advertising synchronization established. */ + hciLePerAdvReportEvt_t lePerAdvReport; /*!< \brief LE periodic advertising report. */ + hciLePerAdvSyncLostEvt_t lePerAdvSyncLost; /*!< \brief LE periodic advertising synchronization lost. */ + hciLeChSelAlgoEvt_t leChSelAlgo; /*!< \brief LE channel select algorithm. */ + HciLePerAdvSyncTrsfRcvdEvt_t lePerAdvSyncTrsfRcvd; /*!< \brief LE periodic advertising sync transfer received. */ + hciLePerAdvSyncTrsfCmdCmplEvt_t lePerAdvSyncTrsfCmdCmpl; /*!< \brief LE periodic advertising sync transfer command complete. */ + hciLePerAdvSetInfoTrsfCmdCmplEvt_t lePerAdvSetInfoTrsfCmdCmpl; /*!< \brief LE set periodic advertising set info transfer command complete. */ + hciLeConnIQReportEvt_t leConnIQReport; /*!< \brief LE connection IQ report. */ + hciLeCteReqFailedEvt_t leCteReqFailed; /*!< \brief LE CTE request failed. */ + hciLeSetConnCteRxParamsCmdCmplEvt_t leSetConnCteRxParamsCmdCmpl; /*!< \brief LE set connection CTE receive parameters command complete. */ + hciLeSetConnCteTxParamsCmdCmplEvt_t leSetConnCteTxParamsCmdCmpl; /*!< \brief LE set connection CTE transmit parameters command complete. */ + hciLeConnCteReqEnableCmdCmplEvt_t leConnCteReqEnableCmdCmpl; /*!< \brief LE connection CTE request enable command complete. */ + hciLeConnCteRspEnableCmdCmplEvt_t leConnCteRspEnableCmdCmpl; /*!< \brief LE connection CTE response enable command complete. */ + hciLeReadAntennaInfoCmdCmplEvt_t leReadAntennaInfoCmdCmpl; /*!< \brief LE read antenna information command complete. */ } hciEvt_t; /*! \} */ /* STACK_HCI_EVT_API */ @@ -821,8 +939,6 @@ void HciResetSequence(void); /*************************************************************************************************/ /*! - * \fn HciVsInit - * * \brief Vendor-specific controller initialization function. * * \param param Vendor-specific parameter. @@ -832,35 +948,6 @@ void HciResetSequence(void); /*************************************************************************************************/ void HciVsInit(uint8_t param); -/*************************************************************************************************/ -/*! - * \fn HciVsSetFeatures - * - * \brief Set link layer features to be reported by link layer. - * - * \param features Byte array containing features - * to be reported as being supported by the link layer. - * \param featuresMask Pointer to new feature mask set buffer. - * Should be 8 bytes in length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsSetFeatures(const uint8_t *features, const uint8_t *featuresMask); - -/*************************************************************************************************/ -/*! - * \fn HciVsSetTxPower - * - * \brief Vendor-specific set power level. - * - * \param param power level in dBm. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsSetTxPower(int8_t power); - /*************************************************************************************************/ /*! * \brief HCI core initialization. @@ -915,7 +1002,7 @@ void HciSetAclQueueWatermarks(uint8_t queueHi, uint8_t queueLo); * \return None. */ /*************************************************************************************************/ -void HciSetLeSupFeat(uint16_t feat, bool_t flag); +void HciSetLeSupFeat(uint32_t feat, bool_t flag); /**@}*/ /*************************************************************************************************/ @@ -1002,7 +1089,7 @@ uint8_t *HciGetSupStates(void); * \return Supported features. */ /*************************************************************************************************/ -uint16_t HciGetLeSupFeat(void); +uint32_t HciGetLeSupFeat(void); /*************************************************************************************************/ /*! @@ -1069,21 +1156,12 @@ uint8_t HciGetPerAdvListSize(void); /*************************************************************************************************/ /*! - * \brief Return the default data length. + * \brief Return a pointer to the local version information. * - * \return default data length. + * \return Pointer to the local version information. */ /*************************************************************************************************/ -void HciLeGetDefDataLen(uint16_t *txOctets, uint16_t *txTime); - -/*************************************************************************************************/ -/*! - * \brief Return the maximum data length. - * - * \return maximum data length. - */ -/*************************************************************************************************/ -void HciLeGetMaxDataLen(uint16_t *txOctets, uint16_t *txTime, uint16_t *rxOctets, uint16_t *rxTime); +hciLocalVerInfo_t *HciGetLocalVerInfo(void); /**@}*/ /*! \} */ /* STACK_HCI_OPT_API */ @@ -1809,6 +1887,19 @@ void HciLeReadLocalP256PubKey(void); /*************************************************************************************************/ void HciLeGenerateDHKey(uint8_t *pPubKeyX, uint8_t *pPubKeyY); +/*************************************************************************************************/ +/*! + * \brief HCI LE Generate DH Key Version 2. + * + * \param pPubKeyX Public key X-coordinate. + * \param pPubKeyY Public key Y-coordinate. + * \param keyType Key type. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeGenerateDHKeyV2(uint8_t *pPubKeyX, uint8_t *pPubKeyY, uint8_t keyType); + /*************************************************************************************************/ /*! * \brief HCI LE Read Maximum Data Length. @@ -2065,7 +2156,7 @@ void HciLeExtCreateConnCmd(hciExtInitParam_t *pInitParam, hciExtInitScanParam_t /*! * \brief HCI LE periodic advertising create sync command. * - * \param filterPolicy Filter policy. + * \param options options. * \param advSid Advertising SID. * \param advAddrType Advertiser address type. * \param pAdvAddr Advertiser address. @@ -2077,7 +2168,7 @@ void HciLeExtCreateConnCmd(hciExtInitParam_t *pInitParam, hciExtInitScanParam_t * \return None. */ /*************************************************************************************************/ -void HciLePerAdvCreateSyncCmd(uint8_t filterPolicy, uint8_t advSid, uint8_t advAddrType, +void HciLePerAdvCreateSyncCmd(uint8_t options, uint8_t advSid, uint8_t advAddrType, uint8_t *pAdvAddr, uint16_t skip, uint16_t syncTimeout, uint8_t unused); /*************************************************************************************************/ @@ -2143,6 +2234,145 @@ void HciLeClearPerAdvListCmd(void); */ /*************************************************************************************************/ void HciLeReadPerAdvListSizeCmd(void); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising receive enable command. + * + * \param syncHandle Periodic sync handle. + * \param enable TRUE to enable reports, FALSE to disable reports. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvRcvEnableCmd(uint16_t syncHandle, uint8_t enable); + +/*************************************************************************************************/ +/*! + * \brief HCI LE periodic advertising sync transfer command. + * + * \param connHandle Connection handle. + * \param serviceData Service data provided by the host. + * \param syncHandle Periodic sync handle. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvSyncTrsfCmd(uint16_t connHandle, uint16_t serviceData, uint16_t syncHandle); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising set info transfer command. + * + * \param connHandle Connection handle. + * \param serviceData Service data provided by the host. + * \param advHandle Handle to identify an advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvSetInfoTrsfCmd(uint16_t connHandle, uint16_t serviceData, uint8_t advHandle); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising sync transfer parameters command. + * + * \param connHandle Connection handle. + * \param mode Periodic sync advertising sync transfer mode. + * \param skip The number of periodic advertising packets that can be skipped after + * a successful receive. + * \param syncTimeout Synchronization timeout for the periodic advertising. + * \param cteType Constant tone extension type(Used in AoD/AoA). + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvSyncTrsfParamsCmd(uint16_t connHandle, uint8_t mode, uint16_t skip, + uint16_t syncTimeout, uint8_t cteType); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set default periodic advertising sync transfer parameters command. + * + * \param mode Periodic sync advertising sync transfer mode. + * \param skip The number of periodic advertising packets that can be skipped after + * a successful receive. + * \param syncTimeout Synchronization timeout for the periodic advertising. + * \param cteType Constant tone extension type(Used in AoD/AoA). + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetDefaultPerAdvSyncTrsfParamsCmd(uint8_t mode, uint16_t skip, uint16_t syncTimeout, + uint8_t cteType); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set connection CTE receive parameters command. + * + * \param connHandle Connection handle. + * \param samplingEnable TRUE to enable Connection IQ sampling, FALSE to disable it. + * \param slotDurations Switching and sampling slot durations to be used while receiving CTE. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetConnCteRxParamsCmd(uint16_t connHandle, uint8_t samplingEnable, uint8_t slotDurations, + uint8_t switchPatternLen, uint8_t *pAntennaIDs); + +/*************************************************************************************************/ +/*! + * \brief HCI LE set connection CTE transmit parameters command. + * + * \param connHandle Connection handle. + * \param cteTypeBits Permitted CTE type bits used for transmitting CTEs requested by peer. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetConnCteTxParamsCmd(uint16_t connHandle, uint8_t cteTypeBits, uint8_t switchPatternLen, + uint8_t *pAntennaIDs); + +/*************************************************************************************************/ +/*! + * \brief HCI LE connection CTE request enable command. + * + * \param connHandle Connection handle. + * \param enable TRUE to enable CTE request for connection, FALSE to disable it. + * \param cteReqInt CTE request interval. + * \param reqCteLen Minimum length of CTE being requested in 8 us units. + * \param reqCteType Requested CTE type. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeConnCteReqEnableCmd(uint16_t connHandle, uint8_t enable, uint16_t cteReqInt, + uint8_t reqCteLen, uint8_t reqCteType); + +/*************************************************************************************************/ +/*! + * \brief HCI LE connection CTE response enable command. + * + * \param connHandle Connection handle. + * \param enable TRUE to enable CTE response for connection, FALSE to disable it. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeConnCteRspEnableCmd(uint16_t connHandle, uint8_t enable); + +/*************************************************************************************************/ +/*! + * \brief HCI LE read antenna information command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadAntennaInfoCmd(void); /**@}*/ /*! \} */ /* STACK_HCI_CMD_API */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_cmd.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_cmd.h similarity index 77% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_cmd.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_cmd.h index 0fbe9b43f959ac07b4e93f65304288271e5210e3..65dbbd44234d87a1a90a818471e5991ec01a4e33 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_cmd.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_cmd.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI command module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module. */ /*************************************************************************************************/ #ifndef HCI_CMD_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_core.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_core.h similarity index 64% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_core.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_core.h index 2ad368688bc1c9e1d54bc8535222ef32d0ce27b9..4840f5c3ce36bdc6d8977bed5a8d78159b39dc54 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_core.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_core.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI core interfaces. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI core interfaces. */ /*************************************************************************************************/ #ifndef HCI_CORE_H @@ -43,42 +46,43 @@ typedef void(*hciResetSeq_t)(uint8_t *pMsg, uint16_t opcode); /*! \brief Per-connection structure for ACL packet accounting */ typedef struct { - uint8_t *pTxAclPkt; /*!< \brief Fragmenting TX ACL packet pointer */ - uint8_t *pNextTxFrag; /*!< \brief Next TX ACL packet fragment */ - uint8_t *pRxAclPkt; /*!< \brief RX ACL packet pointer */ - uint8_t *pNextRxFrag; /*!< \brief Next RX ACL packet fragment */ - uint16_t handle; /*!< \brief Connection handle */ - uint16_t txAclRemLen; /*!< \brief Fragmenting TX ACL packet remaining length */ - uint16_t rxAclRemLen; /*!< \brief Fragmented RX ACL packet remaining length */ - bool_t fragmenting; /*!< \brief TRUE if fragmenting a TX ACL packet */ - bool_t flowDisabled; /*!< \brief TRUE if data flow disabled */ - uint8_t queuedBufs; /*!< \brief Queued ACL buffers on this connection */ - uint8_t outBufs; /*!< \brief Outstanding ACL buffers sent to controller */ + uint8_t *pTxAclPkt; /*!< \brief Fragmenting TX ACL packet pointer */ + uint8_t *pNextTxFrag; /*!< \brief Next TX ACL packet fragment */ + uint8_t *pRxAclPkt; /*!< \brief RX ACL packet pointer */ + uint8_t *pNextRxFrag; /*!< \brief Next RX ACL packet fragment */ + uint16_t handle; /*!< \brief Connection handle */ + uint16_t txAclRemLen; /*!< \brief Fragmenting TX ACL packet remaining length */ + uint16_t rxAclRemLen; /*!< \brief Fragmented RX ACL packet remaining length */ + bool_t fragmenting; /*!< \brief TRUE if fragmenting a TX ACL packet */ + bool_t flowDisabled; /*!< \brief TRUE if data flow disabled */ + uint8_t queuedBufs; /*!< \brief Queued ACL buffers on this connection */ + uint8_t outBufs; /*!< \brief Outstanding ACL buffers sent to controller */ } hciCoreConn_t; /*! \brief Main control block for dual-chip implementation */ typedef struct { - hciCoreConn_t conn[DM_CONN_MAX]; /*!< \brief Connection structures */ - uint8_t leStates[HCI_LE_STATES_LEN]; /*!< \brief Controller LE supported states */ - bdAddr_t bdAddr; /*!< \brief Bluetooth device address */ - wsfQueue_t aclQueue; /*!< \brief HCI ACL TX queue */ - hciCoreConn_t *pConnRx; /*!< \brief Connection struct for current transport RX packet */ - uint16_t maxRxAclLen; /*!< \brief Maximum reassembled RX ACL packet length */ - uint16_t bufSize; /*!< \brief Controller ACL data buffer size */ - uint8_t aclQueueHi; /*!< \brief Disable flow when this many ACL buffers queued */ - uint8_t aclQueueLo; /*!< \brief Enable flow when this many ACL buffers queued */ - uint8_t availBufs; /*!< \brief Current avail ACL data buffers */ - uint8_t numBufs; /*!< \brief Controller number of ACL data buffers */ - uint8_t whiteListSize; /*!< \brief Controller white list size */ - uint8_t numCmdPkts; /*!< \brief Controller command packed count */ - uint16_t leSupFeat; /*!< \brief Controller LE supported features */ - int8_t advTxPwr; /*!< \brief Controller advertising TX power */ - uint8_t resListSize; /*!< \brief Controller resolving list size */ - uint16_t maxAdvDataLen; /*!< \brief Controller maximum advertisement (or scan response) data length */ - uint8_t numSupAdvSets; /*!< \brief Controller maximum number of advertising sets */ - uint8_t perAdvListSize; /*!< \brief Controller periodic advertising list size */ - hciResetSeq_t extResetSeq; /*!< \brief HCI extended reset sequence callback */ + hciCoreConn_t conn[DM_CONN_MAX]; /*!< \brief Connection structures */ + uint8_t leStates[HCI_LE_STATES_LEN]; /*!< \brief Controller LE supported states */ + bdAddr_t bdAddr; /*!< \brief Bluetooth device address */ + wsfQueue_t aclQueue; /*!< \brief HCI ACL TX queue */ + hciCoreConn_t *pConnRx; /*!< \brief Connection struct for current transport RX packet */ + uint16_t maxRxAclLen; /*!< \brief Maximum reassembled RX ACL packet length */ + uint16_t bufSize; /*!< \brief Controller ACL data buffer size */ + uint8_t aclQueueHi; /*!< \brief Disable flow when this many ACL buffers queued */ + uint8_t aclQueueLo; /*!< \brief Enable flow when this many ACL buffers queued */ + uint8_t availBufs; /*!< \brief Current avail ACL data buffers */ + uint8_t numBufs; /*!< \brief Controller number of ACL data buffers */ + uint8_t whiteListSize; /*!< \brief Controller white list size */ + uint8_t numCmdPkts; /*!< \brief Controller command packed count */ + uint32_t leSupFeat; /*!< \brief Controller LE supported features */ + int8_t advTxPwr; /*!< \brief Controller advertising TX power */ + uint8_t resListSize; /*!< \brief Controller resolving list size */ + uint16_t maxAdvDataLen; /*!< \brief Controller maximum advertisement (or scan response) data length */ + uint8_t numSupAdvSets; /*!< \brief Controller maximum number of advertising sets */ + uint8_t perAdvListSize; /*!< \brief Controller periodic advertising list size */ + hciLocalVerInfo_t locVerInfo; /*!< \brief Controller version information */ + hciResetSeq_t extResetSeq; /*!< \brief HCI extended reset sequence callback */ } hciCoreCb_t; /************************************************************************************************** @@ -98,7 +102,7 @@ extern const uint8_t hciLeEventMask[HCI_LE_EVT_MASK_LEN]; extern const uint8_t hciEventMaskPage2[HCI_EVT_MASK_LEN]; /*! \brief LE supported features configuration mask */ -extern uint16_t hciLeSupFeatCfg; +extern uint32_t hciLeSupFeatCfg; /************************************************************************************************** Function Declarations diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_drv.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_drv.h similarity index 74% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_drv.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_drv.h index a0093c727c3ec79ba419064a2daab44b8853aec4..a4478ccf3c806b1ed1c33860ff902cf0eec792c6 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_drv.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_drv.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI driver interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2012-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI driver interface. */ /*************************************************************************************************/ #ifndef HCI_DRV_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_evt.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_evt.h similarity index 79% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_evt.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_evt.h index d780034c152fd5b9e9b313e83921f1d935994901..8432f101934c7ba7c30bffe42466b215e70a41a8 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_evt.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_evt.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI event module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI event module. */ /*************************************************************************************************/ #ifndef HCI_EVT_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_handler.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_handler.h similarity index 69% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_handler.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_handler.h index a07f9078140b2864524aa669976bff708d735598..7bd5704b7f2cd02b5b5a7f34c7e1892f2100a008 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_handler.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_handler.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Interface to HCI event handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Interface to HCI event handler. */ /*************************************************************************************************/ #ifndef HCI_HANDLER_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_tr.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_tr.h similarity index 65% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/hci_tr.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_tr.h index d8ed051040f4de955ee1b6fd6db6fdc96b2373cc..a43ad956ae5c6b7850ddd6604335d2d236aebd65 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/hci_tr.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/hci_tr.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI transport interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI transport interface. */ /*************************************************************************************************/ #ifndef HCI_TR_H @@ -50,18 +53,6 @@ void hciTrSendAclData(void *pContext, uint8_t *pAclData); /*************************************************************************************************/ void hciTrSendCmd(uint8_t *pCmdData); -/*************************************************************************************************/ -/*! - * \brief Receive function. Gets called by external code when bytes are received. - * - * \param pBuf Pointer to buffer of incoming bytes. - * \param len Number of bytes in incoming buffer. - * - * \return None. - */ -/*************************************************************************************************/ -void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len); - /*************************************************************************************************/ /*! * \brief Initialize HCI transport resources. diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_api.h similarity index 92% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_api.h index b67818439dc2062a44d1e0405867cb79c472bb1a..cadf317f4fb086ad125fc2c0860f1801671d51c3 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief L2CAP subsystem API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP subsystem API. */ /*************************************************************************************************/ #ifndef L2C_API_H @@ -47,6 +50,9 @@ extern "C" { /*! \brief Invalid channel ID for connection oriented channels */ #define L2C_COC_CID_NONE 0 +/*! \brief Invalid signal identifier */ +#define L2C_SIGNAL_ID_INVALID 0 + /** \name L2CAP COC Channel Roles * Connection oriented channel initiator/acceptor role */ @@ -305,6 +311,20 @@ void L2cRegister(uint16_t cid, l2cDataCback_t dataCback, l2cCtrlCback_t ctrlCbac /*************************************************************************************************/ void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket); +/*************************************************************************************************/ +/*! +* \brief Build and send a signaling packet. +* +* \param handle The connection handle. +* \param code Type of command. +* \param len Length of the parameter. +* \param pParam parameters of command to send. +* +* \return None. +*/ +/*************************************************************************************************/ +void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam); + /**@}*/ /** \name L2CAP COC Functions diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_defs.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_defs.h similarity index 89% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_defs.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_defs.h index d5cfefd1228a027d00cf45f056c85c73665cf56e..d5e111c4eb1044d2f01d2a394c46edda70539dd3 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_defs.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_defs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief L2CAP constants and definitions from the Bluetooth specification. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP constants and definitions from the Bluetooth specification. */ /*************************************************************************************************/ #ifndef L2C_DEFS_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_handler.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_handler.h similarity index 77% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_handler.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_handler.h index bae72d37e369bb3534de8ded611edb53307cc5a5..4507104ab4476ec98370fb1dccf96fe321067722 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/l2c_handler.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/l2c_handler.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief L2CAP handler interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP handler interface. */ /*************************************************************************************************/ #ifndef L2C_HANDLER_H diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/include/sec_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/sec_api.h new file mode 100644 index 0000000000000000000000000000000000000000..398b9e57e767d1897b4f0e91aa6c76f9b4a80acd --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/sec_api.h @@ -0,0 +1,385 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief AES and random number security service API. + */ +/*************************************************************************************************/ +#ifndef SEC_API_H +#define SEC_API_H + +#include "wsf_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup STACK_SECURITY_API + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief CMAC algorithm key length. */ +#define SEC_CMAC_KEY_LEN 16 + +/*! \brief CMAC algorithm result length. */ +#define SEC_CMAC_HASH_LEN 16 + +/*! \brief ECC algorithm key length. */ +#define SEC_ECC_KEY_LEN 32 + +/** \name CCM-Mode algorithm lengths + * + */ +/**@{*/ +#define SEC_CCM_KEY_LEN 16 +#define SEC_CCM_MAX_ADDITIONAL_LEN ((1<<16) - (1<<8)) +#define SEC_CCM_L 2 +#define SEC_CCM_NONCE_LEN (15-SEC_CCM_L) +/**@}*/ + +/*! \brief Invalid AES Token. */ +#define SEC_TOKEN_INVALID 0xFF + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief AES Security callback parameters structure. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header. */ + uint8_t *pCiphertext; /*!< Pointer to 16 bytes of ciphertext data. */ +} secAes_t; + +/*! \brief CMAC Security callback parameters structure. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header. */ + uint8_t *pCiphertext; /*!< Pointer to 16 bytes of ciphertext data. */ + uint8_t *pPlainText; /*!< Pointer to pPlaintext parameter passed to SecCmac. */ +} secCmacMsg_t; + +/*! \brief CCM-Mode encrypt callback parameters structure. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header. */ + uint8_t *pCiphertext; /*!< Pointer to ciphertext data. */ + uint16_t textLen; /*!< Length of pCiphertext in bytes. */ +} secCcmEncMsg_t; + +/*! \brief CCM-Mode decrypt and authenticate callback parameters structure. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header. */ + uint8_t *pText; /*!< Pointer to decrypted text within result buffer. */ + uint8_t *pResult; /*!< Pointer to result buffer (passed into SecCcmDec). */ + uint16_t textLen; /*!< Length of pText in bytes. */ + bool_t success; /*!< TRUE if message is authenticated. */ +} secCcmDecMsg_t; + +/*! \brief Generic security callback parameters structure. */ +typedef union +{ + wsfMsgHdr_t hdr; /*!< Header. */ + secAes_t aes; /*!< AES complete message. */ + secCmacMsg_t cmac; /*!< CMAC complete message. */ + secCcmEncMsg_t ccmEnc; /*!< CCM-Mode Encrypt complete message. */ + secCcmDecMsg_t ccmDec; /*!< CCM-Mode Decrypt complete message. */ +} secMsg_t; + +/*! \brief ECC Security public/private key pair. */ +typedef struct +{ + uint8_t pubKey_x[SEC_ECC_KEY_LEN]; /*!< x component of ECC public key. */ + uint8_t pubKey_y[SEC_ECC_KEY_LEN]; /*!< y component of ECC public key. */ + uint8_t privKey[SEC_ECC_KEY_LEN]; /*!< ECC private key. */ +} secEccKey_t; + +/*! \brief ECC security DH Key shared secret. */ +typedef struct +{ + uint8_t secret[SEC_ECC_KEY_LEN]; /*!< DH Key Shared secret. */ +} secEccSharedSec_t; + + +/*! \brief ECC Security callback parameters structure. */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header. */ + union + { + secEccSharedSec_t sharedSecret; /*!< Shared secret. */ + secEccKey_t key; /*!< ECC public/private key pair. */ + bool_t keyValid; /*!< TRUE if ECC public/private key pair is valid. */ + } data; /*!< ECC message data union. */ +} secEccMsg_t; + +/*! \brief Block encryption function. */ +typedef void (*SecBlkEncFunc_t)(uint8_t *pKey, uint8_t *pMessage, void *pParam); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/** \name Security Initialization Functions + * + */ +/**@{*/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the security service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize the random number service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecRandInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize the AES service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecAesInit(void); + +/*************************************************************************************************/ +/*! + * \brief Initialize the AES (reverse) service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecAesRevInit(void); + +/*************************************************************************************************/ +/*! + * \brief Called to initialize CMAC security. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecCmacInit(void); + +/*************************************************************************************************/ +/*! + * \brief Called to initialize CCM security. + * + * \return None. + */ +/*************************************************************************************************/ +void SecCcmInit(void); + +/*************************************************************************************************/ +/*! + * \brief Called to initialize ECC security. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecEccInit(void); + +/**@}*/ + +/** \name Security AES, CMAC and CCM Functions + * + */ +/**@{*/ + +/*************************************************************************************************/ +/*! + * \brief Execute an AES calculation. When the calculation completes, a WSF message will be + * sent to the specified handler. This function returns a token value that + * the client can use to match calls to this function with messages. + * + * \param pKey Pointer to 16 byte key. + * \param pPlaintext Pointer to 16 byte plaintext. + * \param handlerId WSF handler ID. + * \param param Client-defined parameter returned in message. + * \param event Event for client's WSF handler. + * + * \return Token value. + */ +/*************************************************************************************************/ +uint8_t SecAes(uint8_t *pKey, uint8_t *pPlaintext, wsfHandlerId_t handlerId, + uint16_t param, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Execute an AES calculation. When the calculation completes, a WSF message will be + * sent to the specified handler. This function returns a token value that + * the client can use to match calls to this function with messages. Note this version + * reverses the key and plaintext bytes. + * + * \param pKey Pointer to 16 byte key. + * \param pPlaintext Pointer to 16 byte plaintext. + * \param handlerId WSF handler ID. + * \param param Client-defined parameter returned in message. + * \param event Event for client's WSF handler. + * + * \return Token value. + */ +/*************************************************************************************************/ +uint8_t SecAesRev(uint8_t *pKey, uint8_t *pPlaintext, wsfHandlerId_t handlerId, + uint16_t param, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Execute the CMAC algorithm. + * + * \param pKey Key used in CMAC operation. + * \param pPlaintext Plain text buffer - buffer must persist until secCmacMsg_t callback. + * \param textLen Size of pPlaintext in bytes. + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCmac(const uint8_t *pKey, uint8_t *pPlaintext, uint16_t textLen, wsfHandlerId_t handlerId, + uint16_t param, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Execute the CCM-Mode encryption algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pPlainText Pointer to text to encrypt. + * \param textLen Length of pPlainText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmEnc(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult, + wsfHandlerId_t handlerId, uint16_t param, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Execute the CCM-Mode verify and decrypt algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pCypherText Pointer to text to decrypt. + * \param textLen Length of pCypherText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param pMic Pointer to authentication digest. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmDec(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen, + uint8_t *pResult, wsfHandlerId_t handlerId, uint16_t param, uint8_t event); + +/**@}*/ + +/** \name Security ECC Functions + * + */ +/**@{*/ + +/*************************************************************************************************/ +/*! + * \brief Generate an ECC key. + * + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecEccGenKey(wsfHandlerId_t handlerId, uint16_t param, uint8_t event); + +/*************************************************************************************************/ +/*! + * \brief Generate an ECC key. + * + * \param pKey ECC Key structure. + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecEccGenSharedSecret(secEccKey_t *pKey, wsfHandlerId_t handlerId, uint16_t param, uint8_t event); + +/**@}*/ + +/** \name Security Random Number Generator Functions + * + */ +/**@{*/ + +/*************************************************************************************************/ +/*! + * \brief This function returns up to 16 bytes of random data to a buffer provided by the + * client. + * + * \param pRand Pointer to returned random data. + * \param randLen Length of random data. + * + * \return None. + */ +/*************************************************************************************************/ +void SecRand(uint8_t *pRand, uint8_t randLen); + +/**@}*/ + +/*! \} */ /* STACK_SECURITY_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* SEC_API_H */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_api.h similarity index 78% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/smp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_api.h index d05dc864d1f9aab6bccb7300deb20b2d07976264..b9867e8c70982e6ec21e8ebfe91112b5b7ebb1d2 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_api.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief SMP subsystem API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP subsystem API. */ /*************************************************************************************************/ #ifndef SMP_API_H @@ -55,7 +58,8 @@ enum SMP_MSG_INT_SEND_NEXT_KEY, /*!< \brief Send next key to be distributed */ SMP_MSG_INT_MAX_ATTEMPTS, /*!< \brief Maximum pairing attempts reached */ SMP_MSG_INT_PAIRING_CMPL, /*!< \brief Pairing complete */ - SMP_MSG_INT_TIMEOUT, /*!< \brief Pairing protocol timeout */ + SMP_MSG_INT_RSP_TIMEOUT, /*!< \brief Pairing protocol response timeout */ + SMP_MSG_INT_WI_TIMEOUT, /*!< \brief Pairing protocol wait interval timeout */ SMP_MSG_INT_LESC, /*!< \brief Pair with Secure Connections */ SMP_MSG_INT_LEGACY, /*!< \brief Pair with Legacy Security */ SMP_MSG_INT_JW_NC, /*!< \brief LESC Just-Works/Numeric Comparison pairing */ @@ -68,12 +72,20 @@ enum SMP_MSG_INT_PK_NEXT, /*!< \brief Continue to next passkey bit */ SMP_MSG_INT_PK_CMPL, /*!< \brief Passkey operation complete */ SMP_MSG_WSF_CMAC_CMPL, /*!< \brief WSF CMAC operation complete */ - SMP_MSG_DH_CHECK_FAILURE, /*!< \brief WSF CMAC operation complete */ + SMP_MSG_DH_CHECK_FAILURE, /*!< \brief DHKey check failure */ SMP_MSG_EARLY_CNF, /*!< \brief An early Confirm from the initiator in passkey pairing */ SMP_NUM_MSGS /*!< \brief Number of SMP message types. */ }; /**@}*/ +/**@{*/ +/*! \brief Additional SMP messages */ +enum +{ + SMP_DB_SERVICE_IND = SMP_NUM_MSGS /*!< \brief SMP DB Service timer indication */ +}; +/**@}*/ + /************************************************************************************************** Data Types **************************************************************************************************/ @@ -81,12 +93,15 @@ enum /*! \brief Configurable parameters */ typedef struct { - uint16_t attemptTimeout; /*!< \brief 'Repeated attempts' timeout in msec */ + uint32_t attemptTimeout; /*!< \brief 'Repeated attempts' timeout in msec */ uint8_t ioCap; /*!< \brief I/O Capability */ uint8_t minKeyLen; /*!< \brief Minimum encryption key length */ uint8_t maxKeyLen; /*!< \brief Maximum encryption key length */ uint8_t maxAttempts; /*!< \brief Attempts to trigger 'repeated attempts' timeout */ uint8_t auth; /*!< \brief Device authentication requirements */ + uint32_t maxAttemptTimeout; /*!< \brief Maximum 'Repeated attempts' timeout in msec */ + uint32_t attemptDecTimeout; /*!< \brief Time msec before attemptExp decreases */ + uint16_t attemptExp; /*!< \brief Exponent to raise attemptTimeout on maxAttempts */ } smpCfg_t; /*! \brief Data type for SMP_MSG_API_PAIR_REQ and SMP_MSG_API_PAIR_RSP */ @@ -249,6 +264,39 @@ void SmpDmEncryptInd(wsfMsgHdr_t *pMsg); /*************************************************************************************************/ uint8_t *SmpDmGetStk(dmConnId_t connId, uint8_t *pSecLevel); +/*************************************************************************************************/ +/*! + * \brief Format a cancel message with consideration for the attempts counter + * + * \param connId Connection Id. + * \param pHdr Pointer to header of message to fill. + * \param status Status to include. + * + * \return none. + */ +/*************************************************************************************************/ +void SmpScGetCancelMsgWithReattempt(dmConnId_t connId, wsfMsgHdr_t *pHdr, uint8_t status); + +/*************************************************************************************************/ +/*! + * \brief Initialize the SMP Database. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbInit(void); + +/*************************************************************************************************/ +/*! + * \brief Called to force the DhKey to zero for qualification test purposes. + * + * \param enable TRUE - Force DhKey to zero. FALSE - Use calculated key + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScEnableZeroDhKey(bool_t enable); + /**@}*/ /*! \} */ /* STACK_SMP_API */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_defs.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_defs.h similarity index 93% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/smp_defs.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_defs.h index 06449244418bdb87613d2f4c7d3956458ac269e5..9a21672131c88766acded9f152b7d1925578af1b 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_defs.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_defs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Security manager constants and definitions from the Bluetooth specification. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Security manager constants and definitions from the Bluetooth specification. */ /*************************************************************************************************/ #ifndef SMP_DEFS_H diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_handler.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_handler.h similarity index 68% rename from lib/sdk/NDALibraries/BTLE/ble-host/include/smp_handler.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_handler.h index db4a6e59347ca0681b630fa9fd8d462d912d42a8..381558951fbcbb844051377a5978b7c0a71bad23 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/smp_handler.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/smp_handler.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Interface to SMP event handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Interface to SMP event handler. */ /*************************************************************************************************/ #ifndef SMP_HANDLER_H diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/include/svc_core.h b/lib/sdk/Libraries/BTLE/stack/ble-host/include/svc_core.h new file mode 100644 index 0000000000000000000000000000000000000000..3555b57143c98c147c3ba88abfee9574ce6656bf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/include/svc_core.h @@ -0,0 +1,171 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Example GATT and GAP service implementations. + */ +/*************************************************************************************************/ + +#ifndef SVC_CORE_H +#define SVC_CORE_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup GATT_AND_GAP_SERVICE + * \{ */ + + +/************************************************************************************************** + Handle Ranges +**************************************************************************************************/ +/** \name GAP Service Handles + * \note GAP -- RPAO characterstic added only when DM Privacy enabled + */ +/**@{*/ +#define GAP_START_HDL 0x01 /*!< \brief GAP start handle */ +#define GAP_END_HDL (GAP_MAX_HDL - 3) /*!< \brief GAP end handle */ +/**@}*/ + +/** \name GATT Service Handles + * + */ +/**@{*/ +#define GATT_START_HDL 0x10 /*!< \brief GATT start handle */ +#define GATT_END_HDL (GATT_MAX_HDL - 1) /*!< \brief GATT end handle */ +/**@}*/ + +/************************************************************************************************** + Handles +**************************************************************************************************/ + +/** \name GAP Service Handles + * + */ +/**@{*/ +/*! \brief GAP service handle */ +enum +{ + GAP_SVC_HDL = GAP_START_HDL, /*!< \brief GAP service declaration */ + GAP_DN_CH_HDL, /*!< \brief Device name characteristic */ + GAP_DN_HDL, /*!< \brief Device name */ + GAP_AP_CH_HDL, /*!< \brief Appearance characteristic */ + GAP_AP_HDL, /*!< \brief Appearance */ + GAP_CAR_CH_HDL, /*!< \brief Central address resolution characteristic */ + GAP_CAR_HDL, /*!< \brief Central address resolution */ + GAP_RPAO_CH_HDL, /*!< \brief Resolvable private address only characteristic */ + GAP_RPAO_HDL, /*!< \brief Resolvable private address only */ + GAP_MAX_HDL /*!< \brief GAP maximum handle */ +}; +/**@}*/ + +/** \name GATT Service Handles + * + */ +/**@{*/ +/*! \brief GATT service handles */ +enum +{ + GATT_SVC_HDL = GATT_START_HDL, /*!< \brief GATT service declaration */ + GATT_SC_CH_HDL, /*!< \brief Service changed characteristic */ + GATT_SC_HDL, /*!< \brief Service changed */ + GATT_SC_CH_CCC_HDL, /*!< \brief Service changed client characteristic configuration descriptor */ + GATT_CSF_CH_HDL, /*!< \brief Client supported features characteristic */ + GATT_CSF_HDL, /*!< \brief Client supported features */ + GATT_DBH_CH_HDL, /*!< \brief Database hash characteristic */ + GATT_DBH_HDL, /*!< \brief Database hash */ + GATT_MAX_HDL /*!< \brief GATT maximum handle */ +}; +/**@}*/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Add the services to the attribute server. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreAddGroup(void); + +/*************************************************************************************************/ +/*! + * \brief Remove the services from the attribute server. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreRemoveGroup(void); + +/*************************************************************************************************/ +/*! + * \brief Register callbacks for the service. + * + * \param readCback Read callback function. + * \param writeCback Write callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreGattCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback); + +/*************************************************************************************************/ +/*! + * \brief Register callbacks for the service. + * + * \param readCback Read callback function. + * \param writeCback Write callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreGapCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback); + +/*************************************************************************************************/ +/*! + * \brief Update the central address resolution attribute value. + * + * \param value New value. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreGapCentAddrResUpdate(bool_t value); + +/*************************************************************************************************/ +/*! + * \brief Add the Resolvable Private Address Only (RPAO) characteristic to the GAP service. + * The RPAO characteristic should be added only when DM Privacy is enabled. + * + * \return None. + */ +/*************************************************************************************************/ +void SvcCoreGapAddRpaoCh(void); + +/*! \} */ /* GATT_AND_GAP_SERVICE */ + +#ifdef __cplusplus +}; +#endif + +#endif /* SVC_CORE_H */ + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/common/hci_core.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/common/hci_core.c new file mode 100644 index 0000000000000000000000000000000000000000..bb7c8ab31133ae7dc08ba251378e6aa26d2fda5b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/common/hci_core.c @@ -0,0 +1,833 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI core module, platform independent functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "util/bda.h" +#include "util/bstream.h" +#include "hci_core.h" +#include "hci_tr.h" +#include "hci_cmd.h" +#include "hci_api.h" +#include "hci_main.h" +#include "l2c_defs.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Default ACL buffer flow control watermark levels */ +#ifndef HCI_ACL_QUEUE_HI +#define HCI_ACL_QUEUE_HI 5 /* Disable flow when this many buffers queued */ +#endif +#ifndef HCI_ACL_QUEUE_LO +#define HCI_ACL_QUEUE_LO 1 /* Enable flow when this many buffers queued */ +#endif + +/* Default maximum ACL packet size for reassembly */ +#ifndef HCI_MAX_RX_ACL_LEN +#define HCI_MAX_RX_ACL_LEN HCI_ACL_DEFAULT_LEN +#endif + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Event mask */ +const uint8_t hciEventMask[HCI_EVT_MASK_LEN] = +{ + HCI_EVT_MASK_DISCONNECT_CMPL | /* Byte 0 */ + HCI_EVT_MASK_ENC_CHANGE, /* Byte 0 */ + HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL | /* Byte 1 */ + HCI_EVT_MASK_HW_ERROR, /* Byte 1 */ + 0, /* Byte 2 */ + HCI_EVT_MASK_DATA_BUF_OVERFLOW, /* Byte 3 */ + 0, /* Byte 4 */ + HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL, /* Byte 5 */ + 0, /* Byte 6 */ + HCI_EVT_MASK_LE_META /* Byte 7 */ +}; + +/* LE event mask */ +const uint8_t hciLeEventMask[HCI_LE_EVT_MASK_LEN] = +{ + HCI_EVT_MASK_LE_CONN_CMPL_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_ADV_REPORT_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_LTK_REQ_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_REMOTE_CONN_PARAM_REQ_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_DATA_LEN_CHANGE_EVT | /* Byte 0 */ + HCI_EVT_MASK_LE_READ_LOCAL_P256_PUB_KEY_CMPL, /* Byte 0 */ + HCI_EVT_MASK_LE_GENERATE_DHKEY_CMPL | /* Byte 1 */ + HCI_EVT_MASK_LE_ENHANCED_CONN_CMPL_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_DIRECT_ADV_REPORT_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_PHY_UPDATE_CMPL_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_EXT_ADV_REPORT_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_PER_ADV_SYNC_EST_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_PER_ADV_REPORT_EVT | /* Byte 1 */ + HCI_EVT_MASK_LE_PER_ADV_SYNC_LOST_EVT, /* Byte 1 */ + HCI_EVT_MASK_LE_SCAN_TIMEOUT_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_ADV_SET_TERM_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_SCAN_REQ_RCVD_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_CH_SEL_ALGO_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_CONN_IQ_REPORT_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_CTE_REQ_FAILED_EVT | /* Byte 2 */ + HCI_EVT_MASK_LE_PER_SYNC_TRSF_RCVT_EVT, /* Byte 2 */ + 0, /* Byte 3 */ + 0, /* Byte 4 */ + 0, /* Byte 5 */ + 0, /* Byte 6 */ + 0 /* Byte 7 */ +}; + +/* event mask page 2 */ +const uint8_t hciEventMaskPage2[HCI_EVT_MASK_PAGE_2_LEN] = +{ + 0, /* Byte 0 */ + 0, /* Byte 1 */ + HCI_EVT_MASK_AUTH_PAYLOAD_TIMEOUT, /* Byte 2 */ + 0, /* Byte 3 */ + 0, /* Byte 4 */ + 0, /* Byte 5 */ + 0, /* Byte 6 */ + 0 /* Byte 7 */ +}; + +/* LE supported features configuration mask */ +uint32_t hciLeSupFeatCfg = + HCI_LE_SUP_FEAT_ENCRYPTION | /* LE Encryption */ + HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC | /* Connection Parameters Request Procedure */ + HCI_LE_SUP_FEAT_EXT_REJECT_IND | /* Extended Reject Indication */ + HCI_LE_SUP_FEAT_SLV_INIT_FEAT_EXCH | /* Slave-initiated Features Exchange */ + HCI_LE_SUP_FEAT_LE_PING | /* LE Ping */ + HCI_LE_SUP_FEAT_DATA_LEN_EXT | /* LE Data Packet Length Extension */ + HCI_LE_SUP_FEAT_PRIVACY | /* LL Privacy */ + HCI_LE_SUP_FEAT_EXT_SCAN_FILT_POLICY | /* Extended Scanner Filter Policies */ + HCI_LE_SUP_FEAT_LE_2M_PHY | /* LE 2M PHY supported */ + HCI_LE_SUP_FEAT_STABLE_MOD_IDX_TRANSMITTER | /* Stable Modulation Index - Transmitter supported */ + HCI_LE_SUP_FEAT_STABLE_MOD_IDX_RECEIVER | /* Stable Modulation Index - Receiver supported */ + HCI_LE_SUP_FEAT_LE_EXT_ADV | /* LE Extended Advertising */ + HCI_LE_SUP_FEAT_LE_PER_ADV; /* LE Periodic Advertising */ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +hciCoreCb_t hciCoreCb; + +/*************************************************************************************************/ +/*! + * \brief Allocate a connection structure. + * + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreConnAlloc(uint16_t handle) +{ + uint8_t i; + hciCoreConn_t *pConn = hciCoreCb.conn; + + /* find available connection struct */ + for (i = DM_CONN_MAX; i > 0; i--, pConn++) + { + if (pConn->handle == HCI_HANDLE_NONE) + { + /* allocate and initialize */ + pConn->handle = handle; + pConn->flowDisabled = FALSE; + pConn->outBufs = 0; + pConn->queuedBufs = 0; + + return; + } + } + + HCI_TRACE_WARN0("HCI conn struct alloc failure"); +} + +/*************************************************************************************************/ +/*! + * \brief Free a connection structure. + * + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreConnFree(uint16_t handle) +{ + uint8_t i; + hciCoreConn_t *pConn = hciCoreCb.conn; + + /* find connection struct */ + for (i = DM_CONN_MAX; i > 0; i--, pConn++) + { + if (pConn->handle == handle) + { + /* free any fragmenting ACL packet */ + if (pConn->pTxAclPkt != NULL) + { + WsfMsgFree(pConn->pTxAclPkt); + pConn->pTxAclPkt = NULL; + } + pConn->fragmenting = FALSE; + + if (pConn->pRxAclPkt != NULL) + { + WsfMsgFree(pConn->pRxAclPkt); + pConn->pRxAclPkt = NULL; + } + + /* free structure */ + pConn->handle = HCI_HANDLE_NONE; + + /* optional: iterate through tx ACL queue and free any buffers with this handle */ + + /* outstanding buffers are now available; service TX data path */ + hciCoreTxReady(pConn->outBufs); + + return; + } + } + + HCI_TRACE_WARN1("hciCoreConnFree handle not found:%u", handle); +} + +/*************************************************************************************************/ +/*! + * \brief Get a connection structure by handle + * + * \param handle Connection handle. + * + * \return Pointer to connection structure or NULL if not found. + */ +/*************************************************************************************************/ +hciCoreConn_t *hciCoreConnByHandle(uint16_t handle) +{ + uint8_t i; + hciCoreConn_t *pConn = hciCoreCb.conn; + + /* find available connection struct */ + for (i = DM_CONN_MAX; i > 0; i--, pConn++) + { + if (pConn->handle == handle) + { + return pConn; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Get the next connection structure with a packet fragment to send. + * + * \return Pointer to connection structure or NULL if not found. + */ +/*************************************************************************************************/ +static hciCoreConn_t *hciCoreNextConnFragment(void) +{ + uint8_t i; + hciCoreConn_t *pConn = hciCoreCb.conn; + + /* find connection struct */ + for (i = DM_CONN_MAX; i > 0; i--, pConn++) + { + if (pConn->handle != HCI_HANDLE_NONE && pConn->fragmenting) + { + return pConn; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Perform internal processing on HCI connection open. + * + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreConnOpen(uint16_t handle) +{ + /* allocate connection structure */ + hciCoreConnAlloc(handle); +} + +/*************************************************************************************************/ +/*! + * \brief Perform internal processing on HCI connection close. + * + * \param handle Connection handle. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreConnClose(uint16_t handle) +{ + /* free connection structure */ + hciCoreConnFree(handle); +} + + +/*************************************************************************************************/ +/*! + * \brief Send ACL data to transport. + * + * \param pConn Pointer to connection structure. + * \param pData WSF buffer containing an ACL packet. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreSendAclData(hciCoreConn_t *pConn, uint8_t *pData) +{ + /* increment outstanding buf count for handle */ + pConn->outBufs++; + + /* send to transport */ + hciTrSendAclData(pConn, pData); + + /* decrement available buffer count */ + if (hciCoreCb.availBufs > 0) + { + hciCoreCb.availBufs--; + } + else + { + HCI_TRACE_WARN0("hciCoreSendAclData availBufs=0"); + } +} + +/*************************************************************************************************/ +/*! + * \brief Service the TX data path. + * + * \param bufs Number of new buffers now available. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreTxReady(uint8_t bufs) +{ + uint8_t *pData; + wsfHandlerId_t handlerId; + uint16_t handle; + uint16_t len; + hciCoreConn_t *pConn; + + /* increment available buffers, with ceiling */ + if (bufs > 0) + { + hciCoreCb.availBufs += bufs; + if (hciCoreCb.availBufs > hciCoreCb.numBufs) + { + hciCoreCb.availBufs = hciCoreCb.numBufs; + } + } + + /* service ACL data queue and send as many buffers as we can */ + while (hciCoreCb.availBufs > 0) + { + /* send continuation of any fragments first */ + if (hciCoreTxAclContinue(NULL) == FALSE) + { + /* if no fragments then check for any queued ACL data */ + if ((pData = WsfMsgDeq(&hciCoreCb.aclQueue, &handlerId)) != NULL) + { + /* parse handle and length */ + BYTES_TO_UINT16(handle, pData); + BYTES_TO_UINT16(len, &pData[2]); + + /* look up conn structure and send data */ + if ((pConn = hciCoreConnByHandle(handle)) != NULL) + { + hciCoreTxAclStart(pConn, len, pData); + } + /* handle not found, connection must be closed */ + else + { + /* discard buffer */ + WsfMsgFree(pData); + + HCI_TRACE_WARN1("hciCoreTxReady discarding buffer, handle=%u", handle); + } + } + else + { + /* no fragments or queued data to send; we're done */ + break; + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send ACL packets, start of packet. + * + * \param pConn Pointer to connection structure. + * \param len ACL packet length. + * \param pData WSF buffer containing an ACL packet. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreTxAclStart(hciCoreConn_t *pConn, uint16_t len, uint8_t *pData) +{ + uint16_t hciLen; + + /* make sure not already fragmenting on this connection */ + WSF_ASSERT(pConn->fragmenting == FALSE); + + hciLen = HciGetBufSize(); + + HCI_TRACE_INFO1("hciCoreTxAclStart len=%u", len); + + /* if acl len > controller acl buf len */ + if (len > hciLen) + { + /* store remaining acl len = acl len - hci acl buf len */ + pConn->txAclRemLen = len - hciLen; + + /* store position for next fragment */ + pConn->pNextTxFrag = pData + hciLen; + + /* store information required for fragmentation */ + pConn->pTxAclPkt = pData; + pConn->fragmenting = TRUE; + + /* set acl len in packet to hci acl buf len */ + UINT16_TO_BUF(&pData[2], hciLen); + + /* send the packet */ + hciCoreSendAclData(pConn, pData); + + /* send additional fragments while there are HCI buffers available */ + while ((hciCoreCb.availBufs > 0) && hciCoreTxAclContinue(pConn)); + } + else + { + /* no fragmentation, just send the packet */ + hciCoreSendAclData(pConn, pData); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send ACL packets, continuation of fragmented packets. + * + * \param pConn Pointer to connection structure. If set non-NULL, then a fragment is + * sent from this connection structure. If NULL the function finds the next + * connection structure with a fragment to be sent. + * + * \return TRUE if packet sent, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t hciCoreTxAclContinue(hciCoreConn_t *pConn) +{ + uint16_t aclLen; + + if (pConn == NULL) + { + pConn = hciCoreNextConnFragment(); + } + + if (pConn != NULL) + { + /* get next fragment length */ + aclLen = (pConn->txAclRemLen < HciGetBufSize()) ? pConn->txAclRemLen : HciGetBufSize(); + + if (aclLen > 0) + { + /* decrement remaining length */ + pConn->txAclRemLen -= aclLen; + + /* set handle in packet with continuation bit set */ + UINT16_TO_BUF(pConn->pNextTxFrag, (pConn->handle | HCI_PB_CONTINUE)); + + /* set acl len in packet */ + UINT16_TO_BUF(&(pConn->pNextTxFrag[2]), aclLen); + + HCI_TRACE_INFO2("hciCoreTxAclContinue aclLen=%u remLen=%u", aclLen, pConn->txAclRemLen); + + /* send the packet */ + hciCoreSendAclData(pConn, pConn->pNextTxFrag); + + /* set up pointer to next fragment */ + if (pConn->txAclRemLen > 0) + { + pConn->pNextTxFrag += aclLen; + } + + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief This function is called from the HCI transport layer when transmission of an ACL + * packet is complete. + * + * \param pConn Pointer to connection structure. + * \param pData WSF buffer containing an ACL packet. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreTxAclComplete(hciCoreConn_t *pConn, uint8_t *pData) +{ + /* if fragmenting */ + if (pConn->fragmenting) + { + /* check if all fragments sent */ + if (pConn->txAclRemLen == 0) + { + /* free original buffer */ + WsfMsgFree(pConn->pTxAclPkt); + pConn->pTxAclPkt = NULL; + pConn->fragmenting = FALSE; + HCI_TRACE_INFO0("hciCoreTxAclComplete free pTxAclPkt"); + } + } + else if (pData != NULL) + { + WsfMsgFree(pData); + } +} + +/*************************************************************************************************/ +/*! + * \brief Reassemble an ACL packet. + * + * \param pData Input ACL packet. + * + * \return pointer to ACL packet to send, or NULL if no packet to send. + */ +/*************************************************************************************************/ +uint8_t *hciCoreAclReassembly(uint8_t *pData) +{ + hciCoreConn_t *pConn; + uint8_t *pDataRtn = NULL; + uint16_t handle; + uint16_t aclLen; + uint16_t l2cLen; + uint16_t pbf; + bool_t freeData = TRUE; + + BYTES_TO_UINT16(handle, pData); + pbf = handle & HCI_PB_FLAG_MASK; + handle &= HCI_HANDLE_MASK; + BYTES_TO_UINT16(aclLen, &pData[2]); + + /* look up connection */ + if ((pConn = hciCoreConnByHandle(handle)) != NULL) + { + /* if this is a start packet */ + if (pbf == HCI_PB_START_C2H) + { + /* if currently reassembled packet not complete */ + if (pConn->pRxAclPkt != NULL) + { + /* discard currently reassembled packet */ + WsfMsgFree(pConn->pRxAclPkt); + pConn->pRxAclPkt = NULL; + HCI_TRACE_WARN1("disarded hci rx pkt handle=0x%04x", handle); + } + + /* read l2cap length */ + if (aclLen >= L2C_HDR_LEN) + { + BYTES_TO_UINT16(l2cLen, &pData[4]); + + /* check length vs. configured maximum */ + if ((l2cLen + L2C_HDR_LEN) > hciCoreCb.maxRxAclLen) + { + HCI_TRACE_WARN1("l2c len=0x%04x to large for reassembly", l2cLen); + } + /* if reassembly required */ + else if ((l2cLen + L2C_HDR_LEN) > aclLen) + { + /* allocate buffer to store complete l2cap packet */ + if ((pConn->pRxAclPkt = WsfMsgDataAlloc(l2cLen + L2C_HDR_LEN + HCI_ACL_HDR_LEN, 0)) != NULL) + { + /* store buffer for reassembly */ + pConn->pNextRxFrag = pConn->pRxAclPkt; + + /* build acl header and copy data */ + UINT16_TO_BSTREAM(pConn->pNextRxFrag, handle); + UINT16_TO_BSTREAM(pConn->pNextRxFrag, l2cLen + L2C_HDR_LEN); + memcpy(pConn->pNextRxFrag, &pData[4], aclLen); + pConn->pNextRxFrag += aclLen; + + /* store remaining length */ + pConn->rxAclRemLen = l2cLen + L2C_HDR_LEN - aclLen; + } + else + { + /* alloc failed; discard */ + HCI_TRACE_WARN1("reassembly alloc failed len=%u", (l2cLen + L2C_HDR_LEN + HCI_ACL_HDR_LEN)); + } + } + else + { + /* no reassembly required, pData is ready to go */ + pDataRtn = pData; + freeData = FALSE; + } + } + else + { + /* invalid l2cap packet; discard */ + HCI_TRACE_WARN1("invalid l2c pkt aclLen=%u", aclLen); + } + } + /* else if this is a continuation packet */ + else if (pbf == HCI_PB_CONTINUE) + { + /* if expecting a continuation */ + if (pConn->pRxAclPkt != NULL) + { + if (aclLen <= pConn->rxAclRemLen) + { + /* copy data to start of next fragment */ + memcpy(pConn->pNextRxFrag, &pData[HCI_ACL_HDR_LEN], aclLen); + pConn->pNextRxFrag += aclLen; + + /* update remaining length */ + pConn->rxAclRemLen -= aclLen; + + /* if reassembly complete return reassembled packet */ + if (pConn->rxAclRemLen == 0) + { + pDataRtn = pConn->pRxAclPkt; + pConn->pRxAclPkt = NULL; + } + } + else + { + HCI_TRACE_WARN2("continuation pkt too long len=%u RemLen=%u", aclLen, pConn->rxAclRemLen); + } + } + else + { + HCI_TRACE_WARN1("unexpected continuation pkt handle=0x%04x", handle); + } + } + /* else unknown packet type */ + else + { + HCI_TRACE_WARN1("unknown pb flags=0x%04x", pbf); + } + } + else + { + /* connection not found */ + HCI_TRACE_WARN1("pkt rcvd on unknown handle=0x%04x", (handle & HCI_HANDLE_MASK)); + } + + if (freeData) + { + WsfMsgFree(pData); + } + + return pDataRtn; +} + +/*************************************************************************************************/ +/*! + * \brief Check if a TX ACL packet is being fragmented. + * + * \param pContext Connection context. + * + * \return TRUE if fragmenting a TX ACL packet, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t hciCoreTxAclDataFragmented(hciCoreConn_t *pConn) +{ + return pConn->fragmenting; +} + +/*************************************************************************************************/ +/*! + * \brief HCI core initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void HciCoreInit(void) +{ + uint8_t i; + + WSF_QUEUE_INIT(&hciCoreCb.aclQueue); + + for (i = 0; i < DM_CONN_MAX; i++) + { + hciCoreCb.conn[i].handle = HCI_HANDLE_NONE; + } + + hciCoreCb.maxRxAclLen = HCI_MAX_RX_ACL_LEN; + hciCoreCb.aclQueueHi = HCI_ACL_QUEUE_HI; + hciCoreCb.aclQueueLo = HCI_ACL_QUEUE_LO; + hciCoreCb.extResetSeq = NULL; + + hciCoreInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an HCI reset sequence. + * + * \return None. + */ +/*************************************************************************************************/ +void HciResetSequence(void) +{ + /* set resetting state */ + hciCb.resetting = TRUE; + + /* start the reset sequence */ + hciCoreResetStart(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the maximum reassembled RX ACL packet length. Minimum value is 27. + * + * \param len ACL packet length. + * + * \return None. + */ +/*************************************************************************************************/ +void HciSetMaxRxAclLen(uint16_t len) +{ + hciCoreCb.maxRxAclLen = len; +} + +/*************************************************************************************************/ +/*! + * \brief Set TX ACL queue high and low watermarks. + * + * \param queueHi Disable flow on a connection when this many ACL buffers are queued. + * queueLo Disable flow on a connection when this many ACL buffers are queued. + * + * \return None. + */ +/*************************************************************************************************/ +void HciSetAclQueueWatermarks(uint8_t queueHi, uint8_t queueLo) +{ + hciCoreCb.aclQueueHi = queueHi; + hciCoreCb.aclQueueLo = queueLo; +} + +/*************************************************************************************************/ +/*! +* \brief Set LE supported features configuration mask. +* +* \param feat Feature bit to set or clear +* \param flag TRUE to set feature bit and FALSE to clear it +* +* \return None. +*/ +/*************************************************************************************************/ +void HciSetLeSupFeat(uint32_t feat, bool_t flag) +{ + /* if asked to include feature */ + if (flag) + { + /* set feature bit */ + hciLeSupFeatCfg |= feat; + } + else + { + /* clear feature bit */ + hciLeSupFeatCfg &= ~feat; + } +} + +/*************************************************************************************************/ +/*! + * \brief Send data from the stack to HCI. + * + * \param pData WSF buffer containing an ACL packet + * + * \return None. + */ +/*************************************************************************************************/ +void HciSendAclData(uint8_t *pData) +{ + uint16_t handle; + uint16_t len; + hciCoreConn_t *pConn; + + /* parse handle and length */ + BYTES_TO_UINT16(handle, pData); + BYTES_TO_UINT16(len, &pData[2]); + + /* look up connection structure */ + if ((pConn = hciCoreConnByHandle(handle)) != NULL) + { + /* if queue empty and buffers available */ + if (WsfQueueEmpty(&hciCoreCb.aclQueue) && hciCoreCb.availBufs > 0) + { + /* send data */ + hciCoreTxAclStart(pConn, len, pData); + } + else + { + /* queue data - message handler ID 'handerId' not used */ + WsfMsgEnq(&hciCoreCb.aclQueue, 0, pData); + } + + /* increment buffer queue count for this connection with consideration for HCI fragmentation */ + pConn->queuedBufs += ((len - 1) / HciGetBufSize()) + 1; + + /* manage flow control to stack */ + if (pConn->queuedBufs >= hciCoreCb.aclQueueHi && pConn->flowDisabled == FALSE) + { + pConn->flowDisabled = TRUE; + (*hciCb.flowCback)(handle, TRUE); + } + } + /* connection not found, connection must be closed */ + else + { + /* discard buffer */ + WsfMsgFree(pData); + + HCI_TRACE_WARN1("HciSendAclData discarding buffer, handle=%u", handle); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd.c new file mode 100644 index 0000000000000000000000000000000000000000..d2121feecd732f69b8e89e4ce57424783a7ae88c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd.c @@ -0,0 +1,1425 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI command module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_timer.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "hci_cmd.h" +#include "hci_tr.h" +#include "hci_api.h" +#include "hci_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* HCI command timeout in seconds */ +#define HCI_CMD_TIMEOUT 2 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Local control block type */ +typedef struct +{ + wsfTimer_t cmdTimer; /* HCI command timeout timer */ + wsfQueue_t cmdQueue; /* HCI command queue */ + uint16_t cmdOpcode; /* Opcode of last HCI command sent */ + uint8_t numCmdPkts; /* Number of outstanding HCI commands that can be sent */ +} hciCmdCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Local control block */ +hciCmdCb_t hciCmdCb; + +/*************************************************************************************************/ +/*! + * \brief Allocate an HCI command buffer and set the command header fields. + * + * \param opcode Command opcode. + * \param len length of command parameters. + * + * \return Pointer to WSF msg buffer. + */ +/*************************************************************************************************/ +uint8_t *hciCmdAlloc(uint16_t opcode, uint16_t len) +{ + uint8_t *p; + + /* allocate buffer */ + if ((p = WsfMsgAlloc(len + HCI_CMD_HDR_LEN)) != NULL) + { + /* set HCI command header */ + UINT16_TO_BSTREAM(p, opcode); + UINT8_TO_BSTREAM(p, len); + p -= HCI_CMD_HDR_LEN; + } + + return p; +} + +/*************************************************************************************************/ +/*! + * \brief Send an HCI command and service the HCI command queue. + * + * \param pData Buffer containing HCI command to send or NULL. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCmdSend(uint8_t *pData) +{ + uint8_t *p; + wsfHandlerId_t handlerId; + + /* queue command if present */ + if (pData != NULL) + { + /* queue data - message handler ID 'handerId' not used */ + WsfMsgEnq(&hciCmdCb.cmdQueue, 0, pData); + } + + /* service the HCI command queue; first check if controller can accept any commands */ + if (hciCmdCb.numCmdPkts > 0) + { + /* if queue not empty */ + if ((p = WsfMsgDeq(&hciCmdCb.cmdQueue, &handlerId)) != NULL) + { + /* decrement controller command packet count */ + hciCmdCb.numCmdPkts--; + + /* store opcode of command we're sending */ + BYTES_TO_UINT16(hciCmdCb.cmdOpcode, p); + + /* start command timeout */ + WsfTimerStartSec(&hciCmdCb.cmdTimer, HCI_CMD_TIMEOUT); + + /* send command to transport */ + hciTrSendCmd(p); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the HCI cmd module. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCmdInit(void) +{ + WSF_QUEUE_INIT(&hciCmdCb.cmdQueue); + + /* initialize numCmdPkts for special case of first command */ + hciCmdCb.numCmdPkts = 1; + + /* initialize timer */ + hciCmdCb.cmdTimer.msg.event = HCI_MSG_CMD_TIMEOUT; + hciCmdCb.cmdTimer.handlerId = hciCb.handlerId; +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI command timeout. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCmdTimeout(wsfMsgHdr_t *pMsg) +{ + HCI_TRACE_INFO0("hciCmdTimeout"); +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI Command Complete or Command Status event. + * + * \param numCmdPkts Number of commands that can be sent to the controller. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCmdRecvCmpl(uint8_t numCmdPkts) +{ + /* stop the command timeout timer */ + WsfTimerStop(&hciCmdCb.cmdTimer); + + /* + * Set the number of commands that can be sent to the controller. Setting this + * to 1 rather than incrementing by numCmdPkts allows only one command at a time to + * be sent to the controller and simplifies the code. + */ + hciCmdCb.numCmdPkts = 1; + + /* send the next queued command */ + hciCmdSend(NULL); +} + +/*************************************************************************************************/ +/*! + * \brief HCI disconnect command. + */ +/*************************************************************************************************/ +void HciDisconnectCmd(uint16_t handle, uint8_t reason) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_DISCONNECT, HCI_LEN_DISCONNECT)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT8_TO_BSTREAM(p, reason); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE add device white list command. + */ +/*************************************************************************************************/ +void HciLeAddDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_ADD_DEV_WHITE_LIST, HCI_LEN_LE_ADD_DEV_WHITE_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, addrType); + BDA_TO_BSTREAM(p, pAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE clear white list command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeClearWhiteListCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CLEAR_WHITE_LIST, HCI_LEN_LE_CLEAR_WHITE_LIST)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI connection update command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeConnUpdateCmd(uint16_t handle, hciConnSpec_t *pConnSpec) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CONN_UPDATE, HCI_LEN_LE_CONN_UPDATE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMin); + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMax); + UINT16_TO_BSTREAM(p, pConnSpec->connLatency); + UINT16_TO_BSTREAM(p, pConnSpec->supTimeout); + UINT16_TO_BSTREAM(p, pConnSpec->minCeLen); + UINT16_TO_BSTREAM(p, pConnSpec->maxCeLen); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE create connection command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeCreateConnCmd(uint16_t scanInterval, uint16_t scanWindow, uint8_t filterPolicy, + uint8_t peerAddrType, uint8_t *pPeerAddr, uint8_t ownAddrType, + hciConnSpec_t *pConnSpec) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CREATE_CONN, HCI_LEN_LE_CREATE_CONN)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, scanInterval); + UINT16_TO_BSTREAM(p, scanWindow); + UINT8_TO_BSTREAM(p, filterPolicy); + UINT8_TO_BSTREAM(p, peerAddrType); + BDA_TO_BSTREAM(p, pPeerAddr); + UINT8_TO_BSTREAM(p, ownAddrType); + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMin); + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMax); + UINT16_TO_BSTREAM(p, pConnSpec->connLatency); + UINT16_TO_BSTREAM(p, pConnSpec->supTimeout); + UINT16_TO_BSTREAM(p, pConnSpec->minCeLen); + UINT16_TO_BSTREAM(p, pConnSpec->maxCeLen); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE create connection cancel command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeCreateConnCancelCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CREATE_CONN_CANCEL, HCI_LEN_LE_CREATE_CONN_CANCEL)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE remote connection parameter request reply command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeRemoteConnParamReqReply(uint16_t handle, uint16_t intervalMin, uint16_t intervalMax, uint16_t latency, + uint16_t timeout, uint16_t minCeLen, uint16_t maxCeLen) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REM_CONN_PARAM_REP, HCI_LEN_LE_REM_CONN_PARAM_REP)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, intervalMin); + UINT16_TO_BSTREAM(p, intervalMax); + UINT16_TO_BSTREAM(p, latency); + UINT16_TO_BSTREAM(p, timeout); + UINT16_TO_BSTREAM(p, minCeLen); + UINT16_TO_BSTREAM(p, maxCeLen); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE remote connection parameter request negative reply command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP, HCI_LEN_LE_REM_CONN_PARAM_NEG_REP)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT8_TO_BSTREAM(p, reason); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE set data len command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeSetDataLen(uint16_t handle, uint16_t txOctets, uint16_t txTime) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_DATA_LEN, HCI_LEN_LE_SET_DATA_LEN)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, txOctets); + UINT16_TO_BSTREAM(p, txTime); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE read suggested default data len command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeReadDefDataLen(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_DEF_DATA_LEN, HCI_LEN_LE_READ_DEF_DATA_LEN)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE write suggested default data len command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeWriteDefDataLen(uint16_t suggestedMaxTxOctets, uint16_t suggestedMaxTxTime) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_WRITE_DEF_DATA_LEN, HCI_LEN_LE_WRITE_DEF_DATA_LEN)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, suggestedMaxTxOctets); + UINT16_TO_BSTREAM(p, suggestedMaxTxTime); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE read local P-256 public key command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeReadLocalP256PubKey(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_LOCAL_P256_PUB_KEY, HCI_LEN_LE_READ_LOCAL_P256_PUB_KEY)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE generate DHKey command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeGenerateDHKey(uint8_t *pPubKeyX, uint8_t *pPubKeyY) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_GENERATE_DHKEY, HCI_LEN_LE_GENERATE_DHKEY)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pPubKeyX, HCI_DH_KEY_LEN); + memcpy(p + HCI_DH_KEY_LEN, pPubKeyY, HCI_DH_KEY_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE Generate DH Key Version 2 command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeGenerateDHKeyV2(uint8_t *pPubKeyX, uint8_t *pPubKeyY, uint8_t keyType) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_GENERATE_DHKEY_V2, HCI_LEN_LE_GENERATE_DHKEY_V2)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pPubKeyX, HCI_DH_KEY_LEN); + p += HCI_DH_KEY_LEN; + memcpy(p, pPubKeyY, HCI_DH_KEY_LEN); + p += HCI_DH_KEY_LEN; + UINT8_TO_BSTREAM(p, keyType); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI LE read maximum data len command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeReadMaxDataLen(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_MAX_DATA_LEN, HCI_LEN_LE_READ_MAX_DATA_LEN)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE encrypt command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeEncryptCmd(uint8_t *pKey, uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_ENCRYPT, HCI_LEN_LE_ENCRYPT)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pKey, HCI_KEY_LEN); + p += HCI_KEY_LEN; + memcpy(p, pData, HCI_ENCRYPT_DATA_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE long term key request negative reply command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeLtkReqNegReplCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_LTK_REQ_NEG_REPL, HCI_LEN_LE_LTK_REQ_NEG_REPL)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE long term key request reply command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeLtkReqReplCmd(uint16_t handle, uint8_t *pKey) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_LTK_REQ_REPL, HCI_LEN_LE_LTK_REQ_REPL)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pKey, HCI_KEY_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE random command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeRandCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_RAND, HCI_LEN_LE_RAND)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read advertising TX power command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadAdvTXPowerCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_ADV_TX_POWER, HCI_LEN_LE_READ_ADV_TX_POWER)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read buffer size command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadBufSizeCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_BUF_SIZE, HCI_LEN_LE_READ_BUF_SIZE)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read channel map command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadChanMapCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_CHAN_MAP, HCI_LEN_LE_READ_CHAN_MAP)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read local supported feautre command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadLocalSupFeatCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT, HCI_LEN_LE_READ_LOCAL_SUP_FEAT)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read remote feature command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadRemoteFeatCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_REMOTE_FEAT, HCI_LEN_LE_READ_REMOTE_FEAT)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read supported states command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadSupStatesCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_SUP_STATES, HCI_LEN_LE_READ_SUP_STATES)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read white list size command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadWhiteListSizeCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_WHITE_LIST_SIZE, HCI_LEN_LE_READ_WHITE_LIST_SIZE)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE remove device white list command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeRemoveDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST, HCI_LEN_LE_REMOVE_DEV_WHITE_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, addrType); + BDA_TO_BSTREAM(p, pAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set advanced enable command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetAdvEnableCmd(uint8_t enable) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_ADV_ENABLE, HCI_LEN_LE_SET_ADV_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set advertising data command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetAdvDataCmd(uint8_t len, uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_ADV_DATA, HCI_LEN_LE_SET_ADV_DATA)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, len); + memcpy(p, pData, len); + p += len; + memset(p, 0, (HCI_ADV_DATA_LEN - len)); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set advertising parameters command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetAdvParamCmd(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, + uint8_t ownAddrType, uint8_t peerAddrType, uint8_t *pPeerAddr, + uint8_t advChanMap, uint8_t advFiltPolicy) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_ADV_PARAM, HCI_LEN_LE_SET_ADV_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, advIntervalMin); + UINT16_TO_BSTREAM(p, advIntervalMax); + UINT8_TO_BSTREAM(p, advType); + UINT8_TO_BSTREAM(p, ownAddrType); + UINT8_TO_BSTREAM(p, peerAddrType); + if (pPeerAddr != NULL) + { + BDA_TO_BSTREAM(p, pPeerAddr); + } + else + { + p = BdaClr(p); + } + + /* Note: p cannot equal NULL here. */ + /* coverity[dereference] */ + UINT8_TO_BSTREAM(p, advChanMap); + UINT8_TO_BSTREAM(p, advFiltPolicy); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set event mask command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetEventMaskCmd(uint8_t *pLeEventMask) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EVENT_MASK, HCI_LEN_LE_SET_EVENT_MASK)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pLeEventMask, HCI_LE_EVT_MASK_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI set host channel class command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetHostChanClassCmd(uint8_t *pChanMap) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_HOST_CHAN_CLASS, HCI_LEN_LE_SET_HOST_CHAN_CLASS)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pChanMap, HCI_CHAN_MAP_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set random address command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetRandAddrCmd(uint8_t *pAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_RAND_ADDR, HCI_LEN_LE_SET_RAND_ADDR)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + BDA_TO_BSTREAM(p, pAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set scan enable command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetScanEnableCmd(uint8_t enable, uint8_t filterDup) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_SCAN_ENABLE, HCI_LEN_LE_SET_SCAN_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + UINT8_TO_BSTREAM(p, filterDup); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI set scan parameters command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetScanParamCmd(uint8_t scanType, uint16_t scanInterval, uint16_t scanWindow, + uint8_t ownAddrType, uint8_t scanFiltPolicy) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_SCAN_PARAM, HCI_LEN_LE_SET_SCAN_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, scanType); + UINT16_TO_BSTREAM(p, scanInterval); + UINT16_TO_BSTREAM(p, scanWindow); + UINT8_TO_BSTREAM(p, ownAddrType); + UINT8_TO_BSTREAM(p, scanFiltPolicy); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set scan response data. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetScanRespDataCmd(uint8_t len, uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_SCAN_RESP_DATA, HCI_LEN_LE_SET_SCAN_RESP_DATA)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, len); + memcpy(p, pData, len); + p += len; + memset(p, 0, (HCI_SCAN_DATA_LEN - len)); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE start encryption command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeStartEncryptionCmd(uint16_t handle, uint8_t *pRand, uint16_t diversifier, uint8_t *pKey) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_START_ENCRYPTION, HCI_LEN_LE_START_ENCRYPTION)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pRand, HCI_RAND_LEN); + p += HCI_RAND_LEN; + UINT16_TO_BSTREAM(p, diversifier); + memcpy(p, pKey, HCI_KEY_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read BD address command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadBdAddrCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_BD_ADDR, HCI_LEN_READ_BD_ADDR)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read buffer size command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadBufSizeCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_BUF_SIZE, HCI_LEN_READ_BUF_SIZE)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read local supported feature command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadLocalSupFeatCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_LOCAL_SUP_FEAT, HCI_LEN_READ_LOCAL_SUP_FEAT)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read local version info command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadLocalVerInfoCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_LOCAL_VER_INFO, HCI_LEN_READ_LOCAL_VER_INFO)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read remote version info command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadRemoteVerInfoCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_REMOTE_VER_INFO, HCI_LEN_READ_REMOTE_VER_INFO)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read RSSI command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadRssiCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_RSSI, HCI_LEN_READ_RSSI)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read Tx power level command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciReadTxPwrLvlCmd(uint16_t handle, uint8_t type) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_TX_PWR_LVL, HCI_LEN_READ_TX_PWR_LVL)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT8_TO_BSTREAM(p, type); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI reset command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciResetCmd(void) +{ + uint8_t *pBuf; + + /* initialize numCmdPkts for special case of reset command */ + hciCmdCb.numCmdPkts = 1; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_RESET, HCI_LEN_RESET)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI set event mask command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciSetEventMaskCmd(uint8_t *pEventMask) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_SET_EVENT_MASK, HCI_LEN_SET_EVENT_MASK)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pEventMask, HCI_EVT_MASK_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI set event mask page 2 command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciSetEventMaskPage2Cmd(uint8_t *pEventMask) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_SET_EVENT_MASK_PAGE2, HCI_LEN_SET_EVENT_MASK_PAGE2)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pEventMask, HCI_EVT_MASK_PAGE_2_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI read authenticated payload timeout command. +* +* \param handle Connection handle. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciReadAuthPayloadTimeout(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_READ_AUTH_PAYLOAD_TO, HCI_LEN_READ_AUTH_PAYLOAD_TO)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI write authenticated payload timeout command. +* +* \param handle Connection handle. +* \param timeout Timeout value. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO, HCI_LEN_WRITE_AUTH_PAYLOAD_TO)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, timeout); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI add device to resolving list command. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * \param pPeerIrk Peer IRK. + * \param pLocalIrk Local IRK. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeAddDeviceToResolvingListCmd(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, + const uint8_t *pPeerIrk, const uint8_t *pLocalIrk) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_ADD_DEV_RES_LIST, HCI_LEN_LE_ADD_DEV_RES_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, peerAddrType); + BDA_TO_BSTREAM(p, pPeerIdentityAddr); + memcpy(p, pPeerIrk, HCI_KEY_LEN); + p += HCI_KEY_LEN; + memcpy(p, pLocalIrk, HCI_KEY_LEN); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI remove device from resolving list command. + * + * \param peerAddrType Peer identity address type. + * \param pPeerIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeRemoveDeviceFromResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REMOVE_DEV_RES_LIST, HCI_LEN_LE_REMOVE_DEV_RES_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, peerAddrType); + BDA_TO_BSTREAM(p, pPeerIdentityAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI clear resolving list command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeClearResolvingList(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CLEAR_RES_LIST, HCI_LEN_LE_CLEAR_RES_LIST)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read resolving list command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadResolvingListSize(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_RES_LIST_SIZE, HCI_LEN_LE_READ_RES_LIST_SIZE)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read peer resolvable address command. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_PEER_RES_ADDR, HCI_LEN_LE_READ_PEER_RES_ADDR)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, addrType); + BDA_TO_BSTREAM(p, pIdentityAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read local resolvable address command. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_LOCAL_RES_ADDR, HCI_LEN_LE_READ_LOCAL_RES_ADDR)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, addrType); + BDA_TO_BSTREAM(p, pIdentityAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI enable or disable address resolution command. + * + * \param enable Set to TRUE to enable address resolution or FALSE to disable address + * resolution. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetAddrResolutionEnable(uint8_t enable) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_ADDR_RES_ENABLE, HCI_LEN_LE_SET_ADDR_RES_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI set resolvable private address timeout command. + * + * \param rpaTimeout Timeout measured in seconds. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_RES_PRIV_ADDR_TO, HCI_LEN_LE_SET_RES_PRIV_ADDR_TO)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, rpaTimeout); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set privacy mode command. + * + * \param peerAddrType Peer identity address type. + * \param pPeerAddr Peer identity address. + * \param mode Privacy mode. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPrivacyModeCmd(uint8_t addrType, uint8_t *pAddr, uint8_t mode) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PRIVACY_MODE, HCI_LEN_LE_SET_PRIVACY_MODE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, addrType); + BDA_TO_BSTREAM(p, pAddr); + UINT8_TO_BSTREAM(p, mode); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI vencor specific command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVendorSpecificCmd(uint16_t opcode, uint8_t len, uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(opcode, len)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + memcpy(p, pData, len); + hciCmdSend(pBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..19d382b12c851b9b03ead37b25d0edfd3101448a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c @@ -0,0 +1,703 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI Advertising Extensions (AE) command module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "hci_cmd.h" +#include "hci_api.h" +#include "hci_main.h" + +/*************************************************************************************************/ +/*! + * \brief HCI LE set advertising set random device address command. + * + * \param advHandle Advertising handle. + * \param pAddr Random device address. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetAdvSetRandAddrCmd(uint8_t advHandle, const uint8_t *pAddr) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_ADV_SET_RAND_ADDR, HCI_LEN_LE_SET_ADV_SET_RAND_ADDR)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + BDA_TO_BSTREAM(p, pAddr); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set extended advertising parameters command. + * + * \param advHandle Advertising handle. + * \param pExtAdvParam Extended advertising parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetExtAdvParamCmd(uint8_t advHandle, hciExtAdvParam_t *pExtAdvParam) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_ADV_PARAM, HCI_LEN_LE_SET_EXT_ADV_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + UINT16_TO_BSTREAM(p, pExtAdvParam->advEventProp); + UINT24_TO_BSTREAM(p, pExtAdvParam->priAdvInterMin); + UINT24_TO_BSTREAM(p, pExtAdvParam->priAdvInterMax); + UINT8_TO_BSTREAM(p, pExtAdvParam->priAdvChanMap); + UINT8_TO_BSTREAM(p, pExtAdvParam->ownAddrType); + UINT8_TO_BSTREAM(p, pExtAdvParam->peerAddrType); + BDA_TO_BSTREAM(p, pExtAdvParam->pPeerAddr); + UINT8_TO_BSTREAM(p, pExtAdvParam->advFiltPolicy); + UINT8_TO_BSTREAM(p, pExtAdvParam->advTxPwr); + UINT8_TO_BSTREAM(p, pExtAdvParam->priAdvPhy); + UINT8_TO_BSTREAM(p, pExtAdvParam->secAdvMaxSkip); + UINT8_TO_BSTREAM(p, pExtAdvParam->secAdvPhy); + UINT8_TO_BSTREAM(p, pExtAdvParam->advSetId); + UINT8_TO_BSTREAM(p, pExtAdvParam->scanReqNotifEna); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set extended advertising data command. + * + * \param advHandle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetExtAdvDataCmd(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, + const uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if (len > HCI_EXT_ADV_DATA_LEN) + { + len = HCI_EXT_ADV_DATA_LEN; + } + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_ADV_DATA, HCI_LEN_LE_SET_EXT_ADV_DATA(len))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + UINT8_TO_BSTREAM(p, op); + UINT8_TO_BSTREAM(p, fragPref); + UINT8_TO_BSTREAM(p, len); + memcpy(p, pData, len); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set extended scan response data command. + * + * \param advHandle Advertising handle. + * \param op Operation. + * \param fragPref Fragment preference. + * \param len Data buffer length. + * \param pData Scan response data buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetExtScanRespDataCmd(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, + const uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if (len > HCI_EXT_ADV_DATA_LEN) + { + len = HCI_EXT_ADV_DATA_LEN; + } + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_SCAN_RESP_DATA, + HCI_LEN_LE_SET_EXT_SCAN_RESP_DATA(len))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + UINT8_TO_BSTREAM(p, op); + UINT8_TO_BSTREAM(p, fragPref); + UINT8_TO_BSTREAM(p, len); + memcpy(p, pData, len); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set extended advertising enable command. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * \param numSets Number of advertising sets. + * \param pScanParam Advertising enable parameter array. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetExtAdvEnableCmd(uint8_t enable, uint8_t numSets, hciExtAdvEnableParam_t *pEnableParam) +{ + uint8_t *pBuf; + uint8_t *p; + uint8_t i; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_ADV_ENABLE, HCI_LEN_LE_EXT_ADV_ENABLE(numSets))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + UINT8_TO_BSTREAM(p, numSets); + + for (i = 0; i < numSets; i++) + { + UINT8_TO_BSTREAM(p, pEnableParam[i].advHandle); + UINT16_TO_BSTREAM(p, pEnableParam[i].duration); + UINT8_TO_BSTREAM(p, pEnableParam[i].maxEaEvents); + } + + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read maximum advertising data length command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadMaxAdvDataLen(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN, HCI_LEN_LE_READ_MAX_ADV_DATA_LEN)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read number of supported advertising sets command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadNumSupAdvSets(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS, HCI_LEN_LE_READ_NUM_OF_SUP_ADV_SETS)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE remove advertising set command. + * + * \param advHandle Advertising handle. + * + * \return Status error code. + */ +/*************************************************************************************************/ +void HciLeRemoveAdvSet(uint8_t advHandle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REMOVE_ADV_SET, HCI_LEN_LE_REMOVE_ADV_SET)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE clear advertising sets command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeClearAdvSets(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CLEAR_ADV_SETS, HCI_LEN_LE_CLEAR_ADV_SETS)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising parameters command. + * + * \param advHandle Advertising handle. + * \param advIntervalMin Periodic advertising interval minimum. + * \param advIntervalMax Periodic advertising interval maximum. + * \param advProps Periodic advertising properties. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvParamCmd(uint8_t advHandle, uint16_t advIntervalMin, uint16_t advIntervalMax, + uint16_t advProps) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PER_ADV_PARAM, HCI_LEN_LE_SET_PER_ADV_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + UINT16_TO_BSTREAM(p, advIntervalMin); + UINT16_TO_BSTREAM(p, advIntervalMax); + UINT16_TO_BSTREAM(p, advProps); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising data command. + * + * \param advHandle Advertising handle. + * \param op Operation. + * \param len Data buffer length. + * \param pData Advertising data buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvDataCmd(uint8_t advHandle, uint8_t op, uint8_t len, const uint8_t *pData) +{ + uint8_t *pBuf; + uint8_t *p; + + if (len > HCI_PER_ADV_DATA_LEN) + { + len = HCI_PER_ADV_DATA_LEN; + } + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PER_ADV_DATA, HCI_LEN_LE_SET_PER_ADV_DATA(len))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advHandle); + UINT8_TO_BSTREAM(p, op); + UINT8_TO_BSTREAM(p, len); + memcpy(p, pData, len); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising enable command. + * + * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvEnableCmd(uint8_t enable, uint8_t advHandle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PER_ADV_ENABLE, HCI_LEN_LE_SET_PER_ADV_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + UINT8_TO_BSTREAM(p, advHandle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set extended scanning parameters command. + * + * \param ownAddrType Address type used by this device. + * \param scanFiltPolicy Scan filter policy. + * \param scanPhys Scanning PHYs. + * \param pScanParam Scanning parameter array. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetExtScanParamCmd(uint8_t ownAddrType, uint8_t scanFiltPolicy, uint8_t scanPhys, + hciExtScanParam_t *pScanParam) +{ + uint8_t *pBuf; + uint8_t *p; + uint8_t i; + uint8_t numPhys; + + /* find out number of scanning PHYs */ + for (i = 0, numPhys = 0; (i < 8) && (numPhys <= HCI_MAX_NUM_PHYS); i++) + { + if (scanPhys & (1 << i)) + { + numPhys++; + } + } + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_SCAN_PARAM, HCI_LEN_LE_SET_EXT_SCAN_PARAM(numPhys))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, ownAddrType); + UINT8_TO_BSTREAM(p, scanFiltPolicy); + UINT8_TO_BSTREAM(p, scanPhys); + + for (i = 0; i < numPhys; i++) + { + UINT8_TO_BSTREAM(p, pScanParam[i].scanType); + UINT16_TO_BSTREAM(p, pScanParam[i].scanInterval); + UINT16_TO_BSTREAM(p, pScanParam[i].scanWindow) + } + + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE extended scan enable command. + * + * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. + * \param filterDup Set to TRUE to filter duplicates. + * \param duration Duration. + * \param period Period. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeExtScanEnableCmd(uint8_t enable, uint8_t filterDup, uint16_t duration, uint16_t period) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE, HCI_LEN_LE_SET_EXT_SCAN_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, enable); + UINT8_TO_BSTREAM(p, filterDup); + UINT16_TO_BSTREAM(p, duration); + UINT16_TO_BSTREAM(p, period); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE extended create connection command. + * + * \param pInitParam Initiating parameters. + * \param pScanParam Initiating scan parameters. + * \param pConnSpec Connection specification. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeExtCreateConnCmd(hciExtInitParam_t *pInitParam, hciExtInitScanParam_t *pScanParam, + hciConnSpec_t *pConnSpec) +{ + uint8_t *pBuf; + uint8_t *p; + uint8_t i; + uint8_t numPhys; + + /* find out number of initiating PHYs */ + for (i = 0, numPhys = 0; (i < 8) && (numPhys <= HCI_MAX_NUM_PHYS); i++) + { + if (pInitParam->initPhys & (1 << i)) + { + numPhys++; + } + } + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_EXT_CREATE_CONN, HCI_LEN_LE_EXT_CREATE_CONN(numPhys))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, pInitParam->filterPolicy); + UINT8_TO_BSTREAM(p, pInitParam->ownAddrType); + UINT8_TO_BSTREAM(p, pInitParam->peerAddrType); + BDA_TO_BSTREAM(p, pInitParam->pPeerAddr); + UINT8_TO_BSTREAM(p, pInitParam->initPhys); + + for (i = 0; i < numPhys; i++) + { + UINT16_TO_BSTREAM(p, pScanParam[i].scanInterval); + UINT16_TO_BSTREAM(p, pScanParam[i].scanWindow); + UINT16_TO_BSTREAM(p, pConnSpec[i].connIntervalMin); + UINT16_TO_BSTREAM(p, pConnSpec[i].connIntervalMax); + UINT16_TO_BSTREAM(p, pConnSpec[i].connLatency); + UINT16_TO_BSTREAM(p, pConnSpec[i].supTimeout); + UINT16_TO_BSTREAM(p, pConnSpec[i].minCeLen); + UINT16_TO_BSTREAM(p, pConnSpec[i].maxCeLen); + } + + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE periodic advertising create sync command. + * + * \param options Options. + * \param advSid Advertising SID. + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param skip Number of periodic advertising packets that can be skipped after + * successful receive. + * \param syncTimeout Synchronization timeout. + * \param unused Reserved for future use (must be zero). + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvCreateSyncCmd(uint8_t options, uint8_t advSid, uint8_t advAddrType, + uint8_t *pAdvAddr, uint16_t skip, uint16_t syncTimeout, uint8_t unused) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_PER_ADV_CREATE_SYNC, HCI_LEN_LE_PER_ADV_CREATE_SYNC)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, options); + UINT8_TO_BSTREAM(p, advSid); + UINT8_TO_BSTREAM(p, advAddrType); + BDA_TO_BSTREAM(p, pAdvAddr); + UINT16_TO_BSTREAM(p, skip); + UINT16_TO_BSTREAM(p, syncTimeout); + UINT8_TO_BSTREAM(p, unused); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE periodic advertising create sync cancel command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvCreateSyncCancelCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_PER_ADV_CREATE_SYNC_CANCEL, HCI_LEN_LE_PER_ADV_CREATE_SYNC_CANCEL)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE periodic advertising terminate sync command. + * + * \param syncHandle Sync handle. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvTerminateSyncCmd(uint16_t syncHandle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_PER_ADV_TERMINATE_SYNC, HCI_LEN_LE_PER_ADV_TERMINATE_SYNC)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, syncHandle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE add device to periodic advertiser list command. + * + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param advSid Advertising SID. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeAddDeviceToPerAdvListCmd(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_ADD_DEV_PER_ADV_LIST, HCI_LEN_LE_ADD_DEV_PER_ADV_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advAddrType); + BDA_TO_BSTREAM(p, pAdvAddr); + UINT8_TO_BSTREAM(p, advSid); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE remove device from periodic advertiser list command. + * + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param advSid Advertising SID. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeRemoveDeviceFromPerAdvListCmd(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_REMOVE_DEV_PER_ADV_LIST, HCI_LEN_LE_REMOVE_DEV_PER_ADV_LIST)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, advAddrType); + BDA_TO_BSTREAM(p, pAdvAddr); + UINT8_TO_BSTREAM(p, advSid); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE clear periodic advertiser list command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeClearPerAdvListCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CLEAR_PER_ADV_LIST, HCI_LEN_LE_CLEAR_PER_ADV_LIST)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read periodic advertiser size command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadPerAdvListSizeCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE, HCI_LEN_LE_READ_PER_ADV_LIST_SIZE)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read transmit power command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadTxPower(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_TX_POWER, HCI_LEN_LE_READ_TX_POWER)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read RF path compensation command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadRfPathComp(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_RF_PATH_COMP, HCI_LEN_LE_READ_RF_PATH_COMP)) != NULL) + { + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE write RF path compensation command. + * + * \param txPathComp RF transmit path compensation value. + * \param rxPathComp RF receive path compensation value. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_WRITE_RF_PATH_COMP, HCI_LEN_LE_WRITE_RF_PATH_COMP)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, txPathComp); + UINT16_TO_BSTREAM(p, rxPathComp); + hciCmdSend(pBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c new file mode 100644 index 0000000000000000000000000000000000000000..32117dbfd5ac01bb7e71289c52b64037cc62b8d1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c @@ -0,0 +1,165 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI Constant Tone Extension (CTE) command module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "hci_cmd.h" +#include "hci_api.h" +#include "hci_main.h" + +/*************************************************************************************************/ +/*! + * \brief HCI LE set connection CTE receive parameters command. + * + * \param connHandle Connection handle. + * \param samplingEnable TRUE to enable Connection IQ sampling, FALSE to disable it. + * \param slotDurations Switching and sampling slot durations to be used while receiving CTE. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetConnCteRxParamsCmd(uint16_t connHandle, uint8_t samplingEnable, uint8_t slotDurations, + uint8_t switchPatternLen, uint8_t *pAntennaIDs) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_CONN_CTE_RX_PARAMS, + HCI_LEN_LE_SET_CONN_CTE_RX_PARAMS(switchPatternLen))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT8_TO_BSTREAM(p, samplingEnable); + UINT8_TO_BSTREAM(p, slotDurations); + UINT8_TO_BSTREAM(p, switchPatternLen); + memcpy(p, pAntennaIDs, switchPatternLen); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set connection CTE transmit parameters command. + * + * \param connHandle Connection handle. + * \param cteTypeBits Permitted CTE type bits used for transmitting CTEs requested by peer. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetConnCteTxParamsCmd(uint16_t connHandle, uint8_t cteTypeBits, uint8_t switchPatternLen, + uint8_t *pAntennaIDs) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_CONN_CTE_TX_PARAMS, + HCI_LEN_LE_SET_CONN_CTE_TX_PARAMS(switchPatternLen))) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT8_TO_BSTREAM(p, cteTypeBits); + UINT8_TO_BSTREAM(p, switchPatternLen); + memcpy(p, pAntennaIDs, switchPatternLen); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE connection CTE request enable command. + * + * \param connHandle Connection handle. + * \param enable TRUE to enable CTE request for connection, FALSE to disable it. + * \param cteReqInt CTE request interval. + * \param reqCteLen Minimum length of CTE being requested in 8 us units. + * \param reqCteType Requested CTE type. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeConnCteReqEnableCmd(uint16_t connHandle, uint8_t enable, uint16_t cteReqInt, + uint8_t reqCteLen, uint8_t reqCteType) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CONN_CTE_REQ_ENABLE, + HCI_LEN_LE_CONN_CTE_REQ_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT8_TO_BSTREAM(p, enable); + UINT16_TO_BSTREAM(p, cteReqInt); + UINT8_TO_BSTREAM(p, reqCteLen); + UINT8_TO_BSTREAM(p, reqCteType); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE connection CTE response enable command. + * + * \param connHandle Connection handle. + * \param enable TRUE to enable CTE response for connection, FALSE to disable it. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeConnCteRspEnableCmd(uint16_t connHandle, uint8_t enable) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_CONN_CTE_RSP_ENABLE, + HCI_LEN_LE_CONN_CTE_RSP_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT8_TO_BSTREAM(p, enable); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE read antenna information command. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeReadAntennaInfoCmd(void) +{ + uint8_t *pBuf; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_ANTENNA_INFO, HCI_LEN_LE_READ_ANTENNA_INFO)) != NULL) + { + hciCmdSend(pBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c new file mode 100644 index 0000000000000000000000000000000000000000..a2da0214d9c342c80167a6dbd4e7c8c67daa44f2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c @@ -0,0 +1,171 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI Periodic Advertising Sync Transfer (PAST) command module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "hci_cmd.h" +#include "hci_api.h" +#include "hci_main.h" + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising receive enable command. + * + * \param syncHandle Periodic sync handle. + * \param enable TRUE to enable reports, FALSE to disable reports. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvRcvEnableCmd(uint16_t syncHandle, uint8_t enable) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PER_ADV_RCV_ENABLE, + HCI_LEN_LE_SET_PER_ADV_RCV_ENABLE)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, syncHandle); + UINT8_TO_BSTREAM(p, enable); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE periodic advertising sync transfer command. + * + * \param connHandle Connection handle. + * \param serviceData Service data provided by the host. + * \param syncHandle Periodic sync handle. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvSyncTrsfCmd(uint16_t connHandle, uint16_t serviceData, uint16_t syncHandle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_PER_ADV_SYNC_TRANSFER, + HCI_LEN_LE_PER_ADV_SYNC_TRANSFER)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT16_TO_BSTREAM(p, serviceData); + UINT16_TO_BSTREAM(p, syncHandle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising set info transfer command. + * + * \param connHandle Connection handle. + * \param serviceData Service data provided by the host. + * \param advHandle Handle to identify an advertising set. + * + * \return None. + */ +/*************************************************************************************************/ +void HciLePerAdvSetInfoTrsfCmd(uint16_t connHandle, uint16_t serviceData, uint8_t advHandle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_PER_ADV_SET_INFO_TRANSFER, + HCI_LEN_LE_PER_ADV_SET_INFO_TRANSFER)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT16_TO_BSTREAM(p, serviceData); + UINT8_TO_BSTREAM(p, advHandle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set periodic advertising sync transfer parameters command. + * + * \param connHandle Connection handle. + * \param mode Periodic sync advertising sync transfer mode. + * \param skip The number of periodic advertising packets that can be skipped after + * a successful receive. + * \param syncTimeout Synchronization timeout for the periodic advertising. + * \param cteType Constant tone extension type(Used in AoD/AoA). + * + * \return None. + */ +/*************************************************************************************************/ +void HciLeSetPerAdvSyncTrsfParamsCmd(uint16_t connHandle, uint8_t mode, uint16_t skip, + uint16_t syncTimeout, uint8_t cteType) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PAST_PARAM, HCI_LEN_LE_SET_PAST_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, connHandle); + UINT8_TO_BSTREAM(p, mode); + UINT16_TO_BSTREAM(p, skip); + UINT16_TO_BSTREAM(p, syncTimeout); + UINT8_TO_BSTREAM(p, cteType); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI LE set default periodic advertising sync transfer parameters command. + * + * \param mode Periodic sync advertising sync transfer mode. + * \param skip The number of periodic advertising packets that can be skipped after + * a successful receive. + * \param syncTimeout Synchronization timeout for the periodic advertising. + * \param cteType Constant tone extension type(Used in AoD/AoA). + * + * \return None. +*/ +/*************************************************************************************************/ +void HciLeSetDefaultPerAdvSyncTrsfParamsCmd(uint8_t mode, uint16_t skip, uint16_t syncTimeout, + uint8_t cteType) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_DEFAULT_PAST_PARAM, + HCI_LEN_LE_SET_DEFAULT_PAST_PARAM)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, mode); + UINT16_TO_BSTREAM(p, skip); + UINT16_TO_BSTREAM(p, syncTimeout); + UINT8_TO_BSTREAM(p, cteType); + hciCmdSend(pBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..e9ef9a54cb1a8df7e71abfa579800c6226d5ba9b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c @@ -0,0 +1,94 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI PHY command module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "hci_cmd.h" +#include "hci_api.h" +#include "hci_main.h" + +/*************************************************************************************************/ +/*! +* \brief HCI read PHY command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeReadPhyCmd(uint16_t handle) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_READ_PHY, HCI_LEN_LE_READ_PHY)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI set default PHY command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeSetDefaultPhyCmd(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_DEF_PHY, HCI_LEN_LE_SET_DEF_PHY)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT8_TO_BSTREAM(p, allPhys); + UINT8_TO_BSTREAM(p, txPhys); + UINT8_TO_BSTREAM(p, rxPhys); + hciCmdSend(pBuf); + } +} + +/*************************************************************************************************/ +/*! +* \brief HCI set PHY command. +* +* \return None. +*/ +/*************************************************************************************************/ +void HciLeSetPhyCmd(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions) +{ + uint8_t *pBuf; + uint8_t *p; + + if ((pBuf = hciCmdAlloc(HCI_OPCODE_LE_SET_PHY, HCI_LEN_LE_SET_PHY)) != NULL) + { + p = pBuf + HCI_CMD_HDR_LEN; + UINT16_TO_BSTREAM(p, handle); + UINT8_TO_BSTREAM(p, allPhys); + UINT8_TO_BSTREAM(p, txPhys); + UINT8_TO_BSTREAM(p, rxPhys); + UINT16_TO_BSTREAM(p, phyOptions); + hciCmdSend(pBuf); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c new file mode 100644 index 0000000000000000000000000000000000000000..0a868375d6c100fd9c6e1bb17f78e5040c484d4d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c @@ -0,0 +1,365 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI core platform-specific module for dual-chip. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bda.h" +#include "util/bstream.h" +#include "hci_core.h" +#include "hci_tr.h" +#include "hci_cmd.h" +#include "hci_evt.h" +#include "hci_api.h" +#include "hci_main.h" + +/*************************************************************************************************/ +/*! + * \brief HCI core initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreInit(void) +{ + hciCmdInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an HCI Number of Completed Packets event. + * + * \param pMsg Message containing the HCI Number of Completed Packets event. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreNumCmplPkts(uint8_t *pMsg) +{ + uint8_t numHandles; + uint16_t bufs; + uint16_t handle; + uint8_t availBufs = 0; + hciCoreConn_t *pConn; + + /* parse number of handles */ + BSTREAM_TO_UINT8(numHandles, pMsg); + + /* for each handle in event */ + while (numHandles-- > 0) + { + /* parse handle and number of buffers */ + BSTREAM_TO_UINT16(handle, pMsg); + BSTREAM_TO_UINT16(bufs, pMsg); + + if ((pConn = hciCoreConnByHandle(handle)) != NULL) + { + /* decrement outstanding buffer count to controller */ + pConn->outBufs -= (uint8_t) bufs; + + /* decrement queued buffer count for this connection */ + pConn->queuedBufs -= (uint8_t) bufs; + + /* increment available buffer count */ + availBufs += (uint8_t) bufs; + + /* call flow control callback */ + if (pConn->flowDisabled && pConn->queuedBufs <= hciCoreCb.aclQueueLo) + { + pConn->flowDisabled = FALSE; + (*hciCb.flowCback)(handle, FALSE); + } + } + } + + /* service TX data path */ + hciCoreTxReady(availBufs); +} + +/*************************************************************************************************/ +/*! + * \brief Send a received HCI event or ACL packet to the HCI event handler. + * + * \param msgType Message type: HCI_ACL_TYPE or HCI_EVT_TYPE. + * \param pCoreRecvMsg Pointer to received message. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreRecv(uint8_t msgType, uint8_t *pCoreRecvMsg) +{ + /* dump event for protocol analysis */ + if (msgType == HCI_EVT_TYPE) + { + HCI_PDUMP_EVT(*(pCoreRecvMsg + 1) + HCI_EVT_HDR_LEN, pCoreRecvMsg); + } + else if (msgType == HCI_ACL_TYPE) + { + HCI_PDUMP_RX_ACL(*(pCoreRecvMsg + 2) + HCI_ACL_HDR_LEN, pCoreRecvMsg); + } + + /* queue buffer */ + WsfMsgEnq(&hciCb.rxQueue, (wsfHandlerId_t) msgType, pCoreRecvMsg); + + /* set event */ + WsfSetEvent(hciCb.handlerId, HCI_EVT_RX); +} + +/*************************************************************************************************/ +/*! + * \brief WSF event handler for core HCI. + * + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void HciCoreHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + uint8_t *pBuf; + wsfHandlerId_t handlerId; + + /* Handle message */ + if (pMsg != NULL) + { + /* Handle HCI command timeout */ + if (pMsg->event == HCI_MSG_CMD_TIMEOUT) + { + hciCmdTimeout(pMsg); + } + } + /* Handle events */ + else if (event & HCI_EVT_RX) + { + /* Process rx queue */ + while ((pBuf = WsfMsgDeq(&hciCb.rxQueue, &handlerId)) != NULL) + { + /* Handle incoming HCI events */ + if (handlerId == HCI_EVT_TYPE) + { + /* Parse/process events */ + hciEvtProcessMsg(pBuf); + + /* Handle events during reset sequence */ + if (hciCb.resetting) + { + hciCoreResetSequence(pBuf); + } + + /* Free buffer */ + WsfMsgFree(pBuf); + } + /* Handle ACL data */ + else + { + /* Reassemble */ + if ((pBuf = hciCoreAclReassembly(pBuf)) != NULL) + { + /* Call ACL callback; client will free buffer */ + hciCb.aclCback(pBuf); + } + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Return a pointer to the BD address of this device. + * + * \return Pointer to the BD address. + */ +/*************************************************************************************************/ +uint8_t *HciGetBdAddr(void) +{ + return hciCoreCb.bdAddr; +} + +/*************************************************************************************************/ +/*! + * \brief Return the white list size. + * + * \return White list size. + */ +/*************************************************************************************************/ +uint8_t HciGetWhiteListSize(void) +{ + return hciCoreCb.whiteListSize; +} + +/*************************************************************************************************/ +/*! + * \brief Return the advertising transmit power. + * + * \return Advertising transmit power. + */ +/*************************************************************************************************/ +int8_t HciGetAdvTxPwr(void) +{ + return hciCoreCb.advTxPwr; +} + +/*************************************************************************************************/ +/*! + * \brief Return the ACL buffer size supported by the controller. + * + * \return ACL buffer size. + */ +/*************************************************************************************************/ +uint16_t HciGetBufSize(void) +{ + return hciCoreCb.bufSize; +} + +/*************************************************************************************************/ +/*! + * \brief Return the number of ACL buffers supported by the controller. + * + * \return Number of ACL buffers. + */ +/*************************************************************************************************/ +uint8_t HciGetNumBufs(void) +{ + return hciCoreCb.numBufs; +} + +/*************************************************************************************************/ +/*! + * \brief Return the states supported by the controller. + * + * \return Pointer to the supported states array. + */ +/*************************************************************************************************/ +uint8_t *HciGetSupStates(void) +{ + return hciCoreCb.leStates; +} + +/*************************************************************************************************/ +/*! + * \brief Return the LE supported features supported by the controller. + * + * \return Supported features. + */ +/*************************************************************************************************/ +uint32_t HciGetLeSupFeat(void) +{ + return hciCoreCb.leSupFeat; +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum reassembled RX ACL packet length. + * + * \return ACL packet length. + */ +/*************************************************************************************************/ +uint16_t HciGetMaxRxAclLen(void) +{ + return hciCoreCb.maxRxAclLen; +} + +/*************************************************************************************************/ +/*! + * \brief Return the resolving list size. + * + * \return resolving list size. + */ +/*************************************************************************************************/ +uint8_t HciGetResolvingListSize(void) +{ + return hciCoreCb.resListSize; +} + +/*************************************************************************************************/ +/*! + * \brief Whether LL Privacy is supported. + * + * \return TRUE if LL Privacy is supported. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t HciLlPrivacySupported(void) +{ + return (hciCoreCb.resListSize > 0) ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum advertisement (or scan response) data length supported by the Controller. + * + * \return Maximum advertisement data length. + */ +/*************************************************************************************************/ +uint16_t HciGetMaxAdvDataLen(void) +{ + return hciCoreCb.maxAdvDataLen; +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum number of advertising sets supported by the Controller. + * + * \return Maximum number of advertising sets. + */ +/*************************************************************************************************/ +uint8_t HciGetNumSupAdvSets(void) +{ + return hciCoreCb.numSupAdvSets; +} + +/*************************************************************************************************/ +/*! + * \brief Whether LE Advertising Extensions is supported. + * + * \return TRUE if LE Advertising Extensions is supported. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t HciLeAdvExtSupported(void) +{ + return (hciCoreCb.numSupAdvSets > 0) ? TRUE : FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Return the periodic advertising list size. + * + * \return periodic advertising list size. + */ +/*************************************************************************************************/ +uint8_t HciGetPerAdvListSize(void) +{ + return hciCoreCb.perAdvListSize; +} + +/*************************************************************************************************/ +/*! + * \brief Return a pointer to the local version information. + * + * \return Pointer to the local version information. + */ +/*************************************************************************************************/ +hciLocalVerInfo_t *HciGetLocalVerInfo(void) +{ + return &hciCoreCb.locVerInfo; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h new file mode 100644 index 0000000000000000000000000000000000000000..f332dda297de7a1fea8d6c4ab732755b044d3fbf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h @@ -0,0 +1,42 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI core platform-specific interfaces for dual-chip. + */ +/*************************************************************************************************/ +#ifndef HCI_CORE_PS_H +#define HCI_CORE_PS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void hciCoreResetSequence(uint8_t *pMsg); +void hciCoreNumCmplPkts(uint8_t *pMsg); +void hciCoreRecv(uint8_t msgType, uint8_t *pCoreRecvMsg); +uint8_t hciCoreVsCmdCmplRcvd(uint16_t opcode, uint8_t *pMsg, uint8_t len); + +#ifdef __cplusplus +}; +#endif + +#endif /* HCI_CORE_PS_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_evt.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_evt.c new file mode 100644 index 0000000000000000000000000000000000000000..d934ebac8e22ac7cc2b917c87cab2b7014de91ae --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_evt.c @@ -0,0 +1,2353 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI event module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "hci_api.h" +#include "hci_main.h" +#include "hci_evt.h" +#include "hci_cmd.h" +#include "hci_core.h" + +#ifdef WSF_DETOKEN_TRACE +#include "wsf_detoken.h" +#endif /* LL_DETOKEN_TRACE */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Maximum number of reports that can fit in an advertising report event */ +#define HCI_MAX_REPORTS 15 + +/* Length of fixed parameters in an advertising report event */ +#define HCI_LE_ADV_REPORT_FIXED_LEN 2 + +/* Length of fixed parameters in each individual report */ +#define HCI_LE_ADV_REPORT_INDIV_LEN 10 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Event parsing function type */ +typedef void (*hciEvtParse_t)(hciEvt_t *pMsg, uint8_t *p, uint8_t len); + +/************************************************************************************************** + Local Declarations +**************************************************************************************************/ + +/* Event parsing functions */ +static void hciEvtParseLeConnCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeEnhancedConnCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseDisconnectCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeConnUpdateCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeCreateConnCancelCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadRssiCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadChanMapCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadTxPwrLvlCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadRemoteVerInfoCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadLeRemoteFeatCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeLtkReqReplCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeLtkReqNegReplCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseEncKeyRefreshCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseEncChange(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeLtkReq(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseVendorSpecCmdStatus(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseVendorSpecCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseVendorSpec(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseHwError(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeEncryptCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeRandCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeAddDevToResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeRemDevFromResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeClearResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeReadPeerResAddrCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeReadLocalResAddrCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeSetAddrResEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseRemConnParamRepCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseRemConnParamNegRepCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadDefDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseWriteDefDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseSetDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadMaxDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseRemConnParamReq(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseDataLenChange(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadPubKeyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseGenDhKeyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseWriteAuthTimeoutCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseAuthTimeoutExpiredEvt(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseReadPhyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseSetDefPhyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParsePhyUpdateCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeScanTimeout(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeAdvSetTerm(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeScanReqRcvd(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLePerAdvSyncEst(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLePerAdvSyncLost(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeChSelAlgo(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLePerSyncTrsfRcvd(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLePerAdvSyncTrsfCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLePerAdvSetInfoTrsfCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeCteReqFailed(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeSetConnCteRxParamsCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeSetConnCteTxParamsCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeConnCteReqEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeConnCteRspEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); +static void hciEvtParseLeReadAntennaInfoCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Event parsing function lookup table, indexed by internal callback event value */ +static const hciEvtParse_t hciEvtParseFcnTbl[] = +{ + NULL, + hciEvtParseLeConnCmpl, + hciEvtParseLeEnhancedConnCmpl, + hciEvtParseDisconnectCmpl, + hciEvtParseLeConnUpdateCmpl, + hciEvtParseLeCreateConnCancelCmdCmpl, + NULL, + hciEvtParseReadRssiCmdCmpl, + hciEvtParseReadChanMapCmdCmpl, + hciEvtParseReadTxPwrLvlCmdCmpl, + hciEvtParseReadRemoteVerInfoCmpl, + hciEvtParseReadLeRemoteFeatCmpl, + hciEvtParseLeLtkReqReplCmdCmpl, + hciEvtParseLeLtkReqNegReplCmdCmpl, + hciEvtParseEncKeyRefreshCmpl, + hciEvtParseEncChange, + hciEvtParseLeLtkReq, + hciEvtParseVendorSpecCmdStatus, + hciEvtParseVendorSpecCmdCmpl, + hciEvtParseVendorSpec, + hciEvtParseHwError, + hciEvtParseLeAddDevToResListCmdCmpl, + hciEvtParseLeRemDevFromResListCmdCmpl, + hciEvtParseLeClearResListCmdCmpl, + hciEvtParseLeReadPeerResAddrCmdCmpl, + hciEvtParseLeReadLocalResAddrCmdCmpl, + hciEvtParseLeSetAddrResEnableCmdCmpl, + hciEvtParseLeEncryptCmdCmpl, + hciEvtParseLeRandCmdCmpl, + hciEvtParseRemConnParamRepCmdCmpl, + hciEvtParseRemConnParamNegRepCmdCmpl, + hciEvtParseReadDefDataLenCmdCmpl, + hciEvtParseWriteDefDataLenCmdCmpl, + hciEvtParseSetDataLenCmdCmpl, + hciEvtParseReadMaxDataLenCmdCmpl, + hciEvtParseRemConnParamReq, + hciEvtParseDataLenChange, + hciEvtParseReadPubKeyCmdCmpl, + hciEvtParseGenDhKeyCmdCmpl, + hciEvtParseWriteAuthTimeoutCmdCmpl, + hciEvtParseAuthTimeoutExpiredEvt, + hciEvtParseReadPhyCmdCmpl, + hciEvtParseSetDefPhyCmdCmpl, + hciEvtParsePhyUpdateCmpl, + NULL, + hciEvtParseLeScanTimeout, + hciEvtParseLeAdvSetTerm, + hciEvtParseLeScanReqRcvd, + hciEvtParseLePerAdvSyncEst, + NULL, + hciEvtParseLePerAdvSyncLost, + hciEvtParseLeChSelAlgo, + hciEvtParseLeCmdCmpl, + hciEvtParseLeCmdCmpl, + hciEvtParseLeCmdCmpl, + hciEvtParseLeCmdCmpl, + hciEvtParseLeCmdCmpl, + hciEvtParseLeCmdCmpl, + hciEvtParseLePerSyncTrsfRcvd, + hciEvtParseLePerAdvSyncTrsfCmdCmpl, + hciEvtParseLePerAdvSetInfoTrsfCmdCmpl, + NULL, + hciEvtParseLeCteReqFailed, + hciEvtParseLeSetConnCteRxParamsCmdCmpl, + hciEvtParseLeSetConnCteTxParamsCmdCmpl, + hciEvtParseLeConnCteReqEnableCmdCmpl, + hciEvtParseLeConnCteRspEnableCmdCmpl, + hciEvtParseLeReadAntennaInfoCmdCmpl +}; + +/* HCI event structure length table, indexed by internal callback event value */ +static const uint8_t hciEvtCbackLen[] = +{ + sizeof(wsfMsgHdr_t), + sizeof(hciLeConnCmplEvt_t), + sizeof(hciLeConnCmplEvt_t), + sizeof(hciDisconnectCmplEvt_t), + sizeof(hciLeConnUpdateCmplEvt_t), + sizeof(hciLeCreateConnCancelCmdCmplEvt_t), + sizeof(hciLeAdvReportEvt_t), + sizeof(hciReadRssiCmdCmplEvt_t), + sizeof(hciReadChanMapCmdCmplEvt_t), + sizeof(hciReadTxPwrLvlCmdCmplEvt_t), + sizeof(hciReadRemoteVerInfoCmplEvt_t), + sizeof(hciLeReadRemoteFeatCmplEvt_t), + sizeof(hciLeLtkReqReplCmdCmplEvt_t), + sizeof(hciLeLtkReqNegReplCmdCmplEvt_t), + sizeof(hciEncKeyRefreshCmpl_t), + sizeof(hciEncChangeEvt_t), + sizeof(hciLeLtkReqEvt_t), + sizeof(hciVendorSpecCmdStatusEvt_t), + sizeof(hciVendorSpecCmdCmplEvt_t), + sizeof(hciVendorSpecEvt_t), + sizeof(hciHwErrorEvt_t), + sizeof(hciLeAddDevToResListCmdCmplEvt_t), + sizeof(hciLeRemDevFromResListCmdCmplEvt_t), + sizeof(hciLeClearResListCmdCmplEvt_t), + sizeof(hciLeReadPeerResAddrCmdCmplEvt_t), + sizeof(hciLeReadLocalResAddrCmdCmplEvt_t), + sizeof(hciLeSetAddrResEnableCmdCmplEvt_t), + sizeof(hciLeEncryptCmdCmplEvt_t), + sizeof(hciLeRandCmdCmplEvt_t), + sizeof(hciLeRemConnParamRepEvt_t), + sizeof(hciLeRemConnParamNegRepEvt_t), + sizeof(hciLeReadDefDataLenEvt_t), + sizeof(hciLeWriteDefDataLenEvt_t), + sizeof(hciLeSetDataLenEvt_t), + sizeof(hciLeReadMaxDataLenEvt_t), + sizeof(hciLeRemConnParamReqEvt_t), + sizeof(hciLeDataLenChangeEvt_t), + sizeof(hciLeP256CmplEvt_t), + sizeof(hciLeGenDhKeyEvt_t), + sizeof(hciWriteAuthPayloadToCmdCmplEvt_t), + sizeof(hciAuthPayloadToExpiredEvt_t), + sizeof(hciLeReadPhyCmdCmplEvt_t), + sizeof(hciLeSetDefPhyCmdCmplEvt_t), + sizeof(hciLePhyUpdateEvt_t), + sizeof(hciLeExtAdvReportEvt_t), + sizeof(hciLeScanTimeoutEvt_t), + sizeof(hciLeAdvSetTermEvt_t), + sizeof(hciLeScanReqRcvdEvt_t), + sizeof(hciLePerAdvSyncEstEvt_t), + sizeof(hciLePerAdvReportEvt_t), + sizeof(hciLePerAdvSyncLostEvt_t), + sizeof(hciLeChSelAlgoEvt_t), + sizeof(wsfMsgHdr_t), + sizeof(wsfMsgHdr_t), + sizeof(wsfMsgHdr_t), + sizeof(wsfMsgHdr_t), + sizeof(wsfMsgHdr_t), + sizeof(wsfMsgHdr_t), + sizeof(HciLePerAdvSyncTrsfRcvdEvt_t), + sizeof(hciLePerAdvSyncTrsfCmdCmplEvt_t), + sizeof(hciLePerAdvSetInfoTrsfCmdCmplEvt_t), + sizeof(hciLeConnIQReportEvt_t), + sizeof(hciLeCteReqFailedEvt_t), + sizeof(hciLeSetConnCteRxParamsCmdCmplEvt_t), + sizeof(hciLeSetConnCteTxParamsCmdCmplEvt_t), + sizeof(hciLeConnCteReqEnableCmdCmplEvt_t), + sizeof(hciLeConnCteRspEnableCmdCmplEvt_t), + sizeof(hciLeReadAntennaInfoCmdCmplEvt_t) +}; + +/* Global event statistics. */ +static hciEvtStats_t hciEvtStats = {0}; + + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeConnCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leConnCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.role, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.addrType, p); + BSTREAM_TO_BDA(pMsg->leConnCmpl.peerAddr, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.connInterval, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.connLatency, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.supTimeout, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.clockAccuracy, p); + + /* zero out unused fields */ + memset(pMsg->leConnCmpl.localRpa, 0, BDA_ADDR_LEN); + memset(pMsg->leConnCmpl.peerRpa, 0, BDA_ADDR_LEN); + + pMsg->hdr.param = pMsg->leConnCmpl.handle; + pMsg->hdr.status = pMsg->leConnCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeEnhancedConnCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leConnCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.role, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.addrType, p); + BSTREAM_TO_BDA(pMsg->leConnCmpl.peerAddr, p); + BSTREAM_TO_BDA(pMsg->leConnCmpl.localRpa, p); + BSTREAM_TO_BDA(pMsg->leConnCmpl.peerRpa, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.connInterval, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.connLatency, p); + BSTREAM_TO_UINT16(pMsg->leConnCmpl.supTimeout, p); + BSTREAM_TO_UINT8(pMsg->leConnCmpl.clockAccuracy, p); + + pMsg->hdr.param = pMsg->leConnCmpl.handle; + pMsg->hdr.status = pMsg->leConnCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseDisconnectCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->disconnectCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->disconnectCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->disconnectCmpl.reason, p); + + pMsg->hdr.param = pMsg->disconnectCmpl.handle; + pMsg->hdr.status = pMsg->disconnectCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeConnUpdateCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leConnUpdateCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leConnUpdateCmpl.handle, p); + BSTREAM_TO_UINT16(pMsg->leConnUpdateCmpl.connInterval, p); + BSTREAM_TO_UINT16(pMsg->leConnUpdateCmpl.connLatency, p); + BSTREAM_TO_UINT16(pMsg->leConnUpdateCmpl.supTimeout, p); + + pMsg->hdr.param = pMsg->leConnUpdateCmpl.handle; + pMsg->hdr.status = pMsg->leConnUpdateCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeCreateConnCancelCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leCreateConnCancelCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leCreateConnCancelCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadRssiCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->readRssiCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->readRssiCmdCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->readRssiCmdCmpl.rssi, p); + + pMsg->hdr.param = pMsg->readRssiCmdCmpl.handle; + pMsg->hdr.status = pMsg->readRssiCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadChanMapCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->readChanMapCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->readChanMapCmdCmpl.handle, p); + + memcpy(pMsg->readChanMapCmdCmpl.chanMap, p, HCI_CHAN_MAP_LEN); + + pMsg->hdr.param = pMsg->readChanMapCmdCmpl.handle; + pMsg->hdr.status = pMsg->readChanMapCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadTxPwrLvlCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->readTxPwrLvlCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->readTxPwrLvlCmdCmpl.handle, p); + BSTREAM_TO_INT8(pMsg->readTxPwrLvlCmdCmpl.pwrLvl, p); + + pMsg->hdr.param = pMsg->readTxPwrLvlCmdCmpl.handle; + pMsg->hdr.status = pMsg->readTxPwrLvlCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadRemoteVerInfoCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->readRemoteVerInfoCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->readRemoteVerInfoCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->readRemoteVerInfoCmpl.version, p); + BSTREAM_TO_UINT16(pMsg->readRemoteVerInfoCmpl.mfrName, p); + BSTREAM_TO_UINT16(pMsg->readRemoteVerInfoCmpl.subversion, p); + + pMsg->hdr.param = pMsg->readRemoteVerInfoCmpl.handle; + pMsg->hdr.status = pMsg->readRemoteVerInfoCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadLeRemoteFeatCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadRemoteFeatCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leReadRemoteFeatCmpl.handle, p); + memcpy(&pMsg->leReadRemoteFeatCmpl.features, p, HCI_FEAT_LEN); + + pMsg->hdr.param = pMsg->leReadRemoteFeatCmpl.handle; + pMsg->hdr.status = pMsg->leReadRemoteFeatCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeLtkReqReplCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leLtkReqReplCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leLtkReqReplCmdCmpl.handle, p); + + pMsg->hdr.param = pMsg->leLtkReqReplCmdCmpl.handle; + pMsg->hdr.status = pMsg->leLtkReqReplCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeLtkReqNegReplCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leLtkReqNegReplCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leLtkReqNegReplCmdCmpl.handle, p); + + pMsg->hdr.param = pMsg->leLtkReqNegReplCmdCmpl.handle; + pMsg->hdr.status = pMsg->leLtkReqNegReplCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseEncKeyRefreshCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->encKeyRefreshCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->encKeyRefreshCmpl.handle, p); + + pMsg->hdr.param = pMsg->encKeyRefreshCmpl.handle; + pMsg->hdr.status = pMsg->encKeyRefreshCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseEncChange(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->encChange.status, p); + BSTREAM_TO_UINT16(pMsg->encChange.handle, p); + BSTREAM_TO_UINT8(pMsg->encChange.enabled, p); + + pMsg->hdr.param = pMsg->encChange.handle; + pMsg->hdr.status = pMsg->encChange.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeLtkReq(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->leLtkReq.handle, p); + + memcpy(pMsg->leLtkReq.randNum, p, HCI_RAND_LEN); + p += HCI_RAND_LEN; + + BSTREAM_TO_UINT16(pMsg->leLtkReq.encDiversifier, p); + + pMsg->hdr.param = pMsg->leLtkReq.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseVendorSpecCmdStatus(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->vendorSpecCmdStatus.opcode, p); +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseVendorSpecCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + /* roll pointer back to opcode */ + p -= 2; + + BSTREAM_TO_UINT16(pMsg->vendorSpecCmdCmpl.opcode, p); + BSTREAM_TO_UINT8(pMsg->hdr.status, p); + BSTREAM_TO_UINT8(pMsg->vendorSpecCmdCmpl.param[0], p); +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseVendorSpec(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + memcpy(pMsg->vendorSpec.param, p, len); +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseHwError(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->hwError.code, p); +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeEncryptCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leEncryptCmdCmpl.status, p); + memcpy(pMsg->leEncryptCmdCmpl.data, p, HCI_ENCRYPT_DATA_LEN); + + pMsg->hdr.status = pMsg->leEncryptCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeRandCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leRandCmdCmpl.status, p); + memcpy(pMsg->leRandCmdCmpl.randNum, p, HCI_RAND_LEN); + + pMsg->hdr.status = pMsg->leRandCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeAddDevToResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leAddDevToResListCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leAddDevToResListCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeRemDevFromResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leRemDevFromResListCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leRemDevFromResListCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeClearResListCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leClearResListCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leClearResListCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeReadPeerResAddrCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadPeerResAddrCmdCmpl.status, p); + BSTREAM_TO_BDA(pMsg->leReadPeerResAddrCmdCmpl.peerRpa, p); + + pMsg->hdr.status = pMsg->leReadPeerResAddrCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeReadLocalResAddrCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadLocalResAddrCmdCmpl.status, p); + BSTREAM_TO_BDA(pMsg->leReadLocalResAddrCmdCmpl.localRpa, p); + + pMsg->hdr.status = pMsg->leReadLocalResAddrCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeSetAddrResEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leSetAddrResEnableCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leSetAddrResEnableCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseRemConnParamRepCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leRemConnParamRepCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamRepCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leRemConnParamRepCmdCmpl.status; + pMsg->hdr.param = pMsg->leRemConnParamRepCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseRemConnParamNegRepCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leRemConnParamNegRepCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamNegRepCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leRemConnParamNegRepCmdCmpl.status; + pMsg->hdr.param = pMsg->leRemConnParamNegRepCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadDefDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadDefDataLenCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leReadDefDataLenCmdCmpl.suggestedMaxTxOctets, p); + BSTREAM_TO_UINT16(pMsg->leReadDefDataLenCmdCmpl.suggestedMaxTxTime, p); + + pMsg->hdr.status = pMsg->leReadDefDataLenCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseWriteDefDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leWriteDefDataLenCmdCmpl.status, p); + pMsg->hdr.status = pMsg->leWriteDefDataLenCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseSetDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leSetDataLenCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leSetDataLenCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leSetDataLenCmdCmpl.status; + pMsg->hdr.param = pMsg->leSetDataLenCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadMaxDataLenCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadMaxDataLenCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leReadMaxDataLenCmdCmpl.supportedMaxTxOctets, p); + BSTREAM_TO_UINT16(pMsg->leReadMaxDataLenCmdCmpl.supportedMaxTxTime, p); + BSTREAM_TO_UINT16(pMsg->leReadMaxDataLenCmdCmpl.supportedMaxRxOctets, p); + BSTREAM_TO_UINT16(pMsg->leReadMaxDataLenCmdCmpl.supportedMaxRxTime, p); + + pMsg->hdr.status = pMsg->leReadMaxDataLenCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseRemConnParamReq(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->leRemConnParamReq.handle, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamReq.intervalMin, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamReq.intervalMax, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamReq.latency, p); + BSTREAM_TO_UINT16(pMsg->leRemConnParamReq.timeout, p); + + pMsg->hdr.param = pMsg->leRemConnParamReq.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseDataLenChange(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->leDataLenChange.handle, p); + BSTREAM_TO_UINT16(pMsg->leDataLenChange.maxTxOctets, p); + BSTREAM_TO_UINT16(pMsg->leDataLenChange.maxTxTime, p); + BSTREAM_TO_UINT16(pMsg->leDataLenChange.maxRxOctets, p); + BSTREAM_TO_UINT16(pMsg->leDataLenChange.maxRxTime, p); + + pMsg->hdr.param = pMsg->leDataLenChange.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadPubKeyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leP256.status, p); + memcpy(pMsg->leP256.key, p, HCI_P256_KEY_LEN); + + pMsg->hdr.status = pMsg->leP256.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseGenDhKeyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leGenDHKey.status, p); + memcpy(pMsg->leGenDHKey.key, p, HCI_DH_KEY_LEN); + + pMsg->hdr.status = pMsg->leGenDHKey.status; +} + +/*************************************************************************************************/ +/*! + * \brief Process HCI write authenticated payload timeout command complete event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseWriteAuthTimeoutCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->writeAuthPayloadToCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->writeAuthPayloadToCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->writeAuthPayloadToCmdCmpl.status; + pMsg->hdr.param = pMsg->writeAuthPayloadToCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Process HCI authenticated payload timeout expired event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseAuthTimeoutExpiredEvt(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->authPayloadToExpired.handle, p); + + pMsg->hdr.param = pMsg->authPayloadToExpired.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseReadPhyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadPhyCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leReadPhyCmdCmpl.handle, p); + BSTREAM_TO_UINT8(pMsg->leReadPhyCmdCmpl.txPhy, p); + BSTREAM_TO_UINT8(pMsg->leReadPhyCmdCmpl.rxPhy, p); + + pMsg->hdr.status = pMsg->leReadPhyCmdCmpl.status; + pMsg->hdr.param = pMsg->leReadPhyCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseSetDefPhyCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leSetDefPhyCmdCmpl.status, p); + + pMsg->hdr.status = pMsg->leSetDefPhyCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParsePhyUpdateCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->lePhyUpdate.status, p); + BSTREAM_TO_UINT16(pMsg->lePhyUpdate.handle, p); + BSTREAM_TO_UINT8(pMsg->lePhyUpdate.txPhy, p); + BSTREAM_TO_UINT8(pMsg->lePhyUpdate.rxPhy, p); + + pMsg->hdr.status = pMsg->lePhyUpdate.status; + pMsg->hdr.param = pMsg->lePhyUpdate.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE advertising report. + * + * \param p Buffer containing HCI event, points to start of parameters. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtProcessLeAdvReport(uint8_t *p, uint8_t len) +{ + hciLeAdvReportEvt_t *pMsg; + uint8_t i; + + /* get number of reports */ + BSTREAM_TO_UINT8(i, p); + + HCI_TRACE_INFO1("HCI Adv report, num reports: %d", i); + + /* sanity check num reports */ + if (i > HCI_MAX_REPORTS) + { + return; + } + + /* allocate temp buffer that can hold max length adv/scan rsp data */ + if ((pMsg = WsfBufAlloc(sizeof(hciLeAdvReportEvt_t) + HCI_ADV_DATA_LEN)) != NULL) + { + /* parse each report and execute callback */ + while (i-- > 0) + { + BSTREAM_TO_UINT8(pMsg->eventType, p); + BSTREAM_TO_UINT8(pMsg->addrType, p); + BSTREAM_TO_BDA(pMsg->addr, p); + BSTREAM_TO_UINT8(pMsg->len, p); + + HCI_TRACE_INFO1("HCI Adv report, data len: %d", pMsg->len); + + /* sanity check on report length; quit if invalid */ + if (pMsg->len > HCI_ADV_DATA_LEN) + { + HCI_TRACE_WARN0("Invalid adv report data len"); + break; + } + + /* Copy data to space after end of report struct */ + pMsg->pData = (uint8_t *) (pMsg + 1); + memcpy(pMsg->pData, p, pMsg->len); + p += pMsg->len; + + BSTREAM_TO_UINT8(pMsg->rssi, p); + + /* zero out unused fields */ + pMsg->directAddrType = 0; + memset(pMsg->directAddr, 0, BDA_ADDR_LEN); + + /* initialize message header */ + pMsg->hdr.param = 0; + pMsg->hdr.event = HCI_LE_ADV_REPORT_CBACK_EVT; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute callback */ + (*hciCb.evtCback)((hciEvt_t *) pMsg); + } + + /* free buffer */ + WsfBufFree(pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE extended advertising report. + * + * \param p Buffer containing HCI event, points to start of parameters. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtProcessLeExtAdvReport(uint8_t *p, uint8_t len) +{ + hciLeExtAdvReportEvt_t *pMsg; + uint8_t i; + uint8_t *ptr; + uint8_t maxLen; + uint8_t dataLen; + + /* get number of reports without advancing pointer */ + i = *p; + + HCI_TRACE_INFO1("HCI Ext Adv report, num reports: %d", i); + + /* sanity check num reports */ + if (i > HCI_MAX_REPORTS) + { + return; + } + + ptr = p + 1; + maxLen = 0; + + /* find out max length ext adv/scan rsp data */ + while (i-- > 0) + { + ptr += HCI_EXT_ADV_RPT_DATA_LEN_OFFSET; + BSTREAM_TO_UINT8(dataLen, ptr); + ptr += dataLen; + + /* if len greater than max len seen so far */ + if (dataLen > maxLen) + { + /* update max len */ + maxLen = dataLen; + } + } + + /* allocate temp buffer that can hold max length ext adv/scan rsp data */ + if ((pMsg = WsfBufAlloc(sizeof(hciLeExtAdvReportEvt_t) + maxLen)) != NULL) + { + /* get number of reports */ + BSTREAM_TO_UINT8(i, p); + + /* parse each report and execute callback */ + while (i-- > 0) + { + BSTREAM_TO_UINT16(pMsg->eventType, p); + BSTREAM_TO_UINT8(pMsg->addrType, p); + BSTREAM_TO_BDA(pMsg->addr, p); + BSTREAM_TO_UINT8(pMsg->priPhy, p); + BSTREAM_TO_UINT8(pMsg->secPhy, p); + BSTREAM_TO_UINT8(pMsg->advSid, p); + BSTREAM_TO_INT8(pMsg->txPower, p); + BSTREAM_TO_INT8(pMsg->rssi, p); + BSTREAM_TO_UINT16(pMsg->perAdvInter, p); + BSTREAM_TO_UINT8(pMsg->directAddrType, p); + BSTREAM_TO_BDA(pMsg->directAddr, p); + BSTREAM_TO_UINT8(pMsg->len, p); + + HCI_TRACE_INFO1("HCI Ext Adv report, data len: %d", pMsg->len); + + /* sanity check on report length; quit if invalid */ + if (pMsg->len > HCI_EXT_ADV_RPT_DATA_LEN) + { + HCI_TRACE_WARN0("Invalid ext adv report data len"); + break; + } + + /* Copy data to space after end of report struct */ + pMsg->pData = (uint8_t *)(pMsg + 1); + memcpy(pMsg->pData, p, pMsg->len); + p += pMsg->len; + + /* initialize message header */ + pMsg->hdr.param = 0; + pMsg->hdr.event = HCI_LE_EXT_ADV_REPORT_CBACK_EVT; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute callback */ + (*hciCb.evtCback)((hciEvt_t *)pMsg); + } + + /* free buffer */ + WsfBufFree(pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE scan timeout event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeScanTimeout(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE advertising set terminated event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeAdvSetTerm(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leAdvSetTerm.status, p); + BSTREAM_TO_UINT8(pMsg->leAdvSetTerm.advHandle, p); + BSTREAM_TO_UINT16(pMsg->leAdvSetTerm.handle, p); + BSTREAM_TO_UINT8(pMsg->leAdvSetTerm.numComplEvts, p); + + pMsg->hdr.status = pMsg->leAdvSetTerm.status; + pMsg->hdr.param = pMsg->leAdvSetTerm.advHandle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE scan request received event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeScanReqRcvd(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leScanReqRcvd.advHandle, p); + BSTREAM_TO_UINT8(pMsg->leScanReqRcvd.scanAddrType, p); + BSTREAM_TO_BDA(pMsg->leScanReqRcvd.scanAddr, p); + + pMsg->hdr.param = pMsg->leScanReqRcvd.advHandle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE periodic advertising sync established event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLePerAdvSyncEst(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncEst.status, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncEst.syncHandle, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncEst.advSid, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncEst.advAddrType, p); + BSTREAM_TO_BDA(pMsg->lePerAdvSyncEst.advAddr, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncEst.advPhy, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncEst.perAdvInterval, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncEst.clockAccuracy, p); + + pMsg->hdr.status = pMsg->lePerAdvSyncEst.status; + pMsg->hdr.param = pMsg->lePerAdvSyncEst.syncHandle; +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE periodic advertising report event. + * + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtProcessLePerAdvReport(uint8_t *p, uint8_t len) +{ + hciLePerAdvReportEvt_t *pMsg; + uint8_t dataLen; + + HCI_TRACE_INFO0("HCI Per Adv report"); + + /* get report data length */ + dataLen = p[HCI_PER_ADV_RPT_DATA_LEN_OFFSET]; + + /* sanity check on report length; quit if invalid */ + if (dataLen > HCI_PER_ADV_RPT_DATA_LEN) + { + HCI_TRACE_WARN1("Invalid per adv report data len: %d", dataLen); + return; + } + + /* allocate temp buffer that can hold max length periodic adv report data */ + if ((pMsg = WsfBufAlloc(sizeof(hciLePerAdvReportEvt_t) + dataLen)) != NULL) + { + /* parse report and execute callback */ + BSTREAM_TO_UINT16(pMsg->syncHandle, p); + BSTREAM_TO_UINT8(pMsg->txPower, p); + BSTREAM_TO_UINT8(pMsg->rssi, p); + BSTREAM_TO_UINT8(pMsg->unused, p); + BSTREAM_TO_UINT8(pMsg->status, p); + BSTREAM_TO_UINT8(pMsg->len, p); + + HCI_TRACE_INFO1("HCI Per Adv report, data len: %d", pMsg->len); + + /* Copy data to space after end of report struct */ + pMsg->pData = (uint8_t *)(pMsg + 1); + memcpy(pMsg->pData, p, pMsg->len); + + /* initialize message header */ + pMsg->hdr.param = pMsg->syncHandle; + pMsg->hdr.event = HCI_LE_PER_ADV_REPORT_CBACK_EVT; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute callback */ + (*hciCb.evtCback)((hciEvt_t *)pMsg); + + /* free buffer */ + WsfBufFree(pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE complete event containing a one byte status. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->hdr.status, p); +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE periodic advertising synch lost event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLePerAdvSyncLost(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncLost.syncHandle, p); + + pMsg->hdr.param = pMsg->lePerAdvSyncLost.syncHandle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE channel selection algorithm event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeChSelAlgo(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT16(pMsg->leChSelAlgo.handle, p); + BSTREAM_TO_UINT8(pMsg->leChSelAlgo.chSelAlgo, p); + + pMsg->hdr.param = pMsg->leChSelAlgo.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE periodic advertising synch transfer received event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. +*/ +/*************************************************************************************************/ +static void hciEvtParseLePerSyncTrsfRcvd(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfRcvd.status, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncTrsfRcvd.connHandle, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncTrsfRcvd.serviceData, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncTrsfRcvd.syncHandle, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfRcvd.advSid, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfRcvd.advAddrType, p); + BSTREAM_TO_BDA(pMsg->lePerAdvSyncTrsfRcvd.advAddr, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfRcvd.advPhy, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncTrsfRcvd.perAdvInterval, p); + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfRcvd.clockAccuracy, p); + + /* initialize message header */ + pMsg->hdr.status = pMsg->lePerAdvSyncTrsfRcvd.status; + pMsg->hdr.param = pMsg->lePerAdvSyncTrsfRcvd.connHandle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE periodic advertising sync transfer command complete event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLePerAdvSyncTrsfCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->lePerAdvSyncTrsfCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSyncTrsfCmdCmpl.handle, p); + + pMsg->hdr.param = pMsg->lePerAdvSyncTrsfCmdCmpl.handle; + pMsg->hdr.status = pMsg->lePerAdvSyncTrsfCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI LE set periodic advertising set info transfer command complete event. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLePerAdvSetInfoTrsfCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->lePerAdvSetInfoTrsfCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->lePerAdvSetInfoTrsfCmdCmpl.handle, p); + + pMsg->hdr.param = pMsg->lePerAdvSetInfoTrsfCmdCmpl.handle; + pMsg->hdr.status = pMsg->lePerAdvSetInfoTrsfCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE direct advertising report. + * + * \param p Buffer containing HCI event, points to start of parameters. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtProcessLeDirectAdvReport(uint8_t *p, uint8_t len) +{ + hciLeAdvReportEvt_t *pMsg; + uint8_t i; + + /* get number of reports */ + BSTREAM_TO_UINT8(i, p); + + HCI_TRACE_INFO1("HCI Adv report, num reports: %d", i); + + /* sanity check num reports */ + if (i > HCI_MAX_REPORTS) + { + return; + } + + /* allocate temp buffer that can hold max length adv/scan rsp data */ + if ((pMsg = WsfBufAlloc(sizeof(hciLeAdvReportEvt_t))) != NULL) + { + /* parse each report and execute callback */ + while (i-- > 0) + { + BSTREAM_TO_UINT8(pMsg->eventType, p); + BSTREAM_TO_UINT8(pMsg->addrType, p); + BSTREAM_TO_BDA(pMsg->addr, p); + BSTREAM_TO_UINT8(pMsg->directAddrType, p); + BSTREAM_TO_BDA(pMsg->directAddr, p); + BSTREAM_TO_UINT8(pMsg->rssi, p); + + /* zero out unused fields */ + pMsg->len = 0; + pMsg->pData = NULL; + + /* initialize message header */ + pMsg->hdr.param = 0; + pMsg->hdr.event = HCI_LE_ADV_REPORT_CBACK_EVT; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute callback */ + (*hciCb.evtCback)((hciEvt_t *) pMsg); + } + + /* free buffer */ + WsfBufFree(pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE connection IQ report event. + * + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtProcessLeConnIQReport(uint8_t *p, uint8_t len) +{ + hciLeConnIQReportEvt_t *pMsg; + uint8_t sampleCnt; + + HCI_TRACE_INFO0("HCI Conn IQ report"); + + /* get report sample count */ + sampleCnt = p[HCI_CONN_IQ_RPT_SAMPLE_CNT_OFFSET]; + + /* sanity check on number of sample count; quit if invalid */ + if ((sampleCnt < HCI_IQ_RPT_SAMPLE_CNT_MIN) || (sampleCnt > HCI_IQ_RPT_SAMPLE_CNT_MAX)) + { + HCI_TRACE_WARN1("Invalid conn IQ report sample count: %d", sampleCnt); + return; + } + + /* allocate temp buffer that can hold max length periodic adv report data */ + if ((pMsg = WsfBufAlloc(sizeof(hciLeConnIQReportEvt_t) + (2 * sampleCnt))) != NULL) + { + /* parse report and execute callback */ + BSTREAM_TO_UINT16(pMsg->handle, p); + BSTREAM_TO_UINT8(pMsg->rxPhy, p); + BSTREAM_TO_UINT8(pMsg->dataChIdx, p); + BSTREAM_TO_INT16(pMsg->rssi, p); + BSTREAM_TO_UINT8(pMsg->rssiAntennaId, p); + BSTREAM_TO_UINT8(pMsg->cteType, p); + BSTREAM_TO_UINT8(pMsg->slotDurations, p); + BSTREAM_TO_UINT8(pMsg->pktStatus, p); + BSTREAM_TO_UINT16(pMsg->connEvtCnt, p); + BSTREAM_TO_UINT8(pMsg->sampleCnt, p); + + HCI_TRACE_INFO1("HCI Conn IQ report sample count: %d", pMsg->sampleCnt); + + /* Copy I samples to space after end of report struct */ + pMsg->pISample = (int8_t *)(pMsg + 1); + memcpy(pMsg->pISample, p, pMsg->sampleCnt); + + /* Copy Q samples to space after I samples space */ + pMsg->pQSample = (int8_t *)((uint8_t *) pMsg->pISample + pMsg->sampleCnt); + memcpy(pMsg->pQSample, (p + pMsg->sampleCnt), pMsg->sampleCnt); + + /* initialize message header */ + pMsg->hdr.param = pMsg->handle; + pMsg->hdr.event = HCI_LE_CONN_IQ_REPORT_CBACK_EVT; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute callback */ + (*hciCb.evtCback)((hciEvt_t *) pMsg); + + /* free buffer */ + WsfBufFree(pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process an HCI LE CTE request failed event. + * + * \param pMsg Pointer to output event message structure. + * \param status Event status. + * \param opcode Command opcode for this event. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeCteReqFailed(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leCteReqFailed.status, p); + BSTREAM_TO_UINT16(pMsg->leCteReqFailed.handle, p); + + pMsg->hdr.param = pMsg->leCteReqFailed.handle; + pMsg->hdr.status = pMsg->leCteReqFailed.status; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI Command Complete event for the LE set connection CTE receive parameters + * command. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeSetConnCteRxParamsCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leSetConnCteRxParamsCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leSetConnCteRxParamsCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leSetConnCteRxParamsCmdCmpl.status; + pMsg->hdr.param = pMsg->leSetConnCteRxParamsCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI Command Complete event for the LE set connection CTE transmit parameters + * command. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeSetConnCteTxParamsCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leSetConnCteTxParamsCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leSetConnCteTxParamsCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leSetConnCteTxParamsCmdCmpl.status; + pMsg->hdr.param = pMsg->leSetConnCteTxParamsCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI Command Complete event for the LE connection CTE request enable command. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeConnCteReqEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leConnCteReqEnableCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leConnCteReqEnableCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leConnCteReqEnableCmdCmpl.status; + pMsg->hdr.param = pMsg->leConnCteReqEnableCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI Command Complete event for the LE connection CTE response enable command. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeConnCteRspEnableCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leConnCteRspEnableCmdCmpl.status, p); + BSTREAM_TO_UINT16(pMsg->leConnCteRspEnableCmdCmpl.handle, p); + + pMsg->hdr.status = pMsg->leConnCteRspEnableCmdCmpl.status; + pMsg->hdr.param = pMsg->leConnCteRspEnableCmdCmpl.handle; +} + +/*************************************************************************************************/ +/*! + * \brief Parse an HCI Command Complete event for the LE read antenna information command. + * + * \param pMsg Pointer to output event message structure. + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciEvtParseLeReadAntennaInfoCmdCmpl(hciEvt_t *pMsg, uint8_t *p, uint8_t len) +{ + BSTREAM_TO_UINT8(pMsg->leReadAntennaInfoCmdCmpl.status, p); + BSTREAM_TO_UINT8(pMsg->leReadAntennaInfoCmdCmpl.switchSampleRates, p); + BSTREAM_TO_UINT8(pMsg->leReadAntennaInfoCmdCmpl.numAntennae, p); + BSTREAM_TO_UINT8(pMsg->leReadAntennaInfoCmdCmpl.switchPatternMaxLen, p); + BSTREAM_TO_UINT8(pMsg->leReadAntennaInfoCmdCmpl.cteMaxLen, p); + + pMsg->hdr.status = pMsg->leReadAntennaInfoCmdCmpl.status; +} + +/*************************************************************************************************/ +/*! + * \brief Process HCI command status event with failure status. + * + * \param status Event status. + * \param opcode Command opcode for this event. + * + * \return None. + */ +/*************************************************************************************************/ +void hciEvtCmdStatusFailure(uint8_t status, uint16_t opcode) +{ + switch(opcode) + { + case HCI_OPCODE_LE_GENERATE_DHKEY: + case HCI_OPCODE_LE_GENERATE_DHKEY_V2: + if (hciCb.secCback) + { + hciLeGenDhKeyEvt_t evt; + + evt.hdr.event = HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT; + evt.hdr.status = evt.status = status; + + hciCb.secCback((hciEvt_t*) &evt); + } + break; + + default: + break; + } +#if 0 + handle these events: + translate the command status event into other appropriate event + HCI_OPCODE_DISCONNECT + HCI_OPCODE_LE_CREATE_CONN + HCI_OPCODE_LE_CONN_UPDATE + HCI_OPCODE_LE_READ_REMOTE_FEAT + HCI_OPCODE_LE_START_ENCRYPTION + HCI_OPCODE_READ_REMOTE_VER_INFO +#endif +} + +/*************************************************************************************************/ +/*! + * \brief Process HCI command status event. + * + * \param p Buffer containing HCI event, points to start of parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void hciEvtProcessCmdStatus(uint8_t *p) +{ + uint8_t status; + uint8_t numPkts; + uint16_t opcode; + + BSTREAM_TO_UINT8(status, p); + BSTREAM_TO_UINT8(numPkts, p); + BSTREAM_TO_UINT16(opcode, p); + + if (status != HCI_SUCCESS) /* optional: or vendor specific */ + { + hciEvtCmdStatusFailure(status, opcode); + } + + /* optional: handle vendor-specific command status event */ + + hciCmdRecvCmpl(numPkts); +} + +/*************************************************************************************************/ +/*! + * \brief Process HCI command complete event. + * + * \param p Buffer containing command complete event, points to start of parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void hciEvtProcessCmdCmpl(uint8_t *p, uint8_t len) +{ + uint8_t numPkts; + uint16_t opcode; + hciEvt_t *pMsg; + uint8_t cbackEvt = 0; + hciEvtCback_t cback = hciCb.evtCback; + + BSTREAM_TO_UINT8(numPkts, p); + BSTREAM_TO_UINT16(opcode, p); + + /* convert opcode to internal event code and perform special handling */ + switch (opcode) + { + case HCI_OPCODE_LE_CREATE_CONN_CANCEL: + cbackEvt = HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_ENCRYPT: + cbackEvt = HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT; + cback = hciCb.secCback; + break; + + case HCI_OPCODE_LE_REM_CONN_PARAM_REP: + cbackEvt = HCI_LE_REM_CONN_PARAM_REP_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP: + cbackEvt = HCI_LE_REM_CONN_PARAM_NEG_REP_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_DEF_DATA_LEN: + cbackEvt = HCI_LE_READ_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_WRITE_DEF_DATA_LEN: + cbackEvt = HCI_LE_WRITE_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_DATA_LEN: + cbackEvt = HCI_LE_SET_DATA_LEN_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_MAX_DATA_LEN: + cbackEvt = HCI_LE_READ_MAX_DATA_LEN_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_LTK_REQ_REPL: + cbackEvt = HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_LTK_REQ_NEG_REPL: + cbackEvt = HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_RAND: + cbackEvt = HCI_LE_RAND_CMD_CMPL_CBACK_EVT; + cback = hciCb.secCback; + break; + + case HCI_OPCODE_LE_READ_CHAN_MAP: + cbackEvt = HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_READ_RSSI: + cbackEvt = HCI_READ_RSSI_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_READ_TX_PWR_LVL: + cbackEvt = HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_ADD_DEV_RES_LIST: + cbackEvt = HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_REMOVE_DEV_RES_LIST: + cbackEvt = HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_CLEAR_RES_LIST: + cbackEvt = HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_PEER_RES_ADDR: + cbackEvt = HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_LOCAL_RES_ADDR: + cbackEvt = HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_ADDR_RES_ENABLE: + cbackEvt = HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO: + cbackEvt = HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_PHY: + cbackEvt = HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_DEF_PHY: + cbackEvt = HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_SCAN_ENABLE: + cbackEvt = HCI_LE_SCAN_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_ADV_ENABLE: + cbackEvt = HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE: + cbackEvt = HCI_LE_EXT_SCAN_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_EXT_ADV_ENABLE: + cbackEvt = HCI_LE_EXT_ADV_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_PER_ADV_ENABLE: + cbackEvt = HCI_LE_PER_ADV_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_RAND_ADDR: + cbackEvt = HCI_LE_SET_RAND_ADDR_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_CONN_CTE_RX_PARAMS: + cbackEvt = HCI_LE_SET_CONN_CTE_RX_PARAMS_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_SET_CONN_CTE_TX_PARAMS: + cbackEvt = HCI_LE_SET_CONN_CTE_TX_PARAMS_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_CONN_CTE_REQ_ENABLE: + cbackEvt = HCI_LE_CONN_CTE_REQ_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_CONN_CTE_RSP_ENABLE: + cbackEvt = HCI_LE_CONN_CTE_RSP_ENABLE_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_READ_ANTENNA_INFO: + cbackEvt = HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT; + + break; + case HCI_OPCODE_LE_PER_ADV_SYNC_TRANSFER: + cbackEvt = HCI_LE_PER_ADV_SYNC_TRSF_CMD_CMPL_CBACK_EVT; + break; + + case HCI_OPCODE_LE_PER_ADV_SET_INFO_TRANSFER: + cbackEvt = HCI_LE_PER_ADV_SET_INFO_TRSF_CMD_CMPL_CBACK_EVT; + break; + + default: + /* test for vendor specific command completion OGF. */ + if (HCI_OGF(opcode) == HCI_OGF_VENDOR_SPEC) + { + cbackEvt = hciCoreVsCmdCmplRcvd(opcode, p, len); + } + break; + } + + /* if callback is executed for this event */ + if (cbackEvt != 0) + { + /* allocate temp buffer */ + if ((pMsg = WsfBufAlloc(hciEvtCbackLen[cbackEvt])) != NULL) + { + /* initialize message header */ + pMsg->hdr.param = 0; + pMsg->hdr.event = cbackEvt; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute parsing function for the event */ + (*hciEvtParseFcnTbl[cbackEvt])(pMsg, p, len); + + /* execute callback */ + (*cback)(pMsg); + + /* free buffer */ + WsfBufFree(pMsg); + } + } + + hciCmdRecvCmpl(numPkts); +} + +/*************************************************************************************************/ +/*! + * \brief Process received HCI events. + * + * \param pEvt Buffer containing HCI event. + * + * \return None. + */ +/*************************************************************************************************/ +void hciEvtProcessMsg(uint8_t *pEvt) +{ + uint8_t evt; + uint8_t subEvt; + uint8_t len; + uint8_t cbackEvt = 0; + hciEvt_t *pMsg; + uint16_t handle; + hciEvtCback_t cback = hciCb.evtCback; + + /* parse HCI event header */ + BSTREAM_TO_UINT8(evt, pEvt); + BSTREAM_TO_UINT8(len, pEvt); + + /* convert hci event code to internal event code and perform special handling */ + switch (evt) + { + case HCI_CMD_STATUS_EVT: + /* special handling for command status event */ + hciEvtStats.numCmdStatusEvt++; + hciEvtProcessCmdStatus(pEvt); + break; + + case HCI_CMD_CMPL_EVT: + /* special handling for command complete event */ + hciEvtStats.numCmdCmplEvt++; + hciEvtProcessCmdCmpl(pEvt, len); +#if defined(HCI_CONN_CANCEL_WORKAROUND) && (HCI_CONN_CANCEL_WORKAROUND == TRUE) + /* workaround for controllers that don't send an LE connection complete event + * after a connection cancel command + */ + { + uint16_t opcode; + BYTES_TO_UINT16(opcode, (pEvt + 1)); + if (opcode == HCI_OPCODE_LE_CREATE_CONN_CANCEL) + { + cbackEvt = HCI_LE_CONN_CMPL_CBACK_EVT; + } + } +#endif + break; + + case HCI_NUM_CMPL_PKTS_EVT: + /* handled internally by hci */ + hciCoreNumCmplPkts(pEvt); + hciEvtStats.numCmplPktsEvt++; + break; + + case HCI_LE_META_EVT: + BSTREAM_TO_UINT8(subEvt, pEvt); + hciEvtStats.numLeMetaEvt++; + switch (subEvt) + { + case HCI_LE_CONN_CMPL_EVT: + /* if connection created successfully */ + if (*pEvt == HCI_SUCCESS) + { + BYTES_TO_UINT16(handle, (pEvt + 1)); + hciCoreConnOpen(handle); + } + cbackEvt = HCI_LE_CONN_CMPL_CBACK_EVT; + break; + + case HCI_LE_ADV_REPORT_EVT: + /* special case for advertising report */ + hciEvtProcessLeAdvReport(pEvt, len); + break; + + case HCI_LE_CONN_UPDATE_CMPL_EVT: + cbackEvt = HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT; + break; + + case HCI_LE_READ_REMOTE_FEAT_CMPL_EVT: + cbackEvt = HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT; + break; + + case HCI_LE_LTK_REQ_EVT: + cbackEvt = HCI_LE_LTK_REQ_CBACK_EVT; + break; + + case HCI_LE_ENHANCED_CONN_CMPL_EVT: + /* if connection created successfully */ + if (*pEvt == HCI_SUCCESS) + { + BYTES_TO_UINT16(handle, (pEvt + 1)); + hciCoreConnOpen(handle); + } + cbackEvt = HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT; + break; + + case HCI_LE_DIRECT_ADV_REPORT_EVT: + /* special case for direct advertising report */ + hciEvtProcessLeDirectAdvReport(pEvt, len); + break; + + case HCI_LE_REM_CONN_PARAM_REQ_EVT: + cbackEvt = HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT; + break; + + case HCI_LE_DATA_LEN_CHANGE_EVT: + cbackEvt = HCI_LE_DATA_LEN_CHANGE_CBACK_EVT; + break; + + case HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_EVT: + cback = hciCb.secCback; + cbackEvt = HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT; + break; + + case HCI_LE_GENERATE_DHKEY_CMPL_EVT: + cback = hciCb.secCback; + cbackEvt = HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT; + break; + + case HCI_LE_PHY_UPDATE_CMPL_EVT: + cbackEvt = HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT; + break; + + case HCI_LE_EXT_ADV_REPORT_EVT: + /* special case for extended advertising report */ + hciEvtProcessLeExtAdvReport(pEvt, len); + break; + + case HCI_LE_SCAN_TIMEOUT_EVT: + cbackEvt = HCI_LE_SCAN_TIMEOUT_CBACK_EVT; + break; + + case HCI_LE_ADV_SET_TERM_EVT: + cbackEvt = HCI_LE_ADV_SET_TERM_CBACK_EVT; + break; + + case HCI_LE_SCAN_REQ_RCVD_EVT: + cbackEvt = HCI_LE_SCAN_REQ_RCVD_CBACK_EVT; + break; + + case HCI_LE_PER_ADV_SYNC_EST_EVT: + cbackEvt = HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT; + break; + + case HCI_LE_PER_ADV_REPORT_EVT: + /* special case for periodic advertising report */ + hciEvtProcessLePerAdvReport(pEvt, len); + break; + + case HCI_LE_PER_ADV_SYNC_LOST_EVT: + cbackEvt = HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT; + break; + + case HCI_LE_PER_SYNC_TRSF_RCVD_EVT: + cbackEvt = HCI_LE_PER_SYNC_TRSF_RCVD_CBACK_EVT; + break; + + case HCI_LE_CONN_IQ_REPORT_EVT: + /* special case for connection IQ report */ + hciEvtProcessLeConnIQReport(pEvt, len); + break; + + case HCI_LE_CTE_REQ_FAILED_EVT: + cbackEvt = HCI_LE_CTE_REQ_FAILED_CBACK_EVT; + break; + + default: + break; + } + break; + + case HCI_DISCONNECT_CMPL_EVT: + hciEvtStats.numDiscCmplEvt++; + cbackEvt = HCI_DISCONNECT_CMPL_CBACK_EVT; + break; + + case HCI_ENC_CHANGE_EVT: + hciEvtStats.numEncChangeEvt++; + cbackEvt = HCI_ENC_CHANGE_CBACK_EVT; + break; + + case HCI_READ_REMOTE_VER_INFO_CMPL_EVT: + hciEvtStats.numReadRemoteVerInfoCmpEvt++; + cbackEvt = HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT; + break; + + case HCI_ENC_KEY_REFRESH_CMPL_EVT: + hciEvtStats.numEncKeyRefreshCmplEvt++; + cbackEvt = HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT; + break; + + case HCI_DATA_BUF_OVERFLOW_EVT: + /* handled internally by hci */ + /* optional */ + hciEvtStats.numDataBufOverflowEvt++; + break; + + case HCI_HW_ERROR_EVT: + hciEvtStats.numHwErrorEvt++; + cbackEvt = HCI_HW_ERROR_CBACK_EVT; + break; + + case HCI_AUTH_PAYLOAD_TIMEOUT_EVT: + hciEvtStats.numAuthToEvt++; + cbackEvt = HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT; + break; + + case HCI_VENDOR_SPEC_EVT: + /* special case for vendor specific event */ + /* optional */ +#if defined (HCI_NONSTANDARD_VS_CMPL) && (HCI_NONSTANDARD_VS_CMPL == TRUE) + /* for nonstandard controllers that send a vendor-specific event instead + * of a command complete event + */ + hciCmdRecvCmpl(1); +#endif + hciEvtStats.numVendorSpecEvt++; + cbackEvt = HCI_VENDOR_SPEC_CBACK_EVT; + +#ifdef WSF_DETOKEN_TRACE + if (WsfDetokenProcessHciEvent(len, pEvt)) + { + cbackEvt = 0; + } +#endif /* LL_DETOKEN_TRACE */ + break; + + default: + break; + } + + /* if callback is executed for this event */ + if (cbackEvt != 0) + { + /* allocate temp buffer */ + if ((pMsg = WsfBufAlloc(hciEvtCbackLen[cbackEvt])) != NULL) + { + /* initialize message header */ + pMsg->hdr.param = 0; + pMsg->hdr.event = cbackEvt; + pMsg->hdr.status = HCI_SUCCESS; + + /* execute parsing function for the event */ + (*hciEvtParseFcnTbl[cbackEvt])(pMsg, pEvt, len); + + /* execute callback */ + (*cback)(pMsg); + + /* free buffer */ + WsfBufFree(pMsg); + } + + /* execute core procedure for connection close after callback */ + if (cbackEvt == HCI_DISCONNECT_CMPL_CBACK_EVT) + { + BYTES_TO_UINT16(handle, (pEvt + 1)); + hciCoreConnClose(handle); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Get event statistics. + * + * \return Event statistics. + */ +/*************************************************************************************************/ +hciEvtStats_t *hciEvtGetStats(void) +{ + return &hciEvtStats; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..d926d5a15ab4c26d2672a1d1cfa986b84ca0c54f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c @@ -0,0 +1,174 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI vendor specific AE functions for generic controllers. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "util/bstream.h" +#include "hci_core.h" + +#if HCI_VS_TARGET == HCI_VS_GENERIC + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +static void hciCoreReadMaxAdvDataLen(void); +static void hciCoreReadNumSupAdvSets(void); +static void hciCoreReadPerAdvListSize(void); + +/*************************************************************************************************/ +/*! + * \brief Read maximum advertising data length command. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreReadMaxAdvDataLen(void) +{ + /* if LE Extended Advertising is supported by Controller and included */ + if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_EXT_ADV) && + (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_EXT_ADV)) + { + /* send next command in sequence */ + HciLeReadMaxAdvDataLen(); + } + else + { + hciCoreCb.maxAdvDataLen = 0; + + /* send next command in sequence */ + hciCoreReadNumSupAdvSets(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Read read number of supported advertising sets command. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreReadNumSupAdvSets(void) +{ + /* if LE Extended Advertising is supported by Controller and included */ + if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_EXT_ADV) && + (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_EXT_ADV)) + { + /* send next command in sequence */ + HciLeReadNumSupAdvSets(); + } + else + { + hciCoreCb.numSupAdvSets = 0; + + /* send next command in sequence */ + hciCoreReadPerAdvListSize(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Read periodic advertiser list size command. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreReadPerAdvListSize(void) +{ + /* if LE Extended Advertising is supported by Controller and included */ + if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_PER_ADV) && + (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_PER_ADV)) + { + /* send next command in sequence */ + HciLeReadPerAdvListSizeCmd(); + } + else + { + hciCoreCb.perAdvListSize = 0; + + /* send next command in sequence */ + HciLeRandCmd(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Implement the HCI extended reset sequence. + * + * \param pMsg HCI event message from previous command in the sequence. + * \param opcode HCI event message opcode. + * + * \return None. + */ +/*************************************************************************************************/ +static void hciCoreExtResetSequence(uint8_t *pMsg, uint16_t opcode) +{ + /* decode opcode */ + switch (opcode) + { + case HCI_OPCODE_READ_LOCAL_VER_INFO: + /* send next command in sequence */ + hciCoreReadMaxAdvDataLen(); + break; + + case HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN: + BSTREAM_TO_UINT16(hciCoreCb.maxAdvDataLen, pMsg); + + /* send next command in sequence */ + hciCoreReadNumSupAdvSets(); + break; + + case HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS: + /* parse and store event parameters */ + BSTREAM_TO_UINT8(hciCoreCb.numSupAdvSets, pMsg); + + /* send next command in sequence */ + hciCoreReadPerAdvListSize(); + break; + + case HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE: + /* parse and store event parameters */ + BSTREAM_TO_UINT8(hciCoreCb.perAdvListSize, pMsg); + + /* send next command in sequence */ + HciLeRandCmd(); + break; + + default: + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief Vendor-specific controller AE initialization function. + * + * \param param Vendor-specific parameter. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsAeInit(uint8_t param) +{ + hciCoreCb.extResetSeq = hciCoreExtResetSequence; +} + +#endif diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_aes.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_aes.c new file mode 100644 index 0000000000000000000000000000000000000000..652b2d3392ac143c0230c1ebd8a044a530be7d41 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_aes.c @@ -0,0 +1,134 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief AES and random number security service implemented using HCI. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "sec_api.h" +#include "sec_main.h" +#include "hci_api.h" +#include "util/calc128.h" + +/************************************************************************************************** + External Variables +**************************************************************************************************/ + +extern secCb_t secCb; + +/*************************************************************************************************/ +/*! + * \brief Returns the next token. + * + * \return Token value. + */ +/*************************************************************************************************/ +static uint8_t getNextToken(void) +{ + uint8_t token = secCb.token++; + + if (token == SEC_TOKEN_INVALID) + { + token = secCb.token++; + } + + return token; +} + +/*************************************************************************************************/ +/*! + * \brief Execute an AES calculation. When the calculation completes, a WSF message will be + * sent to the specified handler. This function returns a token value that + * the client can use to match calls to this function with messages. + * + * \param pKey Pointer to 16 byte key. + * \param pPlaintext Pointer to 16 byte plaintext. + * \param handlerId WSF handler ID. + * \param param Client-defined parameter returned in message. + * \param event Event for client's WSF handler. + * + * \return Token value. + */ +/*************************************************************************************************/ +uint8_t SecAes(uint8_t *pKey, uint8_t *pPlaintext, wsfHandlerId_t handlerId, + uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + + /* allocate a buffer */ + if ((pBuf = WsfMsgAlloc(sizeof(secQueueBuf_t))) != NULL) + { + pBuf->msg.hdr.status = getNextToken(); + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + + pBuf->type = SEC_TYPE_AES; + + /* queue buffer */ + WsfMsgEnq(&secCb.aesEncQueue, handlerId, pBuf); + + /* call HCI encrypt function */ + HciLeEncryptCmd(pKey, pPlaintext); + + return pBuf->msg.hdr.status; + } + + return SEC_TOKEN_INVALID; +} + +/*************************************************************************************************/ +/*! + * \brief Callback for HCI encryption for AES operations. + * + * \param pBuf Pointer to sec queue element. + * \param pEvent Pointer to HCI event. + * \param handlerId WSF handler ID. + * + * \return none. + */ +/*************************************************************************************************/ +void SecAesHciCback(secQueueBuf_t *pBuf, hciEvt_t *pEvent, wsfHandlerId_t handlerId) +{ + secAes_t *pAes = (secAes_t *) &pBuf->msg; + + /* set encrypted data pointer and copy */ + pAes->pCiphertext = pBuf->ciphertext; + Calc128Cpy(pAes->pCiphertext, pEvent->leEncryptCmdCmpl.data); + + /* send message */ + WsfMsgSend(handlerId, pAes); +} + +/*************************************************************************************************/ +/*! + * \brief Called to initialize AES secuirity. + * + * \param none. + * + * \return none. + */ +/*************************************************************************************************/ +void SecAesInit(void) +{ + secCb.hciCbackTbl[SEC_TYPE_AES] = SecAesHciCback; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ccm_hci.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ccm_hci.c new file mode 100644 index 0000000000000000000000000000000000000000..baf4582e7b7b47c7694706c15a8930c6464342ba --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ccm_hci.c @@ -0,0 +1,593 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Counter with CBC-MAC (CCM) mode security - HCI AES. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "sec_api.h" +#include "sec_main.h" +#include "wsf_buf.h" +#include "hci_api.h" +#include "util/calc128.h" +#include "util/wstr.h" + +#ifndef SEC_CCM_CFG +#define SEC_CCM_CFG SEC_CCM_CFG_HCI +#endif + +#if SEC_CCM_CFG == SEC_CCM_CFG_HCI + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/* State machine states */ +enum +{ + SEC_CCM_STATE_XI_HDR, + SEC_CCM_STATE_XI_MSG, + SEC_CCM_STATE_S0, + SEC_CCM_STATE_SI, + SEC_CCM_STATE_MIC_COMPLETE +}; + +/************************************************************************************************** + External Variables +**************************************************************************************************/ + +/* Global security control block */ +extern secCb_t secCb; + +/*************************************************************************************************/ +/*! + * \brief Exclusive-or two 128-bit integers and return the result in pDst. + * + * \param pDst Pointer to destination. + * \param pSrc Pointer to source. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmCalcXor(uint8_t *pDst, uint8_t *pSrc, uint8_t size) +{ + uint8_t i; + + for (i = 0; i < size; i++) + { + *pDst++ ^= *pSrc++; + } +} + +/*************************************************************************************************/ +/*! + * \fn secCcmBlockEncrypt + * + * \brief Perform a 16-byte block encryption (HCI AES) + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param pText Pointer to text to encrypt (16 bytes). + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmBlockEncrypt(secQueueBuf_t *pBuf, uint8_t *pText) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + SecLeEncryptCmd(pCcm->key, pText, pBuf, pCcm->handlerId); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenX0 + * + * \brief Generate X_0 := E(K, B_0) + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenX0(secQueueBuf_t *pBuf) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + + /* Scratch buffer contains nonce, add flags and message length */ + pCcm->scratch[0] = (SEC_CCM_L - 1) | (((pCcm->micLen - 2) / 2) << 3) | ((pCcm->clearLen > 0? 1:0) << 6); + pCcm->scratch[SEC_BLOCK_LEN - 2] = pCcm->textLen >> 8; + pCcm->scratch[SEC_BLOCK_LEN - 1] = pCcm->textLen & 0xFF; + + pCcm->state = pCcm->clearLen > 0 ? SEC_CCM_STATE_XI_HDR : SEC_CCM_STATE_XI_MSG; + pCcm->position = 0; + + /* AES Operation */ + secCcmBlockEncrypt(pBuf, pCcm->scratch); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenXiHdr + * + * \brief Generate X_i header if clear text (additional data) is present. + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param pPriorX 16 byte buffer containing X_i-1. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenXiHdr(secQueueBuf_t *pBuf, uint8_t *pPriorX) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + uint8_t b_i[SEC_BLOCK_LEN]; + uint16_t remaining; + uint16_t offset = 0; + + if (pCcm->position == 0) + { + /* Copy additional data into working buffer */ + memcpy(pCcm->pWorking, pCcm->pClear, pCcm->clearLen); + + /* First two bytes of b_0 contain length of additional data */ + b_i[0] = pCcm->clearLen >> 8; + b_i[1] = pCcm->clearLen & 0xFF; + pCcm->position = offset = 2; + } + + remaining = (int16_t) pCcm->clearLen - pCcm->position + 2; + + /* Copy additional to b_i */ + if (remaining >= SEC_BLOCK_LEN - offset) + { + memcpy(b_i + offset, pCcm->pClear + pCcm->position - 2, SEC_BLOCK_LEN - offset); + pCcm->position += SEC_BLOCK_LEN - offset; + + if (remaining == SEC_BLOCK_LEN - offset) + { + pCcm->state = SEC_CCM_STATE_XI_MSG; + pCcm->position = 0; + } + } + else + { + memcpy(b_i + offset, pCcm->pClear + pCcm->position - 2, remaining); + memset(b_i + offset + remaining, 0, SEC_BLOCK_LEN - remaining - offset); + pCcm->state = SEC_CCM_STATE_XI_MSG; + pCcm->position = 0; + } + + /* X_i XOR B_i */ + Calc128Xor(b_i, pPriorX); + + /* AES Operation */ + secCcmBlockEncrypt(pBuf, b_i); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenXiMsg + * + * \brief Generate X_i for the message text. + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param pPriorX 16 byte buffer containing X_i-1. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenXiMsg(secQueueBuf_t *pBuf, uint8_t *pPriorX) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + uint8_t b_i[SEC_BLOCK_LEN]; + uint16_t remaining = (int16_t) pCcm->textLen - pCcm->position; + + /* Copy data to b_i */ + if (remaining >= SEC_BLOCK_LEN) + { + Calc128Cpy(b_i, pCcm->pText + pCcm->position); + pCcm->position += SEC_BLOCK_LEN; + + if (remaining == SEC_BLOCK_LEN) + { + pCcm->state = SEC_CCM_STATE_S0; + } + } + else + { + memcpy(b_i, pCcm->pText + pCcm->position, remaining); + memset(b_i + remaining, 0, SEC_BLOCK_LEN - remaining); + pCcm->state = SEC_CCM_STATE_S0; + } + + /* X_i XOR B_i */ + Calc128Xor(b_i, pPriorX); + + /* AES Operation */ + secCcmBlockEncrypt(pBuf, b_i); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenS0 + * + * \brief Generate S_0 := E(K, A_0) + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param x_n 16 byte buffer containing X_n (containing T). + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenS0(secQueueBuf_t *pBuf, uint8_t *x_n) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + uint16_t offset = pCcm->textLen + pCcm->clearLen; + + /* Copy T to working buffer */ + memcpy(pCcm->pWorking + offset, x_n, pCcm->micLen); + + /* Scratch buffer contains nonce, add flags and counter */ + pCcm->scratch[0] = (SEC_CCM_L - 1); + pCcm->scratch[SEC_BLOCK_LEN - 2] = pCcm->scratch[SEC_BLOCK_LEN - 1] = 0; + + pCcm->state = SEC_CCM_STATE_MIC_COMPLETE; + + /* AES Operation */ + secCcmBlockEncrypt(pBuf, pCcm->scratch); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenS1 + * + * \brief Generate S_1 := E(K, A_1) + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenS1(secQueueBuf_t *pBuf) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + + /* Set counter. */ + pCcm->counter = 1; + + /* Scratch buffer contains nonce, add flags and counter. */ + pCcm->scratch[0] = (SEC_CCM_L - 1); + pCcm->scratch[SEC_BLOCK_LEN - 2] = 0; + pCcm->scratch[SEC_BLOCK_LEN - 1] = 1; + + /* Change state to S_i state. */ + pCcm->state = SEC_CCM_STATE_SI; + + /* AES Operation. */ + secCcmBlockEncrypt(pBuf, pCcm->scratch); +} + +/*************************************************************************************************/ +/*! + * \fn secCcmMicComplete + * + * \brief Called when MIC calculation is complete. + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param s_0 16 byte buffer containing S_0. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmMicComplete(secQueueBuf_t *pBuf, uint8_t *s_0) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + int16_t micOffset; + + /* MIC = s_0 XOR T (store in result buffer). */ + micOffset = pCcm->textLen + pCcm->clearLen; + secCcmCalcXor(pCcm->pWorking + micOffset, s_0, pCcm->micLen); + + if (pCcm->operation == SEC_CCM_OP_ENCRYPT) + { + /* When encrypting, continue S_i calculations */ + secCcmGenS1(pBuf); + } + else + { + /* Decryption complete. Send notification. */ + secCcmDecMsg_t *pMsg = (secCcmDecMsg_t *) &pBuf->msg; + + /* Verify MIC value */ + if (memcmp(pCcm->pRcvMic, pCcm->pWorking + micOffset, pCcm->micLen) == 0) + { + pMsg->pText = pCcm->pWorking + pCcm->clearLen; + pMsg->textLen = pCcm->textLen; + pMsg->success = TRUE; + } + else + { + pMsg->pText = NULL; + pMsg->textLen = 0; + pMsg->success = FALSE; + } + + WsfMsgSend(pCcm->handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \fn secCcmGenSi + * + * \brief Generate S_i := E(K, A_i) + * + * \param pBuf Security queue buffer containing CCM algorithm control block. + * \param pPriorS 16 byte buffer containing S_i-1. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCcmGenSi(secQueueBuf_t *pBuf, uint8_t *pPriorS) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t*) pBuf->pCb; + int16_t resultOffset = 0; + uint16_t len; + + /* Determine length of XOR operation. */ + len = pCcm->textLen - ((pCcm->counter - 1) * SEC_BLOCK_LEN); + len = len > SEC_BLOCK_LEN? SEC_BLOCK_LEN : len; + + /* m_i XOR s_i+1. */ + resultOffset = (pCcm->counter - 1) * SEC_BLOCK_LEN + pCcm->clearLen; + + secCcmCalcXor(pCcm->pWorking + resultOffset, pPriorS, (uint8_t) len); + + if (pCcm->counter * SEC_BLOCK_LEN >= pCcm->textLen) + { + if (pCcm->operation == SEC_CCM_OP_ENCRYPT) + { + /* Encription complete. Send notification. */ + secCcmEncMsg_t *pMsg = (secCcmEncMsg_t *) &pBuf->msg; + + pMsg->pCiphertext = pCcm->pWorking; + pMsg->textLen = pCcm->textLen + pCcm->clearLen + pCcm->micLen; + WsfMsgSend(pCcm->handlerId, pMsg); + } + else + { + /* Set pText to point to the decrypted result in pWorking */ + pCcm->pText = pCcm->pWorking + pCcm->clearLen; + + /* Begin calculating the MIC */ + secCcmGenX0(pBuf); + } + } + else + { + /* Update counter. */ + pCcm->counter++; + pCcm->scratch[SEC_BLOCK_LEN - 2] = pCcm->counter >> 8; + pCcm->scratch[SEC_BLOCK_LEN - 1] = pCcm->counter & 0xFF; + + /* AES Operation. */ + secCcmBlockEncrypt(pBuf, pCcm->scratch); + } +} + +/*************************************************************************************************/ +/*! + * \fn SecCcmBlockEncryptCmpl + * + * \brief Called when a block encryption operation completes. + * + * \param pParam Pointer to security control block. + * \param pCypherText Pointer to encrypt result. + * + * \return none. + */ +/*************************************************************************************************/ +void SecCcmHciCback(secQueueBuf_t *pBuf, hciEvt_t *pEvent, wsfHandlerId_t handlerId) +{ + secCcmSecCb_t *pCcm = (secCcmSecCb_t *) pBuf->pCb; + + switch (pCcm->state) + { + case SEC_CCM_STATE_XI_HDR: + secCcmGenXiHdr(pBuf, pEvent->leEncryptCmdCmpl.data); + break; + + case SEC_CCM_STATE_XI_MSG: + secCcmGenXiMsg(pBuf, pEvent->leEncryptCmdCmpl.data); + break; + + case SEC_CCM_STATE_S0: + secCcmGenS0(pBuf, pEvent->leEncryptCmdCmpl.data); + break; + + case SEC_CCM_STATE_SI: + secCcmGenSi(pBuf, pEvent->leEncryptCmdCmpl.data); + break; + + case SEC_CCM_STATE_MIC_COMPLETE: + secCcmMicComplete(pBuf, pEvent->leEncryptCmdCmpl.data); + break; + } +} + +/*************************************************************************************************/ +/*! + * \fn SecCcmEnc + * + * \brief Execute the CCM-Mode encryption algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pPlainText Pointer to text to encrypt. + * \param textLen Length of pPlainText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmEnc(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult, + wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + uint16_t bufSize = sizeof(secQueueBuf_t) + sizeof(secCcmSecCb_t); + + WSF_ASSERT(clearLen < SEC_CCM_MAX_ADDITIONAL_LEN); + + if ((pBuf = WsfMsgAlloc(bufSize)) != NULL) + { + secCcmSecCb_t *pCcm = (secCcmSecCb_t *) (pBuf + 1); + + /* Setup queue buffer */ + pBuf->pCb = pCcm; + pBuf->type = SEC_TYPE_CCM; + + pBuf->msg.hdr.status = secCb.token++; + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + + pCcm->handlerId = handlerId; + + pCcm->pText = pPlainText; + pCcm->textLen = textLen; + pCcm->pClear = pClear; + pCcm->pWorking = pResult; + pCcm->clearLen = clearLen; + pCcm->micLen = micLen; + pCcm->counter = 0; + + memcpy(pCcm->pWorking + clearLen, pPlainText, textLen); + memcpy(&pCcm->scratch[1], pNonce, SEC_CCM_NONCE_LEN); + Calc128Cpy(pCcm->key, (uint8_t *) pKey); + + pCcm->operation = SEC_CCM_OP_ENCRYPT; + + /* Begin encryption of text by generation of X_0 */ + secCcmGenX0(pBuf); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \fn SecCcmDec + * + * \brief Execute the CCM-Mode verify and decrypt algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pCypherText Pointer to text to decrypt. + * \param textLen Length of pCypherText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param pMic Pointer to authentication digest. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmDec(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen, + uint8_t *pResult, wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + uint16_t bufSize = sizeof(secQueueBuf_t) + sizeof(secCcmSecCb_t); + + WSF_ASSERT(clearLen < SEC_CCM_MAX_ADDITIONAL_LEN); + + if ((pBuf = WsfMsgAlloc(bufSize)) != NULL) + { + secCcmSecCb_t *pCcm = (secCcmSecCb_t *) (pBuf + 1); + + /* Setup queue buffer */ + pBuf->pCb = pCcm; + pBuf->type = SEC_TYPE_CCM; + + pBuf->msg.hdr.status = secCb.token++; + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + + pCcm->handlerId = handlerId; + + pCcm->pClear = pClear; + pCcm->pRcvMic = pMic; + pCcm->pWorking = pResult; + pCcm->textLen = textLen; + pCcm->clearLen = clearLen; + pCcm->micLen = micLen; + pCcm->counter = 0; + + /* Prepare the working buffer */ + memcpy(pCcm->pWorking, pClear, clearLen); + memcpy(pCcm->pWorking + clearLen, pCypherText, textLen); + memcpy(pCcm->pWorking + clearLen + textLen, pMic, micLen); + + memcpy(&pCcm->scratch[1], pNonce, SEC_CCM_NONCE_LEN); + Calc128Cpy(pCcm->key, (uint8_t *) pKey); + + pCcm->operation = SEC_CCM_OP_DECRYPT; + + /* Begin decryption of text by generation of S_1 */ + secCcmGenS1(pBuf); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \fn SecCcmInit + * + * \brief Called to initialize CCM-Mode security. + * + * \param None. + * + * \return None. + */ +/*************************************************************************************************/ +void SecCcmInit(void) +{ + secCb.hciCbackTbl[SEC_TYPE_CCM] = SecCcmHciCback; +} + +#endif /* SEC_CCM_CFG */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_cmac_hci.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_cmac_hci.c new file mode 100644 index 0000000000000000000000000000000000000000..8ab15a77c76008a0b6aa543cb136666b90584ad8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_cmac_hci.c @@ -0,0 +1,321 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief AES and random number security service implemented using HCI. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "sec_api.h" +#include "sec_main.h" +#include "wsf_buf.h" +#include "hci_api.h" +#include "util/calc128.h" +#include "util/wstr.h" + +#ifndef SEC_CMAC_CFG +#define SEC_CMAC_CFG SEC_CMAC_CFG_HCI +#endif + +#if SEC_CMAC_CFG == SEC_CMAC_CFG_HCI + +enum +{ + SEC_CMAC_STATE_SUBKEY, + SEC_CMAC_STATE_BLOCK, + SEC_CMAC_STATE_COMPLETE +}; + +/************************************************************************************************** + External Variables +**************************************************************************************************/ + +extern secCb_t secCb; + +/*************************************************************************************************/ +/*! + * \brief Continue the execution of the CMAC algorithm over the next message block. + * + * \param pBuf Security queue buffer containing CMAC algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCmacProcessBlock(secQueueBuf_t *pBuf) +{ + secCmacSecCb_t *pCmac = (secCmacSecCb_t*) pBuf->pCb; + uint8_t text[SEC_BLOCK_LEN]; + uint8_t *pMn = pCmac->pPlainText + pCmac->position; + int16_t remaining = (int16_t) pCmac->len - pCmac->position; + + /* Check for Last Block */ + if (remaining <= SEC_BLOCK_LEN) + { + memcpy(text, pMn, remaining); + + /* Pad the message if necessary */ + if (remaining != SEC_BLOCK_LEN) + { + memset(text + remaining, 0, SEC_BLOCK_LEN - remaining); + text[remaining] = 0x80; + } + + /* XOr the subkey */ + Calc128Xor(text, pCmac->subkey); + pCmac->state = SEC_CMAC_STATE_COMPLETE; + } + else + { + /* Copy the block to the buffer */ + Calc128Cpy(text, pMn); + } + + if (pCmac->position != 0) + { + /* Except for first block, XOr the previous AES calculation */ + Calc128Xor(text, pBuf->ciphertext); + } + + pCmac->position += SEC_BLOCK_LEN; + + SecLeEncryptCmd(pCmac->key, text, pBuf, pCmac->handlerId); +} + +/*************************************************************************************************/ +/*! + * \brief Step 1 to generate the subkey used in the CMAC algorithm. + * + * \param pBuf Security queue buffer containing CMAC algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCmacGenSubkey1(secQueueBuf_t *pBuf) +{ + secCmacSecCb_t *pCmac = (secCmacSecCb_t*) pBuf->pCb; + uint8_t buf[SEC_BLOCK_LEN]; + + /* Perform aes on the key with a constant zero */ + memset(buf, 0, SEC_BLOCK_LEN); + + SecLeEncryptCmd(pCmac->key, buf, pBuf, pCmac->handlerId); +} + +/*************************************************************************************************/ +/*! + * \brief Left shift a buffer of WSF_CMAC_KEY_LEN bytes by N bits. + * + * \param pBuf Buffer to left shift. + * \param shift Number of bits to shift. + * + * \return The overflow of the operaiton. + */ +/*************************************************************************************************/ +static uint8_t secCmacKeyShift(uint8_t *pBuf, uint8_t shift) +{ + uint8_t overflow, i; + uint8_t finalOverflow = pBuf[0] >> (8 - shift); + + for (i = 0; i < SEC_CMAC_KEY_LEN; i++) + { + /* store shifted bits for next byte */ + if (i < SEC_CMAC_KEY_LEN-1) + { + overflow = pBuf[i+1] >> (8 - shift); + } + else + { + overflow = 0; + } + + /* shift byte and OR in shifted bits from previous byte */ + pBuf[i] = (pBuf[i] << shift) | overflow; + } + + return finalOverflow; +} + +/*************************************************************************************************/ +/*! + * \brief Complete generation of the subkey used in the CMAC algorithm. + * + * \param pBuf Security queue buffer containing CMAC algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCmacGenSubkey2(secQueueBuf_t *pBuf) +{ + secCmacSecCb_t *pCmac = (secCmacSecCb_t*) pBuf->pCb; + uint8_t overflow; + + /* Copy the result of the AES oepration */ + Calc128Cpy(pCmac->subkey, pBuf->ciphertext); + + /* Calculate the K1 subkey */ + overflow = secCmacKeyShift(pCmac->subkey, 1); + + if (overflow) + { + pCmac->subkey[SEC_BLOCK_LEN-1] ^= SEC_CMAC_RB; + } + + if (pCmac->len % SEC_BLOCK_LEN != 0) + { + /* If the message len is not a multiple of SEC_BLOCK_LEN */ + /* Continue with generation of the K2 subkey based on the K1 key */ + overflow = secCmacKeyShift(pCmac->subkey, 1); + + if (overflow) + { + pCmac->subkey[SEC_BLOCK_LEN-1] ^= SEC_CMAC_RB; + } + } + + /* Begin CMAC calculation */ + pCmac->state = SEC_CMAC_STATE_BLOCK; + secCmacProcessBlock(pBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Send a message to the handler with CMAC result. + * + * \param pBuf Security queue buffer containing CMAC algorithm control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void secCmacComplete(secQueueBuf_t *pBuf) +{ + /* CMAC is complete, copy and send result to handler */ + secCmacMsg_t *pMsg = (secCmacMsg_t *) &pBuf->msg; + secCmacSecCb_t *pCmac = (secCmacSecCb_t *) pBuf->pCb; + + pMsg->pCiphertext = pBuf->ciphertext; + pMsg->pPlainText = pCmac->pPlainText; + + WsfMsgSend(pCmac->handlerId, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Callback for HCI encryption for CMAC operations. + * + * \param pBuf Pointer to sec queue element. + * \param pEvent Pointer to HCI event. + * \param handlerId WSF handler ID. + * + * \return none. + */ +/*************************************************************************************************/ +void SecCmacHciCback(secQueueBuf_t *pBuf, hciEvt_t *pEvent, wsfHandlerId_t handlerId) +{ + secCmacSecCb_t *pCmac = (secCmacSecCb_t *) pBuf->pCb; + + if (pCmac) + { + Calc128Cpy(pBuf->ciphertext, pEvent->leEncryptCmdCmpl.data); + + switch (pCmac->state) + { + case SEC_CMAC_STATE_SUBKEY: + secCmacGenSubkey2(pBuf); + break; + + case SEC_CMAC_STATE_BLOCK: + secCmacProcessBlock(pBuf); + break; + + case SEC_CMAC_STATE_COMPLETE: + secCmacComplete(pBuf); + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute the CMAC algorithm. + * + * \param pKey Key used in CMAC operation. + * \param pPlainText Data to perform CMAC operation over + * \param len Size of pPlaintext in bytes. + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCmac(const uint8_t *pKey, uint8_t *pPlainText, uint16_t textLen, wsfHandlerId_t handlerId, + uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + uint16_t bufSize = sizeof(secQueueBuf_t) + sizeof(secCmacSecCb_t); + + if ((pBuf = WsfMsgAlloc(bufSize)) != NULL) + { + secCmacSecCb_t *pCmacCb = (secCmacSecCb_t *) (pBuf + 1); + + /* Setup queue buffer */ + pBuf->pCb = pCmacCb; + pBuf->type = SEC_TYPE_CMAC; + + pBuf->msg.hdr.status = secCb.token++; + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + + pCmacCb->pPlainText = pPlainText; + + pCmacCb->len = textLen; + pCmacCb->position = 0; + pCmacCb->handlerId = handlerId; + pCmacCb->state = SEC_CMAC_STATE_SUBKEY; + + /* Copy key */ + Calc128Cpy(pCmacCb->key, (uint8_t *) pKey); + + /* Start the CMAC process by calculating the subkey */ + secCmacGenSubkey1(pBuf); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Called to initialize CMAC security. + * + * \param None. + * + * \return None. + */ +/*************************************************************************************************/ +void SecCmacInit(void) +{ + secCb.hciCbackTbl[SEC_TYPE_CMAC] = SecCmacHciCback; +} + +#endif /* SEC_CMAC_CFG */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ecc_hci.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ecc_hci.c new file mode 100644 index 0000000000000000000000000000000000000000..3aac4774d63f66b9a4886699bcb6f6d382d2c248 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_ecc_hci.c @@ -0,0 +1,181 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief WSF Security ECC implementation using HCI. + */ +/*************************************************************************************************/ + +#include <stdlib.h> +#include <time.h> +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "sec_api.h" +#include "sec_main.h" +#include "wsf_buf.h" +#include "hci_api.h" +#include "util/calc128.h" +#include "util/wstr.h" + +#ifndef SEC_ECC_CFG +#define SEC_ECC_CFG SEC_ECC_CFG_HCI +#endif + +#if SEC_ECC_CFG == SEC_ECC_CFG_HCI + +/************************************************************************************************** +External Variables +**************************************************************************************************/ + +extern secCb_t secCb; + +/************************************************************************************************** +Local Variables +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Callback for HCI encryption for ECC operations. + * + * \param pBuf Pointer to sec queue element. + * \param pEvent Pointer to HCI event. + * \param handlerId WSF handler ID. + * + * \return none. + */ +/*************************************************************************************************/ +void SecEccHciCback(secQueueBuf_t *pBuf, hciEvt_t *pEvent, wsfHandlerId_t handlerId) +{ + secEccMsg_t *pMsg = (secEccMsg_t *) &pBuf->msg; + + if (pEvent->hdr.event == HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT) + { + /* Reverse copy the public key (to big endian) */ + WStrReverseCpy(pMsg->data.key.pubKey_x, pEvent->leP256.key, SEC_ECC_KEY_LEN); + WStrReverseCpy(pMsg->data.key.pubKey_y, pEvent->leP256.key + SEC_ECC_KEY_LEN, SEC_ECC_KEY_LEN); + + /* Send shared secret to handler */ + pMsg->hdr.status = pEvent->leP256.status; + WsfMsgSend(handlerId, pMsg); + } + else if (pEvent->hdr.event == HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT) + { + /* Reverse copy the DH key (to big endian) */ + WStrReverseCpy(pMsg->data.sharedSecret.secret, pEvent->leGenDHKey.key, SEC_ECC_KEY_LEN); + + /* Send shared secret to handler */ + pMsg->hdr.status = pEvent->leGenDHKey.status; + WsfMsgSend(handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Generate an ECC key. + * + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecEccGenKey(wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + uint16_t bufSize = sizeof(secQueueBuf_t) + sizeof(secEccMsg_t); + + if ((pBuf = WsfMsgAlloc(bufSize)) != NULL) + { + /* Record the event and parameter for use in the HCI response */ + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + pBuf->type = SEC_TYPE_DH; + + /* queue buffer */ + WsfMsgEnq(&secCb.pubKeyQueue, handlerId, pBuf); + + /* Request the local public key via HCI */ + HciLeReadLocalP256PubKey(); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Generate an ECC key. + * + * \param pKey ECC Key structure. + * \param handlerId WSF handler ID for client. + * \param param Optional parameter sent to client's WSF handler. + * \param event Event for client's WSF handler. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecEccGenSharedSecret(secEccKey_t *pKey, wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secQueueBuf_t *pBuf; + uint16_t bufSize = sizeof(secQueueBuf_t) + sizeof(secEccMsg_t); + + if ((pBuf = WsfMsgAlloc(bufSize)) != NULL) + { + uint8_t pubKeyX[SEC_ECC_KEY_LEN]; + uint8_t pubKeyY[SEC_ECC_KEY_LEN]; + + /* Record the event and parameter for use in the HCI response */ + pBuf->msg.hdr.param = param; + pBuf->msg.hdr.event = event; + pBuf->type = SEC_TYPE_DH; + + /* queue buffer */ + WsfMsgEnq(&secCb.dhKeyQueue, handlerId, pBuf); + + /* Reverse keys (to little endian) */ + WStrReverseCpy(pubKeyX, pKey->pubKey_x, SEC_ECC_KEY_LEN); + WStrReverseCpy(pubKeyY, pKey->pubKey_y, SEC_ECC_KEY_LEN); + + /* Request the DH Key via HCI */ + HciLeGenerateDHKey(pubKeyX, pubKeyY); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Called to initialize ECC security. + * + * \param None. + * + * \return None. + */ +/*************************************************************************************************/ +void SecEccInit(void) +{ + secCb.hciCbackTbl[SEC_TYPE_DH] = SecEccHciCback; +} + +#endif /* SEC_ECC_CFG */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.c new file mode 100644 index 0000000000000000000000000000000000000000..e847b9f70308d0a929519dc5dfd8517eec6f395e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.c @@ -0,0 +1,193 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Security service implemented using HCI. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "sec_api.h" +#include "sec_main.h" +#include "hci_api.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "stack/platform/include/pal_crypto.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Security Control block */ +secCb_t secCb; + +/*************************************************************************************************/ +/*! + * \brief Callback for HCI encryption and random number events. + * + * \return None. + */ +/*************************************************************************************************/ +static void secHciCback(hciEvt_t *pEvent) +{ + secQueueBuf_t *pBuf = NULL; + wsfHandlerId_t handlerId = 0; + + /* Handle random number event. */ + switch (pEvent->hdr.event) + { + case HCI_LE_RAND_CMD_CMPL_CBACK_EVT: + + /* Copy new data to circular buffer of random data. */ + memcpy(&secCb.rand[HCI_RAND_LEN * secCb.randTop], pEvent->leRandCmdCmpl.randNum, HCI_RAND_LEN); + secCb.randTop = (secCb.randTop >= SEC_HCI_RAND_MULT - 1) ? 0 : secCb.randTop + 1; + break; + + case HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT: + pBuf = WsfMsgDeq(&secCb.aesEncQueue, &handlerId); + + WSF_ASSERT(pBuf != NULL); + + /* note: pBuf should never be NULL and is checked by assert above. */ + /* coverity[dereference] */ + if (pBuf->type == SEC_TYPE_CCM || pBuf->type == SEC_TYPE_CMAC || pBuf->type == SEC_TYPE_AES_REV) + { + WStrReverse(pEvent->leEncryptCmdCmpl.data, HCI_ENCRYPT_DATA_LEN); + } + break; + + case HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT: + pBuf = WsfMsgDeq(&secCb.pubKeyQueue, &handlerId); + break; + + case HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT: + pBuf = WsfMsgDeq(&secCb.dhKeyQueue, &handlerId); + break; + + default: + break; + } + + if (pBuf) + { + WSF_ASSERT(secCb.hciCbackTbl[pBuf->type]); + secCb.hciCbackTbl[pBuf->type](pBuf, pEvent, handlerId); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the security service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecInit(void) +{ + WSF_QUEUE_INIT(&secCb.aesEncQueue); + WSF_QUEUE_INIT(&secCb.pubKeyQueue); + WSF_QUEUE_INIT(&secCb.dhKeyQueue); + + secCb.token = 0; + + /* Register callback with HCI */ + HciSecRegister(secHciCback); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the random number service. This function should only be called once + * upon system initialization. + * + * \return None. + */ +/*************************************************************************************************/ +void SecRandInit(void) +{ + int8_t i; + + /* get new random numbers */ + for (i=0; i<SEC_HCI_RAND_MULT; i++) + { + HciLeRandCmd(); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function returns up to HCI_RAND_LEN * SEC_HCI_RAND_MULT bytes of random data to + * a buffer provided by the client. + * + * \param pRand Pointer to returned random data. + * \param randLen Length of random data. + * + * \return None. + */ +/*************************************************************************************************/ +void SecRand(uint8_t *pRand, uint8_t randLen) +{ + int8_t count = (randLen + HCI_RAND_LEN - 1) / HCI_RAND_LEN; + uint8_t index = secCb.randBtm * HCI_RAND_LEN; + + WSF_ASSERT(randLen <= SEC_RAND_DATA_LEN); + + /* Copy from circular buffer of random data. */ + while (randLen--) + { + *pRand++ = secCb.rand[index]; + index = (index == SEC_RAND_DATA_LEN - 1) ? 0 : index + 1; + } + + while (count--) + { + /* Request more random data. */ + HciLeRandCmd(); + + /* Update copy index. */ + secCb.randBtm = (secCb.randBtm >= SEC_HCI_RAND_MULT - 1) ? 0 : secCb.randBtm + 1; + } +} + +/*************************************************************************************************/ +/*! + * \brief Queue callback and call LE encrypt given most significant byte ordered key and data. + * + * \param pKey Pointer to key. + * \param pText Pointer to text to encrypt. + * \param pBuf Pointer to queue block. + * \param handlerId Handler ID. + * + * \return None. + */ +/*************************************************************************************************/ +void SecLeEncryptCmd(uint8_t *pKey, uint8_t *pText, void *pBuf, wsfHandlerId_t handlerId) +{ + uint8_t revKey[HCI_KEY_LEN]; + uint8_t revText[HCI_ENCRYPT_DATA_LEN]; + + WStrReverseCpy(revKey, pKey, HCI_KEY_LEN); + WStrReverseCpy(revText, pText, HCI_ENCRYPT_DATA_LEN); + + WsfMsgEnq(&secCb.aesEncQueue, handlerId, pBuf); + HciLeEncryptCmd(revKey, revText); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.h new file mode 100644 index 0000000000000000000000000000000000000000..ac2b7f6cb2695ef47c1dd198b091fd5235347097 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/common/sec_main.h @@ -0,0 +1,160 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Internal security service structures. + */ +/*************************************************************************************************/ +#ifndef SEC_MAIN_H +#define SEC_MAIN_H + +#include "hci_api.h" +#include "stack/platform/include/pal_crypto.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + + +/*! AES, CMAC and HCI algorithm block length */ +#define SEC_BLOCK_LEN 16 + +/* CMAC constant Rb */ +#define SEC_CMAC_RB 0x87 + +/*! Number or random bytes to keep in the secCb_t rand data buffer */ +#define SEC_RAND_DATA_LEN 32 + +/*! Multiple of HCI_RAND_LEN kept in the secCb_t rand data buffer */ +#define SEC_HCI_RAND_MULT (SEC_RAND_DATA_LEN / HCI_RAND_LEN) + +/*! Compile time ECC configuration */ +#define SEC_ECC_CFG_DEBUG 0 +#define SEC_ECC_CFG_UECC 1 +#define SEC_ECC_CFG_HCI 2 + +/*! Compile time CMAC configuration */ +#define SEC_CMAC_CFG_PLATFORM 0 +#define SEC_CMAC_CFG_HCI 1 + +/*! Compile time CCM configuration */ +#define SEC_CCM_CFG_PLATFORM 0 +#define SEC_CCM_CFG_HCI 1 + +/*! CCM Operation (Encryption or Decryption) */ +#define SEC_CCM_OP_ENCRYPT 0 +#define SEC_CCM_OP_DECRYPT 1 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! Enumeration of security operation types */ +enum +{ + SEC_TYPE_AES, + SEC_TYPE_CMAC, + SEC_TYPE_DH, + SEC_TYPE_CCM, + SEC_TYPE_AES_REV, + SEC_NUM_TYPES +}; + +/*! Security queue element for CMAC operations */ +typedef struct +{ + uint8_t *pPlainText; + uint8_t key[SEC_CMAC_KEY_LEN]; + uint8_t subkey[SEC_CMAC_KEY_LEN]; + uint16_t position; + uint16_t len; + wsfHandlerId_t handlerId; + uint8_t state; +} secCmacSecCb_t; + +/*! Security queue element for CCM-Mode operations */ +typedef struct +{ + uint8_t operation; + uint8_t *pText; + uint8_t *pClear; + uint8_t *pRcvMic; + uint16_t textLen; + uint16_t clearLen; + uint8_t micLen; + uint8_t key[SEC_CCM_KEY_LEN]; + uint8_t scratch[SEC_BLOCK_LEN]; + uint16_t counter; + uint16_t position; + wsfHandlerId_t handlerId; + uint8_t state; + uint8_t *pWorking; +} secCcmSecCb_t; + +/*! Security queue element */ +typedef struct +{ + secMsg_t msg; + uint8_t ciphertext[SEC_BLOCK_LEN]; + uint8_t reserved[SEC_BLOCK_LEN]; + void *pCb; + uint8_t type; +} secQueueBuf_t; + +typedef void secHciCback_t(secQueueBuf_t *pBuf, hciEvt_t *pEvent, wsfHandlerId_t handlerId); +typedef secHciCback_t *pSecHciCback_t; + +/* Control block */ +typedef struct +{ + uint8_t rand[SEC_RAND_DATA_LEN]; /* Random data buffer */ + wsfQueue_t aesEncQueue; /* Queue for AES encrypt requests */ + wsfQueue_t pubKeyQueue; /* Queue for read p256 public key requests */ + wsfQueue_t dhKeyQueue; /* Queue for generate dh key requests */ + uint8_t token; /* Token value */ + uint8_t randTop; /* Random buffer insert point (HCI_RAND_LEN bytes) */ + uint8_t randBtm; /* Random buffer copy point (HCI_RAND_LEN bytes) */ + pSecHciCback_t hciCbackTbl[SEC_NUM_TYPES]; +} secCb_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Queue callback and call LE encrypt given most significant byte ordered key and data. + * + * \param pKey Pointer to key. + * \param pText Pointer to text to encrypt. + * \param pBuf Pointer to queue block. + * \param handlerId Handler ID. + * + * \return None. + */ +/*************************************************************************************************/ +void SecLeEncryptCmd(uint8_t *pKey, uint8_t *pText, void *pBuf, wsfHandlerId_t handlerId); + +#ifdef __cplusplus +}; +#endif + +#endif /* SEC_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/pal/sec_ccm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/pal/sec_ccm.c new file mode 100644 index 0000000000000000000000000000000000000000..44ca3c6ed211130d5b7015ac227ccc402529c758 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/sec/pal/sec_ccm.c @@ -0,0 +1,172 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Counter with CBC-MAC (CCM) mode security - Native AES. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "sec_main.h" + +#ifndef SEC_CCM_CFG +#define SEC_CCM_CFG SEC_CCM_CFG_PLATFORM +#endif + +#if SEC_CCM_CFG == SEC_CCM_CFG_PLATFORM + +/************************************************************************************************** + External Variables +**************************************************************************************************/ + +/* Global security control block */ +extern secCb_t secCb; + +/*************************************************************************************************/ +/*! + * \brief Execute the CCM-Mode encryption algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pPlainText Pointer to text to encrypt. + * \param textLen Length of pPlainText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmEnc(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult, + wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secCcmEncMsg_t *pCcmMsg; + + if ((pCcmMsg = WsfMsgAlloc(sizeof(secCcmEncMsg_t))) != NULL) + { + /* Encrypt. */ + PalCryptoCcmEnc(pKey, pNonce, pPlainText, textLen, pClear, clearLen, micLen, pResult, + handlerId, param, event); + + memcpy(pResult, pClear, clearLen); + + /* Send notification of encryption complete. */ + pCcmMsg->hdr.status = secCb.token++; + pCcmMsg->hdr.param = param; + pCcmMsg->hdr.event = event; + pCcmMsg->pCiphertext = pResult; + pCcmMsg->textLen = textLen + clearLen + micLen; + WsfMsgSend(handlerId, pCcmMsg); + + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \fn SecCcmDec + * + * \brief Execute the CCM-Mode verify and decrypt algorithm. + * + * \param pKey Pointer to encryption key (SEC_CCM_KEY_LEN bytes). + * \param pNonce Pointer to nonce (SEC_CCM_NONCE_LEN bytes). + * \param pCypherText Pointer to text to decrypt. + * \param textLen Length of pCypherText in bytes. + * \param pClear Pointer to additional, unencrypted authentication text. + * \param clearLen Length of pClear in bytes. + * \param pMic Pointer to authentication digest. + * \param micLen Size of MIC in bytes (4, 8 or 16). + * \param pResult Buffer to hold result (returned in complete event). + * \param handlerId Task handler ID to receive complete event. + * \param param Optional parameter passed in complete event. + * \param event Event ID of complete event. + * + * \return TRUE if successful, else FALSE. + */ +/*************************************************************************************************/ +bool_t SecCcmDec(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen, + uint8_t *pResult, wsfHandlerId_t handlerId, uint16_t param, uint8_t event) +{ + secCcmDecMsg_t *pCcmMsg; + + if ((pCcmMsg = WsfMsgAlloc(sizeof(secCcmDecMsg_t))) != NULL) + { + /* Decrypt. */ + uint32_t error; + + error = PalCryptoCcmDec(pKey, pNonce, pCypherText, textLen, pClear, clearLen, pMic, micLen, + pResult, handlerId, param, event); + + /* Send notification of decryption complete. */ + pCcmMsg->hdr.status = secCb.token++; + pCcmMsg->hdr.param = param; + pCcmMsg->hdr.event = event; + + /* Compare MIC with computed MIC. */ + if (error) + { + /* MIC not authentic. */ + pCcmMsg->success = FALSE; + pCcmMsg->pResult = NULL; + pCcmMsg->pText = NULL; + pCcmMsg->textLen = 0; + } + else + { + /* MIC authentic. */ + pCcmMsg->success = TRUE; + pCcmMsg->pResult = pResult; + pCcmMsg->pText = pResult; + pCcmMsg->textLen = textLen; + } + + WsfMsgSend(handlerId, pCcmMsg); + + return TRUE; + } + + return FALSE; + +} + +/*************************************************************************************************/ +/*! + * \brief Called to initialize CCM-Mode security. + * + * \return None. + */ +/*************************************************************************************************/ +void SecCcmInit(void) +{ + PalCryptoInit(); + + secCb.hciCbackTbl[SEC_TYPE_CCM] = NULL; +} + +#endif /* SEC_CCM_CFG */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.c new file mode 100644 index 0000000000000000000000000000000000000000..a921cca5a684c79813654997b1fba34423317d5e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.c @@ -0,0 +1,550 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT main module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_buf.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* indexes into base UUID for 16-to-128 bit UUID conversion */ +#define ATT_BASE_UUID_POS_0 12 +#define ATT_BASE_UUID_POS_1 13 + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +static uint8_t attBaseUuid[] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Default component function inteface */ +const attFcnIf_t attFcnDefault = +{ + attEmptyDataCback, + (l2cCtrlCback_t) attEmptyHandler, + (attMsgHandler_t) attEmptyHandler, + attEmptyConnCback +}; + +/* Control block */ +attCb_t attCb; + +/*************************************************************************************************/ +/*! + * \brief L2C data callback for ATT. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void attL2cDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t pduType; + + /* parse PDU type */ + pduType = *(pPacket + L2C_PAYLOAD_START); + + /* if from server */ + if ((pduType & ATT_PDU_MASK_SERVER) != 0) + { + /* call client data callback */ + (*attCb.pClient->dataCback)(handle, len, pPacket); + } + /* else from client */ + else + { + /* call server data callback */ + (*attCb.pServer->dataCback)(handle, len, pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief L2C control callback for ATT. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void attL2cCtrlCback(wsfMsgHdr_t *pMsg) +{ + attCcb_t *pCcb; + + /* get connection control block */ + pCcb = attCcbByConnId((dmConnId_t) pMsg->param); + + /* verify connection is open */ + if (pCcb->connId != DM_CONN_ID_NONE) + { + if (pMsg->event == L2C_CTRL_FLOW_DISABLE_IND) + { + /* flow disabled */ + pCcb->control |= ATT_CCB_STATUS_FLOW_DISABLED; + } + else + { + /* flow enabled */ + pCcb->control &= ~ATT_CCB_STATUS_FLOW_DISABLED; + + /* call server control callback */ + (*attCb.pServer->ctrlCback)(pMsg); + + /* check flow again; could be changed recursively */ + if (!(pCcb->control & ATT_CCB_STATUS_FLOW_DISABLED)) + { + /* call client control callback */ + (*attCb.pClient->ctrlCback)(pMsg); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM connection callback for ATT. + * + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attDmConnCback(dmEvt_t *pDmEvt) +{ + attCcb_t *pCcb; + + pCcb = attCcbByConnId((dmConnId_t) pDmEvt->hdr.param); + + /* if new connection created */ + if (pDmEvt->hdr.event == DM_CONN_OPEN_IND) + { + /* initialize control block before handling event */ + pCcb->handle = pDmEvt->connOpen.handle; + pCcb->mtu = ATT_DEFAULT_MTU; + pCcb->connId = (dmConnId_t) pDmEvt->hdr.param; + pCcb->control = 0; + pCcb->pPendDbHashRsp = NULL; + } + + /* if connection has been opened */ + if (pCcb->connId != DM_CONN_ID_NONE) + { + /* pass event to server */ + (*attCb.pServer->connCback)(pCcb, pDmEvt); + + /* pass event to client */ + (*attCb.pClient->connCback)(pCcb, pDmEvt); + + /* if connection closed */ + if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* clear control block after handling event */ + pCcb->connId = DM_CONN_ID_NONE; + + if (pCcb->pPendDbHashRsp) + { + WsfBufFree(pCcb->pPendDbHashRsp); + } + } + } + + /* execute ATT connection callback */ + if (attCb.connCback != NULL) + { + (*attCb.connCback)(pDmEvt); + } +} + +/*************************************************************************************************/ +/*! + * \brief ATT empty event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void attEmptyHandler(wsfMsgHdr_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Empty connection callback for ATT. + * + * \param pCcb ATT control block. + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +void attEmptyConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Empty data callback for ATT. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attEmptyDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the given handle. + * + * \param handle The connection handle. + * + * \return Pointer to connection control block or NULL if not found. + */ +/*************************************************************************************************/ +attCcb_t *attCcbByHandle(uint16_t handle) +{ + dmConnId_t connId; + + if ((connId = DmConnIdByHandle(handle)) != DM_CONN_ID_NONE) + { + return &attCb.ccb[connId - 1]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to connection control block. + */ +/*************************************************************************************************/ +attCcb_t *attCcbByConnId(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return &attCb.ccb[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Compare a 16 bit UUID to a 128 bit UUID. + * + * \param pUuid16 Pointer to 16 bit UUID. + * \param pUuid128 Pointer to 128 bit UUID. + * + * \return TRUE of UUIDs match, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t attUuidCmp16to128(const uint8_t *pUuid16, const uint8_t *pUuid128) +{ + attBaseUuid[ATT_BASE_UUID_POS_0] = pUuid16[0]; + attBaseUuid[ATT_BASE_UUID_POS_1] = pUuid16[1]; + + return (memcmp(attBaseUuid, pUuid128, ATT_128_UUID_LEN) == 0); +} + +/*************************************************************************************************/ +/*! + * \brief Set the attribute protocol MTU of a connection. + * + * \param pCcb Connection control block. + * \param peerMtu Peer MTU. + * \param localMtu Local MTU. + * + * \return None. + */ +/*************************************************************************************************/ +void attSetMtu(attCcb_t *pCcb, uint16_t peerMtu, uint16_t localMtu) +{ + uint16_t mtu; + + /* set negotiated mtu for the connection to the lesser of ours and theirs */ + mtu = WSF_MIN(peerMtu, localMtu); + + /* if current mtu is not the same as the negotiated value */ + if (pCcb->mtu != mtu) + { + /* set mtu to the new value */ + pCcb->mtu = mtu; + + /* notify app about the new value */ + attExecCallback(pCcb->connId, ATT_MTU_UPDATE_IND, 0, ATT_SUCCESS, mtu); + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute application callback function. + * + * \param connId DM connection ID. + * \param event Callback event ID. + * \param handle Attribute handle. + * \param status Callback event status. + * \param mtu Negotiated MTU value. + * + * \return None. + */ +/*************************************************************************************************/ +void attExecCallback(dmConnId_t connId, uint8_t event, uint16_t handle, uint8_t status, uint16_t mtu) +{ + if (attCb.cback) + { + attEvt_t evt; + + evt.hdr.param = connId; + evt.hdr.event = event; + evt.hdr.status = status; + evt.valueLen = 0; + evt.handle = handle; + evt.continuing = 0; + evt.mtu = mtu; + + (*attCb.cback)(&evt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an ATT data message buffer to be used for the ATT attribute protocol messages. + * + * \param len Message length in bytes. + * + * \return Pointer to data message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *attMsgAlloc(uint16_t len) +{ + return WsfMsgDataAlloc(len, HCI_TX_DATA_TAILROOM); +} + +/*************************************************************************************************/ +/*! + * \brief ATT handler init function called during system initialization. + * + * \param handlerID WSF handler ID for ATT. + * + * \return None. + */ +/*************************************************************************************************/ +void AttHandlerInit(wsfHandlerId_t handlerId) +{ + /* store handler ID */ + attCb.handlerId = handlerId; + + /* initialize control block */ + attCb.pClient = &attFcnDefault; + attCb.pServer = &attFcnDefault; + + /* Register with L2C */ + L2cRegister(L2C_CID_ATT, attL2cDataCback, attL2cCtrlCback); + + /* Register with DM */ + DmConnRegister(DM_CLIENT_ID_ATT, attDmConnCback); + +} + +/*************************************************************************************************/ +/*! + * \brief WSF event handler for ATT. + * + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void AttHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + /* Handle message */ + if (pMsg != NULL) + { + if (pMsg->event >= ATTS_MSG_START) + { + /* pass event to server */ + (*attCb.pServer->msgCback)(pMsg); + } + else + { + /* pass event to client */ + (*attCb.pClient->msgCback)(pMsg); + } + } + /* Handle events */ + else if (event) + { + + } +} + +/*************************************************************************************************/ +/*! + * \brief Register a callback with ATT. + * + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void AttRegister(attCback_t cback) +{ + attCb.cback = cback; + + /* if configured MTU size is larger than maximum RX PDU length */ + if (pAttCfg->mtu > (HciGetMaxRxAclLen() - L2C_HDR_LEN)) + { + /* notify app about MTU misconfiguration */ + attExecCallback(0, DM_ERROR_IND, 0, DM_ERR_ATT_RX_PDU_LEN_EXCEEDED, 0); + } +} + +/*************************************************************************************************/ +/*! + * \brief Register a connection callback with ATT. The callback is typically used to + * manage the attribute server database. + * + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void AttConnRegister(dmCback_t cback) +{ + attCb.connCback = cback; +} + +/*************************************************************************************************/ +/*! + * \brief Get the attribute protocol MTU of a connection. + * + * \param connId DM connection ID. + * + * \return MTU of the connection. + */ +/*************************************************************************************************/ +uint16_t AttGetMtu(dmConnId_t connId) +{ + return (attCcbByConnId(connId)->mtu); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an ATT message buffer to be sent with the ATT attribute protocol + * zero-copy APIs. + * + * \param len Message length in bytes. + * \param opcode Opcode for ATT message. + * + * \return Pointer to message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *AttMsgAlloc(uint16_t len, uint8_t opcode) +{ + uint8_t *pMsg; + uint8_t hdrLen; + + WSF_ASSERT((opcode == ATT_PDU_VALUE_IND) || (opcode == ATT_PDU_VALUE_NTF)); + + switch (opcode) + { + case ATT_PDU_VALUE_IND: + case ATT_PDU_VALUE_NTF: + hdrLen = ATT_VALUE_IND_NTF_BUF_LEN; + break; + + default: + hdrLen = 0; + break; + } + + if (hdrLen > 0) + { + pMsg = attMsgAlloc(hdrLen + len); + if (pMsg != NULL) + { + /* return pointer to attribute value buffer */ + return (pMsg + hdrLen); + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Free an ATT message buffer allocated with AttMsgAlloc(). + * + * \param pMsg Pointer to message buffer. + * \param opcode Opcode for ATT message. + * + * \return None. + */ +/*************************************************************************************************/ +void AttMsgFree(void *pMsg, uint8_t opcode) +{ + uint8_t hdrLen; + + WSF_ASSERT((opcode == ATT_PDU_VALUE_IND) || (opcode == ATT_PDU_VALUE_NTF)); + + switch (opcode) + { + case ATT_PDU_VALUE_IND: + case ATT_PDU_VALUE_NTF: + hdrLen = ATT_VALUE_IND_NTF_BUF_LEN; + break; + + default: + hdrLen = 0; + break; + } + + WsfMsgFree(((uint8_t *)pMsg) - hdrLen); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.h new file mode 100644 index 0000000000000000000000000000000000000000..67c4924efc0b70e91f7276d43d4f0859ae1ad25b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_main.h @@ -0,0 +1,154 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT main module. + */ +/*************************************************************************************************/ +#ifndef ATT_MAIN_H +#define ATT_MAIN_H + +#include "wsf_queue.h" +#include "wsf_timer.h" +#include "l2c_api.h" +#include "dm_api.h" +#include "att_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* ATT protocol methods */ +#define ATT_METHOD_ERR 0 /* Error response */ +#define ATT_METHOD_MTU 1 /* Exchange mtu */ +#define ATT_METHOD_FIND_INFO 2 /* Find information */ +#define ATT_METHOD_FIND_TYPE 3 /* Find by type value */ +#define ATT_METHOD_READ_TYPE 4 /* Read by type value */ +#define ATT_METHOD_READ 5 /* Read */ +#define ATT_METHOD_READ_BLOB 6 /* Read long */ +#define ATT_METHOD_READ_MULTIPLE 7 /* Read multiple */ +#define ATT_METHOD_READ_GROUP_TYPE 8 /* Read group type */ +#define ATT_METHOD_WRITE 9 /* Write */ +#define ATT_METHOD_WRITE_CMD 10 /* Write command */ +#define ATT_METHOD_PREPARE_WRITE 11 /* Prepare write */ +#define ATT_METHOD_EXECUTE_WRITE 12 /* Execute write */ +#define ATT_METHOD_VALUE_NTF 13 /* Handle value notification */ +#define ATT_METHOD_VALUE_IND 14 /* Handle value indication */ +#define ATT_METHOD_VALUE_CNF 15 /* Handle value confirm */ +#define ATT_METHOD_SIGNED_WRITE_CMD 16 /* Signed write command */ + +/* Convert opcode to method */ +#define ATT_OPCODE_2_METHOD(op) (((op) & ~ATT_PDU_MASK_SERVER) / 2) + +/* Client and server message macros */ +#define ATTC_MSG_START 0x00 +#define ATTS_MSG_START 0x20 +#define ATT_MSG_MASK(msg) ((msg) & 0x1F) + +/* Buffer lengths for messages */ +#define ATT_VALUE_IND_NTF_BUF_LEN (ATT_VALUE_NTF_LEN + L2C_PAYLOAD_START) + +/* attCcb_t control bits */ +#define ATT_CCB_STATUS_MTU_SENT (1<<0) /* MTU req or rsp sent */ +#define ATT_CCB_STATUS_FLOW_DISABLED (1<<1) /* Data flow disabled */ +#define ATT_CCB_STATUS_TX_TIMEOUT (1<<2) /* ATT transaction timed out */ +#define ATT_CCB_STATUS_RSP_PENDING (1<<3) /* ATTS write rsp pending */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +typedef struct +{ + uint16_t startHandle; /* Start handle of the requested operation. Used if an Error Response is sent. */ + uint16_t handle; /* Attribute handle of pending response. */ + } attPendDbHashRsp_t; + +/* Connection control block */ +typedef struct +{ + wsfQueue_t prepWriteQueue; /* prepare write queue */ + wsfTimer_t idleTimer; /* service discovery idle timer */ + uint16_t handle; /* connection handle */ + uint16_t mtu; /* connection mtu */ + dmConnId_t connId; /* DM connection ID */ + uint8_t control; /* Control bitfield */ + attPendDbHashRsp_t *pPendDbHashRsp; /* Pending ATT Response information. */ +} attCcb_t; + +/* ATT message handling function type */ +typedef void (*attMsgHandler_t)(void *pMsg); + +/* ATT connection callback type */ +typedef void (*attConnCback_t)(attCcb_t *pCcb, dmEvt_t *pDmEvt); + +/* Callback interface for client and server */ +typedef struct +{ + l2cDataCback_t dataCback; /* Data callback */ + l2cCtrlCback_t ctrlCback; /* Control callback */ + attMsgHandler_t msgCback; /* Message handling callback */ + attConnCback_t connCback; /* Connection callback */ +} attFcnIf_t; + +/* Main control block of the ATT subsystem */ +typedef struct +{ + attCcb_t ccb[DM_CONN_MAX]; /* Connection control blocks */ + attFcnIf_t const *pClient; /* Client callback interface */ + attFcnIf_t const *pServer; /* Server callback interface */ + attCback_t cback; /* ATT callback function */ + dmCback_t connCback; /* ATT connection callback function */ + wsfHandlerId_t handlerId; /* WSF handler ID */ + uint8_t errTest; /* Status code for error testing */ +} attCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Default component function inteface */ +extern const attFcnIf_t attFcnDefault; + +/* Control block */ +extern attCb_t attCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void attEmptyHandler(wsfMsgHdr_t *pMsg); +void attEmptyDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket); +void attEmptyConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt); + +attCcb_t *attCcbByHandle(uint16_t handle); +attCcb_t *attCcbByConnId(dmConnId_t connId); + +bool_t attUuidCmp16to128(const uint8_t *pUuid16, const uint8_t *pUuid128); +void attSetMtu(attCcb_t *pCcb, uint16_t peerMtu, uint16_t localMtu); +void attExecCallback(dmConnId_t connId, uint8_t event, uint16_t handle, uint8_t status, uint16_t mtu); +void *attMsgAlloc(uint16_t len); + +#ifdef __cplusplus +}; +#endif + +#endif /* ATT_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_sign.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_sign.h new file mode 100644 index 0000000000000000000000000000000000000000..9f4fd3b4d989ba040e4048fd2c5883e238709300 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_sign.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT optional signed PDU processing functions. + */ +/*************************************************************************************************/ +#ifndef ATT_SIGN_H +#define ATT_SIGN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* CMAC algorithm subkey length */ +#define ATT_CMAC_SUBKEY_LEN 16 + +/* CMAC algorithm block length */ +#define ATT_CMAC_BLOCK_LEN 16 + +/* CMAC constant Rb */ +#define ATT_CMAC_RB 0x87 + +/* CMAC signature result length */ +#define ATT_CMAC_RESULT_LEN 8 + + +#ifdef __cplusplus +}; +#endif + +#endif /* ATT_SIGN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_uuid.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_uuid.c new file mode 100644 index 0000000000000000000000000000000000000000..d34e556fd143446b2441590135eb2a2fd239ecee --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/att_uuid.c @@ -0,0 +1,188 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT UUID constants. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "util/bstream.h" +#include "att_uuid.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! Service UUIDs */ +const uint8_t attGapSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GAP_SERVICE)}; +const uint8_t attGattSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GATT_SERVICE)}; +const uint8_t attIasSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_IMMEDIATE_ALERT_SERVICE)}; +const uint8_t attLlsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_LINK_LOSS_SERVICE)}; +const uint8_t attTpsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TX_POWER_SERVICE)}; +const uint8_t attCtsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CURRENT_TIME_SERVICE)}; +const uint8_t attRtusSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_REF_TIME_UPDATE_SERVICE)}; +const uint8_t attNdcsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DST_CHANGE_SERVICE)}; +const uint8_t attGlsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GLUCOSE_SERVICE)}; +const uint8_t attHtsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HEALTH_THERM_SERVICE)}; +const uint8_t attDisSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DEVICE_INFO_SERVICE)}; +const uint8_t attNwaSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_NETWORK_AVAIL_SERVICE)}; +const uint8_t attWdsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_WATCHDOG_SERVICE)}; +const uint8_t attHrsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HEART_RATE_SERVICE)}; +const uint8_t attPassSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PHONE_ALERT_SERVICE)}; +const uint8_t attBasSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BATTERY_SERVICE)}; +const uint8_t attBpsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BLOOD_PRESSURE_SERVICE)}; +const uint8_t attAnsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_NOTIF_SERVICE)}; +const uint8_t attHidSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_SERVICE)}; +const uint8_t attSpsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SCAN_PARAM_SERVICE)}; +const uint8_t attPlxsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PULSE_OXIMITER_SERVICE)}; +const uint8_t attUdsSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_USER_DATA_SERVICE)}; +const uint8_t attMprvSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PRV_SERVICE)}; +const uint8_t attMprxSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PROXY_SERVICE)}; + +/*! GATT UUIDs */ +const uint8_t attPrimSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PRIMARY_SERVICE)}; +const uint8_t attSecSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SECONDARY_SERVICE)}; +const uint8_t attIncUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_INCLUDE)}; +const uint8_t attChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CHARACTERISTIC)}; + +/*! Descriptor UUIDs */ +const uint8_t attChExtUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CHARACTERISTIC_EXT)}; +const uint8_t attChUserDescUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CHAR_USER_DESC)}; +const uint8_t attCliChCfgUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CLIENT_CHAR_CONFIG)}; +const uint8_t attSrvChCfgUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SERVER_CHAR_CONFIG)}; +const uint8_t attChPresFmtUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CHAR_PRES_FORMAT)}; +const uint8_t attAggFmtUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_AGGREGATE_FORMAT)}; +const uint8_t attValRangeUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_VALID_RANGE)}; +const uint8_t attHidErmUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_EXT_REPORT_MAPPING)}; +const uint8_t attHidRimUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_REPORT_ID_MAPPING)}; + +/*! Characteristic UUIDs */ +const uint8_t attDnChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DEVICE_NAME)}; +const uint8_t attApChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_APPEARANCE)}; +const uint8_t attPpfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PERIPH_PRIVACY_FLAG)}; +const uint8_t attRaChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RECONN_ADDR)}; +const uint8_t attPpcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PREF_CONN_PARAM)}; +const uint8_t attScChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SERVICE_CHANGED)}; +const uint8_t attAlChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_LEVEL)}; +const uint8_t attTxpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TX_POWER_LEVEL)}; +const uint8_t attDtChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DATE_TIME)}; +const uint8_t attDwChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DAY_OF_WEEK)}; +const uint8_t attDdtChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DAY_DATE_TIME)}; +const uint8_t attEt100ChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_EXACT_TIME_100)}; +const uint8_t attEt256ChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_EXACT_TIME_256)}; +const uint8_t attDstoChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DST_OFFSET)}; +const uint8_t attTzChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_ZONE)}; +const uint8_t attLtiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_LOCAL_TIME_INFO)}; +const uint8_t attStzChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SECONDARY_TIME_ZONE)}; +const uint8_t attTdstChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_WITH_DST)}; +const uint8_t attTaChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_ACCURACY)}; +const uint8_t attTsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_SOURCE)}; +const uint8_t attRtiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_REFERENCE_TIME_INFO)}; +const uint8_t attTbChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_BROADCAST)}; +const uint8_t attTucpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_UPDATE_CP)}; +const uint8_t attTusChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TIME_UPDATE_STATE)}; +const uint8_t attGlmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GLUCOSE_MEAS)}; +const uint8_t attBlChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BATTERY_LEVEL)}; +const uint8_t attBpsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BATTERY_POWER_STATE)}; +const uint8_t attBlsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BATTERY_LEVEL_STATE)}; +const uint8_t attTmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TEMP_MEAS)}; +const uint8_t attTtChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TEMP_TYPE)}; +const uint8_t attItChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_INTERMEDIATE_TEMP)}; +const uint8_t attTcelChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TEMP_C)}; +const uint8_t attTfahChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_TEMP_F)}; +const uint8_t attSidChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SYSTEM_ID)}; +const uint8_t attMnsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MODEL_NUMBER)}; +const uint8_t attSnsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SERIAL_NUMBER)}; +const uint8_t attFrsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_FIRMWARE_REV)}; +const uint8_t attHrsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HARDWARE_REV)}; +const uint8_t attSrsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SOFTWARE_REV)}; +const uint8_t attMfnsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MANUFACTURER_NAME)}; +const uint8_t attIeeeChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_11073_CERT_DATA)}; +const uint8_t attCtChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CURRENT_TIME)}; +const uint8_t attElChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ELEVATION)}; +const uint8_t attLatChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_LATITUDE)}; +const uint8_t attLongChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_LONGITUDE)}; +const uint8_t attP2dChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_POSITION_2D)}; +const uint8_t attP3dChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_POSITION_3D)}; +const uint8_t attVidChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_VENDOR_ID)}; +const uint8_t attHbmiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_BOOT_MOUSE_IN)}; +const uint8_t attGlmcChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GLUCOSE_MEAS_CONTEXT)}; +const uint8_t attBpmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BP_MEAS)}; +const uint8_t attIcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_INTERMEDIATE_BP)}; +const uint8_t attHrmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HR_MEAS)}; +const uint8_t attBslChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HR_SENSOR_LOC)}; +const uint8_t attHrcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HR_CP)}; +const uint8_t attRemChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_REMOVABLE)}; +const uint8_t attSrChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SERVICE_REQ)}; +const uint8_t attStcChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SCI_TEMP_C)}; +const uint8_t attStrChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_STRING)}; +const uint8_t attNwaChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_NETWORK_AVAIL)}; +const uint8_t attAsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_STATUS)}; +const uint8_t attRcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RINGER_CP)}; +const uint8_t attRsChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RINGER_SETTING)}; +const uint8_t attAcbmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_CAT_ID_MASK)}; +const uint8_t attAcChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_CAT_ID)}; +const uint8_t attAncpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_ALERT_NOTIF_CP)}; +const uint8_t attUasChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_UNREAD_ALERT_STATUS)}; +const uint8_t attNaChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_NEW_ALERT)}; +const uint8_t attSnacChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SUP_NEW_ALERT_CAT)}; +const uint8_t attSuacChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SUP_UNREAD_ALERT_CAT)}; +const uint8_t attBpfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_BP_FEATURE)}; +const uint8_t attHidBmiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MEAS_INTERVAL)}; +const uint8_t attHidBkiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_BOOT_KEYBOARD_IN)}; +const uint8_t attHidBkoChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_BOOT_KEYBOARD_OUT)}; +const uint8_t attHidiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_INFORMATION)}; +const uint8_t attHidRmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_REPORT_MAP)}; +const uint8_t attHidcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_CONTROL_POINT)}; +const uint8_t attHidRepChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_REPORT)}; +const uint8_t attHidPmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_HID_PROTOCOL_MODE)}; +const uint8_t attSiwChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SCAN_INT_WIND)}; +const uint8_t attPnpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PNP_ID)}; +const uint8_t attGlfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_GLUCOSE_FEATURE)}; +const uint8_t attRacpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RACP)}; +const uint8_t attCarChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CAR)}; +const uint8_t attRsfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RUNNING_SPEED_FEATURE)}; +const uint8_t attRsmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RUNNING_SPEED_MEASUREMENT)}; +const uint8_t attCpfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CYCLING_POWER_FEATURE)}; +const uint8_t attCpmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CYCLING_POWER_MEASUREMENT)}; +const uint8_t attCsfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CYCLING_SPEED_FEATURE)}; +const uint8_t attCsmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CYCLING_SPEED_MEASUREMENT)}; +const uint8_t attSlChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SENSOR_LOCATION)}; +const uint8_t attPlxfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PULSE_OX_FEATURES)}; +const uint8_t attPlxscmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PULSE_OX_SPOT_CHECK)}; +const uint8_t attPlxcmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PULSE_OX_CONTINUOUS)}; +const uint8_t attRpaoChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_RPAO)}; +const uint8_t attDbciChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DB_CHANGE_INCREMENT)}; +const uint8_t attUiChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_USER_INDEX)}; +const uint8_t attUcpChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_USER_CONTROL_POINT)}; +const uint8_t attMprvDinChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PRV_DATA_IN)}; +const uint8_t attMprvDoutChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PRV_DATA_OUT)}; +const uint8_t attMprxDinChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PROXY_DATA_IN)}; +const uint8_t attMprxDoutChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_MESH_PROXY_DATA_OUT)}; +const uint8_t attWssSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_WEIGHT_SCALE_SERVICE)}; +const uint8_t attWmChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_WEIGHT_MEAS)}; +const uint8_t attWsfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_WEIGHT_SCALE_FEATURE)}; +const uint8_t attGattCsfChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CLIENT_SUPPORTED_FEATURES)}; +const uint8_t attGattDbhChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_DATABASE_HASH)}; +const uint8_t attCteSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CONSTANT_TONE_SERVICE)}; +const uint8_t attCteEnChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CTE_ENABLE)}; +const uint8_t attCteMinLenChUuid[ATT_16_UUID_LEN] ={UINT16_TO_BYTES(ATT_UUID_CTE_MIN_LEN)}; +const uint8_t attCteTxCntChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CTE_TX_CNT)}; +const uint8_t attCteTxDurChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CTE_TX_DURATION)}; +const uint8_t attCteIntChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CTE_INTERVAL)}; +const uint8_t attCtePhyChUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_CTE_PHY)}; diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_disc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_disc.c new file mode 100644 index 0000000000000000000000000000000000000000..19a30c34302f148d91174af4887032a953d93fbe --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_disc.c @@ -0,0 +1,704 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client service and characteristic utility functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_uuid.h" +#include "att_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#define ATT_DISC_HDL_IDX_NONE 0xFF + +#define ATT_SET_UUID_MASK ATTC_SET_UUID_128 + +/* Characteristic declaration lengths */ +#define ATT_CHAR_DECL_LEN_UUID16 5 +#define ATT_CHAR_DECL_LEN_UUID128 19 + +/* Read by type response lengths for characteristic discovery */ +#define ATT_READ_RSP_LEN_UUID16 (ATT_CHAR_DECL_LEN_UUID16 + 2) +#define ATT_READ_RSP_LEN_UUID128 (ATT_CHAR_DECL_LEN_UUID128 + 2) + +/* Find info response lengths */ +#define ATT_FIND_RSP_LEN_UUID16 (ATT_16_UUID_LEN + 2) +#define ATT_FIND_RSP_LEN_UUID128 (ATT_128_UUID_LEN + 2) + +/*************************************************************************************************/ +/*! + * \brief Compare two UUIDs. + * + * \param pChar Characteristic that we are looking for. + * \param pUuid Pointer to peer UUID data. + * \param settings Indicates 16 or 128 bit UUID. + * + * \return TRUE if UUIDs match. + */ +/*************************************************************************************************/ +static bool_t attcUuidCmp(attcDiscChar_t *pChar, uint8_t *pUuid, uint8_t settings) +{ + /* if both uuids are the same length */ + if ((pChar->settings & ATT_SET_UUID_MASK) == settings) + { + /* simply compare the data */ + return (memcmp(pChar->pUuid, pUuid, (settings == 0) ? ATT_16_UUID_LEN : ATT_128_UUID_LEN) == 0); + } + /* if discovered UUID is 128 bit and our UUID is 16 bit */ + else if ((settings == ATTC_SET_UUID_128) && ((pChar->settings & ATTC_SET_UUID_128) == 0)) + { + /* convert our UUID to 128 bit and compare */ + return attUuidCmp16to128(pChar->pUuid, pUuid); + } + /* else discovered UUID is 16 bit and our UUID is 128 bit */ + else + { + /* no match */ + return FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Verify that required characterstics and descriptors have been discovered. + * + * \param pCb Pointer to service discovery control block. + * + * \return ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static uint8_t attcDiscVerify(attcDiscCb_t *pCb) +{ + attcDiscChar_t **pChar; + uint8_t i; + + /* for each characteristic */ + for (i = 0, pChar = pCb->pCharList; i < pCb->charListLen; i++, pChar++) + { + /* if characteristic required */ + if (((*pChar)->settings & ATTC_SET_REQUIRED) != 0) + { + /* verify handle was discovered */ + if (pCb->pHdlList[i] == ATT_HANDLE_NONE) + { + return ATT_ERR_REQ_NOT_FOUND; + } + } + } + + return ATT_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Find next characteristic that requires descriptor discovery. If none found, + * discovery is complete; verify that required characterstics have been discovered. + * + * \param connId DM connection ID. + * \param pCb Pointer to service discovery control block. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static uint8_t attcDiscDescriptors(dmConnId_t connId, attcDiscCb_t *pCb) +{ + attcDiscChar_t **pChar; + uint16_t startHdl = ATT_HANDLE_NONE; + uint16_t endHdl = ATT_HANDLE_NONE; + + /* find next descriptor in list */ + pChar = pCb->pCharList + pCb->charListIdx; + while (pCb->charListIdx < pCb->charListLen) + { + /* if this is a descriptor */ + if (((*pChar)->settings & ATTC_SET_DESCRIPTOR) != 0) + { + /* start handle is one greater than characteristic value handle, + * which is stored in the previous entry in the list; + * end handle is stored at current entry in the list + */ + startHdl = pCb->pHdlList[pCb->charListIdx - 1] + 1; + endHdl = pCb->pHdlList[pCb->charListIdx]; + + /* clear temp end handle */ + pCb->pHdlList[pCb->charListIdx] = ATT_HANDLE_NONE; + + /* if there are descriptors */ + if (startHdl <= endHdl) + { + break; + } + else + { + /* we are looking for descriptors for this characteristic but + * there aren't any; + * skip over any other descriptors that follow in our list + */ + while (++pCb->charListIdx < pCb->charListLen) + { + pChar++; + if ((*pChar)->settings & ATTC_SET_DESCRIPTOR) + { + continue; + } + } + } + } + else + { + /* go to next in list */ + pChar++; + pCb->charListIdx++; + } + } + + /* if no more descriptors to be discovered */ + if (pCb->charListIdx == pCb->charListLen) + { + /* we're done; verify required characteristics and descriptors were discovered */ + return attcDiscVerify(pCb); + } + /* else initiate characteristic descriptor discovery */ + else + { + AttcFindInfoReq(connId, startHdl, endHdl, TRUE); + return ATT_CONTINUING; + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a descriptor handle/UUID pair. + * + * \param pCb Pointer to service discovery control block. + * \param settings Indicates 16 or 128 bit UUID. + * \param pPair Pointer to handle/UUID pair. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static void attcDiscProcDescPair(attcDiscCb_t *pCb, uint8_t settings, uint8_t *pPair) +{ + attcDiscChar_t **pDesc; + uint16_t hdl; + uint8_t i; + + /* parse handle */ + BSTREAM_TO_UINT16(hdl, pPair); + + /* now pPair points to UUID; find descriptor with matching UUID */ + pDesc = &pCb->pCharList[pCb->charListIdx]; + for (i = pCb->charListIdx; + (i < pCb->charListLen) && (((*pDesc)->settings & ATTC_SET_DESCRIPTOR) != 0); + i++, pDesc++) + { + /* if characteristic not already found */ + if (pCb->pHdlList[i] == 0) + { + /* if UUIDs match */ + if (attcUuidCmp(*pDesc, pPair, settings)) + { + /* match found; store handle */ + pCb->pHdlList[i] = hdl; + + ATT_TRACE_INFO1("descriptor found handle:0x%x", hdl); + break; + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a ATTC_FIND_INFO_RSP received while performing characteristic discovery. + * + * \param pCb Pointer to service discovery control block. + * \param pMsg ATT callback event message. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static uint8_t attcDiscProcDesc(attcDiscCb_t *pCb, attEvt_t *pMsg) +{ + attcDiscChar_t **pChar; + uint8_t *p; + uint8_t *pEnd; + uint8_t format; + uint8_t pairLen; + uint8_t settings; + + /* if find info successful */ + if (pMsg->hdr.status == ATT_SUCCESS) + { + p = pMsg->pValue; + pEnd = pMsg->pValue + pMsg->valueLen; + + /* determine UUID format */ + BSTREAM_TO_UINT8(format, p); + if (format == ATT_FIND_HANDLE_16_UUID) + { + settings = 0; + pairLen = ATT_FIND_RSP_LEN_UUID16; + } + else if (format == ATT_FIND_HANDLE_128_UUID) + { + settings = ATTC_SET_UUID_128; + pairLen = ATT_FIND_RSP_LEN_UUID128; + } + else + { + return ATT_ERR_INVALID_RSP; + } + + /* for each handle/UUID pair */ + while (p < pEnd) + { + /* process descriptor handle/UUID pair */ + attcDiscProcDescPair(pCb, settings, p); + + /* go to next */ + p += pairLen; + } + } + + /* if descriptor discovery complete for this characteristic */ + if (pMsg->hdr.status != ATT_SUCCESS || pMsg->continuing == FALSE) + { + /* go to next entry in list */ + pChar = &pCb->pCharList[pCb->charListIdx]; + do + { + /* check if at end of list */ + pCb->charListIdx++; + if (pCb->charListIdx == pCb->charListLen) + { + break; + } + + /* skip over descriptors that follow current characteristic */ + pChar++; + } while ((*pChar)->settings & ATTC_SET_DESCRIPTOR); + + /* proceed with descriptor discovery for the next characteristic */ + return attcDiscDescriptors((dmConnId_t) pMsg->hdr.param, pCb); + } + else + { + /* still more to do */ + return ATT_CONTINUING; + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a characteristic declaration. + * + * \param pCb Pointer to service discovery control block. + * \param settings Indicates 16 or 128 bit UUID. + * \param pDecl Pointer to declaration. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static void attcDiscProcCharDecl(attcDiscCb_t *pCb, uint8_t settings, uint8_t *pDecl) +{ + attcDiscChar_t **pChar; + uint16_t hdl; + uint16_t declHdl; + uint8_t i; + + /* parse it */ + BSTREAM_TO_UINT16(declHdl, pDecl); + pDecl++; /* skip properties field */ + BSTREAM_TO_UINT16(hdl, pDecl); + + /* if looking for end handle of previous characteristic */ + if (pCb->endHdlIdx != ATT_DISC_HDL_IDX_NONE) + { + /* end handle of previous characteristic is one less than + * the handle of the current characteristic declaration + */ + pCb->pHdlList[pCb->endHdlIdx] = declHdl - 1; + pCb->endHdlIdx = ATT_DISC_HDL_IDX_NONE; + } + + /* check handle */ + if (hdl > declHdl && hdl <= pCb->svcEndHdl) + { + /* now pDecl points to UUID; search for UUID in characteristic list */ + for (i = 0, pChar = pCb->pCharList; i < pCb->charListLen; i++, pChar++) + { + /* if characteristic not already found */ + if (pCb->pHdlList[i] == 0) + { + /* if UUIDs match */ + if (attcUuidCmp(*pChar, pDecl, settings)) + { + /* match found; store handle */ + pCb->pHdlList[i] = hdl; + + /* if not at end of list and next in list is a descriptor */ + if (i < (pCb->charListLen - 1) && + ((*(pChar + 1))->settings & ATTC_SET_DESCRIPTOR) == ATTC_SET_DESCRIPTOR) + { + /* characteristic has descriptors, we need to find end handle + * store end handle temporarily in handle list location + * for the first descriptor + */ + pCb->endHdlIdx = i + 1; + } + + ATT_TRACE_INFO1("characteristic found handle:0x%x", hdl); + } + } + } + } + else + { + /* invalid handle; skip this declaration */ + ATT_TRACE_WARN1("invalid handle:0x%x", hdl); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a ATTC_READ_BY_TYPE_RSP received while performing characteristic discovery. + * + * \param pCb Pointer to service discovery control block. + * \param pMsg ATT callback event message. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +static uint8_t attcDiscProcChar(attcDiscCb_t *pCb, attEvt_t *pMsg) +{ + uint8_t *p; + uint8_t *pEnd; + uint8_t pairLen; + uint8_t settings; + + /* if read by type successful */ + if (pMsg->hdr.status == ATT_SUCCESS) + { + p = pMsg->pValue; + pEnd = pMsg->pValue + pMsg->valueLen; + + /* verify attribute-handle pair length and determine UUID length */ + BSTREAM_TO_UINT8(pairLen, p); + if (pairLen == ATT_READ_RSP_LEN_UUID16) + { + settings = 0; + } + else if (pairLen == ATT_READ_RSP_LEN_UUID128) + { + settings = ATTC_SET_UUID_128; + } + else + { + return ATT_ERR_INVALID_RSP; + } + + /* Note that ATT already verifies response length and handle values */ + + /* for each characteristic declaration */ + while (p < pEnd) + { + /* process characteristic declaration */ + attcDiscProcCharDecl(pCb, settings, p); + + /* go to next */ + p += pairLen; + } + } + + /* if characteristic discovery complete */ + if (pMsg->hdr.status != ATT_SUCCESS || pMsg->continuing == FALSE) + { + /* check if characteristic end handle needs to be set */ + if (pCb->endHdlIdx != ATT_DISC_HDL_IDX_NONE) + { + /* end handle of characteristic declaration is end handle of service */ + pCb->pHdlList[pCb->endHdlIdx] = pCb->svcEndHdl; + } + + /* proceed with descriptor discovery */ + pCb->charListIdx = 0; + return attcDiscDescriptors((dmConnId_t) pMsg->hdr.param, pCb); + } + else + { + /* still more to do */ + return ATT_CONTINUING; + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiates the next characteristic configuration procedure. + * + * \param pCb Pointer to service discovery control block. + * \param pMsg ATT callback event message. + * + * \return ATT_CONTINUING if successful and configuration procedure is continuing. + * ATT_SUCCESS if configuration procedure completed successfully. + */ +/*************************************************************************************************/ +static uint8_t attcDiscConfigNext(dmConnId_t connId, attcDiscCb_t *pCb) +{ + attcDiscCfg_t *pCfg; + + pCfg = pCb->pCfgList + pCb->charListIdx; + + /* iterate over list */ + while (pCb->charListIdx < pCb->cfgListLen) + { + /* if handle was discovered */ + if (pCb->pHdlList[pCfg->hdlIdx] != ATT_HANDLE_NONE) + { + /* if value present do write req */ + if (pCfg->valueLen != 0) + { + AttcWriteReq(connId, pCb->pHdlList[pCfg->hdlIdx], pCfg->valueLen, (uint8_t *) pCfg->pValue); + } + /* else do read */ + else + { + AttcReadReq(connId, pCb->pHdlList[pCfg->hdlIdx]); + } + + /* done for now */ + return ATT_CONTINUING; + } + + /* next in list */ + pCb->charListIdx++; + pCfg++; + } + + /* nothing left to configure; we're done */ + return ATT_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief This utility function discovers the given service on a peer device. Function + * AttcFindByTypeValueReq() is called to initiate the discovery procedure. + * + * \param connId DM connection ID. + * \param pCb Pointer to service discovery control block. + * \param uuidLen Length of UUID (2 or 16). + * \param pUuid Pointer to UUID data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcDiscService(dmConnId_t connId, attcDiscCb_t *pCb, uint8_t uuidLen, uint8_t *pUuid) +{ + AttcFindByTypeValueReq(connId, ATT_HANDLE_START, ATT_HANDLE_MAX, ATT_UUID_PRIMARY_SERVICE, + uuidLen, pUuid, FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief This utility function processes a service discovery result. It should be called + * when an ATTC_FIND_BY_TYPE_VALUE_RSP callback event is received after service + * discovery is initiated by calling AttcDiscService(). + * + * \param pCb Pointer to service discovery control block. + * \param pMsg ATT callback event message. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +/*************************************************************************************************/ +uint8_t AttcDiscServiceCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg) +{ + uint8_t *p; + + /* verify callback event */ + if (pMsg->hdr.event != ATTC_FIND_BY_TYPE_VALUE_RSP) + { + ATT_TRACE_WARN1("unexpected callback event %d", pMsg->hdr.event); + return ATT_ERR_UNDEFINED; + } + /* verify status */ + else if (pMsg->hdr.status != ATT_SUCCESS) + { + return pMsg->hdr.status; + } + /* verify result was found */ + else if (pMsg->valueLen == 0) + { + return ATT_ERR_NOT_FOUND; + } + + /* get handles of first returned service only; ATT has already performed error checking */ + p = pMsg->pValue; + BSTREAM_TO_UINT16(pCb->svcStartHdl, p); + BSTREAM_TO_UINT16(pCb->svcEndHdl, p); + + ATT_TRACE_INFO2("found service startHdl=0x%x endHdl=0x%x", pCb->svcStartHdl, pCb->svcEndHdl); + + return ATT_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief This utility function starts characteristic and characteristic descriptor + * discovery for a service on a peer device. The service must have been previously + * discovered by calling AttcDiscService() and AttcDiscServiceCmpl(). + * + * \param connId DM connection ID. + * \param pCb Pointer to service discovery control block. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcDiscCharStart(dmConnId_t connId, attcDiscCb_t *pCb) +{ + /* initialize control block */ + pCb->charListIdx = 0; + pCb->endHdlIdx = ATT_DISC_HDL_IDX_NONE; + + AttcReadByTypeReq(connId, pCb->svcStartHdl, pCb->svcEndHdl, ATT_16_UUID_LEN, + (uint8_t *) attChUuid, TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief This utility function processes a characteristic discovery result. It should be + * called when an ATTC_READ_BY_TYPE_RSP or ATTC_FIND_INFO_RSP callback event is + * received after characteristic discovery is initiated by calling AttcDiscCharStart(). + * + * \param pCb Pointer to service discovery control block. + * \param pMsg ATT callback event message. + * + * \return ATT_CONTINUING if successful and discovery procedure is continuing. + * ATT_SUCCESS if discovery procedure completed successfully. + * Otherwise the discovery procedure failed. + */ +/*************************************************************************************************/ +uint8_t AttcDiscCharCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg) +{ + uint8_t status; + + /* verify callback event */ + if (pMsg->hdr.event != ATTC_READ_BY_TYPE_RSP && + pMsg->hdr.event != ATTC_FIND_INFO_RSP) + { + ATT_TRACE_WARN1("unexpected callback event %d", pMsg->hdr.event); + return ATT_ERR_UNDEFINED; + } + + /* if read by type (characteristic discovery) */ + if (pMsg->hdr.event == ATTC_READ_BY_TYPE_RSP) + { + status = attcDiscProcChar(pCb, pMsg); + } + /* else if find info (descriptor discovery) */ + else + { + status = attcDiscProcDesc(pCb, pMsg); + } + + /* if characteristic discovery failed clear any handles */ + if (status != ATT_SUCCESS && status != ATT_CONTINUING) + { + memset(pCb->pHdlList, 0, (pCb->charListLen * sizeof(uint16_t))); + } + + return status; +} + +/*************************************************************************************************/ +/*! + * \brief This utility function starts characteristic configuration for characteristics on a + * peer device. The characteristics must have been previously discovered by calling + * AttcDiscCharStart() and AttcDisccharCont(). + * + * \param connId DM connection ID. + * \param pCb Pointer to service discovery control block. + * + * \return ATT_CONTINUING if successful and configuration procedure is continuing. + * ATT_SUCCESS if nothing to configure. + */ +/*************************************************************************************************/ +uint8_t AttcDiscConfigStart(dmConnId_t connId, attcDiscCb_t *pCb) +{ + /* use char list index to iterate over config list */ + pCb->charListIdx = 0; + + return attcDiscConfigNext(connId, pCb); +} + +/*************************************************************************************************/ +/*! + * \brief This utility function initiates the next characteristic configuration procedure. + * It should be called when an ATTC_READ_RSP or ATTC_WRITE_RSP callback event is received + * after characteristic configuration is initiated by calling AttcDiscConfigStart(). + * + * \param connId DM connection ID. + * \param pCb Pointer to discovery control block. + * + * \return ATT_CONTINUING if successful and configuration procedure is continuing. + * ATT_SUCCESS if configuration procedure completed successfully. + */ +/*************************************************************************************************/ +uint8_t AttcDiscConfigCmpl(dmConnId_t connId, attcDiscCb_t *pCb) +{ + /* go to next in list */ + pCb->charListIdx++; + + return attcDiscConfigNext(connId, pCb); +} + +/*************************************************************************************************/ +/*! + * \brief This utility function resumes the characteristic configuration procedure. It can + * be called when an ATTC_READ_RSP or ATTC_WRITE_RSP callback event is received + * with failure status to attempt the read or write procedure again. + * + * \param connId DM connection ID. + * \param pCb Pointer to discovery control block. + * + * \return ATT_CONTINUING if successful and configuration procedure is continuing. + * ATT_SUCCESS if configuration procedure completed successfully. + */ +/*************************************************************************************************/ +uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb) +{ + return attcDiscConfigNext(connId, pCb); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.c new file mode 100644 index 0000000000000000000000000000000000000000..2f613d3f521326560a662741a9c912fca7a56153 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.c @@ -0,0 +1,838 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client main module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "attc_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* type for send request function */ +typedef void (*attcSendReq_t)(attcCcb_t *pCcb); + +/************************************************************************************************** + Function Prototypes +**************************************************************************************************/ + +static void attcDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket); +static void attcCtrlCback(wsfMsgHdr_t *pMsg); +static void attcConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt); +static void attcMsgCback(attcApiMsg_t *pMsg); + +static void attcSendSimpleReq(attcCcb_t *pCcb); +static void attcSendContinuingReq(attcCcb_t *pCcb); +static void attcSendMtuReq(attcCcb_t *pCcb); +static void attcSendWriteCmd(attcCcb_t *pCcb); +static void attcSendPrepWriteReq(attcCcb_t *pCcb); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Interface to ATT */ +static const attFcnIf_t attcFcnIf = +{ + attcDataCback, + attcCtrlCback, + (attMsgHandler_t) attcMsgCback, + attcConnCback +}; + +/* Table of send request functions */ +static const attcSendReq_t attcSendReqTbl[] = +{ + NULL, /* ATTC_MSG_API_NONE (unused) */ + attcSendMtuReq, /* ATTC_MSG_API_MTU */ + attcSendContinuingReq, /* ATTC_MSG_API_FIND_INFO */ + attcSendContinuingReq, /* ATTC_MSG_API_FIND_BY_TYPE_VALUE */ + attcSendContinuingReq, /* ATTC_MSG_API_READ_BY_TYPE */ + attcSendSimpleReq, /* ATTC_MSG_API_READ */ + attcSendContinuingReq, /* ATTC_MSG_API_READ_LONG */ + attcSendSimpleReq, /* ATTC_MSG_API_READ_MULTIPLE */ + attcSendContinuingReq, /* ATTC_MSG_API_READ_BY_GROUP_TYPE */ + attcSendSimpleReq, /* ATTC_MSG_API_WRITE */ + attcSendWriteCmd, /* ATTC_MSG_API_WRITE_CMD */ + attcSendPrepWriteReq, /* ATTC_MSG_API_PREP_WRITE */ + attcSendSimpleReq /* ATTC_MSG_API_EXEC_WRITE */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +attcCb_t attcCb; + +/*************************************************************************************************/ +/*! + * \brief Check if application callback is pending for a given write command, or the maximum + * number of simultaneous write commands has been reached. + * + * \param pCcb ATTC control block. + * \param pMsg ATTC message. + * + * \return TRUE if app callback's pending or maximum number of simultaneous write commands reached. + * FALSE, otherwise. + */ +/*************************************************************************************************/ +static bool_t attcPendWriteCmd(attcCcb_t *pCcb, attcApiMsg_t *pMsg) +{ + uint8_t pendRsp; + uint8_t i; + + /* initialize number of response callbacks pending */ + pendRsp = 0; + + for (i = 0; i < ATT_NUM_SIMUL_WRITE_CMD; i++) + { + /* if callback pending for write command */ + if (pCcb->pendWriteCmdHandle[i] != ATT_HANDLE_NONE) + { + /* if callback pending for this handle */ + if (pCcb->pendWriteCmdHandle[i] == pMsg->handle) + { + /* callback pending for this write command */ + return TRUE; + } + + pendRsp++; + } + } + + /* no callback is pending for this write command but see if the maximum number of simultaneous + write commands has been reached */ + return (pendRsp < ATT_NUM_SIMUL_WRITE_CMD) ? FALSE : TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set pending write command response callback for a given attribute handle. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSetPendWriteCmd(attcCcb_t *pCcb) +{ + uint8_t i; + + for (i = 0; i < ATT_NUM_SIMUL_WRITE_CMD; i++) + { + /* if entry free */ + if (pCcb->pendWriteCmdHandle[i] == ATT_HANDLE_NONE) + { + /* set pending write command handle */ + pCcb->pendWriteCmdHandle[i] = pCcb->outReq.handle; + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Call pending write command response application callback. + * + * \param connId DM connection ID. + * \param pCcb ATTC control block. + * \param status Callback event status. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcWriteCmdCallback(dmConnId_t connId, attcCcb_t *pCcb, uint8_t status) +{ + uint8_t i; + + /* if any pending write command callback */ + for (i = 0; i < ATT_NUM_SIMUL_WRITE_CMD; i++) + { + if (pCcb->pendWriteCmdHandle[i] != ATT_HANDLE_NONE) + { + /* call callback with status */ + attcExecCallback(connId, ATTC_WRITE_CMD_RSP, pCcb->pendWriteCmdHandle[i], status); + pCcb->pendWriteCmdHandle[i] = ATT_HANDLE_NONE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send attribute client request that has already been built. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSendSimpleReq(attcCcb_t *pCcb) +{ + attcPktParam_t *pPkt = pCcb->outReq.pPkt; + + /* clear stored packet pointer */ + pCcb->outReq.pPkt = NULL; + + /* start request timer (except for write command) */ + if (pCcb->outReq.hdr.event != ATTC_MSG_API_WRITE_CMD) + { + pCcb->outReqTimer.msg.event = ATTC_MSG_REQ_TIMEOUT; + WsfTimerStartSec(&pCcb->outReqTimer, pAttCfg->transTimeout); + } + + /* send packet to L2CAP */ + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, pPkt->len, (uint8_t *) pPkt); +} + +/*************************************************************************************************/ +/*! + * \brief Send a request that may be continuing. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSendContinuingReq(attcCcb_t *pCcb) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* allocate new buffer */ + if ((pPkt = attMsgAlloc(pCcb->outReq.pPkt->len + L2C_PAYLOAD_START)) != NULL) + { + /* copy stored packet to new */ + memcpy(pPkt, pCcb->outReq.pPkt, pCcb->outReq.pPkt->len + L2C_PAYLOAD_START); + } + /* else handle error case of allocation failure */ + else + { + /* free stored packet and call callback with failure status */ + attcReqClear(pCcb, &pCcb->outReq, ATT_ERR_MEMORY); + return; + } + } + /* else not continuing */ + else + { + /* send the stored packet */ + pPkt = pCcb->outReq.pPkt; + + /* clear stored packet pointer */ + pCcb->outReq.pPkt = NULL; + } + + /* build remaining fields of packet from stored parameters */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START + ATT_HDR_LEN; + if (pCcb->outReq.hdr.event == ATTC_MSG_API_READ_LONG) + { + /* build offset field */ + p += sizeof(uint16_t); + UINT16_TO_BSTREAM(p, pCcb->outReqParams.o.offset); + } + else + { + /* + * Find Info, Find By Type Value, Read By Type, and Read By Group Type + * request packets all begin with a start handle and end handle. + */ + UINT16_TO_BSTREAM(p, pCcb->outReqParams.h.startHandle); + UINT16_TO_BSTREAM(p, pCcb->outReqParams.h.endHandle); + } + + /* start request timer */ + pCcb->outReqTimer.msg.event = ATTC_MSG_REQ_TIMEOUT; + WsfTimerStartSec(&pCcb->outReqTimer, pAttCfg->transTimeout); + + /* send packet to L2CAP */ + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, pPkt->len, (uint8_t *) pPkt); +} + +/*************************************************************************************************/ +/*! + * \brief Send MTU request. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSendMtuReq(attcCcb_t *pCcb) +{ + /* if MTU already exchanged */ + if (pCcb->pMainCcb->control & ATT_CCB_STATUS_MTU_SENT) + { + /* discard request */ + attcFreePkt(&pCcb->outReq); + + /* clear out req */ + pCcb->outReq.hdr.event = ATTC_MSG_API_NONE; + + ATT_TRACE_WARN0("MTU req discarded"); + } + else + { + /* set MTU sent */ + pCcb->pMainCcb->control |= ATT_CCB_STATUS_MTU_SENT; + + /* send packet */ + attcSendSimpleReq(pCcb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send attribute client Write command. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSendWriteCmd(attcCcb_t *pCcb) +{ + /* send packet */ + attcSendSimpleReq(pCcb); + + /* if flow not disabled */ + if (!(pCcb->pMainCcb->control & ATT_CCB_STATUS_FLOW_DISABLED)) + { + /* call callback */ + attcExecCallback(pCcb->pMainCcb->connId, ATTC_WRITE_CMD_RSP, pCcb->outReq.handle, ATT_SUCCESS); + } + else + { + /* set pending write command callback for this handle */ + attcSetPendWriteCmd(pCcb); + } + + /* clear out req */ + pCcb->outReq.hdr.event = ATTC_MSG_API_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Send attribute client Prepare Write request. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSendPrepWriteReq(attcCcb_t *pCcb) +{ + attcPktParam_t *pPkt; + uint8_t *p; + uint16_t dataLen; + + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* determine size of buffer to allocate */ + if (pCcb->outReqParams.w.len < (pCcb->pMainCcb->mtu - ATT_PREP_WRITE_REQ_LEN)) + { + dataLen = pCcb->outReqParams.w.len; + } + else + { + dataLen = pCcb->pMainCcb->mtu - ATT_PREP_WRITE_REQ_LEN; + } + + /* allocate new buffer */ + if ((pPkt = attMsgAlloc(dataLen + ATT_PREP_WRITE_REQ_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* copy fixed fields */ + memcpy(pPkt, pCcb->outReq.pPkt, ATT_PREP_WRITE_REQ_LEN + L2C_PAYLOAD_START); + + /* copy data */ + memcpy(((uint8_t *) pPkt + L2C_PAYLOAD_START + ATT_PREP_WRITE_REQ_LEN), + pCcb->outReqParams.w.pValue, dataLen); + + /* update length and data pointer */ + pCcb->outReqParams.w.pValue += dataLen; + pCcb->outReqParams.w.len -= dataLen; + } + /* else handle error case of allocation failure */ + else + { + /* free stored packet and call callback with failure status */ + attcReqClear(pCcb, &pCcb->outReq, ATT_ERR_MEMORY); + return; + } + } + /* else not continuing */ + else + { + dataLen = pCcb->outReqParams.w.len; + + /* send the stored packet */ + pPkt = pCcb->outReq.pPkt; + + /* clear stored packet pointer */ + pCcb->outReq.pPkt = NULL; + } + + /* build remaining fields of packet from stored parameters */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START + ATT_HDR_LEN + sizeof(uint16_t); + UINT16_TO_BSTREAM(p, pCcb->outReqParams.w.offset); + + /* update offset after building packet */ + pCcb->outReqParams.w.offset += dataLen; + + /* start request timer */ + pCcb->outReqTimer.msg.event = ATTC_MSG_REQ_TIMEOUT; + WsfTimerStartSec(&pCcb->outReqTimer, pAttCfg->transTimeout); + + /* send packet to L2CAP */ + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, dataLen + ATT_PREP_WRITE_REQ_LEN, (uint8_t *) pPkt); +} + +/*************************************************************************************************/ +/*! + * \brief Lookup and execute function to build and send request. + * + * \param pCcb ATTC control block. + * + * \return None. + */ +/*************************************************************************************************/ +void attcSendReq(attcCcb_t *pCcb) +{ + (*attcSendReqTbl[pCcb->outReq.hdr.event])(pCcb); +} + +/*************************************************************************************************/ +/*! + * \brief Set up and send an attribute client request. + * + * \param pCcb ATTC control block. + * \param pMsg ATTC message. + * + * \return None. + */ +/*************************************************************************************************/ +void attcSetupReq(attcCcb_t *pCcb, attcApiMsg_t *pMsg) +{ + /* set out req to api message */ + pCcb->outReq = *pMsg; + + /* store parameters */ + pCcb->outReqParams = *(pMsg->pPkt); + + /* build and send request */ + attcSendReq(pCcb); +} + +/*************************************************************************************************/ +/*! + * \brief Data callback for ATTC. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t opcode; + attcCcb_t *pCcb; + + /* get connection control block for this handle, ignore packet if not found */ + if ((pCcb = attcCcbByHandle(handle)) == NULL) + { + return; + } + + /* parse opcode */ + opcode = *(pPacket + L2C_PAYLOAD_START); + + /* if response */ + if (opcode <= ATT_PDU_EXEC_WRITE_RSP) + { + attcProcRsp(pCcb, len, pPacket); + } + /* else if indication or notification */ + else if ((opcode == ATT_PDU_VALUE_NTF) || (opcode == ATT_PDU_VALUE_IND)) + { + attcProcInd(pCcb, len, pPacket); + } + /* else unknown opcode */ + else + { + ATT_TRACE_WARN1("attc unknown opcode 0x%02x", opcode); + } +} + +/*************************************************************************************************/ +/*! + * \brief L2CAP control callback. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcCtrlCback(wsfMsgHdr_t *pMsg) +{ + attcCcb_t *pCcb; + + /* note this function is currently only called when flow is enabled */ + + /* get CCB */ + if ((pCcb = attcCcbByConnId((dmConnId_t) pMsg->param)) != NULL) + { + /* if confirmation pending try sending now */ + AttcIndConfirm((dmConnId_t) pMsg->param); + + /* call pending write command callback */ + attcWriteCmdCallback((dmConnId_t) pMsg->param, pCcb, ATT_SUCCESS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Connection callback for ATTC. + * + * \param pCcb ATT control block. + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt) +{ + attcCcb_t *pClient; + uint16_t localMtu; + uint8_t status; + + /* if connection opened */ + if (pDmEvt->hdr.event == DM_CONN_OPEN_IND) + { + /* if we initiated connection send MTU request */ + if (DmConnRole(pCcb->connId) == DM_ROLE_MASTER) + { + localMtu = WSF_MIN(pAttCfg->mtu, (HciGetMaxRxAclLen() - L2C_HDR_LEN)); + + /* if desired MTU is not the default */ + if (localMtu != ATT_DEFAULT_MTU) + { + AttcMtuReq(pCcb->connId, localMtu); + } + } + } + /* if connection closed */ + else if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* set status */ + if (pDmEvt->connClose.hdr.status == HCI_SUCCESS) + { + status = pDmEvt->connClose.reason + ATT_HCI_ERR_BASE; + } + else + { + status = pDmEvt->connClose.hdr.status + ATT_HCI_ERR_BASE; + } + + /* get client control block directly */ + pClient = &attcCb.ccb[pCcb->connId - 1]; + + /* free any out req */ + if (pClient->outReq.hdr.event != ATTC_MSG_API_NONE) + { + WsfTimerStop(&pClient->outReqTimer); + attcReqClear(pClient, &pClient->outReq, status); + } + + /* free any req on deck */ + if (pClient->onDeck.hdr.event != ATTC_MSG_API_NONE) + { + attcReqClear(pClient, &pClient->onDeck, status); + } + + /* initialize other control block variables */ + pClient->flowDisabled = FALSE; + pClient->cnfPending = FALSE; + + /* pass to connection close callback for signed data */ + if (attcCb.pSign != NULL) + { + (*attcCb.pSign->closeCback)(pClient, status); + } + + /* call pending write command callback */ + attcWriteCmdCallback(pCcb->connId, pClient, status); + } +} + +/*************************************************************************************************/ +/*! + * \brief Message handler callback for ATTC. + * + * \param pMsg ATTC message. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcMsgCback(attcApiMsg_t *pMsg) +{ + attcCcb_t *pCcb; + + /* get CCB and verify connection still in use */ + if ((pCcb = attcCcbByConnId((dmConnId_t) pMsg->hdr.param)) == NULL) + { + /* if message has a packet buffer */ + if (pMsg->hdr.event >= ATTC_MSG_API_MTU && + pMsg->hdr.event <= ATTC_MSG_API_SIGNED_WRITE_CMD) + { + /* free packet buffer */ + attcFreePkt(pMsg); + } + + /* ignore if connection not in use */ + return; + } + + /* if an API request to send packet (non-signed) */ + if (pMsg->hdr.event <= ATTC_MSG_API_EXEC_WRITE) + { + /* verify no API request already waiting on deck, in progress, or no pending write command + already for this handle */ + if ((pCcb->onDeck.hdr.event != ATTC_MSG_API_NONE) || + (pCcb->outReq.hdr.event > ATTC_MSG_API_MTU) || + ((pMsg->hdr.event == ATTC_MSG_API_WRITE_CMD) && + attcPendWriteCmd(pCcb, pMsg))) + { + /* free request and call callback with failure status */ + attcReqClear(pCcb, pMsg, ATT_ERR_OVERFLOW); + return; + } + + /* if MTU request in progress or flow controlled */ + if (pCcb->outReq.hdr.event == ATTC_MSG_API_MTU || pCcb->flowDisabled) + { + /* put request "on deck" for processing later */ + pCcb->onDeck = *pMsg; + } + /* otherwise ready to send; set up request */ + else + { + attcSetupReq(pCcb, pMsg); + } + } + /* else if signed data event */ + else if (pMsg->hdr.event >= ATTC_MSG_API_SIGNED_WRITE_CMD && + pMsg->hdr.event <= ATTC_MSG_CMAC_CMPL) + { + /* pass to message callback for signed data */ + if (attcCb.pSign != NULL) + { + (*attcCb.pSign->msgCback)(pCcb, pMsg); + } + } + /* else if cancel request */ + else if (pMsg->hdr.event == ATTC_MSG_API_CANCEL) + { + /* free any out req (except mtu req) */ + if (pCcb->outReq.hdr.event != ATTC_MSG_API_NONE && + pCcb->outReq.hdr.event != ATTC_MSG_API_MTU) + { + WsfTimerStop(&pCcb->outReqTimer); + attcReqClear(pCcb, &pCcb->outReq, ATT_ERR_CANCELLED); + } + /* else free any req on deck */ + else if (pCcb->onDeck.hdr.event != ATTC_MSG_API_NONE) + { + attcReqClear(pCcb, &pCcb->onDeck, ATT_ERR_CANCELLED); + } + } + /* else if timeout */ + else if (pMsg->hdr.event == ATTC_MSG_REQ_TIMEOUT) + { + /* free any out req */ + if (pCcb->outReq.hdr.event != ATTC_MSG_API_NONE) + { + attcReqClear(pCcb, &pCcb->outReq, ATT_ERR_TIMEOUT); + pCcb->pMainCcb->control |= ATT_CCB_STATUS_TX_TIMEOUT; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Return the ATTC connection control block connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to connection control block or NULL if not in use. + */ +/*************************************************************************************************/ +attcCcb_t *attcCcbByConnId(dmConnId_t connId) +{ + if (DmConnInUse(connId)) + { + return &attcCb.ccb[connId - 1]; + } + else + { + ATT_TRACE_WARN1("attc ccb not in use: %d", connId); + return NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the given handle. + * + * \param handle The connection handle. + * + * \return Pointer to connection control block or NULL if not found. + */ +/*************************************************************************************************/ +attcCcb_t *attcCcbByHandle(uint16_t handle) +{ + dmConnId_t connId; + + if ((connId = DmConnIdByHandle(handle)) != DM_CONN_ID_NONE) + { + return &attcCb.ccb[connId - 1]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Free the packet buffer of an API message structure. + * + * \param pMsg Pointer to API message structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcFreePkt(attcApiMsg_t *pMsg) +{ + if (pMsg->pPkt != NULL) + { + WsfMsgFree(pMsg->pPkt); + pMsg->pPkt = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute application callback function. + * + * \param connId DM connection ID. + * \param event Callback event ID. + * \param handle Attribute handle. + * \param status Callback event status. + * + * \return None. + */ +/*************************************************************************************************/ +void attcExecCallback(dmConnId_t connId, uint8_t event, uint16_t handle, uint8_t status) +{ + if (event != ATT_METHOD_MTU) + { + attExecCallback(connId, event, handle, status, 0); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear an outstanding request and execute the callback. + * + * \param pCcb Pointer to control block. + * \param pMsg API message. + * \param status Callback event status. + * + * \return None. + */ +/*************************************************************************************************/ +void attcReqClear(attcCcb_t *pCcb, attcApiMsg_t *pMsg, uint8_t status) +{ + attcFreePkt(pMsg); + attcExecCallback(pCcb->pMainCcb->connId, pMsg->hdr.event, pMsg->handle, status); + pMsg->hdr.event = ATTC_MSG_API_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Set automatic Indication Confirmations sent from this ATT Client. + * + * \param enable \ref TRUE to enable automatic confirmations (default), \ref FALSE to disable. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcSetAutoConfirm(bool_t enable) +{ + attcCb.autoCnf = enable; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize ATT client. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcInit(void) +{ + uint8_t i; + attcCcb_t *pCcb; + + /* Initialize control block */ + attcCb.pSign = NULL; + attcCb.autoCnf = TRUE; + + /* Initialize control block CCBs */ + for (i = 0, pCcb = attcCb.ccb; i < DM_CONN_MAX; i++, pCcb++) + { + /* set pointer to main CCB */ + pCcb->pMainCcb = &attCb.ccb[i]; + + /* initialize timer */ + pCcb->outReqTimer.handlerId = attCb.handlerId; + pCcb->outReqTimer.msg.param = i + 1; /* param stores the conn id */ + } + + /* set up callback interface */ + attCb.pClient = &attcFcnIf; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.h new file mode 100644 index 0000000000000000000000000000000000000000..516ad325ca55cbe002226ee1b7b1da99215f70ac --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_main.h @@ -0,0 +1,206 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client main module. + */ +/*************************************************************************************************/ +#ifndef ATTC_MAIN_H +#define ATTC_MAIN_H + +#include "wsf_queue.h" +#include "wsf_timer.h" +#include "wsf_assert.h" +#include "att_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Buffer lengths for requests */ +#define ATT_MTU_REQ_BUF_LEN (ATT_MTU_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_FIND_INFO_REQ_BUF_LEN (ATT_FIND_INFO_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_FIND_TYPE_REQ_BUF_LEN (ATT_FIND_TYPE_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_READ_TYPE_REQ_BUF_LEN (ATT_READ_TYPE_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_READ_REQ_BUF_LEN (ATT_READ_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_READ_BLOB_REQ_BUF_LEN (ATT_READ_BLOB_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_READ_MULT_REQ_BUF_LEN (ATT_READ_MULT_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_READ_GROUP_TYPE_REQ_BUF_LEN (ATT_READ_GROUP_TYPE_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_WRITE_REQ_BUF_LEN (ATT_WRITE_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_WRITE_CMD_BUF_LEN (ATT_WRITE_CMD_LEN + L2C_PAYLOAD_START) +#define ATT_SIGNED_WRITE_CMD_BUF_LEN (ATT_SIGNED_WRITE_CMD_LEN + L2C_PAYLOAD_START) +#define ATT_PREP_WRITE_REQ_BUF_LEN (ATT_PREP_WRITE_REQ_LEN + L2C_PAYLOAD_START) +#define ATT_EXEC_WRITE_REQ_BUF_LEN (ATT_EXEC_WRITE_REQ_LEN + L2C_PAYLOAD_START) + +/* values for 'continuing' flag */ +#define ATTC_CONTINUING TRUE +#define ATTC_NOT_CONTINUING FALSE + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* ATTC event handler messages */ +enum +{ + /* messages from API; note these match method values */ + ATTC_MSG_API_NONE = ATTC_MSG_START, + ATTC_MSG_API_MTU = ATT_METHOD_MTU, + ATTC_MSG_API_FIND_INFO = ATT_METHOD_FIND_INFO, + ATTC_MSG_API_FIND_BY_TYPE_VALUE = ATT_METHOD_FIND_TYPE, + ATTC_MSG_API_READ_BY_TYPE = ATT_METHOD_READ_TYPE, + ATTC_MSG_API_READ = ATT_METHOD_READ, + ATTC_MSG_API_READ_LONG = ATT_METHOD_READ_BLOB, + ATTC_MSG_API_READ_MULTIPLE = ATT_METHOD_READ_MULTIPLE, + ATTC_MSG_API_READ_BY_GROUP_TYPE = ATT_METHOD_READ_GROUP_TYPE, + ATTC_MSG_API_WRITE = ATT_METHOD_WRITE, + ATTC_MSG_API_WRITE_CMD = ATT_METHOD_WRITE_CMD, + ATTC_MSG_API_PREP_WRITE = ATT_METHOD_PREPARE_WRITE, + ATTC_MSG_API_EXEC_WRITE = ATT_METHOD_EXECUTE_WRITE, + ATTC_MSG_API_SIGNED_WRITE_CMD, + ATTC_MSG_CMAC_CMPL, + ATTC_MSG_API_CANCEL, + ATTC_MSG_REQ_TIMEOUT +}; + +/*! + * Data buffer format for API request messages: + * + * | attcPktParam_t | ATT request data | + * | bytes 0 to 7 | bytes 8 - | + */ + +/* Structure for API with offset parameter */ +typedef struct +{ + uint16_t len; + uint16_t offset; +} attcPktParamOffset_t; + +/* Structure for API with start and end handle parameters */ +typedef struct +{ + uint16_t len; + uint16_t startHandle; + uint16_t endHandle; +} attcPktParamHandles_t; + +/* Structure for API with offset and value parameters */ +typedef struct +{ + uint16_t len; + uint16_t offset; + uint8_t *pValue; +} attcPktParamPrepWrite_t; + +/* union of API parameter types */ +typedef union +{ + uint16_t len; + attcPktParamOffset_t o; + attcPktParamHandles_t h; + attcPktParamPrepWrite_t w; +} attcPktParam_t; + +/* verify attcPktParam_t will work in data buffer format described above */ +WSF_CT_ASSERT(sizeof(attcPktParam_t) <= L2C_PAYLOAD_START); + +/* API message structure */ +typedef struct +{ + wsfMsgHdr_t hdr; + attcPktParam_t *pPkt; + uint16_t handle; +} attcApiMsg_t; + +/* ATTC connection control block */ +typedef struct +{ + attCcb_t *pMainCcb; /* Pointer to ATT main CCB */ + attcApiMsg_t onDeck; /* API message "on deck" waiting to be sent */ + attcApiMsg_t outReq; /* Outstanding request waiting for response */ + attcPktParam_t outReqParams; /* Parameters associated with outstanding request */ + wsfTimer_t outReqTimer; /* Outstanding request timer */ + bool_t flowDisabled; /* Data flow disabled */ + bool_t cnfPending; /* Handle value confirm packet waiting to be sent */ + uint16_t pendWriteCmdHandle[ATT_NUM_SIMUL_WRITE_CMD]; /* Callback to app pending for this write cmd handle */ +} attcCcb_t; + +/* Signed data callbacks */ +typedef void (*attcSignMsgCback_t)(attcCcb_t *pCcb, attcApiMsg_t *pMsg); +typedef void (*attcCloseCback_t)(attcCcb_t *pCcb, uint8_t status); + +/* Signed data callback interface */ +typedef struct +{ + attcSignMsgCback_t msgCback; /* Message handling callback */ + attcCloseCback_t closeCback; /* Connection close callback */ +} attcSignFcnIf_t; + +/* Main control block of the ATTC subsystem */ +typedef struct +{ + attcCcb_t ccb[DM_CONN_MAX]; + attcSignFcnIf_t const *pSign; + bool_t autoCnf; +} attcCb_t; + +/* type for response processing functions */ +typedef void (*attcProcRsp_t)(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +extern attcCb_t attcCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +attcCcb_t *attcCcbByConnId(dmConnId_t connId); +attcCcb_t *attcCcbByHandle(uint16_t handle); +void attcFreePkt(attcApiMsg_t *pMsg); +void attcExecCallback(dmConnId_t connId, uint8_t event, uint16_t handle, uint8_t status); +void attcReqClear(attcCcb_t *pCcb, attcApiMsg_t *pMsg, uint8_t status); + +void attcSetupReq(attcCcb_t *pCcb, attcApiMsg_t *pMsg); +void attcSendReq(attcCcb_t *pCcb); +void attcSendMsg(dmConnId_t connId, uint16_t handle, uint8_t msgId, attcPktParam_t *pPkt, bool_t continuing); + +void attcProcRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attcProcInd(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket); + +void attcProcErrRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcMtuRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcFindOrReadRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcFindByTypeRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcReadRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcReadLongRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcWriteRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); +void attcProcPrepWriteRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt); + +#ifdef __cplusplus +}; +#endif + +#endif /* ATTC_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_proc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_proc.c new file mode 100644 index 0000000000000000000000000000000000000000..a3b303b577adcb166bfdcefc096fa6cee90b9dc9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_proc.c @@ -0,0 +1,697 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client mandatory PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "wsf_timer.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "attc_main.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Table of response processing functions */ +static const attcProcRsp_t attcProcRspTbl[] = +{ + attcProcErrRsp, /* ATT_METHOD_ERR */ + attcProcMtuRsp, /* ATT_METHOD_MTU */ + attcProcFindOrReadRsp, /* ATT_METHOD_FIND_INFO */ + attcProcFindByTypeRsp, /* ATT_METHOD_FIND_TYPE */ + attcProcFindOrReadRsp, /* ATT_METHOD_READ_TYPE */ + attcProcReadRsp, /* ATT_METHOD_READ */ + attcProcReadLongRsp, /* ATT_METHOD_READ_BLOB */ + attcProcReadRsp, /* ATT_METHOD_READ_MULTIPLE */ + attcProcFindOrReadRsp, /* ATT_METHOD_READ_GROUP_TYPE */ + attcProcWriteRsp, /* ATT_METHOD_WRITE */ + NULL, /* ATT_METHOD_WRITE_CMD */ + attcProcPrepWriteRsp, /* ATT_METHOD_PREPARE_WRITE */ + attcProcWriteRsp /* ATT_METHOD_EXECUTE_WRITE */ +}; + +/*************************************************************************************************/ +/*! + * \brief Process received Error response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcErrRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + uint8_t *p; + + p = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + + /* set callback event from stored method */ + pEvt->hdr.event = pCcb->outReq.hdr.event; + + /* ignore request opcode in the error response */ + p++; + + /* if request was a read or write with a specific handle */ + if (pEvt->hdr.event == ATTC_READ_RSP || pEvt->hdr.event == ATTC_READ_LONG_RSP || + pEvt->hdr.event == ATTC_WRITE_RSP || pEvt->hdr.event == ATTC_PREPARE_WRITE_RSP) + { + /* ignore handle in the error response; callback will use stored handle from request */ + p += 2; + } + else + { + /* set handle from packet */ + BSTREAM_TO_UINT16(pEvt->handle, p); + } + + /* set status from error code in packet, but verify it's not 'success' */ + BSTREAM_TO_UINT8(pEvt->hdr.status, p); + if (pEvt->hdr.status == ATT_SUCCESS) + { + pEvt->hdr.status = ATT_ERR_UNDEFINED; + } + + /* no parameters so clear length */ + pEvt->valueLen = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Process received MTU response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcMtuRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + uint16_t mtu; + + BYTES_TO_UINT16(mtu, pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN); + + /* verify */ + if (mtu < ATT_DEFAULT_MTU) + { + mtu = ATT_DEFAULT_MTU; + } + + /* set mtu for the connection */ + attSetMtu(pCcb->pMainCcb, mtu, WSF_MIN(pAttCfg->mtu, (HciGetMaxRxAclLen() - L2C_HDR_LEN))); +} + +/*************************************************************************************************/ +/*! + * \brief Process received Find Information, Read By Type, or Read By Group Type + * response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcFindOrReadRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + uint8_t *p; + uint8_t *pEnd; + uint16_t handle; + uint16_t nextHandle; + uint16_t prevHandle; + uint8_t paramLen; + + p = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + pEnd = pPacket + L2C_PAYLOAD_START + len; + + /* parameter length depends on packet type */ + if (pCcb->outReq.hdr.event == ATTC_MSG_API_FIND_INFO) + { + /* length in find info response is coded by UUID */ + if (*p++ == ATT_FIND_HANDLE_16_UUID) + { + paramLen = ATT_16_UUID_LEN; + } + else + { + paramLen = ATT_128_UUID_LEN; + } + } + else if (pCcb->outReq.hdr.event == ATTC_MSG_API_READ_BY_TYPE) + { + /* length in read by type response is handle plus parameter length */ + paramLen = *p++ - sizeof(uint16_t); + } + else + { + /* length in read by group type response is two handles plus parameter length */ + paramLen = *p++ - (2 * sizeof(uint16_t)); + } + + /* get and verify all handles */ + nextHandle = pCcb->outReqParams.h.startHandle; + while (p < pEnd) + { + /* get and compare handle */ + BSTREAM_TO_UINT16(handle, p); + if (handle == 0 || nextHandle == 0 || handle < nextHandle || + handle > pCcb->outReqParams.h.endHandle) + { + pEvt->hdr.status = ATT_ERR_INVALID_RSP; + break; + } + + /* if read by group type response get second handle */ + if (pCcb->outReq.hdr.event == ATTC_MSG_API_READ_BY_GROUP_TYPE) + { + prevHandle = handle; + BSTREAM_TO_UINT16(handle, p); + if (handle == 0 || handle < prevHandle || handle < nextHandle || + handle > pCcb->outReqParams.h.endHandle) + { + pEvt->hdr.status = ATT_ERR_INVALID_RSP; + break; + } + } + + /* set next expected handle, with special case for max handle */ + if (handle == ATT_HANDLE_MAX) + { + nextHandle = 0; + } + else + { + nextHandle = handle + 1; + } + + /* skip over parameter */ + p += paramLen; + + /* check for truncated response */ + if (p > pEnd) + { + pEvt->hdr.status = ATT_ERR_INVALID_RSP; + break; + } + } + + /* if response was correct */ + if (pEvt->hdr.status == ATT_SUCCESS) + { + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* if all handles read */ + if (nextHandle == 0 || nextHandle == (pCcb->outReqParams.h.endHandle + 1)) + { + /* we're done */ + pCcb->outReq.hdr.status = ATTC_NOT_CONTINUING; + } + /* else set up for next request */ + else + { + pCcb->outReqParams.h.startHandle = nextHandle; + pCcb->outReq.handle = nextHandle; + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process received Read response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcReadRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + /* nothing to process */ +} + +/*************************************************************************************************/ +/*! + * \brief Process received Write response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcWriteRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + /* no parameters so clear length */ + pEvt->valueLen = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Process received response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + attEvt_t evt; + + /* if no request in progress ignore response */ + if (pCcb->outReq.hdr.event == ATTC_MSG_API_NONE) + { + return; + } + + /* get method */ + evt.hdr.event = ATT_OPCODE_2_METHOD(*(pPacket + L2C_PAYLOAD_START)); + + /* if response method is not error and does not match stored method ignore response */ + if ((evt.hdr.event != ATT_METHOD_ERR) && (evt.hdr.event != pCcb->outReq.hdr.event)) + { + return; + } + + /* stop request timer */ + WsfTimerStop(&pCcb->outReqTimer); + + /* initialize event structure then process response */ + evt.pValue = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + evt.valueLen = len - ATT_HDR_LEN; + evt.handle = pCcb->outReq.handle; + evt.hdr.status = ATT_SUCCESS; + (*attcProcRspTbl[evt.hdr.event])(pCcb, len, pPacket, &evt); + + /* if not continuing or status is not success */ + if ((pCcb->outReq.hdr.status == ATTC_NOT_CONTINUING) || (evt.hdr.status != ATT_SUCCESS)) + { + /* we're not sending another request so clear the out req */ + pCcb->outReq.hdr.event = ATTC_MSG_API_NONE; + attcFreePkt(&pCcb->outReq); + } + + /* call callback (if not mtu rsp) */ + if ((evt.hdr.event != ATT_METHOD_MTU) && attCb.cback) + { + /* set additional parameters and call callback */ + evt.continuing = pCcb->outReq.hdr.status; /* continuing flag */ + evt.hdr.param = pCcb->outReq.hdr.param; /* connId */ + (*attCb.cback)(&evt); + } + + /* if no flow control */ + if (!pCcb->flowDisabled) + { + /* if out req ready */ + if (pCcb->outReq.pPkt != NULL) + { + /* build and send request */ + attcSendReq(pCcb); + } + /* else if api is on deck */ + else if (pCcb->onDeck.hdr.event != ATTC_MSG_API_NONE) + { + /* set up and send request */ + attcSetupReq(pCcb, &pCcb->onDeck); + + /* clear on deck */ + pCcb->onDeck.hdr.event = ATTC_MSG_API_NONE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process received indication or notification packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcInd(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + attEvt_t evt; + uint8_t *p; + uint8_t *pPkt; + + p = pPacket + L2C_PAYLOAD_START; + + /* parse packet and set callback event struct */ + evt.hdr.event = ATT_OPCODE_2_METHOD(*p++); + BSTREAM_TO_UINT16(evt.handle, p); + evt.pValue = p; + evt.valueLen = len - ATT_HDR_LEN - sizeof(uint16_t); + evt.hdr.param = pCcb->pMainCcb->connId; + evt.hdr.status = ATT_SUCCESS; + evt.continuing = FALSE; + + /* verify handle and call callback */ + if ((evt.handle != 0) && attCb.cback) + { + (*attCb.cback)(&evt); + } + + /* if indication send confirm */ + if (attcCb.autoCnf && (evt.hdr.event == ATT_METHOD_VALUE_IND)) + { + if (!pCcb->flowDisabled) + { + if ((pPkt = attMsgAlloc(ATT_VALUE_CNF_LEN + L2C_PAYLOAD_START)) != NULL) + { + *(pPkt + L2C_PAYLOAD_START) = ATT_PDU_VALUE_CNF; + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, ATT_VALUE_CNF_LEN, pPkt); + } + } + + return; + } + + /* mark confirm as pending; will be sent when flow enabled or application sends it. */ + pCcb->cnfPending = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a WSF message to ATTC. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param msgId Message ID. + * \param pPkt Packet parameters. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void attcSendMsg(dmConnId_t connId, uint16_t handle, uint8_t msgId, attcPktParam_t *pPkt, bool_t continuing) +{ + attcCcb_t *pCcb; + uint16_t mtu; + bool_t transTimedOut; + + WsfTaskLock(); + + /* get CCB and verify connection still in use */ + if ((pCcb = attcCcbByConnId(connId)) != NULL) + { + /* get MTU size */ + mtu = pCcb->pMainCcb->mtu; + transTimedOut = !!(pCcb->pMainCcb->control & ATT_CCB_STATUS_TX_TIMEOUT); + } + /* else connection not in use */ + else + { + /* MTU size unknown */ + mtu = 0; + transTimedOut = FALSE; + } + + WsfTaskUnlock(); + + /* if MTU size known for connection */ + if (mtu > 0) + { + /* if no transaction's timed out */ + if (!transTimedOut) + { + uint16_t dataLen = 0; + + /* if packet is not null then find out its length */ + if (pPkt != NULL) + { + /* if not prepare write request */ + if (msgId != ATTC_MSG_API_PREP_WRITE) + { + dataLen = pPkt->len; + } + /* else prepare write request */ + else + { + /* if not continuing */ + if (!continuing) + { + /* single prepare write request */ + dataLen = ATT_PREP_WRITE_REQ_LEN + pPkt->w.len; + } + /* else will be sent as multiple prepare write requests */ + } + } + + /* if packet length is less than or equal to negotiated MTU */ + if (dataLen <= mtu) + { + attcApiMsg_t *pMsg; + + /* allocate message buffer */ + if ((pMsg = WsfMsgAlloc(sizeof(attcApiMsg_t))) != NULL) + { + /* set parameters */ + pMsg->hdr.param = connId; + pMsg->hdr.status = continuing; + pMsg->hdr.event = msgId; + pMsg->pPkt = pPkt; + pMsg->handle = handle; + + /* send message */ + WsfMsgSend(attCb.handlerId, pMsg); + return; + } + } + /* else packet length exceeds MTU size */ + else + { + /* call callback with failure status */ + attcExecCallback(connId, msgId, handle, ATT_ERR_MTU_EXCEEDED); + } + } + else + /* transaction's timed out */ + { + /* call callback with failure status */ + attcExecCallback(connId, msgId, handle, ATT_ERR_TIMEOUT); + } + } + + /* alloc failed, transaction's timed out or packet length exceeded MTU size; free packet buffer */ + if (pPkt != NULL) + { + WsfMsgFree(pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Find Information Request. + * + * \param connId DM connection ID. + * \param startHandle Attribute start handle. + * \param endHandle Attribute end handle. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcFindInfoReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_FIND_INFO_REQ_BUF_LEN)) != NULL) + { + /* set parameters */ + pPkt->len = ATT_FIND_INFO_REQ_LEN; + pPkt->h.startHandle = startHandle; + pPkt->h.endHandle = endHandle; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_FIND_INFO_REQ); + + /* send message */ + attcSendMsg(connId, startHandle, ATTC_MSG_API_FIND_INFO, pPkt, continuing); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Read Request. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcReadReq(dmConnId_t connId, uint16_t handle) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_READ_REQ_BUF_LEN)) != NULL) + { + /* set length */ + pPkt->len = ATT_READ_REQ_LEN; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_REQ); + UINT16_TO_BSTREAM(p, handle); + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_READ, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Write Request. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcWriteReq(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_WRITE_REQ_BUF_LEN + valueLen)) != NULL) + { + /* set length */ + pPkt->len = ATT_WRITE_REQ_LEN + valueLen; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_WRITE_REQ); + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pValue, valueLen); + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_WRITE, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cancel an attribute protocol request in progress. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcCancelReq(dmConnId_t connId) +{ + attcSendMsg(connId, 0, ATTC_MSG_API_CANCEL, NULL, FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. + * + * \param connId DM connection ID. + * \param mtu Attribute protocol MTU. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcMtuReq(dmConnId_t connId, uint16_t mtu) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_MTU_REQ_BUF_LEN)) != NULL) + { + /* set length */ + pPkt->len = ATT_MTU_REQ_LEN; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_MTU_REQ); + UINT16_TO_BSTREAM(p, mtu); + + /* send message */ + attcSendMsg(connId, 0, ATTC_MSG_API_MTU, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol indication confirmation. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcIndConfirm(dmConnId_t connId) +{ + attcCcb_t *pCcb; + uint8_t *pPkt; + + pCcb = attcCcbByHandle(connId - 1); + + /* If confirmation is pending */ + if (pCcb && pCcb->cnfPending && !pCcb->flowDisabled) + { + if ((pPkt = attMsgAlloc(ATT_VALUE_CNF_LEN + L2C_PAYLOAD_START)) != NULL) + { + pCcb->cnfPending = FALSE; + + *(pPkt + L2C_PAYLOAD_START) = ATT_PDU_VALUE_CNF; + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, ATT_VALUE_CNF_LEN, pPkt); + } + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_read.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_read.c new file mode 100644 index 0000000000000000000000000000000000000000..20ad89797d25f391abfc1e1813e9d21952c57913 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_read.c @@ -0,0 +1,345 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client optional read PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "attc_main.h" + + + +/*************************************************************************************************/ +/*! + * \brief Process received Find By Type response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcFindByTypeRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + uint8_t *p; + uint8_t *pEnd; + uint16_t startHandle; + uint16_t endHandle; + uint16_t nextHandle; + + p = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + pEnd = pPacket + L2C_PAYLOAD_START + len; + + /* get and verify all handles */ + nextHandle = pCcb->outReqParams.h.startHandle; + while (p < pEnd) + { + /* get handle pair */ + BSTREAM_TO_UINT16(startHandle, p); + BSTREAM_TO_UINT16(endHandle, p); + + /* + * start handle of handle pair must be: + * not greater than end handle of handle pair + * not less than than start handle of request or end handle of previous handle pair + * not greater than end handle of request + * and no additional handle pairs following end handle = 0xFFFF + */ + if ((startHandle > endHandle) || (startHandle < nextHandle) || + (startHandle > pCcb->outReqParams.h.endHandle) || (nextHandle == 0)) + { + pEvt->hdr.status = ATT_ERR_INVALID_RSP; + break; + } + + /* set next expected handle, with special case for max handle */ + if (endHandle == ATT_HANDLE_MAX) + { + nextHandle = 0; + } + else + { + nextHandle = endHandle + 1; + } + + /* check for truncated response */ + if (p > pEnd) + { + pEvt->hdr.status = ATT_ERR_INVALID_RSP; + break; + } + } + + /* if response was correct */ + if (pEvt->hdr.status == ATT_SUCCESS) + { + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* if all handles read */ + if (nextHandle == 0 || nextHandle > pCcb->outReqParams.h.endHandle) + { + /* we're done */ + pCcb->outReq.hdr.status = ATTC_NOT_CONTINUING; + } + /* else set up for next request */ + else + { + pCcb->outReqParams.h.startHandle = nextHandle; + pCcb->outReq.handle = nextHandle; + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process received Read Long response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcReadLongRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* length of response is less than mtu */ + if (len < pCcb->pMainCcb->mtu) + { + /* we're done */ + pCcb->outReq.hdr.status = ATTC_NOT_CONTINUING; + } + /* else set up for next request */ + else + { + pCcb->outReqParams.o.offset += pEvt->valueLen; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Find By Type Value Request. + * + * \param connId DM connection ID. + * \param startHandle Attribute start handle. + * \param endHandle Attribute end handle. + * \param uuid16 16-bit UUID to find. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcFindByTypeValueReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, + uint16_t uuid16, uint16_t valueLen, uint8_t *pValue, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_FIND_TYPE_REQ_BUF_LEN + valueLen)) != NULL) + { + /* set parameters */ + pPkt->len = ATT_FIND_TYPE_REQ_LEN + valueLen; + pPkt->h.startHandle = startHandle; + pPkt->h.endHandle = endHandle; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_FIND_TYPE_REQ); + /* skip start and end handle fields */ + p += (2 * sizeof(uint16_t)); + UINT16_TO_BSTREAM(p, uuid16); + memcpy(p, pValue, valueLen); + + /* send message */ + attcSendMsg(connId, startHandle, ATTC_MSG_API_FIND_BY_TYPE_VALUE, pPkt, continuing); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Read By Type Request. + * + * \param connId DM connection ID. + * \param startHandle Attribute start handle. + * \param endHandle Attribute end handle. + * \param uuidLen Length of UUID (2 or 16). + * \param pUuid Pointer to UUID data. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcReadByTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, + uint8_t uuidLen, uint8_t *pUuid, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_READ_TYPE_REQ_BUF_LEN + uuidLen)) != NULL) + { + /* set parameters */ + pPkt->len = ATT_READ_TYPE_REQ_LEN + uuidLen; + pPkt->h.startHandle = startHandle; + pPkt->h.endHandle = endHandle; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_TYPE_REQ); + /* skip start and end handle fields */ + p += (2 * sizeof(uint16_t)); + memcpy(p, pUuid, uuidLen); + + /* send message */ + attcSendMsg(connId, startHandle, ATTC_MSG_API_READ_BY_TYPE, pPkt, continuing); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Read Request. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param offset Read attribute data starting at this offset. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcReadLongReq(dmConnId_t connId, uint16_t handle, uint16_t offset, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_READ_BLOB_REQ_BUF_LEN)) != NULL) + { + /* set parameters */ + pPkt->len = ATT_READ_BLOB_REQ_LEN; + pPkt->o.offset = offset; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_BLOB_REQ); + UINT16_TO_BSTREAM(p, handle); + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_READ_LONG, pPkt, continuing); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Read Multiple Request. + * + * \param connId DM connection ID. + * \param numHandles Number of handles in attribute handle list. + * \param pHandles List of attribute handles. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcReadMultipleReq(dmConnId_t connId, uint8_t numHandles, uint16_t *pHandles) +{ + attcPktParam_t *pPkt; + uint8_t *p; + uint16_t handle; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_READ_MULT_REQ_BUF_LEN + (numHandles * sizeof(uint16_t)))) != NULL) + { + /* set length */ + pPkt->len = ATT_READ_MULT_REQ_LEN + (numHandles * sizeof(uint16_t)); + + /* save first handle */ + handle = pHandles[0]; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_MULT_REQ); + while (numHandles--) + { + UINT16_TO_BSTREAM(p, *pHandles); + pHandles++; + } + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_READ_MULTIPLE, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Read By Group Type Request. + * + * \param connId DM connection ID. + * \param startHandle Attribute start handle. + * \param endHandle Attribute end handle. + * \param uuidLen Length of UUID (2 or 16). + * \param pUuid Pointer to UUID data. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcReadByGroupTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, + uint8_t uuidLen, uint8_t *pUuid, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_READ_GROUP_TYPE_REQ_BUF_LEN + uuidLen)) != NULL) + { + /* set parameters */ + pPkt->len = ATT_READ_GROUP_TYPE_REQ_LEN + uuidLen; + pPkt->h.startHandle = startHandle; + pPkt->h.endHandle = endHandle; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_GROUP_TYPE_REQ); + /* skip start and end handle fields */ + p += (2 * sizeof(uint16_t)); + memcpy(p, pUuid, uuidLen); + + /* send message */ + attcSendMsg(connId, startHandle, ATTC_MSG_API_READ_BY_GROUP_TYPE, pPkt, continuing); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_sign.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_sign.c new file mode 100644 index 0000000000000000000000000000000000000000..cd366441cce00a512020fdd7d02a6c5992ad5bda --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_sign.c @@ -0,0 +1,303 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client optional signed PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "att_api.h" +#include "att_main.h" +#include "attc_main.h" +#include "att_sign.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* ATTC signed PDU control block */ +typedef struct +{ + attcApiMsg_t msg; +} attcSignCb_t; + +/* Message parameters */ +typedef union +{ + wsfMsgHdr_t hdr; + attcApiMsg_t api; +} attcSignMsg_t; + +/************************************************************************************************** + Function Prototypes +**************************************************************************************************/ + +static void attcSignCloseCback(attcCcb_t *pCcb, uint8_t status); +static void attcSignMsgCback(attcCcb_t *pCcb, attcSignMsg_t *pMsg); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Interface to ATT */ +static const attcSignFcnIf_t attcSignFcnIf = +{ + (attcSignMsgCback_t) attcSignMsgCback, + attcSignCloseCback +}; + +/* Control block */ +static attcSignCb_t *pAttcSignCb[DM_CONN_MAX]; + +/*************************************************************************************************/ +/*! + * \brief Allocate a signing control block. + * + * \param connId Connection ID. + * + * \return Pointer to control block. + */ +/*************************************************************************************************/ +static attcSignCb_t *attcSignCbAlloc(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + WSF_ASSERT(pAttcSignCb[connId - 1] == NULL); + + return (pAttcSignCb[connId - 1] = WsfBufAlloc(sizeof(attcSignCb_t))); +} +/*************************************************************************************************/ +/*! + * \brief Free a signing control block. + * + * \param connId Connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSignCbFree(dmConnId_t connId) +{ + WsfBufFree(pAttcSignCb[connId - 1]); + pAttcSignCb[connId - 1] = NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Return the signing control block for the connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to control block. + */ +/*************************************************************************************************/ +static attcSignCb_t *attcSignCbByConnId(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return pAttcSignCb[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Connection close callback for ATTC signed PDU processing. + * + * \param pCcb ATT control block. + * \param status Connection close status. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSignCloseCback(attcCcb_t *pCcb, uint8_t status) +{ + attcSignCb_t *pCb; + + /* if connection closed while processing in progress */ + if ((pCb = attcSignCbByConnId(pCcb->pMainCcb->connId)) != NULL) + { + + /* message free buffer */ + if (pCb->msg.hdr.event != ATTC_MSG_API_NONE) + { + attcReqClear(pCcb, &pCb->msg, status); + } + + attcSignCbFree(pCcb->pMainCcb->connId); + } +} + +/*************************************************************************************************/ +/*! + * \brief Message handler callback for ATTC signed PDU processing. + * + * \param pCcb ATT control block. + * \param pMsg ATTC message. + * + * \return None. + */ +/*************************************************************************************************/ +static void attcSignMsgCback(attcCcb_t *pCcb, attcSignMsg_t *pMsg) +{ + attcSignCb_t *pCb; + uint16_t cmacTxtLen; + uint8_t *pCmacText; + + if (pMsg->hdr.event == ATTC_MSG_API_SIGNED_WRITE_CMD) + { + /* adjust msg event id for later use with app callback */ + pMsg->hdr.event = ATTC_MSG_API_WRITE_CMD; + + /* verify no API request already waiting on deck or in progress, + * and no signed write already in progress + */ + if ((pCcb->onDeck.hdr.event != ATTC_MSG_API_NONE) || + (pCcb->outReq.hdr.event > ATTC_MSG_API_MTU) || + (attcSignCbByConnId((dmConnId_t) pMsg->hdr.param) != NULL)) + { + /* free request and call callback with failure status */ + attcReqClear(pCcb, &pMsg->api, ATT_ERR_OVERFLOW); + return; + } + + /* allocate signing control block */ + if ((pCb = attcSignCbAlloc((dmConnId_t) pMsg->hdr.param)) != NULL) + { + /* store message */ + pCb->msg = pMsg->api; + + cmacTxtLen = pCb->msg.pPkt->len - ATT_AUTH_SIG_LEN + sizeof(uint32_t); + pCmacText = WsfBufAlloc(cmacTxtLen); + + if (pCmacText) + { + uint8_t revLocalCsrk[SEC_CMAC_KEY_LEN] = {0}; + + WStrReverseCpy(revLocalCsrk, DmSecGetLocalCsrk(), SEC_CMAC_KEY_LEN); + WStrReverseCpy(pCmacText, (uint8_t *)pCb->msg.pPkt + L2C_PAYLOAD_START, cmacTxtLen); + + if (SecCmac(revLocalCsrk, pCmacText, cmacTxtLen, attCb.handlerId, + (dmConnId_t) pMsg->hdr.param, ATTC_MSG_CMAC_CMPL)) + { + return; + } + else + { + WsfBufFree(pCmacText); + } + } + } + else + { + /* allocation failure */ + attcReqClear(pCcb, &pMsg->api, ATT_ERR_UNDEFINED); + return; + } + } + else if (pMsg->hdr.event == ATTC_MSG_CMAC_CMPL) + { + secCmacMsg_t *pCmacMsg = (secCmacMsg_t*) pMsg; + WsfBufFree(pCmacMsg->pPlainText); + + if ((pCb = attcSignCbByConnId((dmConnId_t) pMsg->hdr.param)) != NULL) + { + /* append signature to packet */ + WStrReverseCpy((uint8_t *) pCb->msg.pPkt + + (L2C_PAYLOAD_START + pCb->msg.pPkt->len - ATT_CMAC_RESULT_LEN), + pCmacMsg->pCiphertext, ATT_CMAC_RESULT_LEN); + + /* if MTU request in progress or flow controlled */ + if (pCcb->outReq.hdr.event == ATTC_MSG_API_MTU || pCcb->flowDisabled) + { + /* put request "on deck" for processing later */ + pCcb->onDeck = pCb->msg; + } + /* otherwise ready to send */ + else + { + attcSetupReq(pCcb, &pCb->msg); + } + + /* we're done-- free control block */ + attcSignCbFree((dmConnId_t) pMsg->hdr.param); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol signed Write Command. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param signCounter Value of the sign counter. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcSignedWriteCmd(dmConnId_t connId, uint16_t handle, uint32_t signCounter, + uint16_t valueLen, uint8_t *pValue) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* if connection already encrypted with security mode 1 level 2 or higher */ + if (DmConnSecLevel(connId) > DM_SEC_LEVEL_NONE) + { + /* use write command instead */ + AttcWriteCmd(connId, handle, valueLen, pValue); + return; + } + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_SIGNED_WRITE_CMD_BUF_LEN + valueLen)) != NULL) + { + /* set length */ + pPkt->len = ATT_SIGNED_WRITE_CMD_LEN + valueLen; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_SIGNED_WRITE_CMD); + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pValue, valueLen); + p += valueLen; + UINT32_TO_BSTREAM(p, signCounter); + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_SIGNED_WRITE_CMD, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize ATT client for data signing. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcSignInit(void) +{ + /* set up callback interface */ + attcCb.pSign = &attcSignFcnIf; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_write.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_write.c new file mode 100644 index 0000000000000000000000000000000000000000..601c5f387857f2b90a499a7eb99353febf05c779 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/attc_write.c @@ -0,0 +1,187 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client optional write PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "attc_main.h" + +/*************************************************************************************************/ +/*! + * \brief Process received Prepare Write response packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * \param pEvt Pointer to callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void attcProcPrepWriteRsp(attcCcb_t *pCcb, uint16_t len, uint8_t *pPacket, attEvt_t *pEvt) +{ + /* if continuing */ + if (pCcb->outReq.hdr.status == ATTC_CONTINUING) + { + /* if no more data to send */ + if (pCcb->outReqParams.w.len == 0) + { + /* we're done */ + pCcb->outReq.hdr.status = ATTC_NOT_CONTINUING; + } + } + + /* adjust attribute value and its length (adjusted by ATT header length already) */ + pEvt->pValue += (ATT_PREP_WRITE_RSP_LEN - ATT_HDR_LEN); + pEvt->valueLen -= (ATT_PREP_WRITE_RSP_LEN - ATT_HDR_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Write Command. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcWriteCmd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_WRITE_CMD_BUF_LEN + valueLen)) != NULL) + { + /* set length */ + pPkt->len = ATT_WRITE_CMD_LEN + valueLen; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_WRITE_CMD); + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pValue, valueLen); + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_WRITE_CMD, pPkt, FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Prepare Write Request. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param offset Write attribute data starting at this offset. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * \param valueByRef TRUE if pValue data is accessed by reference rather than copied. + * \param continuing TRUE if ATTC continues sending requests until complete. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcPrepareWriteReq(dmConnId_t connId, uint16_t handle, uint16_t offset, uint16_t valueLen, + uint8_t *pValue, bool_t valueByRef, bool_t continuing) +{ + attcPktParam_t *pPkt; + uint8_t *p; + uint16_t bufLen; + + if (continuing && valueByRef) + { + bufLen = ATT_PREP_WRITE_REQ_BUF_LEN; + } + else + { + bufLen = ATT_PREP_WRITE_REQ_BUF_LEN + valueLen; + } + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(bufLen)) != NULL) + { + /* set parameters */ + pPkt->w.len = valueLen; + pPkt->w.offset = offset; + + /* build partial packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_PREP_WRITE_REQ); + UINT16_TO_BSTREAM(p, handle); + + /* skip over offset field */ + p += sizeof(uint16_t); + + /* set value pointer and copy data to packet, if not valueByRef */ + if (continuing && valueByRef) + { + pPkt->w.pValue = pValue; + } + else + { + memcpy(p, pValue, valueLen); + pPkt->w.pValue = p; + } + + /* send message */ + attcSendMsg(connId, handle, ATTC_MSG_API_PREP_WRITE, pPkt, continuing); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate an attribute protocol Execute Write Request. + * + * \param connId DM connection ID. + * \param writeAll TRUE to write all queued writes, FALSE to cancel all queued writes. + * + * \return None. + */ +/*************************************************************************************************/ +void AttcExecuteWriteReq(dmConnId_t connId, bool_t writeAll) +{ + attcPktParam_t *pPkt; + uint8_t *p; + + /* allocate packet and parameter buffer */ + if ((pPkt = attMsgAlloc(ATT_EXEC_WRITE_REQ_BUF_LEN)) != NULL) + { + /* set length */ + pPkt->len = ATT_EXEC_WRITE_REQ_LEN; + + /* build packet */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_EXEC_WRITE_REQ); + UINT8_TO_BSTREAM(p, writeAll); + + /* send message */ + attcSendMsg(connId, 0, ATTC_MSG_API_EXEC_WRITE, pPkt, FALSE); + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ccc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ccc.c new file mode 100644 index 0000000000000000000000000000000000000000..5ae97ba54092fa872d3a6b45f1f0c178b403452f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ccc.c @@ -0,0 +1,455 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client characteristic configuration module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_buf.h" +#include "util/bstream.h" +#include "dm_api.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Control block */ +typedef struct +{ + uint16_t *pCccTbl[DM_CONN_MAX]; /* Pointer to descriptor value tables */ + attsCccSet_t *pSet; /* Array of CCC descriptor settings */ + attsCccCback_t cback; /* Client callback function */ + uint8_t setLen; /* Length of settings array */ +} AttsCccCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Control block */ +static AttsCccCb_t attsCccCb; + +/*************************************************************************************************/ +/*! + * \brief Execute the client callback function. + * + * \param connId DM connection ID. + * \param idx Index of descriptor in CCC descriptor handle table. + * \param handle Attribute handle of the descriptor. + * \param value Attribute value of the descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsCccCback(dmConnId_t connId, uint8_t idx, uint16_t handle, uint16_t value) +{ + attsCccEvt_t evt; + + evt.hdr.event = ATTS_CCC_STATE_IND; + evt.hdr.param = connId; + evt.idx = idx; + evt.handle = handle; + evt.value = value; + + (*attsCccCb.cback)(&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate the CCC table for this connection. + * + * \param connId DM connection ID. + * + * \return Pointer into the CCC table. + */ +/*************************************************************************************************/ +static uint16_t *attsCccAllocTbl(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + /* if not already allocated */ + if (attsCccCb.pCccTbl[connId - 1] == NULL) + { + WSF_ASSERT(attsCccCb.setLen > 0); + + /* allocate new buffer */ + attsCccCb.pCccTbl[connId - 1] = WsfBufAlloc(attsCccCb.setLen * sizeof(uint16_t)); + } + + return attsCccCb.pCccTbl[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Get the pointer into the CCC table for this connection. + * + * \param connId DM connection ID. + * + * \return Pointer into the CCC table. + */ +/*************************************************************************************************/ +static uint16_t *attsCccGetTbl(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return attsCccCb.pCccTbl[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Free the CCC table for this connection. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsCccFreeTbl(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + if (attsCccCb.pCccTbl[connId - 1] != NULL) + { + WsfBufFree(attsCccCb.pCccTbl[connId - 1]); + attsCccCb.pCccTbl[connId - 1] = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Read the value of a client characteristic configuration descriptor. Note the + * value is treated as a little endian byte array. + * + * \param connId DM connection ID. + * \param handle Attribute handle of the descriptor. + * \param pValue The attribute value of the descriptor is copied to this pointer. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +/*************************************************************************************************/ +static uint8_t attsCccReadValue(dmConnId_t connId, uint16_t handle, uint8_t *pValue) +{ + attsCccSet_t *pSet; + uint16_t *pTbl; + uint8_t i; + + /* find handle in handle array */ + for (pSet = attsCccCb.pSet, i = 0; i < attsCccCb.setLen; i++, pSet++) + { + if (pSet->handle == handle) + { + break; + } + } + + /* if handle not found return error */ + if (i == attsCccCb.setLen) + { + return ATT_ERR_NOT_FOUND; + } + + /* get pointer to the table for this connection */ + if ((pTbl = attsCccGetTbl(connId)) != NULL) + { + /* read value */ + UINT16_TO_BSTREAM(pValue, pTbl[i]); + + return ATT_SUCCESS; + } + else + { + return ATT_ERR_RESOURCES; + } +} + +/*************************************************************************************************/ +/*! + * \brief Write the value of a client characteristic configuration descriptor. Note the + * value is treated as a little endian byte array. + * + * \param connId DM connection ID. + * \param handle Attribute handle of the descriptor. + * \param pValue Pointer to the attribute value of the descriptor. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +/*************************************************************************************************/ +static uint8_t attsCccWriteValue(dmConnId_t connId, uint16_t handle, uint8_t *pValue) +{ + attsCccSet_t *pSet; + uint16_t *pTbl; + uint8_t i; + uint16_t value; + uint16_t prevValue; + + /* find handle in handle array */ + for (pSet = attsCccCb.pSet, i = 0; i < attsCccCb.setLen; i++, pSet++) + { + if (pSet->handle == handle) + { + break; + } + } + + /* if handle not found return error */ + if (i == attsCccCb.setLen) + { + return ATT_ERR_NOT_FOUND; + } + + BYTES_TO_UINT16(value, pValue); + + /* verify value range */ + if (((value != 0) && (value != ATT_CLIENT_CFG_NOTIFY) && (value != ATT_CLIENT_CFG_INDICATE)) || + ((value != 0) && ((value & pSet->valueRange) == 0))) + { + return ATT_ERR_VALUE_RANGE; + } + + /* get pointer to the table for this connection */ + if ((pTbl = attsCccGetTbl(connId)) != NULL) + { + /* write value */ + prevValue = pTbl[i]; + pTbl[i] = value; + + /* if value changed call callback */ + if (prevValue != value) + { + attsCccCback(connId, i, handle, value); + } + + return ATT_SUCCESS; + } + else + { + return ATT_ERR_RESOURCES; + } +} + +/*************************************************************************************************/ +/*! + * \brief CCC callback function executed by ATTS and CCC read or write. + * + * \param connId DM connection ID. + * \param method Read or write. + * \param handle Attribute handle of the descriptor. + * \param pValue The attribute value of the descriptor is copied to this pointer. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +/*************************************************************************************************/ +static uint8_t attsCccMainCback(dmConnId_t connId, uint8_t method, uint16_t handle, uint8_t *pValue) +{ + ATT_TRACE_INFO2("attsCccMainCback connId=%d handle=%d", connId, handle); + + if (method == ATT_METHOD_READ) + { + return attsCccReadValue(connId, handle, pValue); + } + else + { + return attsCccWriteValue(connId, handle, pValue); + } +} + +/*************************************************************************************************/ +/*! + * \brief Register the utility service for managing client characteristic + * configuration descriptors. This function is typically called once on + * system initialization. + * + * \param setLen Length of settings array. + * \param pSet Array of CCC descriptor settings. + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCccRegister(uint8_t setLen, attsCccSet_t *pSet, attsCccCback_t cback) +{ + attsCccCb.setLen = setLen; + attsCccCb.pSet = pSet; + attsCccCb.cback = cback; + + attsCb.cccCback = attsCccMainCback; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the client characteristic configuration descriptor value table for a + * connection. This function is typically called when a connection is established + * or when a device is bonded. + * + * \param connId DM connection ID. + * \param pCccTbl Pointer to the descriptor value array. The length of the array + * must equal the value of setLen passed to AttsCccRegister(). + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCccInitTable(dmConnId_t connId, uint16_t *pCccTbl) +{ + uint8_t i; + uint16_t *pTbl; + + ATT_TRACE_INFO1("AttsCccInitTable connId=%d", connId); + + if ((pTbl = attsCccAllocTbl(connId)) != NULL) + { + /* if initializer table is passed in */ + if (pCccTbl != NULL) + { + /* initialize table */ + for (i = 0; i < attsCccCb.setLen; i++, pCccTbl++, pTbl++) + { + /* copy value */ + *pTbl = *pCccTbl; + + /* execute callback for each nonzero entry in table */ + if (*pCccTbl != 0) + { + attsCccCback(connId, i, ATT_HANDLE_NONE, *pCccTbl); + } + } + } + else + { + /* initialize table to zero */ + memset(pTbl, 0, (sizeof(uint16_t) * attsCccCb.setLen)); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear and deallocate the client characteristic configuration descriptor value + * table for a connection. This function must be called when a connection is closed. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCccClearTable(dmConnId_t connId) +{ + ATT_TRACE_INFO1("AttsCccClearTable connId=%d", connId); + + attsCccFreeTbl(connId); +} + +/*************************************************************************************************/ +/*! + * \brief Get the value of a client characteristic configuration descriptor by its index. + * If not found, return zero. + * + * \param connId DM connection ID. + * \param idx Index of descriptor in CCC descriptor handle table. + * + * \return Value of the descriptor. + */ +/*************************************************************************************************/ +uint16_t AttsCccGet(dmConnId_t connId, uint8_t idx) +{ + uint16_t *pTbl; + + WSF_ASSERT(idx < attsCccCb.setLen); + + if ((pTbl = attsCccGetTbl(connId)) != NULL) + { + /* return value from table */ + return pTbl[idx]; + } + else + { + return 0; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the value of a client characteristic configuration descriptor by its index. + * + * \param connId DM connection ID. + * \param idx Index of descriptor in CCC descriptor handle table. + * \param value Value of the descriptor. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCccSet(dmConnId_t connId, uint8_t idx, uint16_t value) +{ + uint16_t *pTbl; + + WSF_ASSERT(idx < attsCccCb.setLen); + + if ((pTbl = attsCccGetTbl(connId)) != NULL) + { + pTbl[idx] = value; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if a client characteristic configuration descriptor is enabled and if + * the characteristic's security level has been met. + * + * \param connId DM connection ID. + * \param idx Index of descriptor in CCC descriptor handle table. + * + * \return Value of the descriptor if security level is met, otherwise zero. + */ +/*************************************************************************************************/ +uint16_t AttsCccEnabled(dmConnId_t connId, uint8_t idx) +{ + WSF_ASSERT(idx < attsCccCb.setLen); + + /* check security level */ + if (DmConnSecLevel(connId) < attsCccCb.pSet[idx].secLevel) + { + return 0; + } + + /* get value */ + return AttsCccGet(connId, idx); +} + +/*************************************************************************************************/ +/*! + * \brief Get number of CCC entries in table. + * + * \param None + * + * \return Number of CCC entries in table. + */ +/*************************************************************************************************/ +uint8_t AttsGetCccTableLen(void) +{ + return attsCccCb.setLen; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_csf.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_csf.c new file mode 100644 index 0000000000000000000000000000000000000000..029bca7bd032a8241dde76ed3995bcc6e56a3ab3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_csf.c @@ -0,0 +1,414 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT client supported features module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" +#include "util/bstream.h" +#include "svc_core.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Control block */ +attsCsfCb_t attsCsfCb; + +/*************************************************************************************************/ +/*! + * \brief Set status of on-going database hash update operation. + * + * \param isUpdating \ref TRUE is updating, otherwise \ref FALSE; + * + * \return None. + */ +/*************************************************************************************************/ +void attsCsfSetHashUpdateStatus(bool_t isUpdating) +{ + uint8_t i; + + if (attsCsfCb.isHashUpdating == isUpdating) + { + /* Already in the current state, nothing to do. */ + return; + } + else + { + /* Update state. */ + attsCsfCb.isHashUpdating = isUpdating; + } + + /* Update complete. + * Check if clients were pending on the hash value and fulfill their requests. + */ + if (isUpdating == FALSE) + { + ATT_TRACE_INFO0("Database hash calculation complete"); + + attsCheckPendDbHashReadRsp(); + + /* Note: Clients which were pending on a Database Hash read from a Read by Type Request are not + * transitioned to the change-aware state here. The application is expected to initiate the + * state transition of all clients when the new hash is set. If this is not done, the + * state of pending Clients will be out of sync, and will be corrected on the next database + * sync. + */ + } + else + { + ATT_TRACE_INFO0("Calculating database hash"); + + /* If the application, for whatever reason, previously recalculated the database hash over an + * unchanged database and a client pended on a Read By Type Request of the database hash, then + * that clients state may be out of step if the application did not initiate a state + * transition. That state transition is forced here to keep handle next transition. + */ + for (i = 0; i < DM_CONN_MAX; i++) + { + if (attsCsfCb.attsCsfTable[i].changeAwareState == ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING) + { + attsCsfCb.attsCsfTable[i].changeAwareState = ATTS_CLIENT_CHANGE_PENDING_AWARE; + } + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Check if database hash update is in progress. +* +* \return \ref TRUE if update in progress, \ref FALSE otherwise. +*/ +/*************************************************************************************************/ +uint8_t attsCsfGetHashUpdateStatus(void) +{ + return attsCsfCb.isHashUpdating; +} + +/*************************************************************************************************/ +/*! + * \brief Check client awareness to database hash before sending notification or indication. + * + * \param connId DM connection ID. + * \param handle ATT handle. + * + * \return \ref TRUE if client is aware, otherwise \ref FALSE. + */ +/*************************************************************************************************/ +uint8_t attsCsfIsClientChangeAware(dmConnId_t connId, uint16_t handle) +{ + if ((attsCsfCb.attsCsfTable[connId - 1].csf & ATTS_CSF_ROBUST_CACHING) && + (attsCsfCb.attsCsfTable[connId - 1].changeAwareState == ATTS_CLIENT_CHANGE_UNAWARE) && + (handle != GATT_SC_HDL)) + { + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Update client change-aware state based on protocol event. + * + * \param connId Connection handle. + * \param opcode ATT PDU type. + * \param pPacket Data packet from L2CAP. + * + * \return \ref ATT_SUCCESS if client is change-aware, else \ref ATT_ERR_DATABASE_OUT_OF_SYNC. + */ +/*************************************************************************************************/ +uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket) +{ + uint8_t err = ATT_SUCCESS; + attsCsfRec_t *pRec; + + /* PDU which do not operate on att handles are handled agnostically of the client's state. */ + if (opcode == ATT_PDU_MTU_REQ || opcode == ATT_PDU_VALUE_CNF) + { + return err; + } + + pRec = &attsCsfCb.attsCsfTable[handle]; + + /* If the client is change-unaware */ + if (pRec->changeAwareState == ATTS_CLIENT_CHANGE_UNAWARE) + { + /* If not a command */ + if ((opcode & ATT_PDU_MASK_COMMAND) == 0) + { + /* Note: there is no need to call back to the application here. The application only + * needs to know when a transition to or from the change-aware state occurs. + */ + + /* Move client change-aware state to pending */ + pRec->changeAwareState = ATTS_CLIENT_CHANGE_PENDING_AWARE; + + ATT_TRACE_INFO2("ConnId %d change aware state is %d", handle + 1, + ATTS_CLIENT_CHANGE_PENDING_AWARE); + } + + /* If this is a command or the Client has indicated Robust Caching, set an error so that + * this command or request is not processed. + */ + if ((opcode & ATT_PDU_MASK_COMMAND) || + (pRec->csf & ATTS_CSF_ROBUST_CACHING)) + { + /* return a database out of sync error */ + err = ATT_ERR_DATABASE_OUT_OF_SYNC; + } + } + else if (pRec->changeAwareState == ATTS_CLIENT_CHANGE_PENDING_AWARE) + { + /* If not a command */ + if ((opcode & ATT_PDU_MASK_COMMAND) == 0) + { + /* Move client change-aware state to aware */ + pRec->changeAwareState = ATTS_CLIENT_CHANGE_AWARE; + + ATT_TRACE_INFO2("ConnId %d change aware state is %d", handle + 1, ATTS_CLIENT_CHANGE_AWARE); + + /* Callback to application to store updated awareness, if bonded. */ + if (attsCsfCb.writeCback != NULL) + { + attsCsfCb.writeCback(handle + 1, pRec->changeAwareState, &pRec->csf); + } + } + else + { + /* Return an error so that command is not processed. */ + err = ATT_ERR_DATABASE_OUT_OF_SYNC; + } + } + + /* If this is Read by Type request */ + if (opcode == ATT_PDU_READ_TYPE_REQ) + { + uint16_t uuid; + + /* Extract UUID: Skip L2C, ATT Header and 4 byte handle range */ + BYTES_TO_UINT16(uuid, (pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN + 4)); + + /* If this is a Read By Type Request of the Database Hash characteristic value */ + if (uuid == ATT_UUID_DATABASE_HASH) + { + err = ATT_SUCCESS; + + /* Reading the hash during a hash update causes the new hash to be returned and counts + * towards the peer's progression towards a change-aware state. + */ + if (attsCsfCb.isHashUpdating) + { + /* This read will not be processed until after the hash update completes, so this read + * request shall be counted as a move from change-unaware to chang-aware pending. + */ + pRec->changeAwareState = ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING; + + ATT_TRACE_INFO2("ConnId %d change aware state is %d", handle + 1, + ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING); + } + } + } + + if (err == ATT_ERR_DATABASE_OUT_OF_SYNC) + { + ATT_TRACE_INFO2("ConnId %d out of sync, PDU with opcode 0x%02x ignored!", handle + 1, opcode); + } + + return err; +} + +/*************************************************************************************************/ +/*! + * \brief Update a client's state of awareness to a change in the database. + * + * \param connId DM connection ID. if \ref DM_CONN_ID_NONE, sets the state for all connected + * clients. + * \param state The state of awareness to a change, see ::attClientAwareStates. + * + * \return None. + * + * \note A callback to application is not needed as it is expected the caller (i.e. the + * application) will have updated all persistent records prior to calling this function. + */ +/*************************************************************************************************/ +void AttsCsfSetClientsChangeAwarenessState(dmConnId_t connId, uint8_t state) +{ + uint8_t i; + + if (connId == DM_CONN_ID_NONE) + { + for (i = 0; i < DM_CONN_MAX; i++) + { + if (attsCsfCb.attsCsfTable[i].changeAwareState == ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING) + { + attsCsfCb.attsCsfTable[i].changeAwareState = ATTS_CLIENT_CHANGE_PENDING_AWARE; + } + else + { + attsCsfCb.attsCsfTable[i].changeAwareState = state; + } + } + } + else + { + attsCsfCb.attsCsfTable[connId - 1].changeAwareState = state; + + ATT_TRACE_INFO2("ConnId %d change aware state is %d", connId, state); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the client supported features for a connection. + * + * \param connId DM connection ID. + * \param changeAwareState The state of awareness to a change in the database. + * \param pCsf Pointer to the client supported features value to cache. \ref NULL or + * buffer of length \ref ATT_CSF_LEN. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfConnOpen(dmConnId_t connId, uint8_t changeAwareState, uint8_t *pCsf) +{ + if (pCsf != NULL) + { + attsCsfCb.attsCsfTable[connId - 1].changeAwareState = changeAwareState; + memcpy(&attsCsfCb.attsCsfTable[connId - 1].csf, pCsf, ATT_CSF_LEN); + } + else + { + /* Note: this set client to the change-aware state. */ + memset(&attsCsfCb.attsCsfTable[connId - 1], 0, sizeof(attsCsfRec_t)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Register callback. + * + * \param writeCback Application callback for when features or status change. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfRegister(attsCsfWriteCback_t writeCback) +{ + attsCsfCb.writeCback = writeCback; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize ATTS client supported features module. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfInit(void) +{ + attsCsfCb.isHashUpdating = FALSE; + attsCsfCb.writeCback = NULL; +} + +/*************************************************************************************************/ +/*! + * \brief GATT write of client supported feature characteristic value. + * + * \param connId DM connection ID. + * \param offset offset into csf characteristic. + * \param valueLen length of write in bytes. + * \param pValue Pointer to client's supported features characteristic value. + * + * \return \ref ATT_SUCCESS is successful, \ref ATT_ERR_VALUE_NOT_ALLOWED if any supported + * features are flipped from 1 to 0. + */ +/*************************************************************************************************/ +uint8_t AttsCsfWriteFeatures(dmConnId_t connId, uint16_t offset, uint16_t valueLen, uint8_t *pValue) +{ + attsCsfRec_t *pCsfRec = &attsCsfCb.attsCsfTable[connId - 1]; + + /* future parameter in case the client supported features characteristic becomes a multi-octet + * structure. + */ + (void)offset; + + if (valueLen > ATT_CSF_LEN) + { + return ATT_ERR_LENGTH; + } + + /* A client can not clear any bits it has set. */ + if ((pCsfRec->csf & *pValue) < pCsfRec->csf) + { + return ATT_ERR_VALUE_NOT_ALLOWED; + } + + pCsfRec->csf = *pValue & ATTS_CSF_OCT0_FEATURES; + + ATT_TRACE_INFO2("connId %d updated csf to 0x%02x", connId, pCsfRec->csf); + + /* Callback to application to store updated features, if bonded. */ + if (attsCsfCb.writeCback != NULL) + { + attsCsfCb.writeCback(connId, pCsfRec->changeAwareState, &pCsfRec->csf); + } + + return ATT_SUCCESS; +} + +/*************************************************************************************************/ +/*! + * \brief Get client supported feature record. + * + * \param connId DM connection ID. + * \param pCsfOut Output parameter for client supported features buffer. + * \param pCsfOutLen Length of output parameter buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCsfGetFeatures(dmConnId_t connId, uint8_t *pCsfOut, uint8_t pCsfOutLen) +{ + if (pCsfOutLen <= ATT_CSF_LEN) + { + memcpy(pCsfOut, &attsCsfCb.attsCsfTable[connId - 1].csf, pCsfOutLen); + } +} + +/*************************************************************************************************/ +/*! + * \brief Get client state of awareness to a change in the database. + * + * \param connId DM connection ID. + * + * \return Client's change-aware state. + */ +/*************************************************************************************************/ +uint8_t AttsCsfGetChangeAwareState(dmConnId_t connId) +{ + return attsCsfCb.attsCsfTable[connId - 1].changeAwareState; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_dyn.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_dyn.c new file mode 100644 index 0000000000000000000000000000000000000000..30dc989ff0afe0e83a65dcc4f703521c0af4d5d8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_dyn.c @@ -0,0 +1,353 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Dynamic ATT services and attributes. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Configurable number of bytes in the Dynamic Service and Attribute Heap */ +#ifndef ATTS_DYN_HEAP_SIZE +#define ATTS_DYN_HEAP_SIZE 1280 +#endif + +/* Configurable memory byte alignment Dynamic Service and Attribute Heap */ +#ifndef ATTS_DYN_ALIGNMENT +#define ATTS_DYN_ALIGNMENT 4 +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Dynamic service and attributes control block */ +typedef struct +{ + uint8_t numServices; + uint8_t *pNextBuffer; +} attsDynCb_t; + +/* Dynamic service group control block */ +typedef struct +{ + attsGroup_t group; + uint16_t currentAttr; +} attsDynGroupCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Dynamic Service and Attribute Heap */ +static uint8_t attsDynHeap[ATTS_DYN_HEAP_SIZE]; + +/* Dynamic Service and Attribute control block */ +static attsDynCb_t attsDynCb; + +/*************************************************************************************************/ +/*! + * \brief Allocate memory from the Dynamic Service and Attribute Heap. + * + * \param size Size of buffer to allocate in bytes + * + * \return Allocated buffer or NULL if failed to allocate a buffer. + */ +/*************************************************************************************************/ +static void *attsDynAlloc(uint16_t size) +{ + uint8_t *pMem = attsDynCb.pNextBuffer; + + /* Verify enough space in heap for buffer */ + if (pMem + size <= attsDynHeap + ATTS_DYN_HEAP_SIZE) + { +#if ATTS_DYN_ALIGNMENT > 1 + /* Increase size if size not a multiple of the memory alignment */ + if (size % ATTS_DYN_ALIGNMENT) + { + size += ATTS_DYN_ALIGNMENT - (size % ATTS_DYN_ALIGNMENT); + } +#endif + + /* Set the next buffer location */ + attsDynCb.pNextBuffer += size; + + return pMem; + } + + /* Out of heap */ + WSF_ASSERT(FALSE); + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the Dynamic ATT Service subsystem. + * + * \param None + * + * \return None. + */ +/*************************************************************************************************/ +void AttsDynInit(void) +{ + attsDynCb.numServices = 0; + attsDynCb.pNextBuffer = attsDynHeap; +} + +/*************************************************************************************************/ +/*! + * \brief Dynamically create an ATT Service at runtime. + * + * \param startHandle Starting attribute handle in the service + * \param endHandle Last attribute handle in the service + * + * \return Service Handle. + * + * \note It is recommended this function only be used when no connections are open and the + * device is not in a connectable mode. + */ +/*************************************************************************************************/ +void *AttsDynCreateGroup(uint16_t startHandle, uint16_t endHandle) +{ + attsDynGroupCb_t *pGroup = NULL; + + /* Allocate memory for the service control block */ + pGroup = attsDynAlloc(sizeof(attsDynGroupCb_t)); + WSF_ASSERT(pGroup); + + if (pGroup != NULL) + { + + /* Initialize the service group */ + pGroup->group.startHandle = startHandle; + pGroup->group.endHandle = endHandle; + pGroup->group.readCback = NULL; + pGroup->group.writeCback = NULL; + + /* Allocate memory for the attributes */ + pGroup->group.pAttr = attsDynAlloc(sizeof(attsAttr_t) * (endHandle - startHandle + 1)); + WSF_ASSERT(pGroup->group.pAttr); + + pGroup->currentAttr = 0; + attsDynCb.numServices++; + } + + return pGroup; +} + +/*************************************************************************************************/ +/*! + * \brief Dynamically delete an ATT Service at runtime. + * + * \param pSvcHandle Service handle returned by AttsDynCreateGroup + * + * \return None. + * + * \note It is recommended this function only be used when no connections are open and the + * device is not in a connectable mode. + */ +/*************************************************************************************************/ +void AttsDynDeleteGroup(void *pSvcHandle) +{ + attsDynGroupCb_t *pGroup = pSvcHandle; + + WSF_ASSERT(attsDynCb.numServices); + WSF_ASSERT(pGroup); + + /* Remove the group */ + AttsRemoveGroup(pGroup->group.startHandle); + + attsDynCb.numServices--; + + /* If there are no more dynamic groups, initialize the subsystem to free the memory in the heap */ + if (attsDynCb.numServices == 0) + { + AttsDynInit(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Register callback functions for a dynamic ATT Service at runtime. + * + * \param pSvcHandle Service handle returned by AttsDynCreateGroup + * \param readCback Read callback function. + * \param writeCback Write callback function. + * + * \return None. + * + * \note It is recommended this function only be used when no connections are open and the + * device is not in a connectable mode. + */ +/*************************************************************************************************/ +void AttsDynRegister(void *pSvcHandle, attsReadCback_t readCback, attsWriteCback_t writeCback) +{ + attsDynGroupCb_t *pGroup = pSvcHandle; + + WSF_ASSERT(pGroup); + + pGroup->group.readCback = readCback; + pGroup->group.writeCback = writeCback; +} + +/*************************************************************************************************/ +/*! + * \brief Dynamically add an attribute to a dynamic ATT Services at app initialization. + * + * \param pSvcHandle Service handle returned by AttsDynCreateGroup + * \param pUuid Constant UUID + * \param pValue Initial value of attribute (copied into attribute memory) + * \param len Length of pValue in bytes + * \param maxLen Maximum length of the attribute in bytes + * \param settings Attribute settings + * \param permissions Attribute permissions + * + * \return None. + * + * \note It is recommended this function only be used when no connections are open and the + * device is not in a connectable mode. + */ +/*************************************************************************************************/ +void AttsDynAddAttr(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValue, uint16_t len, + const uint16_t maxLen, uint8_t settings, uint8_t permissions) +{ + attsAttr_t *pAttr; + attsDynGroupCb_t *pGroup = pSvcHandle; + uint16_t handle = pGroup->group.startHandle + pGroup->currentAttr++; + + /* Verify inputs */ + WSF_ASSERT(handle <= pGroup->group.endHandle); + WSF_ASSERT(pUuid); + WSF_ASSERT(len <= maxLen); + + pAttr = pGroup->group.pAttr + (handle - pGroup->group.startHandle); + + + /* Allocate a buffer for the length of the attribute */ + pAttr->pLen = attsDynAlloc(sizeof(uint16_t)); + WSF_ASSERT(pAttr->pLen); + + if (pAttr->pLen == NULL) + { + return; + } + + /* Allocate a buffer for the value of the attribute */ + pAttr->pValue = attsDynAlloc(maxLen); + WSF_ASSERT(pAttr->pValue); + + if (pAttr->pValue == NULL) + { + return; + } + + /* Set the attribute values */ + pAttr->pUuid = pUuid; + pAttr->maxLen = maxLen; + pAttr->settings = settings; + pAttr->permissions = permissions; + + + + if (pValue) + { + /* Copy the initial value */ + memcpy(pAttr->pValue, pValue, len); + *pAttr->pLen = len; + } + else + { + /* No initial value, zero value and length */ + memset(pAttr->pValue, 0, maxLen); + *pAttr->pLen = 0; + } + + /* Add the service when the last attribute has been added */ + if (handle == pGroup->group.endHandle) + { + AttsAddGroup(&pGroup->group); + } +} + +/*************************************************************************************************/ +/*! + * \brief Dynamically add an attribute with a constant value to a dynamic ATT Services. + * + * \param pSvcHandle Service handle returned by AttsDynCreateGroup + * \param pUuid Constant UUID + * \param pValue Pointer to constant attribute memory + * \param len Length of pValue in bytes + * \param settings Attribute settings + * \param permissions Attribute permissions + * + * \return None. + * + * \note It is recommended this function only be used when no connections are open and the + * device is not in a connectable mode. + */ +/*************************************************************************************************/ +void AttsDynAddAttrConst(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValue, + const uint16_t len, uint8_t settings, uint8_t permissions) +{ + attsAttr_t *pAttr; + attsDynGroupCb_t *pGroup = pSvcHandle; + uint16_t handle = pGroup->group.startHandle + pGroup->currentAttr++; + + /* Verify inputs */ + WSF_ASSERT(handle <= pGroup->group.endHandle); + WSF_ASSERT(pValue); + WSF_ASSERT(pUuid); + + pAttr = pGroup->group.pAttr + (handle - pGroup->group.startHandle); + + /* Allocate a buffer for the length of the attribute */ + pAttr->pLen = attsDynAlloc(sizeof(uint16_t)); + WSF_ASSERT(pAttr->pLen); + + if (pAttr->pLen == NULL) + { + return; + } + + /* Set the attribute values */ + *pAttr->pLen = len; + pAttr->pUuid = pUuid; + pAttr->pValue = (uint8_t *) pValue; + pAttr->maxLen = len; + pAttr->settings = settings; + pAttr->permissions = permissions; + + /* Add the service when the last attribute has been added */ + if (handle == pGroup->group.endHandle) + { + AttsAddGroup(&pGroup->group); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ind.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ind.c new file mode 100644 index 0000000000000000000000000000000000000000..f9c357f91492340e2ccbc9bc8edaef5be03838eb --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_ind.c @@ -0,0 +1,652 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server indication and notification functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" + +/************************************************************************************************** + Function Prototypes +**************************************************************************************************/ + +static void attsIndConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt); +static void attsIndMsgCback(attsApiMsg_t *pMsg); +static void attsIndCtrlCback(wsfMsgHdr_t *pMsg); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Interface to ATT */ +static const attFcnIf_t attsIndFcnIf = +{ + attEmptyDataCback, + attsIndCtrlCback, + (attMsgHandler_t) attsIndMsgCback, + attsIndConnCback +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +attsIndCb_t attsIndCb; + +/*************************************************************************************************/ +/*! + * \brief Return the ATTS connection control block connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to connection control block or NULL if not in use. + */ +/*************************************************************************************************/ +static attsIndCcb_t *attsIndCcbByConnId(dmConnId_t connId) +{ + if (DmConnInUse(connId)) + { + return &attsIndCb.ccb[connId - 1]; + } + else + { + ATT_TRACE_WARN1("atts ccb not in use: %d", connId); + return NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if application callback is pending for indication or a given notification, or + * the maximum number of simultaneous notifications has been reached. + * + * \param pCcb ATTS ind control block. + * \param pPkt Pointer to packet. + * + * \return TRUE if app callback's pending or max number of simultaneous notifications reached. + * FALSE, otherwise. + */ +/*************************************************************************************************/ +static bool_t attsPendIndNtfHandle(attsIndCcb_t *pCcb, attsPktParam_t *pPkt) +{ + uint8_t opcode; + uint8_t pendNtfs; + uint8_t i; + + /* extract opcode */ + opcode = *(((uint8_t *) pPkt) + L2C_PAYLOAD_START); + + /* if indication */ + if (opcode == ATT_PDU_VALUE_IND) + { + /* see if callback pending for indication */ + return (pCcb->pendIndHandle == ATT_HANDLE_NONE) ? FALSE : TRUE; + } + + /* initialize number of notification callbacks pending */ + pendNtfs = 0; + + for (i = 0; i < ATT_NUM_SIMUL_NTF; i++) + { + /* if callback pending for notification */ + if (pCcb->pendNtfHandle[i] != ATT_HANDLE_NONE) + { + /* if callback pending for this handle */ + if (pCcb->pendNtfHandle[i] == pPkt->handle) + { + /* callback pending for this notification */ + return TRUE; + } + + pendNtfs++; + } + } + + /* no callback is pending for this notification but see if the maximum number of simultaneous + notifications has been reached */ + return (pendNtfs < ATT_NUM_SIMUL_NTF) ? FALSE : TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Set pending notification callback for a given handle. + * + * \param pCcb ATTS ind control block. + * \param handle Notification handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsSetPendNtfHandle(attsIndCcb_t *pCcb, uint16_t handle) +{ + uint8_t i; + + for (i = 0; i < ATT_NUM_SIMUL_NTF; i++) + { + /* if entry free */ + if (pCcb->pendNtfHandle[i] == ATT_HANDLE_NONE) + { + /* set pending notification handle */ + pCcb->pendNtfHandle[i] = handle; + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Execute application callback function with confirmation event. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param status Callback event status. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsExecCallback(dmConnId_t connId, uint16_t handle, uint8_t status) +{ + attExecCallback(connId, ATTS_HANDLE_VALUE_CNF, handle, status, 0); +} + +/*************************************************************************************************/ +/*! + * \brief Call pending indication or/and notification(s) application callback. + * + * \param connId DM connection ID. + * \param pCcb ATTS ind control block. + * \param status Callback event status. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsIndNtfCallback(dmConnId_t connId, attsIndCcb_t *pCcb, uint8_t status) +{ + uint8_t i; + + /* if pending indication callback */ + if (pCcb->pendIndHandle != ATT_HANDLE_NONE) + { + /* call indication callback with status */ + attsExecCallback(connId, pCcb->pendIndHandle, status); + pCcb->pendIndHandle = ATT_HANDLE_NONE; + } + + /* if any pending notification callback */ + for (i = 0; i < ATT_NUM_SIMUL_NTF; i++) + { + if (pCcb->pendNtfHandle[i] != ATT_HANDLE_NONE) + { + /* call notification callback with status */ + attsExecCallback(connId, pCcb->pendNtfHandle[i], status); + pCcb->pendNtfHandle[i] = ATT_HANDLE_NONE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set up and send an attribute server indication or notification. + * + * \param pCcb ATTS ind control block. + * \param connId DM connection ID. + * \param pPkt Pointer to packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsSetupMsg(attsIndCcb_t *pCcb, dmConnId_t connId, attsPktParam_t *pPkt) +{ + uint8_t opcode; + uint16_t handle; + + /* extract opcode */ + opcode = *(((uint8_t *) pPkt) + L2C_PAYLOAD_START); + + /* copy handle (it may be overwritten in pPkt) */ + handle = pPkt->handle; + + /* send pdu */ + L2cDataReq(L2C_CID_ATT, pCcb->pMainCcb->handle, pPkt->len, (uint8_t *) pPkt); + + /* if indication store handle and start timer */ + if (opcode == ATT_PDU_VALUE_IND) + { + pCcb->outIndHandle = pCcb->pendIndHandle = handle; + pCcb->outIndTimer.msg.event = ATTS_MSG_IND_TIMEOUT; + WsfTimerStartSec(&pCcb->outIndTimer, pAttCfg->transTimeout); + } + /* else if a notification and flow not disabled call callback now */ + else if (!(pCcb->pMainCcb->control & ATT_CCB_STATUS_FLOW_DISABLED)) + { + attsExecCallback(connId, handle, ATT_SUCCESS); + } + /* else set pending notification callback for this handle */ + else + { + attsSetPendNtfHandle(pCcb, handle); + } +} + +/*************************************************************************************************/ +/*! + * \brief Connection callback for ATTS indications/notifications. + * + * \param pCcb ATT control block. + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsIndConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt) +{ + attsIndCcb_t *pIndCcb; + uint8_t status; + + /* if connection opened */ + if (pDmEvt->hdr.event == DM_CONN_OPEN_IND) + { + + } + /* if connection closed */ + else if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* set status */ + if (pDmEvt->connClose.hdr.status == HCI_SUCCESS) + { + status = pDmEvt->connClose.reason + ATT_HCI_ERR_BASE; + } + else + { + status = pDmEvt->connClose.hdr.status + ATT_HCI_ERR_BASE; + } + + /* get server control block directly */ + pIndCcb = &attsIndCb.ccb[pCcb->connId - 1]; + + /* if outstanding indication */ + if (pIndCcb->outIndHandle != ATT_HANDLE_NONE) + { + /* stop timer */ + WsfTimerStop(&pIndCcb->outIndTimer); + pIndCcb->outIndHandle = ATT_HANDLE_NONE; + } + + /* call pending indication and notification callback */ + attsIndNtfCallback(pCcb->connId, pIndCcb, status); + } +} + +/*************************************************************************************************/ +/*! + * \brief WSF message handler callback for ATTS indications/notifications. + * + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsIndMsgCback(attsApiMsg_t *pMsg) +{ + attsIndCcb_t *pCcb; + + /* get CCB and verify connection still in use */ + if ((pCcb = attsIndCcbByConnId((dmConnId_t) pMsg->hdr.param)) == NULL) + { + /* if message has a packet buffer free packet buffer */ + if (pMsg->hdr.event == ATTS_MSG_API_VALUE_IND_NTF) + { + WsfMsgFree(pMsg->pPkt); + } + + /* ignore if connection not in use */ + return; + } + + /* if an API message to send packet */ + if (pMsg->hdr.event == ATTS_MSG_API_VALUE_IND_NTF) + { + /* verify no API message already pending */ + if (attsPendIndNtfHandle(pCcb, pMsg->pPkt)) + { + /* call callback with failure status and free packet buffer */ + attsExecCallback((dmConnId_t) pMsg->hdr.param, pMsg->pPkt->handle, ATT_ERR_OVERFLOW); + WsfMsgFree(pMsg->pPkt); + } + /* otherwise ready to send; set up request */ + else + { + attsSetupMsg(pCcb, (dmConnId_t) pMsg->hdr.param, pMsg->pPkt); + } + } + /* else if indication timeout */ + else if (pMsg->hdr.event == ATTS_MSG_IND_TIMEOUT) + { + /* if outstanding indication */ + if (pCcb->outIndHandle != ATT_HANDLE_NONE) + { + /* clear out handle */ + pCcb->outIndHandle = ATT_HANDLE_NONE; + + /* call callback with timeout error */ + attsExecCallback((dmConnId_t) pMsg->hdr.param, pCcb->pendIndHandle, ATT_ERR_TIMEOUT); + pCcb->pendIndHandle = ATT_HANDLE_NONE; + pCcb->pMainCcb->control |= ATT_CCB_STATUS_TX_TIMEOUT; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief L2CAP control callback. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsIndCtrlCback(wsfMsgHdr_t *pMsg) +{ + attsIndCcb_t *pCcb; + + /* note this function is currently only called when flow is enabled */ + + /* get CCB */ + if ((pCcb = attsIndCcbByConnId((dmConnId_t) pMsg->param)) != NULL) + { + /* call pending indication and notification callback */ + attsIndNtfCallback((dmConnId_t) pMsg->param, pCcb, ATT_SUCCESS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol Handle Value Indication or Notification. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * \param opcode Opcode for notification or indication. + * \param zeroCpy Whether or not to copy attribute value data into new buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsHandleValueIndNtf(dmConnId_t connId, uint16_t handle, uint16_t valueLen, + uint8_t *pValue, uint8_t opcode, bool_t zeroCpy) +{ + attsIndCcb_t *pCcb; + uint16_t mtu; + bool_t transTimedOut; + bool_t pktSent = FALSE; + + WsfTaskLock(); + + /* get CCB and verify connection still in use */ + if ((pCcb = attsIndCcbByConnId(connId)) != NULL) + { + /* get MTU size */ + mtu = pCcb->pMainCcb->mtu; + transTimedOut = !!(pCcb->pMainCcb->control & ATT_CCB_STATUS_TX_TIMEOUT); + } + /* else connection not in use */ + else + { + /* MTU size unknown */ + mtu = 0; + transTimedOut = FALSE; + } + + WsfTaskUnlock(); + + /* if MTU size known for connection */ + if (mtu > 0) + { + /* if no transaction's timed out */ + if (!transTimedOut) + { + /* Only send notifications and indications if client is aware of any database changes. */ + if (attsCsfIsClientChangeAware(connId, handle)) + { + /* if packet length is less than or equal to negotiated MTU */ + if ((valueLen + ATT_VALUE_NTF_LEN) <= mtu) + { + attsApiMsg_t *pMsg; + uint8_t *p; + + /* allocate message buffer */ + if ((pMsg = WsfMsgAlloc(sizeof(attsApiMsg_t))) != NULL) + { + /* set parameters */ + pMsg->hdr.param = connId; + pMsg->hdr.event = ATTS_MSG_API_VALUE_IND_NTF; + + if (zeroCpy) + { + /* use packet buffer provided */ + pMsg->pPkt = (attsPktParam_t *)(pValue - ATT_VALUE_IND_NTF_BUF_LEN); + } + else + { + /* allocate packet buffer */ + pMsg->pPkt = attMsgAlloc(ATT_VALUE_IND_NTF_BUF_LEN + valueLen); + } + + if (pMsg->pPkt != NULL) + { + /* set data length and handle (ind and ntf have same header length) */ + pMsg->pPkt->len = ATT_VALUE_IND_LEN + valueLen; + pMsg->pPkt->handle = handle; + + /* build packet */ + p = (uint8_t *)pMsg->pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, opcode); + UINT16_TO_BSTREAM(p, handle); + + if (!zeroCpy) + { + memcpy(p, pValue, valueLen); + } + + /* send message */ + WsfMsgSend(attCb.handlerId, pMsg); + pktSent = TRUE; + } + else + { + /* free message buffer if packet buffer alloc failed */ + WsfMsgFree(pMsg); + } + } + } + /* packet length exceeds MTU size */ + else + { + /* call callback with failure status */ + attsExecCallback(connId, handle, ATT_ERR_MTU_EXCEEDED); + } + } + } + else + /* transaction's timed out */ + { + /* call callback with failure status */ + attsExecCallback(connId, handle, ATT_ERR_TIMEOUT); + } + } + + /* if packet wasn't sent and it's a zero-copy packet */ + if (!pktSent && zeroCpy) + { + /* free packet buffer provided */ + AttMsgFree(pValue, opcode); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process received handle value confirm packet. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcValueCnf(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + attsIndCcb_t *pIndCcb; + + /* get server indication CCB */ + if ((pIndCcb = attsIndCcbByConnId(pCcb->connId)) == NULL) + { + return; + } + + /* if an outstanding indication */ + if (pIndCcb->outIndHandle != ATT_HANDLE_NONE) + { + /* clear outstanding indication */ + pIndCcb->outIndHandle = ATT_HANDLE_NONE; + + /* stop indication timer */ + WsfTimerStop(&pIndCcb->outIndTimer); + + /* call callback if flow control permits */ + if (!(pCcb->control & ATT_CCB_STATUS_FLOW_DISABLED)) + { + attsExecCallback(pCcb->connId, pIndCcb->pendIndHandle, ATT_SUCCESS); + pIndCcb->pendIndHandle = ATT_HANDLE_NONE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize ATT server for indications/notifications. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsIndInit(void) +{ + uint8_t i; + attsIndCcb_t *pCcb; + + /* Initialize control block CCBs */ + for (i = 0, pCcb = attsIndCb.ccb; i < DM_CONN_MAX; i++, pCcb++) + { + /* set pointer to main CCB */ + pCcb->pMainCcb = &attCb.ccb[i]; + + /* initialize timer */ + pCcb->outIndTimer.handlerId = attCb.handlerId; + pCcb->outIndTimer.msg.param = i + 1; /* param stores the conn id */ + } + + /* set up callback interface */ + attsCb.pInd = &attsIndFcnIf; +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol Handle Value Indication. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsHandleValueInd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue) +{ + attsHandleValueIndNtf(connId, handle, valueLen, pValue, ATT_PDU_VALUE_IND, FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol Handle Value Notification. + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsHandleValueNtf(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue) +{ + attsHandleValueIndNtf(connId, handle, valueLen, pValue, ATT_PDU_VALUE_NTF, FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol Handle Value Indication without copying the attribute + * value data. + * + * Note: attribute value buffer 'pValue' must be allocated with AttMsgAlloc(). + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsHandleValueIndZeroCpy(dmConnId_t connId, uint16_t handle, uint16_t valueLen, + uint8_t *pValue) +{ + attsHandleValueIndNtf(connId, handle, valueLen, pValue, ATT_PDU_VALUE_IND, TRUE); +} + +/*************************************************************************************************/ +/*! + * \brief Send an attribute protocol Handle Value Notification without copying the attribute + * value data. + * + * Note: attribute value buffer 'pValue' must be allocated with AttMsgAlloc(). + * + * \param connId DM connection ID. + * \param handle Attribute handle. + * \param valueLen Length of value data. + * \param pValue Pointer to value data. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsHandleValueNtfZeroCpy(dmConnId_t connId, uint16_t handle, uint16_t valueLen, + uint8_t *pValue) +{ + attsHandleValueIndNtf(connId, handle, valueLen, pValue, ATT_PDU_VALUE_NTF, TRUE); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.c new file mode 100644 index 0000000000000000000000000000000000000000..e39dacb5a97d1e39c38a1988c98f18a5b74a8cb4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.c @@ -0,0 +1,883 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server main module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "util/wstr.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" +#include "att_uuid.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* ATTS control block */ + +/************************************************************************************************** + Function Prototypes +**************************************************************************************************/ + +static void attsDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket); +static void attsConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt); +static void attsMsgCback(wsfMsgHdr_t *pMsg); +static void attsL2cCtrlCback(wsfMsgHdr_t *pMsg); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Interface to ATT */ +static const attFcnIf_t attsFcnIf = +{ + attsDataCback, + attsL2cCtrlCback, + (attMsgHandler_t) attsMsgCback, + attsConnCback +}; + +/* Minimum PDU lengths, indexed by method */ +static const uint8_t attsMinPduLen[] = +{ + 0, /* ATT_METHOD_ERR */ + ATT_MTU_REQ_LEN, /* ATT_METHOD_MTU */ + ATT_FIND_INFO_REQ_LEN, /* ATT_METHOD_FIND_INFO */ + ATT_FIND_TYPE_REQ_LEN, /* ATT_METHOD_FIND_TYPE */ + ATT_READ_TYPE_REQ_LEN, /* ATT_METHOD_READ_TYPE */ + ATT_READ_REQ_LEN, /* ATT_METHOD_READ */ + ATT_READ_BLOB_REQ_LEN, /* ATT_METHOD_READ_BLOB */ + ATT_READ_MULT_REQ_LEN + 4, /* ATT_METHOD_READ_MULTIPLE */ + ATT_READ_GROUP_TYPE_REQ_LEN, /* ATT_METHOD_READ_GROUP_TYPE */ + ATT_WRITE_REQ_LEN, /* ATT_METHOD_WRITE */ + ATT_WRITE_CMD_LEN, /* ATT_METHOD_WRITE_CMD */ + ATT_PREP_WRITE_REQ_LEN, /* ATT_METHOD_PREPARE_WRITE */ + ATT_EXEC_WRITE_REQ_LEN, /* ATT_METHOD_EXECUTE_WRITE */ + 0, /* ATT_METHOD_VALUE_NTF */ + 0, /* ATT_METHOD_VALUE_IND */ + ATT_VALUE_CNF_LEN, /* ATT_METHOD_VALUE_CNF */ + ATT_SIGNED_WRITE_CMD_LEN /* ATT_METHOD_SIGNED_WRITE_CMD */ +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* PDU processing function lookup table, indexed by method */ +attsProcFcn_t attsProcFcnTbl[ATT_METHOD_SIGNED_WRITE_CMD+1] = +{ + NULL, /* ATT_METHOD_ERR */ + attsProcMtuReq, /* ATT_METHOD_MTU */ + attsProcFindInfoReq, /* ATT_METHOD_FIND_INFO */ + attsProcFindTypeReq, /* ATT_METHOD_FIND_TYPE */ + attsProcReadTypeReq, /* ATT_METHOD_READ_TYPE */ + attsProcReadReq, /* ATT_METHOD_READ */ + attsProcReadBlobReq, /* ATT_METHOD_READ_BLOB */ + attsProcReadMultReq, /* ATT_METHOD_READ_MULT */ + attsProcReadGroupTypeReq, /* ATT_METHOD_READ_GROUP_TYPE */ + attsProcWrite, /* ATT_METHOD_WRITE */ + attsProcWrite, /* ATT_METHOD_WRITE_CMD */ + attsProcPrepWriteReq, /* ATT_METHOD_PREP_WRITE */ + attsProcExecWriteReq, /* ATT_METHOD_EXEC_WRITE */ + NULL, /* ATT_METHOD_VALUE_NTF */ + NULL, /* ATT_METHOD_VALUE_IND */ + attsProcValueCnf, /* ATT_METHOD_VALUE_CNF */ + NULL /* ATT_METHOD_SIGNED_WRITE_CMD */ +}; + +/* Control block */ +attsCb_t attsCb; + +/*************************************************************************************************/ +/*! + * \brief Data callback for ATTS. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t opcode; + uint8_t method; + uint8_t err; + attsProcFcn_t procFcn; + attCcb_t *pCcb; + uint16_t attHandle; + + /* get connection cb for this handle */ + if ((pCcb = attCcbByHandle(handle)) == NULL) + { + return; + } + + /* parse opcode */ + opcode = *(pPacket + L2C_PAYLOAD_START); + + /* get method */ + if ((opcode <= ATT_PDU_WRITE_REQ) || + ((opcode >= ATT_PDU_PREP_WRITE_REQ) && (opcode <= ATT_PDU_VALUE_CNF))) + { + method = ATT_OPCODE_2_METHOD(opcode); + } + else if (opcode == ATT_PDU_WRITE_CMD) + { + method = ATT_METHOD_WRITE_CMD; + } + else if (opcode == ATT_PDU_SIGNED_WRITE_CMD) + { + method = ATT_METHOD_SIGNED_WRITE_CMD; + } + else + { + method = ATT_METHOD_ERR; + } + + /* ignore packet if write response is pending. */ + if (pCcb->control & ATT_CCB_STATUS_RSP_PENDING) + { + if (method != ATT_METHOD_VALUE_CNF) + { + return; + } + } + + /* check client's status to see if server is allowed to process this PDU. */ + err = attsCsfActClientState(handle, opcode, pPacket); + if (err) + { + BYTES_TO_UINT16(attHandle, pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN); + } + else + { + attHandle = ATT_HANDLE_NONE; + } + +#if defined(ATTS_ERROR_TEST) && (ATTS_ERROR_TEST == TRUE) + if (attCb.errTest != ATT_SUCCESS) + { + BYTES_TO_UINT16(attHandle, pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN); + attsErrRsp(handle, opcode, attHandle, attCb.errTest); + return; + } +#endif + + /* if no error process request */ + if (!err) + { + /* look up processing function */ + procFcn = attsProcFcnTbl[method]; + + /* if method is supported */ + if (procFcn != NULL) + { + /* verify length */ + if (len >= attsMinPduLen[method]) + { + /* execute processing function */ + (*procFcn)(pCcb, len, pPacket); + err = 0; + } + else + { + /* invalid PDU length */ + err = ATT_ERR_INVALID_PDU; + } + } + else + { + /* PDU not supported */ + err = ATT_ERR_NOT_SUP; + } + } + + /* if there's an error and an error response can be sent for this opcode */ + if (err && (opcode != ATT_PDU_MTU_REQ) && (opcode != ATT_PDU_VALUE_CNF) && + ((opcode & ATT_PDU_MASK_COMMAND) == 0)) + { + attsErrRsp(handle, opcode, attHandle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Connection callback for ATTS. + * + * \param pCcb ATT control block. + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsConnCback(attCcb_t *pCcb, dmEvt_t *pDmEvt) +{ + /* if connection closed */ + if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* clear prepare write queue */ + attsClearPrepWrites(pCcb); + + /* stop service discovery idle timer, if running */ + if (DmConnCheckIdle(pCcb->connId) & DM_IDLE_ATTS_DISC) + { + WsfTimerStop(&pCcb->idleTimer); + } + } + + /* pass event to indication interface */ + (*attsCb.pInd->connCback)(pCcb, pDmEvt); +} + +/*************************************************************************************************/ +/*! + * \brief WSF message handler callback for ATTS. + * + * \param pMsg DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsMsgCback(wsfMsgHdr_t *pMsg) +{ + /* handle service discovery idle timeout */ + if (pMsg->event == ATTS_MSG_IDLE_TIMEOUT) + { + /* set channel as idle */ + DmConnSetIdle((dmConnId_t) pMsg->param, DM_IDLE_ATTS_DISC, DM_CONN_IDLE); + } + /* pass event to indication interface */ + else if (pMsg->event <= ATTS_MSG_IND_TIMEOUT) + { + (*attsCb.pInd->msgCback)(pMsg); + } + /* pass event to signed data interface */ + else if (pMsg->event == ATTS_MSG_SIGN_CMAC_CMPL) + { + (*attsCb.signMsgCback)(pMsg); + } + else if (pMsg->event == ATTS_MSG_DBH_CMAC_CMPL) + { + /* handle database hash update */ + attsProcessDatabaseHashUpdate((secCmacMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief L2C control callback for ATTS. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsL2cCtrlCback(wsfMsgHdr_t *pMsg) +{ + /* pass event to indication interface */ + (*attsCb.pInd->ctrlCback)(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send an error response PDU. + * + * \param handle The connection handle. + * \param opcode Opcode of the request that generated this error. + * \param attHandle Attribute handle in request, if applicable. + * \param reason Error reason. + * + * \return None. + */ +/*************************************************************************************************/ +void attsErrRsp(uint16_t handle, uint8_t opcode, uint16_t attHandle, uint8_t reason) +{ + uint8_t *pBuf; + uint8_t *p; + + /* allocate buffer */ + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_ERR_RSP_LEN)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_ERR_RSP); + UINT8_TO_BSTREAM(p, opcode); + UINT16_TO_BSTREAM(p, attHandle); + UINT8_TO_BSTREAM(p, reason); + + L2cDataReq(L2C_CID_ATT, handle, ATT_ERR_RSP_LEN, pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear the prepared write queue. + * + * \param pCcb ATT control block. + * + * \return None. + */ +/*************************************************************************************************/ +void attsClearPrepWrites(attCcb_t *pCcb) +{ + void *pBuf; + + while ((pBuf = WsfQueueDeq(&pCcb->prepWriteQueue)) != NULL) + { + WsfBufFree(pBuf); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set connection idle status to busy for service discovery. + * + * \param pCcb ATT control block. + * + * \return None. + */ +/*************************************************************************************************/ +void attsDiscBusy(attCcb_t *pCcb) +{ + if (pAttCfg->discIdleTimeout > 0) + { + /* set channel as busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_ATTS_DISC, DM_CONN_BUSY); + + /* start service discovery idle timer */ + pCcb->idleTimer.handlerId = attCb.handlerId; + pCcb->idleTimer.msg.event = ATTS_MSG_IDLE_TIMEOUT; + pCcb->idleTimer.msg.param = pCcb->connId; + WsfTimerStartSec(&pCcb->idleTimer, pAttCfg->discIdleTimeout); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process updated database hash. + * + * \param pMsg Event containing the new database hash. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcessDatabaseHashUpdate(secCmacMsg_t *pMsg) +{ + attEvt_t evt; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t dbhCharHandle; + + /* send to application */ + evt.hdr.event = ATTS_DB_HASH_CALC_CMPL_IND; + evt.hdr.status = ATT_SUCCESS; + evt.hdr.param = DM_CONN_ID_NONE; + + evt.valueLen = ATT_DATABASE_HASH_LEN; + evt.handle = ATT_HANDLE_NONE; + evt.continuing = FALSE; + evt.mtu = 0; + + /* free plain text buffer */ + if (pMsg->pPlainText != NULL) + { + WsfBufFree(pMsg->pPlainText); + pMsg->pPlainText = NULL; + } + + /* copy in little endian */ + evt.pValue = pMsg->pCiphertext; + + /* find GATT database handle */ + dbhCharHandle = attsFindUuidInRange(ATT_HANDLE_START, ATT_HANDLE_MAX, ATT_16_UUID_LEN, + (uint8_t *) attGattDbhChUuid, &pAttr, &pGroup); + + if (dbhCharHandle != ATT_HANDLE_NONE) + { + /* Set hash in service. */ + AttsSetAttr(dbhCharHandle, SEC_CMAC_HASH_LEN, evt.pValue); + } + + /* set hash update complete */ + attsCsfSetHashUpdateStatus(FALSE); + + attCb.cback(&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Check if any clients are pending on a new database hash value. + * + * \return None. + */ +/*************************************************************************************************/ +void attsCheckPendDbHashReadRsp(void) +{ + uint8_t i; + + for (i = 0; i < DM_CONN_MAX; i++) + { + attCcb_t *pCcb = &attCb.ccb[i]; + + if (pCcb->pPendDbHashRsp) + { + uint8_t *pBuf; + + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_TYPE_RSP); + + /* set length parameter in response message */ + UINT8_TO_BSTREAM(p, ATT_DATABASE_HASH_LEN + sizeof(uint16_t)); + + /* copy result to response message */ + UINT16_TO_BSTREAM(p, pCcb->pPendDbHashRsp->handle); + + if ((pAttr = attsFindByHandle(pCcb->pPendDbHashRsp->handle, &pGroup)) != NULL) + { + memcpy(p, pAttr->pValue, *pAttr->pLen); + p += *pAttr->pLen; + + L2cDataReq(L2C_CID_ATT, pCcb->handle, p - (pBuf + L2C_PAYLOAD_START), pBuf); + } + else + { + attsErrRsp(pCcb->connId, ATT_PDU_READ_TYPE_REQ, pCcb->pPendDbHashRsp->startHandle, ATT_ERR_NOT_FOUND); + } + } + else + { + attsErrRsp(pCcb->connId, ATT_PDU_READ_TYPE_REQ, pCcb->pPendDbHashRsp->startHandle, ATT_ERR_RESOURCES); + } + + /* Free pending state information. */ + WsfBufFree(pCcb->pPendDbHashRsp); + pCcb->pPendDbHashRsp = NULL; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Determine if attribute is hashable and return length of hashable data. + * + * \param pAttr Attribute to check for inclusion in hash. + * + * \return 0 if not hashable, else length of hashable data in bytes. + * + * \note Hashable attributes include Primary Service, Secondary Service, Included Service, + * Characteristic Declaration and Characteristic Extended Properties which contribute their + * ATT handle, ATT type and ATT value. Hashable attributes also include Characteristic User + * Description, Client Characteristic Configuration, Server Characteristic Configuration, + * Characteristic Format, and Characteristic Aggreate Format which contribute their ATT + * handle and ATT type. + */ +/*************************************************************************************************/ +uint16_t attsIsHashableAttr(attsAttr_t *pAttr) +{ + /* Initialize length to 2 for ATT Handle length */ + uint16_t length = 2; + uint16_t uuid; + static bool_t isAttrCharVal = FALSE; + + /* Characteristic values are skipped */ + if (isAttrCharVal) + { + isAttrCharVal = FALSE; + return 0; + } + + BYTES_TO_UINT16(uuid, pAttr->pUuid); + switch (uuid) + { + /* Top cases include Attribute Value length */ + case ATT_UUID_CHARACTERISTIC: + /* Set the next characteristic in database to be skipped */ + isAttrCharVal = TRUE; + /* Fallthrough */ + case ATT_UUID_PRIMARY_SERVICE: + case ATT_UUID_SECONDARY_SERVICE: + case ATT_UUID_INCLUDE: + case ATT_UUID_CHARACTERISTIC_EXT: + length += *pAttr->pLen; + /* Fallthrough */ + + /* All values fall through to include Attribute Type length */ + case ATT_UUID_CHAR_USER_DESC: + case ATT_UUID_CLIENT_CHAR_CONFIG: + case ATT_UUID_SERVER_CHAR_CONFIG: + case ATT_UUID_AGGREGATE_FORMAT: + if (pAttr->settings & ATTS_SET_UUID_128) + { + length += 16; + } + else + { + length += 2; + } + break; + + default: + length = 0; + break; + } + + return length; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize ATT server. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsInit(void) +{ + /* Initialize control block */ + WSF_QUEUE_INIT(&attsCb.groupQueue); + attsCb.pInd = &attFcnDefault; + attsCb.signMsgCback = (attMsgHandler_t) attEmptyHandler; + + /* set up callback interfaces */ + attCb.pServer = &attsFcnIf; +} + +/*************************************************************************************************/ +/*! + * \brief Register an authorization callback with the attribute server. + * + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsAuthorRegister(attsAuthorCback_t cback) +{ + attsCb.authorCback = cback; +} + +/*************************************************************************************************/ +/*! + * \brief Create hash from the database string. + * + * \param pKey Key for hashing. + * \param pMsg Plaintext to hash. + * \param msgLen Length of Plaintext data. + * + * \return \ref TRUE if successful, \ref FALSE if not. + */ +/*************************************************************************************************/ +bool_t AttsHashDatabaseString(uint8_t *pKey, uint8_t *pMsg, uint16_t msgLen) +{ + return SecCmac(pKey, pMsg, msgLen, attCb.handlerId, 0, ATTS_MSG_DBH_CMAC_CMPL); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate database hash from the GATT database. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsCalculateDbHash(void) +{ + attsAttr_t *pAttr; + uint16_t msgLen = 0; + uint8_t *pMsg, *p; + uint8_t hashingKey[16] = { 0, }; + + attsGroup_t *pGroup = (attsGroup_t *) attsCb.groupQueue.pHead; + + /* Determine length of message. */ + while (pGroup != NULL) + { + uint8_t numAttrs = (pGroup->endHandle - pGroup->startHandle) + 1; + + for (pAttr = pGroup->pAttr; numAttrs != 0; numAttrs--, pAttr++) + { + msgLen += attsIsHashableAttr(pAttr); + } + + pGroup = pGroup->pNext; + } + + /* Allocate buffer for message. */ + if ((pMsg = WsfBufAlloc(msgLen)) != NULL) + { + pGroup = (attsGroup_t *)attsCb.groupQueue.pHead; + p = pMsg; + + /* For each service in services */ + while (pGroup) + { + uint16_t attHandle = pGroup->startHandle; + + /* For each attribute in the service */ + for (pAttr = pGroup->pAttr; attHandle <= pGroup->endHandle; attHandle++, pAttr++) + { + uint16_t valLen; + uint8_t uuidLen = 2; + + valLen = attsIsHashableAttr(pAttr); + if (valLen) + { + /* Add handle */ + UINT16_TO_BSTREAM(p, attHandle); + + /* Add attribute type*/ + if (pAttr->settings & ATTS_SET_UUID_128) + { + memcpy(p, pAttr->pUuid, 16); + p += 16; + uuidLen = 16; + } + else + { + uint16_t uuid; + BYTES_TO_UINT16(uuid, pAttr->pUuid); + UINT16_TO_BSTREAM(p,uuid); + } + + /* Add Attribute value if required */ + if (valLen - (uuidLen + 2)) + { + memcpy(p, pAttr->pValue, *pAttr->pLen); + p += *pAttr->pLen; + } + } + } + + pGroup = pGroup->pNext; + } + + /* Send to CMAC */ + if (AttsHashDatabaseString(hashingKey, pMsg, msgLen)) + { + return; + } + } + + /* Assert on failure to initiate database hash generation. */ + WSF_ASSERT(FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Add an attribute group to the attribute server. + * + * \param pGroup Pointer to an attribute group structure. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsAddGroup(attsGroup_t *pGroup) +{ + attsGroup_t *pElem; + attsGroup_t *pPrev = NULL; + + /* task schedule lock */ + WsfTaskLock(); + + pElem = (attsGroup_t *) attsCb.groupQueue.pHead; + + /* iterate over queue sorted by increasing handle value */ + while (pElem != NULL) + { + if (pGroup->startHandle < pElem->startHandle) + { + break; + } + pPrev = pElem; + pElem = pElem->pNext; + } + + /* insert new group */ + WsfQueueInsert(&attsCb.groupQueue, pGroup, pPrev); + + /* set database hash update status to true until a new hash is generated */ + attsCsfSetHashUpdateStatus(TRUE); + + /* task schedule unlock */ + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Remove an attribute group from the attribute server. + * + * \param startHandle Start handle of attribute group to be removed. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsRemoveGroup(uint16_t startHandle) +{ + attsGroup_t *pElem; + attsGroup_t *pPrev = NULL; + + /* task schedule lock */ + WsfTaskLock(); + + pElem = (attsGroup_t *) attsCb.groupQueue.pHead; + + /* find group in queue */ + while (pElem != NULL) + { + if (pElem->startHandle == startHandle) + { + break; + } + pPrev = pElem; + pElem = pElem->pNext; + } + + /* if group found remove from queue */ + if (pElem != NULL) + { + WsfQueueRemove(&attsCb.groupQueue, pElem, pPrev); + } + else + { + ATT_TRACE_WARN1("AttsRemoveGroup start handle not found: 0x%04x", startHandle); + } + + /* set database hash update status to true until a new hash is generated */ + attsCsfSetHashUpdateStatus(TRUE); + + /* task schedule unlock */ + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set an attribute value in the attribute server. + * + * \param handle Attribute handle. + * \param valueLen Attribute length. + * \param pValue Attribute value. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +/*************************************************************************************************/ +uint8_t AttsSetAttr(uint16_t handle, uint16_t valueLen, uint8_t *pValue) +{ + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint8_t err = ATT_SUCCESS; + + WsfTaskLock(); + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* verify write length */ + if (valueLen > pAttr->maxLen) + { + err = ATT_ERR_LENGTH; + } + else + { + /* set attribute value */ + memcpy(pAttr->pValue, pValue, valueLen); + + /* set the length if variable length attribute */ + if ((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) + { + *(pAttr->pLen) = valueLen; + } + } + } + /* else attribute not found */ + else + { + err = ATT_ERR_NOT_FOUND; + } + + WsfTaskUnlock(); + + return err; +} + +/*************************************************************************************************/ +/*! + * \brief Get an attribute value in the attribute server. Tasks should be locked before + * calling this function and remain locked until pLen and pValue are no longer used. + * + * \param handle Attribute handle. + * \param pLen Returned attribute length pointer. + * \param pValue Returned attribute value pointer. + * + * \return ATT_SUCCESS if successful or other error code if failure. + */ +/*************************************************************************************************/ +uint8_t AttsGetAttr(uint16_t handle, uint16_t *pLen, uint8_t **pValue) +{ + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint8_t err = ATT_SUCCESS; + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* set length and value pointers */ + *pLen = *(pAttr->pLen); + *pValue = pAttr->pValue; + } + /* else attribute not found */ + else + { + err = ATT_ERR_NOT_FOUND; + } + + return err; +} + +/*************************************************************************************************/ +/*! + * \brief For testing purposes only. + * + * \param status ATT status + * + * \return None. + */ +/*************************************************************************************************/ +void AttsErrorTest(uint8_t status) +{ + attCb.errTest = status; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.h new file mode 100644 index 0000000000000000000000000000000000000000..bdc4a08f83e8b297238a6b751696601b1cfe74c0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_main.h @@ -0,0 +1,172 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server main module. + */ +/*************************************************************************************************/ +#ifndef ATTS_MAIN_H +#define ATTS_MAIN_H + +#include "wsf_queue.h" +#include "wsf_timer.h" +#include "att_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* ATTS event handler messages */ +enum +{ + ATTS_MSG_IDLE_TIMEOUT = ATTS_MSG_START, + ATTS_MSG_API_VALUE_IND_NTF, + ATTS_MSG_IND_TIMEOUT, + ATTS_MSG_SIGN_CMAC_CMPL, + ATTS_MSG_DBH_CMAC_CMPL +}; + +/*! + * Data buffer format for API request messages: + * + * | attsPktParam_t | ATT request data | + * | bytes 0 to 7 | bytes 8 - | + */ + +/* API parameters */ +typedef struct +{ + uint16_t len; + uint16_t handle; +} attsPktParam_t; + +/* verify attsPktParam_t will work in data buffer format described above */ +WSF_CT_ASSERT(sizeof(attsPktParam_t) <= L2C_PAYLOAD_START); + +/* API message structure */ +typedef struct +{ + wsfMsgHdr_t hdr; + attsPktParam_t *pPkt; +} attsApiMsg_t; + +/* Connection control block for indications/notifications */ +typedef struct +{ + wsfTimer_t outIndTimer; /* Outstanding indication timer */ + attCcb_t *pMainCcb; /* Pointer to ATT main CCB */ + uint16_t outIndHandle; /* Waiting for confirm from peer for this indication handle */ + uint16_t pendIndHandle; /* Callback to application pending for this indication handle */ + uint16_t pendNtfHandle[ATT_NUM_SIMUL_NTF]; /* Callback to application pending for this notification handle */ +} attsIndCcb_t; + +/* Control block for indications/notifications */ +typedef struct +{ + attsIndCcb_t ccb[DM_CONN_MAX]; +} attsIndCb_t; + +/* Client characteristic configuration descriptor callback type + * + * \param connId DM connection ID. + * \param method Read or write. + * \param handle Attribute handle of the descriptor. + * \param pValue Pointer to the attribute value of the descriptor. + * + * \return ATT_SUCCESS if successful otherwise error. + */ +typedef uint8_t (*attsCccFcn_t)(dmConnId_t connId, uint8_t method, uint16_t handle, uint8_t *pValue); + +/* Main control block of the ATTS subsystem */ +typedef struct +{ + wsfQueue_t groupQueue; /* Queue of attribute groups */ + attFcnIf_t const *pInd; /* Indication callback interface */ + attMsgHandler_t signMsgCback; /* Signed data callback interface */ + attsAuthorCback_t authorCback; /* Authorization callback */ + attsCccFcn_t cccCback; /* CCC callback */ +} attsCb_t; + +/* PDU processing function type */ +typedef void (*attsProcFcn_t)(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); + +/* CSF Control block */ +typedef struct +{ + attsCsfRec_t attsCsfTable[DM_CONN_MAX]; /* connected clients' supported features record table. */ + attsCsfWriteCback_t writeCback; /* Write callback. */ + uint8_t isHashUpdating; /* Database hash update status. */ +} attsCsfCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* PDU processing function lookup table, indexed by method */ +extern attsProcFcn_t attsProcFcnTbl[ATT_METHOD_SIGNED_WRITE_CMD+1]; + +/* Control block for indications/notifications */ +extern attsIndCb_t attsIndCb; + +/* Control block */ +extern attsCb_t attsCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void attsErrRsp(uint16_t handle, uint8_t opcode, uint16_t attHandle, uint8_t reason); +void attsClearPrepWrites(attCcb_t *pCcb); +bool_t attsUuidCmp(attsAttr_t *pAttr, uint8_t uuidLen, uint8_t *pUuid); +bool_t attsUuid16Cmp(uint8_t *pUuid16, uint8_t uuidLen, uint8_t *pUuid); +attsAttr_t *attsFindByHandle(uint16_t handle, attsGroup_t **pAttrGroup); +uint16_t attsFindInRange(uint16_t startHandle, uint16_t endHandle, attsAttr_t **pAttr); +uint16_t attsFindUuidInRange(uint16_t startHandle, uint16_t endHandle, uint8_t uuidLen, + uint8_t *pUuid, attsAttr_t **pAttr, attsGroup_t **pAttrGroup); +uint8_t attsPermissions(dmConnId_t connId, uint8_t permit, uint16_t handle, uint8_t permissions); +void attsDiscBusy(attCcb_t *pCcb); +void attsCheckPendDbHashReadRsp(void); +void attsProcessDatabaseHashUpdate(secCmacMsg_t *pMsg); +uint16_t attsIsHashableAttr(attsAttr_t *pAttr); + +void attsProcMtuReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcFindInfoReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcFindTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcReadTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcReadReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcReadBlobReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcReadMultReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcReadGroupTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcWrite(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcPrepWriteReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcExecWriteReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); +void attsProcValueCnf(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket); + +uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket); +uint8_t attsCsfIsClientChangeAware(dmConnId_t connId, uint16_t handle); +void attsCsfSetHashUpdateStatus(bool_t isUpdating); +uint8_t attsCsfGetHashUpdateStatus(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* ATTS_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_proc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_proc.c new file mode 100644 index 0000000000000000000000000000000000000000..360f13d46cc9e7ce973693ec0f096d9e3403691a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_proc.c @@ -0,0 +1,467 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server mandatory PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" + +/*************************************************************************************************/ +/*! + * \brief Compare the given attribute's UUID to the given UUID. + * + * \param pAttr Pointer to attribute. + * \param uuidLen UUID length, either 2 or 16. + * \param pUuid Pointer to UUID. + * + * \return TRUE of UUIDs match, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t attsUuidCmp(attsAttr_t *pAttr, uint8_t uuidLen, uint8_t *pUuid) +{ + /* if both uuids are the same length */ + if ((((pAttr->settings & ATTS_SET_UUID_128) == 0) && (uuidLen == ATT_16_UUID_LEN)) || + (((pAttr->settings & ATTS_SET_UUID_128) != 0) && (uuidLen == ATT_128_UUID_LEN))) + { + /* simply compare the data */ + return (memcmp(pAttr->pUuid, pUuid, uuidLen) == 0); + } + /* else we need to convert one of the uuids */ + else if (((pAttr->settings & ATTS_SET_UUID_128) == 0) && (uuidLen == ATT_128_UUID_LEN)) + { + return attUuidCmp16to128(pAttr->pUuid, pUuid); + } + else + { + return attUuidCmp16to128(pUuid, pAttr->pUuid); + } +} + +/*************************************************************************************************/ +/*! + * \brief Compare the given 16 bit UUID to the given UUID. + * + * \param pUuid16 Pointer to the 16 bit UUID. + * \param uuidLen UUID length, either 2 or 16. + * \param pUuid Pointer to UUID. + * + * \return TRUE of UUIDs match, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t attsUuid16Cmp(uint8_t *pUuid16, uint8_t uuidLen, uint8_t *pUuid) +{ + if (uuidLen == ATT_16_UUID_LEN) + { + return ((pUuid16[0] == pUuid[0]) && (pUuid16[1] == pUuid[1])); + } + else + { + return attUuidCmp16to128(pUuid16, pUuid); + } +} + +/*************************************************************************************************/ +/*! + * \brief Find an attribute with the given handle. + * + * \param handle Attribute handle. + * \param pAttrGroup Return value pointer to found attribute's group. + * + * \return Pointer to attribute if found, othewise NULL. + */ +/*************************************************************************************************/ +attsAttr_t *attsFindByHandle(uint16_t handle, attsGroup_t **pAttrGroup) +{ + attsGroup_t *pGroup; + + /* iterate over attribute group list */ + for (pGroup = attsCb.groupQueue.pHead; pGroup != NULL; pGroup = pGroup->pNext) + { + /* if start handle within handle range of group */ + if ((handle >= pGroup->startHandle) && (handle <= pGroup->endHandle)) + { + /* index by handle into attribute array to return attribute */ + *pAttrGroup = pGroup; + return &pGroup->pAttr[handle - pGroup->startHandle]; + } + } + + /* handle not found */ + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Find the first attribute within the given handle range. + * + * \param startHandle Starting attribute handle. + * \param endHandle Ending attribute handle. + * \param pAttr Return value pointer to found attribute. + * + * \return Attribute handle or ATT_HANDLE_NONE if not found. + */ +/*************************************************************************************************/ +uint16_t attsFindInRange(uint16_t startHandle, uint16_t endHandle, attsAttr_t **pAttr) +{ + attsGroup_t *pGroup; + + /* iterate over attribute group list */ + for (pGroup = attsCb.groupQueue.pHead; pGroup != NULL; pGroup = pGroup->pNext) + { + /* if start handle is less than group start handle but handle range is within group */ + if ((startHandle < pGroup->startHandle) && (endHandle >= pGroup->startHandle)) + { + /* set start handle to first handle in group */ + startHandle = pGroup->startHandle; + } + + /* if start handle within handle range of group */ + if ((startHandle >= pGroup->startHandle) && (startHandle <= pGroup->endHandle)) + { + /* index by handle into attribute array to return attribute */ + *pAttr = &pGroup->pAttr[startHandle - pGroup->startHandle]; + return startHandle; + } + } + + /* handle within range not found */ + return ATT_HANDLE_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Perform required permission and security checks when reading or writing an attribute. + * + * \param connId Connection ID. + * \param permit Either ATTS_PERMIT_READ or ATTS_PERMIT_WRITE. + * \param handle Attribute handle. + * \param permissions Attribute permissions. + * + * \return ATT_SUCCESS if successful or error code on failure. + */ +/*************************************************************************************************/ +uint8_t attsPermissions(dmConnId_t connId, uint8_t permit, uint16_t handle, uint8_t permissions) +{ + uint8_t secLevel; + + /* verify read or write permissions */ + if (!(permissions & permit)) + { + return (permit == ATTS_PERMIT_READ) ? ATT_ERR_READ : ATT_ERR_WRITE; + } + + /* convert write permissions to read permissions for easier masking */ + if (permit == ATTS_PERMIT_WRITE) + { + permissions >>= 4; + } + + /* if no security requirements return quickly */ + if ((permissions & (ATTS_PERMIT_READ_AUTH | ATTS_PERMIT_READ_AUTHORIZ | ATTS_PERMIT_READ_ENC)) == 0) + { + return ATT_SUCCESS; + } + + /* get security level for this connection */ + secLevel = DmConnSecLevel(connId); + + /* check if encryption required */ + if ((permissions & ATTS_PERMIT_READ_ENC) && (secLevel == DM_SEC_LEVEL_NONE)) + { + return ATT_ERR_AUTH; + } + + /* check if encryption required with authenticated key */ + if (((permissions & (ATTS_PERMIT_READ_AUTH | ATTS_PERMIT_READ_ENC)) == + (ATTS_PERMIT_READ_AUTH | ATTS_PERMIT_READ_ENC)) && (secLevel < DM_SEC_LEVEL_ENC_AUTH)) + { + return ATT_ERR_AUTH; + } + + /* authorization check */ + if (permissions & ATTS_PERMIT_READ_AUTHORIZ) + { + if (attsCb.authorCback == NULL) + { + return ATT_ERR_AUTHOR; + } + else + { + return (*attsCb.authorCback)(connId, permit, handle); + } + } + else + { + return ATT_SUCCESS; + } +} + +/*************************************************************************************************/ +/*! + * \brief Process an MTU request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcMtuReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *p; + uint16_t mtu; + uint16_t localMtu; + uint8_t *pRsp; + + p = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + + /* parse mtu */ + BYTES_TO_UINT16(mtu, p); + + /* verify */ + if (mtu < ATT_DEFAULT_MTU) + { + mtu = ATT_DEFAULT_MTU; + } + + /* get desired MTU */ + localMtu = WSF_MIN(pAttCfg->mtu, (HciGetMaxRxAclLen() - L2C_HDR_LEN)); + + /* send response */ + if ((pRsp = attMsgAlloc(L2C_PAYLOAD_START + ATT_MTU_RSP_LEN)) != NULL) + { + p = pRsp + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_MTU_RSP); + UINT16_TO_BSTREAM(p, localMtu); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, ATT_MTU_RSP_LEN, pRsp); + } + + /* set mtu for the connection */ + attSetMtu(pCcb, mtu, localMtu); +} + +/*************************************************************************************************/ +/*! + * \brief Process a find information request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcFindInfoReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + uint16_t startHandle; + uint16_t endHandle; + uint16_t handle; + uint8_t err = ATT_SUCCESS; + + /* parse handles */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(startHandle, pPacket); + BSTREAM_TO_UINT16(endHandle, pPacket); + + /* verify handles */ + if ((startHandle == 0) || (startHandle > endHandle)) + { + err = ATT_ERR_HANDLE; + } + + if (!err) + { + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_FIND_INFO_RSP); + + /* set result format */ + UINT8_TO_BSTREAM(p, ATT_FIND_HANDLE_16_UUID); + + /* find attributes within handle range */ + handle = startHandle; + while ((handle = attsFindInRange(handle, endHandle, &pAttr)) != ATT_HANDLE_NONE) + { + /* copy handle and UUID into response buffer */ + + /* if 128 bit UUID */ + if (pAttr->settings & ATTS_SET_UUID_128) + { + /* if this is the first result */ + if (p == (pBuf + L2C_PAYLOAD_START + 2)) + { + p--; + UINT8_TO_BSTREAM(p, ATT_FIND_HANDLE_128_UUID); + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pAttr->pUuid, ATT_128_UUID_LEN); + p += ATT_128_UUID_LEN; + } + break; + } + /* else 16 bit UUID */ + else + { + /* check if result fits */ + if ((p + ATT_16_UUID_LEN + sizeof(uint16_t)) <= + (pBuf + pCcb->mtu + L2C_PAYLOAD_START)) + { + /* copy result */ + UINT16_TO_BSTREAM(p, handle); + UINT8_TO_BSTREAM(p, pAttr->pUuid[0]); + UINT8_TO_BSTREAM(p, pAttr->pUuid[1]); + } + else + { + /* response buffer full, we're done */ + break; + } + } + + /* special case of handle at max range */ + if (handle == ATT_HANDLE_MAX) + { + break; + } + + /* try next handle */ + if (++handle > endHandle) + { + break; + } + } + + /* if no results found set error, free buffer */ + if (p == (pBuf + L2C_PAYLOAD_START + 2)) + { + WsfMsgFree(pBuf); + err = ATT_ERR_NOT_FOUND; + } + } + else + { + /* buffer allocation failed */ + err = ATT_ERR_RESOURCES; + } + } + + /* set channel as busy for service discovery */ + attsDiscBusy(pCcb); + + /* if no error send response, else send error */ + if (!err) + { + L2cDataReq(L2C_CID_ATT, pCcb->handle, (p - (pBuf + L2C_PAYLOAD_START)), pBuf); + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_FIND_INFO_REQ, startHandle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a read request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcReadReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t handle; + uint16_t readLen; + uint8_t err = ATT_SUCCESS; + + /* parse handle */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(handle, pPacket); + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* verify permissions */ + if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions)) == ATT_SUCCESS) + { + /* call read callback if desired */ + if ((pAttr->settings & ATTS_SET_READ_CBACK) && + (pGroup->readCback != NULL)) + { + err = (*pGroup->readCback)(pCcb->connId, handle, ATT_PDU_READ_REQ, 0, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_READ, handle, pAttr->pValue); + } + + if (err == ATT_SUCCESS) + { + /* determine length of data to read */ + readLen = (*pAttr->pLen < (pCcb->mtu - ATT_READ_RSP_LEN)) ? + *pAttr->pLen : (pCcb->mtu - ATT_READ_RSP_LEN); + + /* Allocate response buffer */ + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_READ_RSP_LEN + readLen)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_RSP); + memcpy(p, pAttr->pValue, readLen); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, (ATT_READ_RSP_LEN + readLen), pBuf); + } + } + } + } + /* else invalid handle */ + else + { + err = ATT_ERR_HANDLE; + } + + if (err) + { + attsErrRsp(pCcb->handle, ATT_PDU_READ_REQ, handle, err); + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_read.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_read.c new file mode 100644 index 0000000000000000000000000000000000000000..aa7620d26bbc3b9f71874af989a53d505a121c68 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_read.c @@ -0,0 +1,831 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server optional read PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_buf.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" + +/*************************************************************************************************/ +/*! + * \brief Find the first attribute within the given handle range with a matching UUID. + * + * \param startHandle Starting attribute handle. + * \param endHandle Ending attribute handle. + * \param uuidLen UUID length, either 2 or 16. + * \param pUUID Pointer to UUID. + * \param pAttr Return value pointer to found attribute. + * \param pAttrGroup Return value pointer to found attribute's group. + * + * \return Attribute handle or ATT_HANDLE_NONE if not found. + */ +/*************************************************************************************************/ +uint16_t attsFindUuidInRange(uint16_t startHandle, uint16_t endHandle, uint8_t uuidLen, + uint8_t *pUuid, attsAttr_t **pAttr, attsGroup_t **pAttrGroup) +{ + attsGroup_t *pGroup; + + /* iterate over attribute group list */ + for (pGroup = attsCb.groupQueue.pHead; pGroup != NULL; pGroup = pGroup->pNext) + { + /* if start handle is less than group start handle but handle range is within group */ + if ((startHandle < pGroup->startHandle) && (endHandle >= pGroup->startHandle)) + { + /* set start handle to first handle in group */ + startHandle = pGroup->startHandle; + } + + /* if start handle within handle range of group */ + if ((startHandle >= pGroup->startHandle) && (startHandle <= pGroup->endHandle)) + { + /* compare uuid with each attribute in group */ + *pAttr = &pGroup->pAttr[startHandle - pGroup->startHandle]; + while ((startHandle <= pGroup->endHandle) && (startHandle <= endHandle)) + { + /* compare uuid in attribute */ + if (attsUuidCmp(*pAttr, uuidLen, pUuid)) + { + *pAttrGroup = pGroup; + return startHandle; + } + + /* special case of max handle value */ + if (startHandle == ATT_HANDLE_MAX) + { + break; + } + + startHandle++; + (*pAttr)++; + } + } + } + + /* no match found */ + return ATT_HANDLE_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Find the handle of the last attribute in a service group. + * + * \param startHandle Starting attribute handle of service. + * + * \return Service group end handle. + */ +/*************************************************************************************************/ +uint16_t attsFindServiceGroupEnd(uint16_t startHandle) +{ + attsGroup_t *pGroup; + attsAttr_t *pAttr; + uint16_t prevHandle; + uint8_t primSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PRIMARY_SERVICE)}; + uint8_t secSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_SECONDARY_SERVICE)}; + + /* special case for max handle */ + if (startHandle == ATT_HANDLE_MAX) + { + return ATT_HANDLE_MAX; + } + + prevHandle = startHandle; + startHandle++; + + /* iterate over attribute group list */ + for (pGroup = attsCb.groupQueue.pHead; pGroup != NULL; pGroup = pGroup->pNext) + { + /* if start handle is less than group start handle */ + if (startHandle < pGroup->startHandle) + { + /* set start handle to first handle in group */ + startHandle = pGroup->startHandle; + } + + /* if start handle within handle range of group */ + if (startHandle <= pGroup->endHandle) + { + /* compare uuid with each attribute in group */ + pAttr = &pGroup->pAttr[startHandle - pGroup->startHandle]; + while (startHandle <= pGroup->endHandle) + { + /* compare uuid in attribute to service uuids */ + if (attsUuidCmp(pAttr, ATT_16_UUID_LEN, primSvcUuid) || + attsUuidCmp(pAttr, ATT_16_UUID_LEN, secSvcUuid)) + { + /* found next service; return handle of previous attribute */ + return prevHandle; + } + + /* special case of max handle value */ + if (startHandle == ATT_HANDLE_MAX) + { + return ATT_HANDLE_MAX; + } + + prevHandle = startHandle; + startHandle++; + pAttr++; + } + } + } + + /* next service not found; return 0xFFFF as the last handle in the database */ + return ATT_HANDLE_MAX; +} +/*************************************************************************************************/ +/*! + * \brief Process a read blob request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcReadBlobReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t handle; + uint16_t offset; + uint16_t readLen; + uint8_t err = ATT_SUCCESS; + + /* parse handle and offset */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(handle, pPacket); + BSTREAM_TO_UINT16(offset, pPacket); + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* verify permissions */ + if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + /* err has been set; fail */ + } + /* verify offset */ + else if (offset > *pAttr->pLen) + { + err = ATT_ERR_OFFSET; + } + else + { + /* call read callback if desired */ + if ((pAttr->settings & ATTS_SET_READ_CBACK) && + (pGroup->readCback != NULL)) + { + err = (*pGroup->readCback)(pCcb->connId, handle, ATT_PDU_READ_BLOB_REQ, offset, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_READ, handle, pAttr->pValue); + } + + if (err == ATT_SUCCESS) + { + /* determine length of data to read */ + readLen = ((*pAttr->pLen - offset) < (pCcb->mtu - ATT_READ_BLOB_RSP_LEN)) ? + (*pAttr->pLen - offset) : (pCcb->mtu - ATT_READ_BLOB_RSP_LEN); + + /* Allocate response buffer */ + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_READ_BLOB_RSP_LEN + readLen)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_BLOB_RSP); + memcpy(p, (pAttr->pValue + offset), readLen); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, (ATT_READ_BLOB_RSP_LEN + readLen), pBuf); + } + } + } + } + /* else invalid handle */ + else + { + err = ATT_ERR_HANDLE; + } + + if (err) + { + attsErrRsp(pCcb->handle, ATT_PDU_READ_BLOB_REQ, handle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a find by type value request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcFindTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + uint8_t *pUuid; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t startHandle; + uint16_t endHandle; + uint16_t handle; + uint16_t nextHandle; + uint8_t err = ATT_SUCCESS; + + /* parse handles and uuid; pPacket then points to the value in the request */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(startHandle, pPacket); + BSTREAM_TO_UINT16(endHandle, pPacket); + pUuid = pPacket; + pPacket += ATT_16_UUID_LEN; + + /* set len to the value length */ + len -= ATT_FIND_TYPE_REQ_LEN; + + /* verify handles */ + if ((startHandle == 0) || (startHandle > endHandle)) + { + err = ATT_ERR_HANDLE; + } + + if (!err) + { + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_FIND_TYPE_RSP); + + /* find attributes with matching uuid within handle range */ + handle = startHandle; + while ((handle = attsFindUuidInRange(handle, endHandle, ATT_16_UUID_LEN, + pUuid, &pAttr, &pGroup)) != ATT_HANDLE_NONE) + { + /* if value and length matches */ + if ((pAttr->permissions & ATTS_PERMIT_READ) && + ((len == 0) || + ((len == *pAttr->pLen) && (memcmp(pPacket, pAttr->pValue, len) == 0)))) + { + /* if uuid in request is for primary service */ + if (pUuid[0] == UINT16_TO_BYTE0(ATT_UUID_PRIMARY_SERVICE) && + pUuid[1] == UINT16_TO_BYTE1(ATT_UUID_PRIMARY_SERVICE)) + { + /* next handle is service group end handle */ + nextHandle = attsFindServiceGroupEnd(handle); + } + else + { + /* for any other uuid next handle is same as found handle */ + nextHandle = handle; + } + + /* copy result into response buffer; first check if it fits */ + if ((p + (sizeof(uint16_t) * 2)) <= (pBuf + pCcb->mtu + L2C_PAYLOAD_START)) + { + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, nextHandle); + } + else + { + /* buffer full, we're done */ + break; + } + } + /* value doesn't match; still need to set next handle */ + else + { + nextHandle = handle; + } + + /* check if handle has reached end */ + if ((nextHandle >= endHandle) || (nextHandle == ATT_HANDLE_MAX)) + { + break; + } + + /* try next handle */ + handle = nextHandle + 1; + } + + /* if no results found set error, free buffer */ + if (p == (pBuf + L2C_PAYLOAD_START + 1)) + { + WsfMsgFree(pBuf); + err = ATT_ERR_NOT_FOUND; + } + } + else + { + /* buffer allocation failed */ + err = ATT_ERR_RESOURCES; + } + } + + /* set channel as busy for service discovery */ + attsDiscBusy(pCcb); + + /* if no error send response, else send error */ + if (!err) + { + L2cDataReq(L2C_CID_ATT, pCcb->handle, (p - (pBuf + L2C_PAYLOAD_START)), pBuf); + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_FIND_TYPE_REQ, startHandle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a read by type request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcReadTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t startHandle; + uint16_t endHandle; + uint16_t handle; + uint8_t uuidLen; + uint8_t attLen; + uint8_t cbackErr = ATT_SUCCESS; + uint8_t err = ATT_SUCCESS; + + /* parse handles; pPacket then points to the uuid */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(startHandle, pPacket); + BSTREAM_TO_UINT16(endHandle, pPacket); + + /* get and verify uuid length */ + uuidLen = len - ATT_READ_TYPE_REQ_LEN; + if (!((uuidLen == ATT_16_UUID_LEN) || (uuidLen == ATT_128_UUID_LEN))) + { + err = ATT_ERR_INVALID_PDU; + } + /* verify handles */ + else if ((startHandle == 0) || (startHandle > endHandle)) + { + err = ATT_ERR_HANDLE; + } + + if (!err) + { + /* find first attribute with matching uuid within handle range */ + handle = attsFindUuidInRange(startHandle, endHandle, uuidLen, pPacket, &pAttr, &pGroup); + startHandle = handle; + + if (handle == ATT_HANDLE_NONE) + { + err = ATT_ERR_NOT_FOUND; + } + /* check permissions */ + else if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + /* err is set above */ + } + /* check if read callback should be called */ + else if ((pAttr->settings & ATTS_SET_READ_CBACK) && + (pGroup->readCback != NULL)) + { + err = (*pGroup->readCback)(pCcb->connId, handle, ATT_PDU_READ_TYPE_REQ, 0, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_READ, handle, pAttr->pValue); + } + + if (err == ATT_SUCCESS) + { + /* Check if UUID is the Database Hash Characteristic Value and the value is being + * re-calculated + */ + if ((memcmp(pPacket, attGattDbhChUuid, ATT_16_UUID_LEN) == 0) && attsCsfGetHashUpdateStatus()) + { + /* Store info and return */ + pCcb->pPendDbHashRsp = WsfBufAlloc(sizeof(attPendDbHashRsp_t)); + if (pCcb->pPendDbHashRsp) + { + pCcb->pPendDbHashRsp->startHandle = startHandle; + pCcb->pPendDbHashRsp->handle = handle; + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_READ_TYPE_REQ, startHandle, ATT_ERR_RESOURCES); + } + + return; + } + + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_TYPE_RSP); + + /* get length of this first attribute */ + attLen = (*pAttr->pLen < (pCcb->mtu - ATT_READ_TYPE_RSP_LEN - sizeof(uint16_t))) ? + *pAttr->pLen : (pCcb->mtu - ATT_READ_TYPE_RSP_LEN - sizeof(uint16_t)); + + /* set length parameter in response message */ + UINT8_TO_BSTREAM(p, attLen + sizeof(uint16_t)); + + /* copy result to response message */ + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pAttr->pValue, attLen); + p += attLen; + + /* look for additional attributes */ + handle++; + while ((handle = attsFindUuidInRange(handle, endHandle, uuidLen, + pPacket, &pAttr, &pGroup)) != ATT_HANDLE_NONE) + { + /* call read callback if desired */ + if ((pAttr->settings & ATTS_SET_READ_CBACK) && + (pGroup->readCback != NULL)) + { + cbackErr = (*pGroup->readCback)(pCcb->connId, handle, ATT_PDU_READ_TYPE_REQ, 0, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + cbackErr = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_READ, handle, pAttr->pValue); + } + + /* verify no error from read callback + * verify length is same as first found attribute + * verify attribute permissions + */ + if ((cbackErr == ATT_SUCCESS) && + (*pAttr->pLen == attLen) && + (attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions) == ATT_SUCCESS)) + { + /* copy result into response buffer; first check if it fits */ + if ((p + attLen + sizeof(uint16_t)) <= (pBuf + pCcb->mtu + L2C_PAYLOAD_START)) + { + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pAttr->pValue, attLen); + p += attLen; + } + else + { + /* buffer full, we're done */ + break; + } + } + else + { + /* problem with read callback, length, or permissions; send what we've got so far */ + break; + } + + /* special case of handle at max range */ + if (handle == ATT_HANDLE_MAX) + { + break; + } + + /* try next handle */ + if (++handle > endHandle) + { + break; + } + } + } + else + { + /* buffer allocation failed */ + err = ATT_ERR_RESOURCES; + } + } + } + + /* if no error send response, else send error */ + if (!err) + { + L2cDataReq(L2C_CID_ATT, pCcb->handle, (p - (pBuf + L2C_PAYLOAD_START)), pBuf); + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_READ_TYPE_REQ, startHandle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a read multiple request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcReadMultReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + uint8_t *pEnd; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t handle = ATT_HANDLE_NONE; + uint16_t readLen; + uint8_t err = ATT_SUCCESS; + + /* points to end of payload */ + pEnd = pPacket + L2C_PAYLOAD_START + len; + + /* points to first handle */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_MULT_RSP); + + /* while there are handles remaining and there is space in response buffer */ + while (pPacket < pEnd) + { + /* parse handle */ + BSTREAM_TO_UINT16(handle, pPacket); + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) == NULL) + { + err = ATT_ERR_HANDLE; + break; + } + + /* verify permissions */ + if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + break; + } + + /* call read callback if desired */ + if ((pAttr->settings & ATTS_SET_READ_CBACK) && + (pGroup->readCback != NULL)) + { + err = (*pGroup->readCback)(pCcb->connId, handle, ATT_PDU_READ_MULT_REQ, 0, pAttr); + if (err != ATT_SUCCESS) + { + break; + } + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_READ, handle, pAttr->pValue); + if (err != ATT_SUCCESS) + { + break; + } + } + + if (p < (pBuf + pCcb->mtu + L2C_PAYLOAD_START)) + { + /* calculate remaining space in response buffer */ + readLen = (pBuf + pCcb->mtu + L2C_PAYLOAD_START) - p; + + /* actual length is minimum of remaining space and attribute length */ + readLen = (*pAttr->pLen < readLen) ? *pAttr->pLen : readLen; + + /* copy attribute to response buffer */ + memcpy(p, pAttr->pValue, readLen); + p += readLen; + } + } + } + else + { + /* buffer allocation failed */ + err = ATT_ERR_RESOURCES; + } + + /* if no error send response, else send error */ + if (!err) + { + L2cDataReq(L2C_CID_ATT, pCcb->handle, (p - (pBuf + L2C_PAYLOAD_START)), pBuf); + } + else + { + /* discard response buffer */ + if (pBuf != NULL) + { + WsfMsgFree(pBuf); + } + + attsErrRsp(pCcb->handle, ATT_PDU_READ_MULT_REQ, handle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a read group by type request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcReadGroupTypeReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf = NULL; + uint8_t *p = NULL; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint16_t startHandle; + uint16_t endHandle; + uint16_t handle; + uint8_t uuidLen; + uint8_t attLen; + uint8_t err = ATT_SUCCESS; + uint8_t primSvcUuid[ATT_16_UUID_LEN] = {UINT16_TO_BYTES(ATT_UUID_PRIMARY_SERVICE)}; + + /* parse handles; pPacket then points to the uuid */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(startHandle, pPacket); + BSTREAM_TO_UINT16(endHandle, pPacket); + + /* get and verify uuid length */ + uuidLen = len - ATT_READ_GROUP_TYPE_REQ_LEN; + if (!((uuidLen == ATT_16_UUID_LEN) || (uuidLen == ATT_128_UUID_LEN))) + { + err = ATT_ERR_INVALID_PDU; + } + /* verify handles */ + else if ((startHandle == 0) || (startHandle > endHandle)) + { + err = ATT_ERR_HANDLE; + } + /* verify uuid is primary service group */ + else if (!attsUuid16Cmp(primSvcUuid, uuidLen, pPacket)) + { + err = ATT_ERR_GROUP_TYPE; + } + + if (!err) + { + /* find first attribute with matching uuid within handle range */ + handle = attsFindUuidInRange(startHandle, endHandle, uuidLen, pPacket, &pAttr, &pGroup); + + if (handle == ATT_HANDLE_NONE) + { + err = ATT_ERR_NOT_FOUND; + } + /* check permissions */ + else if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + startHandle = handle; /* this handle is returned in error response */ + } + else + { + /* allocate max size buffer for response */ + if ((pBuf = attMsgAlloc(pCcb->mtu + L2C_PAYLOAD_START)) != NULL) + { + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_READ_GROUP_TYPE_RSP); + + /* get length of this first attribute */ + attLen = (*pAttr->pLen < (pCcb->mtu - ATT_READ_GROUP_TYPE_RSP_LEN - (2 * sizeof(uint16_t)))) ? + *pAttr->pLen : (pCcb->mtu - ATT_READ_GROUP_TYPE_RSP_LEN - (2 * sizeof(uint16_t))); + + /* set length parameter in response message */ + UINT8_TO_BSTREAM(p, attLen + (2 * sizeof(uint16_t))); + + /* copy handle to response message */ + UINT16_TO_BSTREAM(p, handle); + + /* get end group handle and copy it to response message */ + handle = attsFindServiceGroupEnd(handle); + UINT16_TO_BSTREAM(p, handle); + + /* copy the attribute value to response message */ + memcpy(p, pAttr->pValue, attLen); + p += attLen; + + /* look for additional attributes */ + while (TRUE) + { + /* special case of handle at max range */ + if (handle == ATT_HANDLE_MAX) + { + break; + } + + /* increment to next handle */ + if (++handle > endHandle) + { + break; + } + + /* find next matching handle */ + if ((handle = attsFindUuidInRange(handle, endHandle, uuidLen, + pPacket, &pAttr, &pGroup)) == ATT_HANDLE_NONE) + { + break; + } + + /* verify length is same as first found attribute + * verify attribute permissions + */ + if ((*pAttr->pLen == attLen) && + (attsPermissions(pCcb->connId, ATTS_PERMIT_READ, + handle, pAttr->permissions) == ATT_SUCCESS)) + { + /* copy result into response buffer; first check if it fits */ + if ((p + attLen + (2 * sizeof(uint16_t))) <= + (pBuf + pCcb->mtu + L2C_PAYLOAD_START)) + { + UINT16_TO_BSTREAM(p, handle); + handle = attsFindServiceGroupEnd(handle); + UINT16_TO_BSTREAM(p, handle); + memcpy(p, pAttr->pValue, attLen); + p += attLen; + } + else + { + /* buffer full, we're done */ + break; + } + } + else + { + /* problem with either length or permissions; send what we've got so far */ + break; + } + } + } + else + { + /* buffer allocation failed */ + err = ATT_ERR_RESOURCES; + } + } + } + + /* set channel as busy for service discovery */ + attsDiscBusy(pCcb); + + /* if no error send response, else send error */ + if (!err) + { + L2cDataReq(L2C_CID_ATT, pCcb->handle, (p - (pBuf + L2C_PAYLOAD_START)), pBuf); + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_READ_GROUP_TYPE_REQ, startHandle, err); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_sign.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_sign.c new file mode 100644 index 0000000000000000000000000000000000000000..9c0dc8378e406328b939ffb2b0ce7afcd7fe785d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_sign.c @@ -0,0 +1,400 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server signed PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_queue.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" +#include "att_sign.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Signed data buffer structure */ +typedef struct attsSignBuf_tag +{ + struct attsSignBuf_tag *pNext; /* pointer to next in queue */ + attCcb_t *pCcb; /* ATT CCB associated with the packet */ + uint16_t handle; /* ATT handle */ + uint16_t writeLen; /* length of data to write */ + dmConnId_t connId; /* Connection ID associated with the packet */ + uint8_t packet[1]; /* packet */ +} attsSignBuf_t; + +/* ATTS signed PDU connection control block */ +typedef struct +{ + uint32_t signCounter; /* sign counter for this connection */ + uint8_t *pCsrk; /* signing key for this connection */ + attsSignBuf_t *pBuf; /* current data being processed */ + bool_t authenticated; /* Indicate if the CSRK is authenticated or not */ +} attsSignCcb_t; + +/* ATTS signed PDU control block */ +typedef struct +{ + attsSignCcb_t ccb[DM_CONN_MAX]; + wsfQueue_t msgQueue; +} attsSignCb_t; + + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Control block */ +static attsSignCb_t attsSignCb; + +/*************************************************************************************************/ +/*! + * \brief Return the signing connection control block for the connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to control block. + */ +/*************************************************************************************************/ +static attsSignCcb_t *attsSignCcbByConnId(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return &attsSignCb.ccb[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Start processing of data for signed write. + * + * \param pCcb Signed data CCB. + * \param pBuf Signed data buffer structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsSignedWriteStart(attsSignCcb_t *pCcb, attsSignBuf_t *pBuf) +{ + if (pCcb->pCsrk != NULL) + { + uint16_t cmacTxtLen = pBuf->writeLen + ATT_WRITE_CMD_LEN + sizeof(uint32_t); + uint8_t *pCmacTxt = WsfBufAlloc(cmacTxtLen); + + pCcb->pBuf = pBuf; + + if (pCmacTxt) + { + uint8_t revPeerCsrk[SEC_CMAC_KEY_LEN] = {0}; + + WStrReverseCpy(revPeerCsrk, pCcb->pCsrk, SEC_CMAC_KEY_LEN); + WStrReverseCpy(pCmacTxt, pBuf->packet, cmacTxtLen); + + if (SecCmac(revPeerCsrk, pCmacTxt, cmacTxtLen, attCb.handlerId, + pBuf->connId, ATTS_MSG_SIGN_CMAC_CMPL)) + { + return; + } + + WsfBufFree(pCmacTxt); + } + } + + /* no CSRK-- free buffer */ + WsfBufFree(pBuf); + ATT_TRACE_WARN0("ATTS CSRK not set"); +} + +/*************************************************************************************************/ +/*! + * \brief Process a signed write command PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsProcSignedWrite(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + attsSignCcb_t *pSignCcb; + attsSignBuf_t *pBuf; + uint16_t handle; + uint16_t writeLen; + + /* parse handle, calculate write length */ + p = pPacket + L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(handle, p); + writeLen = len - ATT_SIGNED_WRITE_CMD_LEN; + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* verify signed write is permitted */ + if ((pAttr->settings & ATTS_SET_ALLOW_SIGNED) == 0) + { + return; + } + + /* verify that csrk is present */ + if (attsSignCcbByConnId(pCcb->connId)->pCsrk == NULL) { + return; + } + + /* verify basic permissions */ + if ((pAttr->permissions & (ATTS_PERMIT_WRITE | ATTS_PERMIT_WRITE_ENC)) == 0) + { + return; + } + + /* verify authentication */ + if ((pAttr->permissions & ATTS_PERMIT_WRITE_AUTH) && + (attsSignCcbByConnId(pCcb->connId)->authenticated == 0)) + { + return; + } + + /* Note: authorization not verified at this stage as it is reserved for lesc + writes; authorization occurs latter when the write cb is called */ + + /* verify write length, fixed length */ + if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) == 0) && + (writeLen != pAttr->maxLen)) + { + return; + } + + /* verify write length, variable length */ + if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) && + (writeLen > pAttr->maxLen)) + { + return; + } + + /* allocate buffer to store packet and parameters */ + if ((pBuf = WsfBufAlloc(sizeof(attsSignBuf_t) - 1 + len)) != NULL) + { + /* initialize buffer */ + pBuf->pCcb = pCcb; + pBuf->handle = handle; + pBuf->writeLen = writeLen; + pBuf->connId = pCcb->connId; + memcpy(pBuf->packet, (pPacket + L2C_PAYLOAD_START), len); + + /* check if a signed write is already in progress */ + pSignCcb = attsSignCcbByConnId(pCcb->connId); + + if (pSignCcb->pBuf != NULL) + { + /* signed write in progress; queue packet */ + WsfQueueEnq(&attsSignCb.msgQueue, pBuf); + } + else + { + /* start signed data processing */ + attsSignedWriteStart(pSignCcb, pBuf); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Message handler callback for ATTS signed PDU processing. + * + * \param pMsg ATTS message. + * + * \return None. + */ +/*************************************************************************************************/ +static void attsSignMsgCback(secCmacMsg_t *pMsg) +{ + attsSignCcb_t *pCcb; + attsSignBuf_t *pBuf; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint32_t signCounter; + + if (pMsg->hdr.event == ATTS_MSG_SIGN_CMAC_CMPL) + { + uint8_t signature[ATT_CMAC_RESULT_LEN] = {0}; + + pCcb = attsSignCcbByConnId((dmConnId_t) pMsg->hdr.param); + pBuf = pCcb->pBuf; + + WStrReverseCpy(signature, pMsg->pCiphertext, ATT_CMAC_RESULT_LEN); + + /* if signature ok */ + if (memcmp(signature, pBuf->packet + pBuf->writeLen + ATT_WRITE_CMD_LEN + 4, ATT_CMAC_RESULT_LEN) == 0) + { + /* check sign counter */ + BYTES_TO_UINT32(signCounter, (pBuf->packet + pBuf->writeLen + ATT_WRITE_CMD_LEN)); + + if (signCounter >= pCcb->signCounter) + { + /* update sign counter */ + pCcb->signCounter = signCounter + 1; + + /* perform write: */ + + /* find attribute */ + if ((pAttr = attsFindByHandle(pBuf->handle, &pGroup)) != NULL) + { + /* if write callback is desired */ + if ((pAttr->settings & ATTS_SET_WRITE_CBACK) && + (pGroup->writeCback != NULL)) + { + /* write value via write callback */ + (*pGroup->writeCback)(pBuf->connId, pBuf->handle, ATT_PDU_SIGNED_WRITE_CMD, + 0, pBuf->writeLen, (pBuf->packet + ATT_WRITE_CMD_LEN), pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + (*attsCb.cccCback)(pBuf->connId, ATT_METHOD_WRITE, pBuf->handle, + (pBuf->packet + ATT_WRITE_CMD_LEN)); + } + else + { + /* write attribute value */ + memcpy(pAttr->pValue, (pBuf->packet + ATT_WRITE_CMD_LEN), pBuf->writeLen); + + /* write the length if variable length attribute */ + if ((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) + { + *(pAttr->pLen) = pBuf->writeLen; + } + } + } + } + else + { + ATT_TRACE_WARN0("Signed write counter failed"); + } + } + else + { + ATT_TRACE_WARN0("Signed write sig failed"); + } + + /* we're done-- free parameter buffer */ + WsfBufFree(pBuf); + + WsfBufFree(pMsg->pPlainText); + + /* process next signed write in queue, if any */ + if ((pBuf = WsfQueueDeq(&attsSignCb.msgQueue)) != NULL) + { + pCcb = attsSignCcbByConnId(pBuf->connId); + attsSignedWriteStart(pCcb, pBuf); + } + else + { + pCcb->pBuf = NULL; + } + } +} + + +/*************************************************************************************************/ +/*! + * \brief Initialize ATT server for data signing. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsSignInit(void) +{ + /* initialize control block */ + WSF_QUEUE_INIT(&attsSignCb.msgQueue); + + /* set up callback interface */ + attsCb.signMsgCback = (attMsgHandler_t) attsSignMsgCback; + attsProcFcnTbl[ATT_METHOD_SIGNED_WRITE_CMD] = attsProcSignedWrite; +} + +/*************************************************************************************************/ +/*! + * \brief Set the peer's data signing key on this connection. This function + * is typically called from the ATT connection callback when the connection is + * established. The caller is responsible for maintaining the memory that + * contains the key. + * + * \param connId DM connection ID. + * \param pCsrk Pointer to data signing key (CSRK). + * \param authenticated True if CSRK is authenticated and false otherwise. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsSetCsrk(dmConnId_t connId, uint8_t *pCsrk, bool_t authenticated) +{ + attsSignCcbByConnId(connId)->pCsrk = pCsrk; + attsSignCcbByConnId(connId)->authenticated = authenticated; +} + +/*************************************************************************************************/ +/*! + * \brief Set the peer's sign counter on this connection. This function + * is typically called from the ATT connection callback when the connection is + * established. ATT maintains the value of the sign counter internally and + * sets the value when a signed packet is successfully received. + * + * \param connId DM connection ID. + * \param signCounter Sign counter. + * + * \return None. + */ +/*************************************************************************************************/ +void AttsSetSignCounter(dmConnId_t connId, uint32_t signCounter) +{ + attsSignCcbByConnId(connId)->signCounter = signCounter; +} + +/*************************************************************************************************/ +/*! + * \brief Get the current value peer's sign counter on this connection. This function + * is typically called from the ATT connection callback when the connection is + * closed so the application can store the sign counter for use on future + * connections. + * + * \param connId DM connection ID. + * + * \return Sign counter. + */ +/*************************************************************************************************/ +uint32_t AttsGetSignCounter(dmConnId_t connId) +{ + return attsSignCcbByConnId(connId)->signCounter; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_write.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_write.c new file mode 100644 index 0000000000000000000000000000000000000000..0b60bc59d7a4415cef31e3d6c5ec7b01445b4077 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/att/atts_write.c @@ -0,0 +1,461 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief ATT server write PDU processing functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "att_api.h" +#include "att_main.h" +#include "atts_main.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Queued prepare write structure */ +typedef struct attsPrepWrite_tag +{ + struct attsPrepWrite_tag *pNext; + uint16_t writeLen; + uint16_t handle; + uint16_t offset; + uint8_t packet[1]; +} attsPrepWrite_t; + +/*************************************************************************************************/ +/*! + * \brief Execute a queued prepared write operation. + * + * \param pCcb Connection control block. + * \param pPrep Pointer to buffer containing prepared write. + * + * \return ATT_SUCCESS or failure status. + */ +/*************************************************************************************************/ +static uint8_t attsExecPrepWrite(attCcb_t *pCcb, attsPrepWrite_t *pPrep) +{ + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint8_t err = ATT_SUCCESS; + + p = pPrep->packet; + + /* find attribute */ + if ((pAttr = attsFindByHandle(pPrep->handle, &pGroup)) == NULL) + { + /* handle not found; only possible unless handle was removed */ + err = ATT_ERR_UNLIKELY; + } + /* verify write permissions (in theory could have changed) */ + else if (!(pAttr->permissions & ATTS_PERMIT_WRITE)) + { + err = ATT_ERR_WRITE; + } + /* if write callback is desired */ + else if ((pAttr->settings & ATTS_SET_WRITE_CBACK) && + (pGroup->writeCback != NULL)) + { + + /* write callback performs the write */ + err = (*pGroup->writeCback)(pCcb->connId, pPrep->handle, ATT_PDU_EXEC_WRITE_REQ, + pPrep->offset, pPrep->writeLen, p, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_WRITE, pPrep->handle, p); + } + else + { + /* perform write; parameters have already been vetted by previous procedures */ + + /* write attribute value */ + memcpy((pAttr->pValue + pPrep->offset), p, pPrep->writeLen); + + /* write the length if variable length attribute */ + if ((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) + { + *(pAttr->pLen) = pPrep->writeLen + pPrep->offset; + } + } + + return err; +} + +/*************************************************************************************************/ +/*! + * \brief Process a write request or write command PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcWrite(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint8_t opcode; + uint16_t handle; + uint16_t writeLen; + uint8_t err = ATT_SUCCESS; + + /* parse opcode handle, calculate write length */ + pPacket += L2C_PAYLOAD_START; + BSTREAM_TO_UINT8(opcode, pPacket); + BSTREAM_TO_UINT16(handle, pPacket); + writeLen = len - ATT_WRITE_REQ_LEN; + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) != NULL) + { + /* verify permissions */ + if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_WRITE, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + /* err has been set; fail */ + } + /* verify write length, fixed length */ + else if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) == 0) && + (writeLen != pAttr->maxLen)) + { + err = ATT_ERR_LENGTH; + } + /* verify write length, variable length */ + else if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) && + (writeLen > pAttr->maxLen)) + { + err = ATT_ERR_LENGTH; + } + else + { + /* if write callback is desired */ + if ((pAttr->settings & ATTS_SET_WRITE_CBACK) && + (pGroup->writeCback != NULL)) + { + err = (*pGroup->writeCback)(pCcb->connId, handle, opcode, 0, writeLen, + pPacket, pAttr); + } + /* else check if CCC */ + else if ((pAttr->settings & ATTS_SET_CCC) && (attsCb.cccCback != NULL)) + { + err = (*attsCb.cccCback)(pCcb->connId, ATT_METHOD_WRITE, handle, pPacket); + } + else + { + /* write attribute value */ + memcpy(pAttr->pValue, pPacket, writeLen); + + /* write the length if variable length attribute */ + if ((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) + { + *(pAttr->pLen) = writeLen; + } + } + + /* if success and write req allocate response buffer */ + if (err == ATT_SUCCESS && opcode == ATT_PDU_WRITE_REQ) + { + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_WRITE_RSP_LEN)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_WRITE_RSP); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, ATT_WRITE_RSP_LEN, pBuf); + } + } + } + } + /* else attribute not found */ + else + { + err = ATT_ERR_HANDLE; + } + + /* send error response for write req only */ + if (err && (opcode == ATT_PDU_WRITE_REQ)) + { + if (err == ATT_RSP_PENDING) + { + /* set response pending */ + pCcb->control |= ATT_CCB_STATUS_RSP_PENDING; + } + else + { + attsErrRsp(pCcb->handle, ATT_PDU_WRITE_REQ, handle, err); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a prepare write request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcPrepWriteReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + attsPrepWrite_t *pPrep; + uint16_t handle; + uint16_t offset; + uint16_t writeLen; + uint8_t err = ATT_SUCCESS; + + /* parse handle and offset, calculate write length */ + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + BSTREAM_TO_UINT16(handle, pPacket); + BSTREAM_TO_UINT16(offset, pPacket); + writeLen = len - ATT_PREP_WRITE_REQ_LEN; /* length of value being written */ + + /* find attribute */ + if ((pAttr = attsFindByHandle(handle, &pGroup)) == NULL) + { + /* attribute not found */ + err = ATT_ERR_HANDLE; + } + /* verify permissions */ + else if ((err = attsPermissions(pCcb->connId, ATTS_PERMIT_WRITE, + handle, pAttr->permissions)) != ATT_SUCCESS) + { + /* err has been set; fail */ + } + /* verify offset is allowed */ + else if ((offset != 0) && ((pAttr->settings & ATTS_SET_ALLOW_OFFSET) == 0)) + { + err = ATT_ERR_NOT_LONG; + } + /* verify write length, fixed length */ + else if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) == 0) && + (writeLen != pAttr->maxLen)) + { + err = ATT_ERR_LENGTH; + } + /* verify prepare write queue limit not reached */ + else if (WsfQueueCount(&pCcb->prepWriteQueue) >= pAttCfg->numPrepWrites) + { + err = ATT_ERR_QUEUE_FULL; + } + /* allocate new buffer to hold prepared write */ + else if ((pPrep = WsfBufAlloc(sizeof(attsPrepWrite_t) - 1 + writeLen)) == NULL) + { + err = ATT_ERR_RESOURCES; + } + else if ((pAttr->settings & ATTS_SET_WRITE_CBACK) && + (pGroup->writeCback != NULL)) + { + err = (*pGroup->writeCback)(pCcb->connId, handle, ATT_PDU_PREP_WRITE_REQ, 0, writeLen, + pPacket, pAttr); + } + + if (err == ATT_SUCCESS) + { + /* copy data to new buffer and queue it */ + pPrep->writeLen = writeLen; + pPrep->handle = handle; + pPrep->offset = offset; + memcpy(pPrep->packet, pPacket, writeLen); + WsfQueueEnq(&pCcb->prepWriteQueue, pPrep); + + /* allocate response buffer */ + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_PREP_WRITE_RSP_LEN + writeLen)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_PREP_WRITE_RSP); + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, offset); + memcpy(p, pPacket, writeLen); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, (ATT_PREP_WRITE_RSP_LEN + writeLen), pBuf); + } + } + + if (err) + { + attsErrRsp(pCcb->handle, ATT_PDU_PREP_WRITE_REQ, handle, err); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process an execute write request PDU. + * + * \param pCcb Connection control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void attsProcExecWriteReq(attCcb_t *pCcb, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pBuf; + uint8_t *p; + attsPrepWrite_t *pPrep; + attsAttr_t *pAttr; + attsGroup_t *pGroup; + uint8_t err = ATT_SUCCESS; + + pPacket += L2C_PAYLOAD_START + ATT_HDR_LEN; + + /* if cancelling all prepared writes */ + if (*pPacket == ATT_EXEC_WRITE_CANCEL) + { + /* free all queued buffers */ + attsClearPrepWrites(pCcb); + } + /* else writing all prepared writes */ + else if (*pPacket == ATT_EXEC_WRITE_ALL) + { + /* iterate over prepare write queue and verify offset and length */ + for (pPrep = pCcb->prepWriteQueue.pHead; pPrep != NULL; pPrep = pPrep->pNext) + { + /* find attribute */ + if ((pAttr = attsFindByHandle(pPrep->handle, &pGroup)) != NULL) + { + /* verify offset */ + if (pPrep->offset > pAttr->maxLen) + { + err = ATT_ERR_OFFSET; + } + /* verify write length with offset */ + else if ((pPrep->writeLen + pPrep->offset) > pAttr->maxLen) + { + err = ATT_ERR_LENGTH; + } + + if (err) + { + /* verification failed; discard all prepared writes */ + attsClearPrepWrites(pCcb); + break; + } + } + } + + /* if length and offset checks ok then write all buffers in queue */ + if (err == ATT_SUCCESS) + { + /* for each buffer */ + while ((pPrep = WsfQueueDeq(&pCcb->prepWriteQueue)) != NULL) + { + /* write buffer */ + if ((err = attsExecPrepWrite(pCcb, pPrep)) != ATT_SUCCESS) + { + /* write failed; discard remaining prepared writes */ + attsClearPrepWrites(pCcb); + } + + /* free buffer */ + WsfBufFree(pPrep); + } + } + } + /* else unknown operation */ + else + { + err = ATT_ERR_INVALID_PDU; + } + + /* send response or error response */ + if (err) + { + attsErrRsp(pCcb->handle, ATT_PDU_EXEC_WRITE_REQ, 0, err); + } + else + { + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_EXEC_WRITE_RSP_LEN)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_EXEC_WRITE_RSP); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, ATT_EXEC_WRITE_RSP_LEN, pBuf); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a response to a pending write request. For use with ATT_RSP_PENDING. + * + * \param connId Connection ID. + * \param handle Attribute handle. + * \param status Status of the write request. + * + * \return None. + * + * \note When a higher layer returns ATT_RSP_PENDING to an ATT write callback indicating the + * response status is pending, the higher layer must subsequently call this function + * with the status of the write request. + */ +/*************************************************************************************************/ +void AttsContinueWriteReq(dmConnId_t connId, uint16_t handle, uint8_t status) +{ + attCcb_t *pCcb; + uint8_t *pBuf; + uint8_t *p; + + /* get connection cb for this handle */ + if ((pCcb = attCcbByConnId(connId)) == NULL) + { + return; + } + + /* clear response pending */ + pCcb->control &= ~ATT_CCB_STATUS_RSP_PENDING; + + if (status) + { + attsErrRsp(pCcb->handle, ATT_PDU_WRITE_REQ, handle, status); + } + else + { + if ((pBuf = attMsgAlloc(L2C_PAYLOAD_START + ATT_WRITE_RSP_LEN)) != NULL) + { + /* build and send PDU */ + p = pBuf + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, ATT_PDU_WRITE_RSP); + + L2cDataReq(L2C_CID_ATT, pCcb->handle, ATT_WRITE_RSP_LEN, pBuf); + } + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.c new file mode 100644 index 0000000000000000000000000000000000000000..0f9a5f3442490fafc8f732d03fcfce3335294dfa --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.c @@ -0,0 +1,110 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Stack configuration. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "cfg_stack.h" +#include "hci_api.h" +#include "dm_api.h" +#include "l2c_api.h" +#include "att_api.h" +#include "smp_api.h" + +/************************************************************************************************** + HCI +**************************************************************************************************/ + +/************************************************************************************************** + DM +**************************************************************************************************/ + +/* Configuration structure */ +const dmCfg_t dmCfg = +{ + 0 +}; + +/* Configuration pointer */ +dmCfg_t *pDmCfg = (dmCfg_t *) &dmCfg; + +/************************************************************************************************** + L2C +**************************************************************************************************/ + +/* Configuration structure */ +const l2cCfg_t l2cCfg = +{ + 30 /* Request timeout in seconds */ +}; + +/* Configuration pointer */ +l2cCfg_t *pL2cCfg = (l2cCfg_t *) &l2cCfg; + +/************************************************************************************************** + ATT +**************************************************************************************************/ + +/* Configuration structure */ +attCfg_t attCfg = +{ + 15, /* ATT server service discovery connection idle timeout in seconds */ + ATT_DEFAULT_MTU, /* desired ATT MTU */ + ATT_MAX_TRANS_TIMEOUT, /* transaction timeout in seconds */ + 1 /* number of queued prepare writes supported by server */ +}; + +/* Configuration pointer */ +attCfg_t *pAttCfg = (attCfg_t *) &attCfg; + +/************************************************************************************************** + SMP +**************************************************************************************************/ + +/* Configuration structure */ +smpCfg_t smpCfg = +{ + 500, /* 'Repeated attempts' timeout in msec */ + SMP_IO_NO_IN_NO_OUT, /* I/O Capability */ + 7, /* Minimum encryption key length */ + 16, /* Maximum encryption key length */ + 1, /* Attempts to trigger 'repeated attempts' timeout */ + 0, /* Device authentication requirements */ + 64000, /* Maximum repeated attempts timeout in msec */ + 64000, /* Time msec before attemptExp decreases */ + 2 /* Repeated attempts multiplier exponent */ +}; + +/* Configuration pointer */ +smpCfg_t *pSmpCfg = (smpCfg_t *) &smpCfg; + +/*************************************************************************************************/ +/*! +* \brief Get Stack version number. +* +* \param pVersion output parameter for version number. +* +* \return None. +*/ +/*************************************************************************************************/ +void StackGetVersionNumber(const char **pVersion) +{ + *pVersion = STACK_VERSION; +} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/cfg/cfg_stack.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.h similarity index 70% rename from lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/cfg/cfg_stack.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.h index b4af73a4ba6a447dcbd21add93564e3e4885325f..319a40d6bab4cca2103d1a4d8b0baba1fb2da176 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/cfg/cfg_stack.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/cfg/cfg_stack.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Stack configuration. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Stack configuration. */ /*************************************************************************************************/ #ifndef CFG_STACK_H @@ -31,8 +34,10 @@ extern "C" { STACK VERSION **************************************************************************************************/ +/*! \brief Stack release version label */ +#define STACK_VERSION ((const char *)"r19.02\n") /*! \brief Stack release version number */ -#define STACK_VERSION ((const char *)"r2p3-02rel0\n") +#define STACK_VER_NUM 0x1302 /* Default value. Auto-generated by builder. */ /************************************************************************************************** HCI @@ -71,23 +76,23 @@ extern "C" { /**@{*/ /*! \brief Maximum number of connections */ #ifndef DM_CONN_MAX -#define DM_CONN_MAX 3 +#define DM_CONN_MAX 3 #endif /*! \brief Maximum number of periodic advertising synchronizations */ #ifndef DM_SYNC_MAX -#define DM_SYNC_MAX 1 +#define DM_SYNC_MAX 1 #endif /*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */ #ifndef DM_NUM_ADV_SETS -#define DM_NUM_ADV_SETS 1 +#define DM_NUM_ADV_SETS 3 #endif /*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for legacy scanner and initiator */ #ifndef DM_NUM_PHYS -#define DM_NUM_PHYS 1 +#define DM_NUM_PHYS 3 #endif /**@}*/ @@ -101,12 +106,12 @@ extern "C" { /**@{*/ /*! \brief Maximum number of connection oriented channels */ #ifndef L2C_COC_CHAN_MAX -#define L2C_COC_CHAN_MAX 8 +#define L2C_COC_CHAN_MAX 8 #endif /*! \brief Maximum number of connection oriented channel registered clients */ #ifndef L2C_COC_REG_MAX -#define L2C_COC_REG_MAX 4 +#define L2C_COC_REG_MAX 4 #endif /**@}*/ @@ -118,9 +123,14 @@ extern "C" { * ATT build-time configuration parameters */ /**@{*/ -/*! \brief Maximum number of simultanous ATT notifications */ +/*! \brief Maximum number of simultaneous ATT write commands */ +#ifndef ATT_NUM_SIMUL_WRITE_CMD +#define ATT_NUM_SIMUL_WRITE_CMD 1 +#endif + +/*! \brief Maximum number of simultaneous ATT notifications */ #ifndef ATT_NUM_SIMUL_NTF -#define ATT_NUM_SIMUL_NTF 1 +#define ATT_NUM_SIMUL_NTF 1 #endif /**@}*/ @@ -128,6 +138,15 @@ extern "C" { SMP **************************************************************************************************/ +/** \name SMP Configuration + * SMP build-time configuration parameters + */ +/**@{*/ +/*! Max number of devices in the database */ +#ifndef SMP_DB_MAX_DEVICES +#define SMP_DB_MAX_DEVICES 3 +#endif +/**@}*/ /*************************************************************************************************/ /*! diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.c new file mode 100644 index 0000000000000000000000000000000000000000..7ca30c6721bc1ea3fb246b27eb7067cf26e81ca0 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.c @@ -0,0 +1,521 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager advertising module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_adv.h" +#include "dm_main.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* control block */ +dmAdvCb_t dmAdvCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize the advertising CB for a given handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvCbInit(uint8_t advHandle) +{ + /* initialize control block */ + dmAdvCb.advType[advHandle] = DM_ADV_NONE; + dmAdvCb.intervalMin[advHandle] = DM_GAP_ADV_SLOW_INT_MIN; + dmAdvCb.intervalMax[advHandle] = DM_GAP_ADV_SLOW_INT_MAX; + dmAdvCb.channelMap[advHandle] = DM_ADV_CHAN_ALL; + dmCb.advFiltPolicy[advHandle] = HCI_ADV_FILT_NONE; + dmAdvCb.advState[advHandle] = DM_ADV_STATE_IDLE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the legacy adv module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvInit(void) +{ + uint8_t i; + + /* initialize control block */ + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + dmAdvCbInit(i); + } + + dmAdvCb.advTimer.handlerId = dmCb.handlerId; + dmCb.advAddrType = DM_ADDR_PUBLIC; +} + +/*************************************************************************************************/ +/*! + * \brief Generate an enhanced connection complete event. + * + * \param advHandle Advertising handle. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvGenConnCmpl(uint8_t advHandle, uint8_t status) +{ + hciLeConnCmplEvt_t leConnCmpl; + + /* generate enhanced connection complete event */ + memset(&leConnCmpl, 0, sizeof(leConnCmpl)); + + leConnCmpl.hdr.event = HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT; + leConnCmpl.hdr.status = leConnCmpl.status = status; + leConnCmpl.role = DM_ROLE_SLAVE; + leConnCmpl.addrType = dmAdvCb.peerAddrType[advHandle]; + BdaCpy(leConnCmpl.peerAddr, dmAdvCb.peerAddr[advHandle]); + + /* pass connection complete event to DM connection management module */ + dmDevPassHciEvtToConn((hciEvt_t *) &leConnCmpl); +} + +/*************************************************************************************************/ +/*! + * \brief Set the advertising parameters using the given advertising type, and peer address. + * + * \param advHandle Advertising handle. + * \param advType Advertising type. + * \param peerAddrType Peer address type. + * \param pPeerAddr Peer address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvConfig(uint8_t advHandle, uint8_t advType, uint8_t peerAddrType, uint8_t *pPeerAddr) +{ + dmAdvApiConfig_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiConfig_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_CONFIG; + pMsg->advType = advType; + pMsg->advHandle = advHandle; + pMsg->peerAddrType = peerAddrType; + BdaCpy(pMsg->peerAddr, pPeerAddr); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the advertising or scan response data to the given data. + * + * \param advHandle Advertising handle. + * \param op Data operation. + * \param location Data location. + * \param len Length of the data. Maximum length is 236 bytes. + * \param pData Pointer to the data. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetData(uint8_t advHandle, uint8_t op, uint8_t location, uint8_t len, uint8_t *pData) +{ + dmAdvApiSetData_t *pMsg; + + WSF_ASSERT((location == DM_DATA_LOC_SCAN) || (location == DM_DATA_LOC_ADV)); + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetData_t) + len)) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_SET_DATA; + pMsg->advHandle = advHandle; + pMsg->op = op; + pMsg->location = location; + pMsg->len = len; + memcpy(pMsg->pData, pData, len); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start advertising using the given advertising set and duration. + * + * \param numSets Number of advertising sets to enable. + * \param pAdvHandles Advertising handles array. + * \param pDuration Advertising duration (in milliseconds) array. + * \param pMaxEaEvents Maximum number of extended advertising events array. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint16_t *pDuration, uint8_t *pMaxEaEvents) +{ + uint8_t i; + dmAdvApiStart_t *pMsg; + + WSF_ASSERT(numSets <= DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiStart_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_START; + pMsg->numSets = numSets; + + for (i = 0; i < numSets; i++) + { + pMsg->advHandle[i] = pAdvHandles[i]; + pMsg->duration[i] = pDuration[i]; + pMsg->maxEaEvents[i] = pMaxEaEvents[i]; + } + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop advertising for the given advertising set. If the number of sets is set to 0 + * then all advertising sets are disabled. + * + * \param numSets Number of advertising sets to disable. + * \param pAdvHandles Advertising handles array. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvStop(uint8_t numSets, uint8_t *pAdvHandles) +{ + uint8_t i; + dmAdvApiStop_t *pMsg; + + WSF_ASSERT(numSets <= DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiStop_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_STOP; + pMsg->numSets = numSets; + + for (i = 0; i < numSets; i++) + { + pMsg->advHandle[i] = pAdvHandles[i]; + } + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove an advertising set. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvRemoveAdvSet(uint8_t advHandle) +{ + dmAdvApiRemove_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiRemove_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_REMOVE; + pMsg->advHandle = advHandle; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvClearAdvSets(void) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->event = DM_ADV_MSG_API_CLEAR; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the random device address for a given advertising set. + * + * \param advHandle Advertising handle. + * \param pAddr Random device address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr) +{ + dmAdvApiSetRandAddr_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvApiSetRandAddr_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_MSG_API_SET_RAND_ADDR; + pMsg->advHandle = advHandle; + BdaCpy(pMsg->addr, pAddr); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the minimum and maximum advertising intervals. + * + * \param advHandle Advertising handle. + * \param intervalMin Minimum advertising interval. + * \param intervalMax Maximum advertising interval. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmAdvCb.intervalMin[advHandle] = intervalMin; + dmAdvCb.intervalMax[advHandle] = intervalMax; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Include or exclude certain channels from the advertising channel map. + * + * \param advHandle Advertising handle. + * \param channelMap Advertising channel map. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetChannelMap(uint8_t advHandle, uint8_t channelMap) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmAdvCb.channelMap[advHandle] = channelMap; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the local address type used while advertising. This function can be used to + * configure advertising to use a random address. + * + * \param addrType Address type. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetAddrType(uint8_t addrType) +{ + WsfTaskLock(); + dmCb.advAddrType = addrType; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the value of an advertising data element in the given advertising or + * scan response data. If the element already exists in the data then it is replaced + * with the new value. If the element does not exist in the data it is appended + * to it, space permitting. + * + * \param adType Advertising data element type. + * \param len Length of the value. Maximum length is 29 bytes. + * \param pValue Pointer to the value. + * \param pAdvDataLen Advertising or scan response data length. The new length is returned + * in this parameter. + * \param pAdvData Pointer to advertising or scan response data. + * \param advDataBufLen Length of the advertising or scan response data buffer maintained by + * Application. + * + * \return TRUE if the element was successfully added to the data, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t DmAdvSetAdValue(uint8_t adType, uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, + uint8_t *pAdvData, uint16_t advDataBufLen) +{ + uint8_t *pElem; + uint8_t *pNext; + uint16_t totalLen; + uint16_t newAdvDataLen; + bool_t valueSet = FALSE; + + /* find ad type in data */ + if ((pElem = DmFindAdType(adType, *pAdvDataLen, pAdvData)) != NULL) + { + /* if new length equals existing length */ + if ((len + 1) == pElem[DM_AD_LEN_IDX]) + { + /* copy new ad value to data in existing location */ + memcpy(&pElem[DM_AD_DATA_IDX], pValue, len); + valueSet = TRUE; + } + /* else if new value can replace old value and still fit */ + else + { + /* calculate the advertising data length if old element was replaced with new */ + newAdvDataLen = *pAdvDataLen + len + 1 - pElem[DM_AD_LEN_IDX]; + + /* if length is ok */ + if (newAdvDataLen <= advDataBufLen) + { + /* delete item (then we will replace it) */ + + /* get the start of element that follows the element to delete */ + totalLen = pElem[DM_AD_LEN_IDX] + 1; + pNext = pElem + totalLen; + + /* move data from start of next element to start of current item; + * length is equal the data that remains after pNext + */ + memmove(pElem, pNext, *pAdvDataLen - (uint8_t)(pNext - pAdvData)); + + /* update length */ + *pAdvDataLen = *pAdvDataLen - totalLen; + } + } + } + + /* if value not set */ + if (!valueSet) + { + /* if new value fits */ + if ((*pAdvDataLen + len + 2) <= advDataBufLen) + { + /* construct AD item in advertising data */ + pElem = &pAdvData[*pAdvDataLen]; + *pElem++ = len + 1; + *pElem++ = adType; + memcpy(pElem, pValue, len); + + /* update length */ + *pAdvDataLen = *pAdvDataLen + len + 2; + + valueSet = TRUE; + } + } + + return valueSet; +} + +/*************************************************************************************************/ +/*! + * \brief Set the device name in the given advertising or scan response data. If the + * device can only fit in the data if it is shortened, the name is shortened + * and the AD type is changed to DM_ADV_TYPE_SHORT_NAME. + * + * \param len Length of the name. Maximum length is 29 bytes. + * \param pValue Pointer to the name in UTF-8 format. + * \param pAdvDataLen Advertising or scan response data length. The new length is returned + * in this parameter. + * \param pAdvData Pointer to advertising or scan response data. + * \param advDataBufLen Length of the advertising or scan response data buffer maintained by + * Application. + * + * \return TRUE if the element was successfully added to the data, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t DmAdvSetName(uint8_t len, uint8_t *pValue, uint16_t *pAdvDataLen, uint8_t *pAdvData, + uint16_t advDataBufLen) +{ + uint8_t *pElem; + uint8_t *pNext; + uint16_t totalLen; + uint8_t adType; + + /* find name in data */ + if ((pElem = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, *pAdvDataLen, pAdvData)) == NULL) + { + pElem = DmFindAdType(DM_ADV_TYPE_SHORT_NAME, *pAdvDataLen, pAdvData); + } + + /* if found delete it */ + if (pElem != NULL) + { + /* get the start of element that follows the element to delete */ + totalLen = pElem[DM_AD_LEN_IDX] + 1; + pNext = pElem + totalLen; + + /* move data from start of next element to start of current item; + * length is equal the data that remains after pNext + */ + memmove(pElem, pNext, *pAdvDataLen - (uint8_t)(pNext - pAdvData)); + + /* update length */ + *pAdvDataLen = *pAdvDataLen - totalLen; + } + + /* if name will fit */ + if (*pAdvDataLen <= (advDataBufLen - 2)) + { + /* if full device name won't fit */ + if ((*pAdvDataLen + len + 2) > advDataBufLen) + { + /* adjust length so that it will fit */ + len = (advDataBufLen - 2) - *pAdvDataLen; + + /* set ad type to shortened local name */ + adType = DM_ADV_TYPE_SHORT_NAME; + } + else + { + adType = DM_ADV_TYPE_LOCAL_NAME; + } + + /* construct AD item in advertising data */ + pElem = &pAdvData[*pAdvDataLen]; + *pElem++ = len + 1; + *pElem++ = adType; + memcpy(pElem, pValue, len); + + /* update length */ + *pAdvDataLen = *pAdvDataLen + len + 2; + + return TRUE; + } + + return FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.h new file mode 100644 index 0000000000000000000000000000000000000000..f8bbf45528f8ed094f586a4cb5f2eedf49ec4a10 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv.h @@ -0,0 +1,281 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM advertising module. + */ +/*************************************************************************************************/ +#ifndef DM_ADV_H +#define DM_ADV_H + +#include "wsf_timer.h" +#include "sec_api.h" +#include "dm_main.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM adv event handler messages */ +enum +{ + DM_ADV_MSG_API_CONFIG = DM_MSG_START(DM_ID_ADV), + DM_ADV_MSG_API_SET_DATA, + DM_ADV_MSG_API_START, + DM_ADV_MSG_API_STOP, + DM_ADV_MSG_API_REMOVE, + DM_ADV_MSG_API_CLEAR, + DM_ADV_MSG_API_SET_RAND_ADDR, + DM_ADV_MSG_TIMEOUT +}; + +/* DM adv periodic event handler messages */ +enum +{ + DM_ADV_PER_MSG_API_CONFIG = DM_MSG_START(DM_ID_ADV_PER), + DM_ADV_PER_MSG_API_SET_DATA, + DM_ADV_PER_MSG_API_START, + DM_ADV_PER_MSG_API_STOP +}; + +/* DM advertising states */ +enum +{ + DM_ADV_STATE_IDLE, /* idle */ + DM_ADV_STATE_ADVERTISING, /* advertising */ + DM_ADV_STATE_STARTING_DIRECTED, /* starting high duty cycle directed advertising */ + DM_ADV_STATE_STARTING, /* starting undirected or low duty cycle directed advertising */ + DM_ADV_STATE_STOPPING_DIRECTED, /* stopping high duty cycle directed advertising */ + DM_ADV_STATE_STOPPING, /* stopping undirected or low duty cycle directed advertising */ + DM_ADV_STATE_REMOVING_SET, /* removing advertising set */ + DM_ADV_STATE_CLEARING_SETS /* clearing all advertising sets */ +}; + +/* DM periodic advertising states */ +enum +{ + DM_ADV_PER_STATE_IDLE, + DM_ADV_PER_STATE_ADVERTISING, + DM_ADV_PER_STATE_STARTING, + DM_ADV_PER_STATE_STOPPING +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data structure for DM_ADV_MSG_API_CONFIG */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; + uint8_t advType; + uint8_t peerAddrType; + bdAddr_t peerAddr; + bool_t scanReqNotifEna; +} dmAdvApiConfig_t; + +/* Data structure for DM_ADV_MSG_API_SET_DATA */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; + uint8_t op; + uint8_t location; + uint8_t len; + uint8_t pData[]; +} dmAdvApiSetData_t; + +/* Data structure for DM_ADV_MSG_API_START */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t numSets; + uint8_t advHandle[DM_NUM_ADV_SETS]; + uint16_t duration[DM_NUM_ADV_SETS]; + uint8_t maxEaEvents[DM_NUM_ADV_SETS]; +} dmAdvApiStart_t; + +/* Data structure for DM_ADV_MSG_API_STOP */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t numSets; + uint8_t advHandle[DM_NUM_ADV_SETS]; +} dmAdvApiStop_t; + +/* Data structure for DM_ADV_MSG_API_REMOVE */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; +} dmAdvApiRemove_t; + +/* Data structure for DM_ADV_MSG_API_SET_RAND_ADDR */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; + bdAddr_t addr; +} dmAdvApiSetRandAddr_t; + +/* Data structure for DM_ADV_PER_MSG_API_CONFIG */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; +} dmAdvPerApiConfig_t; + +/* Data structure for DM_ADV_PER_MSG_API_SET_DATA */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; + uint8_t op; + uint8_t len; + uint8_t pData[]; +} dmAdvPerApiSetData_t; + +/* Data structure for DM_ADV_PER_MSG_API_START */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; +} dmAdvPerApiStart_t; + +/* Data structure for DM_ADV_PER_MSG_API_STOP */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; +} dmAdvPerApiStop_t; + +/* Union of all adv messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmAdvApiConfig_t apiConfig; + dmAdvApiSetData_t apiSetData; + dmAdvApiStart_t apiStart; + dmAdvApiStop_t apiStop; + dmAdvApiRemove_t apiRemove; + dmAdvApiSetRandAddr_t apiSetRandAddr; + dmAdvPerApiConfig_t apiPerConfig; + dmAdvPerApiSetData_t apiPerSetData; + dmAdvPerApiStart_t apiPerStart; + dmAdvPerApiStop_t apiPerStop; + secAes_t aes; +} dmAdvMsg_t; + +/* Action function */ +typedef void (*dmAdvAct_t)(dmAdvMsg_t *pMsg); + +/* Control block for advertising module */ +typedef struct +{ + wsfTimer_t advTimer; + uint16_t intervalMin[DM_NUM_ADV_SETS]; + uint16_t intervalMax[DM_NUM_ADV_SETS]; + uint8_t advType[DM_NUM_ADV_SETS]; + uint8_t channelMap[DM_NUM_ADV_SETS]; + uint8_t localAddrType; + uint8_t advState[DM_NUM_ADV_SETS]; + uint16_t advDuration[DM_NUM_ADV_SETS]; + bool_t advEnabled; + bdAddr_t peerAddr[DM_NUM_ADV_SETS]; + uint8_t peerAddrType[DM_NUM_ADV_SETS]; +} dmAdvCb_t; + +extern dmAdvCb_t dmAdvCb; + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* legacy adv component inteface */ +void dmAdvMsgHandler(wsfMsgHdr_t *pMsg); +void dmAdvHciHandler(hciEvt_t *pEvent); +void dmAdvReset(void); + +/* legacy adv action functions */ +void dmAdvActConfig(dmAdvMsg_t *pMsg); +void dmAdvActSetData(dmAdvMsg_t *pMsg); +void dmAdvActStart(dmAdvMsg_t *pMsg); +void dmAdvActStop(dmAdvMsg_t *pMsg); +void dmAdvActRemoveSet(dmAdvMsg_t *pMsg); +void dmAdvActClearSets(dmAdvMsg_t *pMsg); +void dmAdvActSetRandAddr(dmAdvMsg_t *pMsg); +void dmAdvActTimeout(dmAdvMsg_t *pMsg); + +/* extended adv component inteface */ +void dmExtAdvMsgHandler(wsfMsgHdr_t *pMsg); +void dmExtAdvHciHandler(hciEvt_t *pEvent); +void dmExtAdvReset(void); + +/* extended adv action functions */ +void dmExtAdvActConfig(dmAdvMsg_t *pMsg); +void dmExtAdvActSetData(dmAdvMsg_t *pMsg); +void dmExtAdvActStart(dmAdvMsg_t *pMsg); +void dmExtAdvActStop(dmAdvMsg_t *pMsg); +void dmExtAdvActRemoveSet(dmAdvMsg_t *pMsg); +void dmExtAdvActClearSets(dmAdvMsg_t *pMsg); +void dmExtAdvActSetRandAddr(dmAdvMsg_t *pMsg); +void dmExtAdvActTimeout(dmAdvMsg_t *pMsg); + +/* periodic adv action functions */ +void dmPerAdvActConfig(dmAdvMsg_t *pMsg); +void dmPerAdvActSetData(dmAdvMsg_t *pMsg); +void dmPerAdvActStart(dmAdvMsg_t *pMsg); +void dmPerAdvActStop(dmAdvMsg_t *pMsg); + +/* periodic adv component inteface */ +void dmPerAdvMsgHandler(wsfMsgHdr_t *pMsg); +void dmPerAdvHciHandler(hciEvt_t *pEvent); +void dmPerAdvReset(void); + +/* legacy adv directed advertising interface */ +void dmAdvStartDirected(uint8_t advType, uint16_t duration, uint8_t addrType, uint8_t *pAddr); +void dmAdvStopDirected(void); +void dmAdvConnected(void); +void dmAdvConnectFailed(void); + +/* extended adv directed advertising interface */ +void dmExtAdvStartDirected(dmConnId_t connId, uint8_t advHandle, uint8_t advType, + uint16_t duration, uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr); +void dmExtAdvStopDirected(dmConnId_t connId); +void dmExtAdvConnected(dmConnId_t connId); +void dmExtAdvConnectFailed(dmConnId_t connId); + +/* adv utility functions */ +void dmAdvInit(void); +void dmAdvCbInit(uint8_t advHandle); +void dmAdvGenConnCmpl(uint8_t advHandle, uint8_t status); + +/* extended and periodic adv utility functions */ +void dmExtAdvInit(void); +void dmPerAdvInit(void); +uint8_t dmPerAdvState(uint8_t advHandle); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_ADV_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..9f3b36c114499150faf4df8dab379ac9501b69fa --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_ae.c @@ -0,0 +1,1939 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager extended advertising module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_adv.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Connectable directed advertising */ +#define DM_ADV_CONN_DIRECTED(advType) (((advType) == DM_ADV_CONN_DIRECT) || \ + ((advType) == DM_ADV_CONN_DIRECT_LO_DUTY)) + +/*! Connectable advertising */ +#define DM_ADV_CONNECTABLE(advType) (((advType) == DM_ADV_CONN_UNDIRECT) || \ + ((advType) == DM_EXT_ADV_CONN_UNDIRECT) || \ + DM_ADV_CONN_DIRECTED((advType))) + +/*! Scannable advertising */ +#define DM_ADV_SCANNABLE(advType) (((advType) == DM_ADV_CONN_UNDIRECT) || \ + ((advType) == DM_ADV_SCAN_UNDIRECT) || \ + ((advType) == DM_EXT_ADV_SCAN_DIRECT)) + +/*! Non-connectable and non-scannable advertising */ +#define DM_NON_CONN_NON_SCAN(advType) (((advType) == DM_ADV_NONCONN_UNDIRECT) || \ + ((advType) == DM_EXT_ADV_NONCONN_DIRECT)) + +/*! Directed advertising */ +#define DM_ADV_DIRECTED(advType) (((advType) == DM_EXT_ADV_NONCONN_DIRECT) || \ + ((advType) == DM_EXT_ADV_SCAN_DIRECT) || \ + DM_ADV_CONN_DIRECTED((advType))) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Control block for extended advertising module */ +typedef struct +{ + uint8_t advType; /*!< Advertising type. */ + bool_t useLegacyPdu; /*!< Use legacy advertising PDUs. */ + bool_t omitAdvAddr; /*!< Omit advertiser's address from all PDUs. */ + bool_t incTxPwr; /*!< Include TxPower in extended header of advertising PDU. */ + int8_t advTxPwr; /*!< Advertising Tx Power. */ + uint8_t priAdvPhy; /*!< Primary Advertising PHY. */ + uint8_t secAdvMaxSkip; /*!< Secondary Advertising Maximum Skip. */ + uint8_t secAdvPhy; /*!< Secondary Advertising PHY. */ + bool_t scanReqNotifEna; /*!< Scan request notification enable. */ + uint8_t fragPref; /*!< Fragment preference for advertising data. */ + bool_t advDataSet; /*!< TRUE if extended adv data has been set. */ + bool_t scanDataSet; /*!< TRUE if extended scan data has been set. */ + dmConnId_t connId; /*!< Connection identifier (used by directed advertising). */ +} dmExtAdvCb_t; + +/* Control block for periodic advertising module */ +typedef struct +{ + uint16_t intervalMin; /*!< Minimum advertising interval. */ + uint16_t intervalMax; /*!< Maximum advertising interval. */ + bool_t incTxPwr; /*!< Include TxPower in extended header of advertising PDU. */ + uint8_t advState; /*!< Periodic advertising state. */ +} dmPerAdvCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* extended advertising action function table */ +static const dmAdvAct_t dmAdvAct[] = +{ + dmExtAdvActConfig, + dmExtAdvActSetData, + dmExtAdvActStart, + dmExtAdvActStop, + dmExtAdvActRemoveSet, + dmExtAdvActClearSets, + dmExtAdvActSetRandAddr, + dmExtAdvActTimeout +}; + +/* extended advertising component function interface */ +static const dmFcnIf_t dmAdvFcnIf = +{ + dmExtAdvReset, + dmExtAdvHciHandler, + dmExtAdvMsgHandler +}; + +/* periodic advertising action function table */ +static const dmAdvAct_t dmPerAdvAct[] = +{ + dmPerAdvActConfig, + dmPerAdvActSetData, + dmPerAdvActStart, + dmPerAdvActStop +}; + +/* periodic advertising component function interface */ +static const dmFcnIf_t dmPerAdvFcnIf = +{ + dmPerAdvReset, + dmPerAdvHciHandler, + dmPerAdvMsgHandler +}; + +/* extended advertising control block */ +static dmExtAdvCb_t dmExtAdvCb[DM_NUM_ADV_SETS]; + +/* periodic advertising control block */ +static dmPerAdvCb_t dmPerAdvCb[DM_NUM_ADV_SETS]; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +static bool_t dmAdvEnabled(void); +static void dmExtAdvCbInit(uint8_t advHandle); +static void dmAdvConfig(uint8_t advHandle, uint8_t advType, uint8_t peerAddrType, + uint8_t *pPeerAddr, bool_t useLegacyPdu); +static void dmAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint16_t *pDuration, + uint8_t *pMaxEaEvents, uint8_t state); +static void dmAdvStop(uint8_t numSets, uint8_t *pAdvHandles, uint8_t state); + +/*************************************************************************************************/ +/*! + * \brief Initialize the extended advertising CB for a given handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmExtAdvCbInit(uint8_t advHandle) +{ + /* initialize advertising set */ + dmExtAdvCb[advHandle].advType = DM_ADV_NONE; + dmExtAdvCb[advHandle].useLegacyPdu = TRUE; + dmExtAdvCb[advHandle].omitAdvAddr = FALSE; + dmExtAdvCb[advHandle].incTxPwr = FALSE; + dmExtAdvCb[advHandle].advTxPwr = HCI_TX_PWR_NO_PREFERENCE; + dmExtAdvCb[advHandle].priAdvPhy = HCI_ADV_PHY_LE_1M; + dmExtAdvCb[advHandle].secAdvMaxSkip = 0; + dmExtAdvCb[advHandle].secAdvPhy = HCI_ADV_PHY_LE_1M; + dmExtAdvCb[advHandle].scanReqNotifEna = FALSE; + dmExtAdvCb[advHandle].fragPref = HCI_ADV_DATA_FRAG_PREF_FRAG; + dmExtAdvCb[advHandle].connId = DM_CONN_ID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the periodic advertising CB for a given handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmPerAdvCbInit(uint8_t advHandle) +{ + /* initialize periodic advertising set */ + dmPerAdvCb[advHandle].intervalMin = DM_GAP_ADV_SLOW_INT_MIN; + dmPerAdvCb[advHandle].intervalMax = DM_GAP_ADV_SLOW_INT_MAX; + dmPerAdvCb[advHandle].incTxPwr = FALSE; + dmPerAdvCb[advHandle].advState = DM_ADV_PER_STATE_IDLE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the extended advertising module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvInit(void) +{ + uint8_t i; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + /* initialize extended control block */ + dmExtAdvCbInit(i); + } + + /* reset legacy adv module */ + dmAdvInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the periodic advertising module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvInit(void) +{ + uint8_t i; + + /* initialize extended control block */ + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + dmPerAdvCbInit(i); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if advertising is enabled for any advertising set. + * + * \return TRUE if advertising enabled. FALSE, otherwise. + */ +/*************************************************************************************************/ +static bool_t dmAdvEnabled(void) +{ + uint8_t i; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + /* if doing advertising */ + if (dmAdvCb.advType[i] != DM_ADV_NONE) + { + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check if connectable directed advertising is enabled for the given advertising set. + * + * \param numSets Number of advertising sets. + * \param pAdvHandles Advertising handles array. + * + * \return TRUE if connectable directed advertising enabled. FALSE, otherwise. + */ +/*************************************************************************************************/ +static bool_t dmAdvDirectedEnabled(uint8_t numSets, uint8_t *pAdvHandles) +{ + uint8_t i; + + for (i = 0; i < numSets; i++) + { + /* if doing connectable directed advertising */ + if (DM_ADV_CONN_DIRECTED(dmAdvCb.advType[pAdvHandles[i]])) + { + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Get conectable directed advertising handle for the given connection id. + * + * \param connId Connection identifier. + * + * \return Advertising handle. DM_NUM_ADV_SETS, if not found. + */ +/*************************************************************************************************/ +static uint8_t dmAdvDirectedByConnId(dmConnId_t connId) +{ + uint8_t i; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if (DM_ADV_CONN_DIRECTED(dmAdvCb.advType[i]) && (dmExtAdvCb[i].connId == connId)) + { + return i; + } + } + + DM_TRACE_INFO0("dmAdvDirectedByConnId not found"); + + return DM_NUM_ADV_SETS; +} + +/*************************************************************************************************/ +/*! + * \brief Disable connectable directed advertising. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmAdvDirectedDisable(dmConnId_t connId) +{ + uint8_t advHandle; + + advHandle = dmAdvDirectedByConnId(connId); + if (advHandle < DM_NUM_ADV_SETS) + { + /* disable advertising set */ + dmAdvCb.advType[advHandle] = DM_ADV_NONE; + dmAdvCb.advState[advHandle] = DM_ADV_STATE_IDLE; + dmExtAdvCb[advHandle].connId = DM_CONN_ID_NONE; + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the extended advertising parameters using the given advertising type, and peer + * address. + * + * \param advHandle Advertising handle. + * \param advType Advertising type. + * \param peerAddrType Peer address type. + * \param pPeerAddr Peer address. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmAdvConfig(uint8_t advHandle, uint8_t advType, uint8_t peerAddrType, + uint8_t *pPeerAddr, bool_t useLegacyPdu) +{ + bool_t advDataAllowed = FALSE; + bool_t scanDataAllowed = FALSE; + uint16_t advEventProp = 0; + hciExtAdvParam_t extAdvParam; + + memset(&extAdvParam, 0, sizeof(hciExtAdvParam_t)); + + /* set advertising event properties */ + if (useLegacyPdu) + { + /* use legacy advertising PDUs (bit 4 = 1) */ + switch (advType) + { + case DM_ADV_CONN_UNDIRECT: + /* connectable and scannable undirected advertising */ + advEventProp = HCI_ADV_PROP_LEG_CONN_UNDIRECT; + break; + + case DM_ADV_CONN_DIRECT_LO_DUTY: + /* connectable directed (low duty cycle) advertising */ + advEventProp = HCI_ADV_PROP_LEG_CONN_DIRECT_LO_DUTY; + break; + + case DM_ADV_CONN_DIRECT: + /* connectable directed (high duty cycle) advertising */ + advEventProp = HCI_ADV_PROP_LEG_CONN_DIRECT; + break; + + case DM_ADV_SCAN_UNDIRECT: + /* scannable undirected advertising */ + advEventProp = HCI_ADV_PROP_LEG_SCAN_UNDIRECT; + break; + + case DM_ADV_NONCONN_UNDIRECT: + /* non-connectable undirected advertising */ + advEventProp = HCI_ADV_PROP_LEG_NONCONN_UNDIRECT; + break; + + default: + /* unkown advertising type */ + break; + } + + /* make sure bit 4 (use legacy advertising PDUs) is set */ + advEventProp |= HCI_ADV_PROP_USE_LEG_PDU_BIT; + + /* set primary advertising PHY to LE 1M for legacy advertising */ + extAdvParam.priAdvPhy = HCI_ADV_PHY_LE_1M; + + /* advertising data is not allowed with connectable directed advertising type */ + if (!DM_ADV_CONN_DIRECTED(advType)) + { + advDataAllowed = TRUE; + } + + /* scan data is only allowed with connectable and scannable undirected advertising + and scannable undirected advertising types */ + if ((advType == DM_ADV_CONN_UNDIRECT) || (advType == DM_ADV_SCAN_UNDIRECT)) + { + scanDataAllowed = TRUE; + } + } + else + { + /* use extended advertising PDUs (bit 4 = 0) */ + + /* extended advertisement cannot be both connectable and scannable */ + if (advType == DM_ADV_CONN_UNDIRECT) + { + /* overwrite it with connectable undirected advertising */ + advType = DM_EXT_ADV_CONN_UNDIRECT; + } + + if (DM_ADV_CONNECTABLE(advType)) + { + /* set bit 0 */ + advEventProp |= HCI_ADV_PROP_CONN_ADV_BIT; + } + + /* if scannable advertising types */ + if (DM_ADV_SCANNABLE(advType)) + { + /* set bit 1 */ + advEventProp |= HCI_ADV_PROP_SCAN_ADV_BIT; + + /* scan data is allowed only with scannable advertising types */ + scanDataAllowed = TRUE; + } + /* advertising data is only allowed with non-scannable advertising types */ + else + { + advDataAllowed = TRUE; + } + + /* if directed advertising */ + if (DM_ADV_DIRECTED(advType)) + { + /* set bit 2 */ + advEventProp |= HCI_ADV_PROP_DIRECT_ADV_BIT; + } + + /* high duty cycle connectable directed advertising cannot be used (bit 3 = 0) */ + + /* omit advertiser's address from all PDUs */ + if (dmExtAdvCb[advHandle].omitAdvAddr) + { + /* set bit 5 */ + advEventProp |= HCI_ADV_PROP_OMIT_ADV_ADDR_BIT; + } + + /* include TxPower in extended header of advertising PDU */ + if (dmExtAdvCb[advHandle].incTxPwr) + { + /* set bit 6 */ + advEventProp |= HCI_ADV_PROP_INC_TX_PWR_BIT; + } + + /* set primary advertising PHY */ + extAdvParam.priAdvPhy = dmExtAdvCb[advHandle].priAdvPhy; + + /* secondary parameters are only valid for extended advertising */ + extAdvParam.secAdvMaxSkip = dmExtAdvCb[advHandle].secAdvMaxSkip; + extAdvParam.secAdvPhy = dmExtAdvCb[advHandle].secAdvPhy; + } + + extAdvParam.advEventProp = advEventProp; + + /* min and max intervals are not used for high duty cycle connectable directed advertising */ + if ((advEventProp & HCI_ADV_PROP_CONN_DIRECT_ADV_BIT) == 0) + { + extAdvParam.priAdvInterMin = dmAdvCb.intervalMin[advHandle]; + extAdvParam.priAdvInterMax = dmAdvCb.intervalMax[advHandle]; + } + + extAdvParam.priAdvChanMap = dmAdvCb.channelMap[advHandle]; + extAdvParam.ownAddrType = DmLlAddrType(dmCb.advAddrType); + extAdvParam.peerAddrType = peerAddrType; + extAdvParam.pPeerAddr = pPeerAddr; + extAdvParam.advFiltPolicy = dmCb.advFiltPolicy[advHandle]; + extAdvParam.advTxPwr = dmExtAdvCb[advHandle].advTxPwr; + extAdvParam.advSetId = advHandle; + extAdvParam.scanReqNotifEna = dmExtAdvCb[advHandle].scanReqNotifEna; + + /* if event type doesn't support advertising data */ + if (!advDataAllowed && + dmExtAdvCb[advHandle].advDataSet && + (dmExtAdvCb[advHandle].advType != DM_ADV_NONE)) + { + /* delete any existing advertising data */ + HciLeSetExtAdvDataCmd(advHandle, HCI_ADV_DATA_OP_COMP_FRAG, HCI_ADV_DATA_FRAG_PREF_FRAG, + 0, NULL); + dmExtAdvCb[advHandle].advDataSet = FALSE; + } + + /* if event type doesn't support scan data */ + if (!scanDataAllowed && + dmExtAdvCb[advHandle].scanDataSet && + (dmExtAdvCb[advHandle].advType != DM_ADV_NONE)) + { + /* delete any existing scan data */ + HciLeSetExtScanRespDataCmd(advHandle, HCI_ADV_DATA_OP_COMP_FRAG, HCI_ADV_DATA_FRAG_PREF_FRAG, + 0, NULL); + dmExtAdvCb[advHandle].scanDataSet = FALSE; + } + + /* set extended advertising parameters */ + HciLeSetExtAdvParamCmd(advHandle, &extAdvParam); + + /* store advertising type here till advertising's enabled */ + dmExtAdvCb[advHandle].advType = advType; + + /* if local device's using an static address */ + if (DM_RAND_ADDR_SA(dmCb.localAddr, dmCb.advAddrType)) + { + /* set static random address for advertising set */ + HciLeSetAdvSetRandAddrCmd(advHandle, dmCb.localAddr); + } + + /* pass advertising set creation to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_ADV_SET_ADD, advHandle, + DM_ADV_CONNECTABLE(advType)); +} + +/*************************************************************************************************/ +/*! + * \brief Check if a command complete is pending. + * + * \param None. + * + * \return TRUE if command complete is pending else FALSE. + */ +/*************************************************************************************************/ +static bool_t dmExtAdvCmdCmplPending(void) +{ + uint8_t i; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if ((dmAdvCb.advState[i] != DM_ADV_STATE_IDLE) && (dmAdvCb.advState[i] != DM_ADV_STATE_ADVERTISING)) + { + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Check if set's states matche the given state. + * + * \param numSets Number of advertising sets to enable. + * \param pAdvHandles Advertising handles array. + * + * \return None. + */ +/*************************************************************************************************/ +static bool_t dmExtAdvCheckState(uint8_t numSets, uint8_t *pAdvHandles, uint8_t state) +{ + uint8_t i; + + /* 0 sets on stop is equivalent to all sets */ + if ((state == DM_ADV_STATE_ADVERTISING) && (numSets == 0)) + { + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if (dmAdvCb.advState[i] != DM_ADV_STATE_ADVERTISING) + { + return FALSE; + } + } + } + else + { + for (i = 0; i < numSets; i++) + { + if (dmAdvCb.advState[pAdvHandles[i]] != state) + { + return FALSE; + } + } + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum advertising data length supported by Controller or allowed with HCI + * Set Extended Advertising/Scan Response Data command. + * + * \param advType Advertising type. + * \param useLegacyPdu Whether to use legacy advertising PDUs with extended advertising. + * \param perSetCmd Get maximum advertising data length allowed with HCI Set Extended + * Advertising/Scan Response Data command. + * + * \return Maximum advertising data length. + */ +/*************************************************************************************************/ +static uint16_t dmExtMaxAdvDataLen(uint8_t advType, bool_t useLegacyPdu, bool_t perSetCmd) +{ + uint16_t maxLen; + + /* since high-duty cycle connectable directed advertising cannot be used with AE, legacy + high-duty cycle connectable directed advertising PDUs will be used with AE instead */ + if ((advType == DM_ADV_CONN_DIRECT) || useLegacyPdu) + { + /* maximum advertising data length supported by Controller for legacy PDUs (i.e. 31 bytes) */ + maxLen = HCI_ADV_DATA_LEN; + } + else if (DM_ADV_CONNECTABLE(advType)) + { + /* maximum advertising data length supported by Controller for connectable advertising (i.e. + 191 bytes) */ + maxLen = HCI_EXT_ADV_CONN_DATA_LEN; + } + else if (perSetCmd) + { + /* maximum number of octets in the Extended Advertising/Scan Response Data parameter */ + maxLen = HCI_EXT_ADV_DATA_LEN; + } + else + { + /* maximum advertisement data length supported by the Controller */ + maxLen = HciGetMaxAdvDataLen(); + } + + return maxLen; +} + +/*************************************************************************************************/ +/*! + * \brief Start extended advertising. + * + * \param numSets Number of advertising sets to enable. + * \param pAdvHandles Advertising handles array. + * \param pDuration Advertising duration (in milliseconds) array. + * \param maxEaEvents Maximum number of extended advertising events array. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmAdvStart(uint8_t numSets, uint8_t *pAdvHandles, uint16_t *pDuration, + uint8_t *pMaxEaEvents, uint8_t state) +{ + uint8_t i; + hciExtAdvEnableParam_t enableParam[DM_NUM_ADV_SETS]; + + for (i = 0; i < numSets; i++) + { + /* set the advertising enable parameter */ + enableParam[i].advHandle = pAdvHandles[i]; + enableParam[i].maxEaEvents = pMaxEaEvents[i]; + + if (pDuration[i] == 0) + { + /* advertising to continue until it's disabled by Host */ + enableParam[i].duration = 0; + } + else + { + /* convert duration to 10 ms units but take the ceiling of duration */ + enableParam[i].duration = ((pDuration[i] - 1) / 10) + 1; + } + + dmAdvCb.advState[pAdvHandles[i]] = state; + } + + /* enable advertising */ + HciLeSetExtAdvEnableCmd(TRUE, numSets, enableParam); +} + +/*************************************************************************************************/ +/*! + * \brief Stop extended advertising. If the number of sets is set to 0 then all advertising sets + * are disabled. + * + * \param numSets Number of advertising sets to disable. + * \param pAdvHandles Advertising handles array. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmAdvStop(uint8_t numSets, uint8_t *pAdvHandles, uint8_t state) +{ + uint8_t i; + hciExtAdvEnableParam_t enableParam[DM_NUM_ADV_SETS]; + + /* if number of advertising sets is 0 */ + if (numSets == 0) + { + /* disable all advertising sets */ + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + /* disable advertising set */ + dmAdvCb.advState[i] = state; + } + } + else + { + /* disable specified advertising sets */ + for (i = 0; i < numSets; i++) + { + enableParam[i].advHandle = pAdvHandles[i]; + enableParam[i].duration = 0; + enableParam[i].maxEaEvents = 0; + + /* disable advertising set */ + dmAdvCb.advState[pAdvHandles[i]] = state; + } + } + + /* disable advertising */ + HciLeSetExtAdvEnableCmd(FALSE, numSets, enableParam); +} + +/*************************************************************************************************/ +/*! + * \brief Configure extended advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActConfig(dmAdvMsg_t *pMsg) +{ + uint8_t advHandle = pMsg->apiConfig.advHandle; + + /* if doing directed advertising ignore the request */ + if (dmAdvDirectedEnabled(1, &advHandle)) + { + DM_TRACE_WARN0("DmAdvConfig during directed advertising!"); + return; + } + + /* set extended advertising parameters (use legacy PDUs for high duty cycle directed adv) */ + dmAdvConfig(advHandle, pMsg->apiConfig.advType, pMsg->apiConfig.peerAddrType, + pMsg->apiConfig.peerAddr, ((pMsg->apiConfig.advType == DM_ADV_CONN_DIRECT) ? \ + TRUE : dmExtAdvCb[advHandle].useLegacyPdu)); +} + +/*************************************************************************************************/ +/*! + * \brief Set the extended advertising or extended scan response data to the given data. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActSetData(dmAdvMsg_t *pMsg) +{ + uint8_t advType; + uint8_t advHandle; + bool_t deleteData; + bool_t dataAllowed = FALSE; + + advHandle = pMsg->apiSetData.advHandle; + advType = dmExtAdvCb[advHandle].advType; + + WSF_ASSERT(pMsg->apiSetData.len <= dmExtMaxAdvDataLen(advType, dmExtAdvCb[advHandle].useLegacyPdu, TRUE)); + + /* if data to be deleted */ + if ((pMsg->apiSetData.op == HCI_ADV_DATA_OP_COMP_FRAG) && (pMsg->apiSetData.len == 0)) + { + deleteData = TRUE; + } + else + { + deleteData = FALSE; + } + + /* set new data in HCI */ + if (pMsg->apiSetData.location == DM_DATA_LOC_ADV) + { + /* if not deleting, find out if setting adv data is allowed with specified advertising type */ + if (!deleteData) + { + /* if using legacy PDUs with extended advertising */ + if (dmExtAdvCb[advHandle].useLegacyPdu) + { + /* advertising data is not allowed with connectable directed advertising type */ + if (!DM_ADV_CONN_DIRECTED(advType)) + { + dataAllowed = TRUE; + } + } + /* extended advertising */ + else + { + /* advertising data is only allowed with non-scannable advertising types */ + if (!DM_ADV_SCANNABLE(advType)) + { + dataAllowed = TRUE; + } + } + } + + /* if deleting advertising data or advertising data is allowed */ + if (deleteData || dataAllowed) + { + HciLeSetExtAdvDataCmd(advHandle, pMsg->apiSetData.op, dmExtAdvCb[advHandle].fragPref, + pMsg->apiSetData.len, pMsg->apiSetData.pData); + dmExtAdvCb[advHandle].advDataSet = TRUE; + } + } + else + { + /* if not deleting, find out if setting scan data is allowed with specified advertising type */ + if (!deleteData) + { + /* if using legacy PDUs with extended advertising */ + if (dmExtAdvCb[advHandle].useLegacyPdu) + { + /* scan data is only allowed with connectable and scannable undirected advertising and + scannable undirected advertising types */ + if ((advType == DM_ADV_CONN_UNDIRECT) || (advType == DM_ADV_SCAN_UNDIRECT)) + { + dataAllowed = TRUE; + } + } + /* extended advertising */ + else + { + /* scan data is only allowed with scannable advertising types */ + if (DM_ADV_SCANNABLE(advType)) + { + dataAllowed = TRUE; + } + } + } + + /* if deleting scan data or scan data is allowed with specified advertising type */ + if (deleteData || dataAllowed) + { + HciLeSetExtScanRespDataCmd(advHandle, pMsg->apiSetData.op, dmExtAdvCb[advHandle].fragPref, + pMsg->apiSetData.len, pMsg->apiSetData.pData); + dmExtAdvCb[advHandle].scanDataSet = TRUE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Start extended advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActStart(dmAdvMsg_t *pMsg) +{ + uint8_t numSets = pMsg->apiStart.numSets; + uint8_t *pHandles = pMsg->apiStart.advHandle; + + if (dmExtAdvCmdCmplPending() || dmExtAdvCheckState(numSets, pHandles, DM_ADV_STATE_IDLE) == FALSE) + { + DM_TRACE_WARN0("DmAdvStart ignored due to advState or pending command complete"); + return; + } + + /* if doing directed advertising ignore the request */ + if (dmAdvDirectedEnabled(numSets, pHandles)) + { + DM_TRACE_WARN0("DmAdvStart during directed advertising!"); + return; + } + + /* store current advertising state */ + dmAdvCb.advEnabled = dmAdvEnabled(); + + /* start advertising */ + dmAdvStart(numSets, pHandles, pMsg->apiStart.duration, pMsg->apiStart.maxEaEvents, + DM_ADV_STATE_STARTING); +} + +/*************************************************************************************************/ +/*! + * \brief Stop extended advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActStop(dmAdvMsg_t *pMsg) +{ + uint8_t i; + uint8_t numSets = 0; + uint8_t advHandle[DM_NUM_ADV_SETS] = {0}; + + /* find out which of advertising set's currently enabled */ + for (i = 0; i < pMsg->apiStop.numSets; i++) + { + /* if doing advertising */ + if (dmAdvCb.advType[pMsg->apiStop.advHandle[i]] != DM_ADV_NONE) + { + advHandle[numSets++] = pMsg->apiStop.advHandle[i]; + } + } + + if (dmExtAdvCmdCmplPending() || dmExtAdvCheckState(numSets, advHandle, DM_ADV_STATE_ADVERTISING) == FALSE) + { + DM_TRACE_WARN0("DmAdvStop ignored due to advState or pending command complete"); + return; + } + + /* if doing directed advertising ignore the request */ + if (dmAdvDirectedEnabled(numSets, advHandle)) + { + DM_TRACE_WARN0("DmAdvStop during directed advertising!"); + return; + } + + /* if advertising's enabled for any set */ + if ((pMsg->apiStop.numSets == 0) || (numSets > 0)) + { + /* stop advertising */ + dmAdvStop(numSets, advHandle, DM_ADV_STATE_STOPPING); + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove an advertising set action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActRemoveSet(dmAdvMsg_t *pMsg) +{ + uint8_t advHandle = pMsg->apiRemove.advHandle; + + /* if already advertising */ + if (dmExtAdvCheckState(1, &advHandle, DM_ADV_STATE_ADVERTISING)) + { + if (dmExtAdvCmdCmplPending() == FALSE) + { + /* stop advertising */ + dmAdvStop(1, &advHandle, DM_ADV_STATE_REMOVING_SET); + } + } + else + { + /* remove advertising set */ + HciLeRemoveAdvSet(advHandle); + + /* clear advertising set record */ + dmAdvCbInit(advHandle); + dmExtAdvCbInit(advHandle); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActClearSets(dmAdvMsg_t *pMsg) +{ + if (dmExtAdvCheckState(HCI_ADV_NUM_SETS_ALL_DISABLE, NULL, DM_ADV_STATE_ADVERTISING)) + { + if (dmExtAdvCmdCmplPending() == FALSE) + { + /* Stop advertising and set DM_ADV_STATE_CLEARING_SETS state */ + dmAdvStop(HCI_ADV_NUM_SETS_ALL_DISABLE, NULL, DM_ADV_STATE_CLEARING_SETS); + } + } + else + { + uint8_t i; + + /* clear all advertising set records */ + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + dmAdvCbInit(i); + dmExtAdvCbInit(i); + } + + /* clear all advertising sets */ + HciLeClearAdvSets(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the random device address for a given advertising set. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActSetRandAddr(dmAdvMsg_t *pMsg) +{ + /* set new address in HCI */ + HciLeSetAdvSetRandAddrCmd(pMsg->apiSetRandAddr.advHandle, pMsg->apiSetRandAddr.addr); +} + +/*************************************************************************************************/ +/*! + * \brief Start periodic advertising for the specified advertising handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmPerAdvStart(uint8_t advHandle) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS) + + /* start periodic advertising */ + dmPerAdvCb[advHandle].advState = DM_ADV_PER_STATE_STARTING; + HciLeSetPerAdvEnableCmd(TRUE, advHandle); +} + +/*************************************************************************************************/ +/*! +* \brief Stop periodic advertising for the specified advertising handle. +* +* \param advHandle Advertising handle. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmPerAdvStop(uint8_t advHandle) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS) + + /* stop periodic advertising */ + dmPerAdvCb[advHandle].advState = DM_ADV_PER_STATE_STOPPING; + HciLeSetPerAdvEnableCmd(FALSE, advHandle); +} + +/*************************************************************************************************/ +/*! + * \brief Get the handle of a pending periodic advertising action. + * + * \param None. + * + * \return Handle or DM_NUM_ADV_SETS if none are pending. + */ +/*************************************************************************************************/ +static uint8_t dmPerAdvCmdCmplPending(void) +{ + uint8_t i; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if ((dmPerAdvCb[i].advState != DM_ADV_PER_STATE_IDLE) && + (dmPerAdvCb[i].advState != DM_ADV_PER_STATE_ADVERTISING)) + { + return i; + } + } + + return DM_NUM_ADV_SETS; +} + +/*************************************************************************************************/ +/*! + * \brief Get the state for the specified periodic advertising handle. + * + * \param advHandle Advertising handle. + * + * \return Advertising state. + */ +/*************************************************************************************************/ +uint8_t dmPerAdvState(uint8_t advHandle) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS) + + /* return state */ + return dmPerAdvCb[advHandle].advState; +} + +/*************************************************************************************************/ +/*! + * \brief Configure periodic advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvActConfig(dmAdvMsg_t *pMsg) +{ + uint8_t advHandle; + uint16_t advProps; + + /* initialize local variables */ + advHandle = pMsg->apiPerConfig.advHandle; + advProps = 0; + + /* include TxPower in extended header of advertising PDU */ + if (dmPerAdvCb[advHandle].incTxPwr) + { + /* set bit 6 */ + advProps |= HCI_ADV_PROP_INC_TX_PWR_BIT; + } + + /* set periodic advertising parameters */ + HciLeSetPerAdvParamCmd(advHandle, dmPerAdvCb[advHandle].intervalMin, + dmPerAdvCb[advHandle].intervalMax, advProps); +} + +/*************************************************************************************************/ +/*! + * \brief Set the periodic advertising data to the given data. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvActSetData(dmAdvMsg_t *pMsg) +{ + /* set new data in HCI */ + HciLeSetPerAdvDataCmd(pMsg->apiPerSetData.advHandle, pMsg->apiPerSetData.op, + pMsg->apiPerSetData.len, pMsg->apiPerSetData.pData); +} + +/*************************************************************************************************/ +/*! + * \brief Start periodic advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvActStart(dmAdvMsg_t *pMsg) +{ + /* if any pending periodic advertising command complete */ + if (dmPerAdvCmdCmplPending() < DM_NUM_ADV_SETS) + { + DM_TRACE_WARN0("DmPerAdvStart ignored due to advState or pending command complete"); + return; + } + + /* start periodic advertising */ + dmPerAdvStart(pMsg->apiPerStart.advHandle); +} + +/*************************************************************************************************/ +/*! + * \brief Stop periodic advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvActStop(dmAdvMsg_t *pMsg) +{ + /* if any pending periodic advertising command complete */ + if (dmPerAdvCmdCmplPending() < DM_NUM_ADV_SETS) + { + DM_TRACE_WARN0("DmPerAdvStop ignored due to advState or pending command complete"); + return; + } + + /* stop periodic advertising */ + dmPerAdvStop(pMsg->apiPerStop.advHandle); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an advertising timeout. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActTimeout(dmAdvMsg_t *pMsg) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief DM extended advertising HCI adv enbale command complete event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvActHciEnableCmpl(hciEvt_t *pEvent) +{ + uint8_t i; + uint8_t advType; + uint8_t cbackEvent = 0; + bool_t clearSets = FALSE; + dmEvt_t dmMsg; + + memcpy(&dmMsg, &pEvent->hdr, sizeof(wsfMsgHdr_t)); + dmMsg.advSetStart.numSets = 0; + + for ( i= 0; i < DM_NUM_ADV_SETS; i++) + { + switch(dmAdvCb.advState[i]) + { + case DM_ADV_STATE_STOPPING: + case DM_ADV_STATE_STOPPING_DIRECTED: + dmMsg.advSetStop.advHandle = i; + advType = dmAdvCb.advType[i]; + + if (dmMsg.hdr.status == HCI_SUCCESS) + { + dmAdvCb.advType[i] = DM_ADV_NONE; + dmAdvCb.advState[i] = DM_ADV_STATE_IDLE; + dmExtAdvCb[i].connId = DM_CONN_ID_NONE; + + /* pass advertising stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_ADV_SET_STOP_IND, i, 0); + } + else + { + dmAdvCb.advState[i] = DM_ADV_STATE_ADVERTISING; + } + + /* if not connectable directed advertising */ + if ((advType != DM_ADV_NONE) && !DM_ADV_CONN_DIRECTED(advType)) + { + cbackEvent = DM_ADV_SET_STOP_IND; + } + break; + + case DM_ADV_STATE_STARTING: + case DM_ADV_STATE_STARTING_DIRECTED: + dmMsg.advSetStart.advHandle[dmMsg.advSetStart.numSets++] = i; + + if (dmMsg.hdr.status == HCI_SUCCESS) + { + /* pass advertising start event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_START, DM_ADV_SET_START_IND, i, 0); + + /* store advertising type */ + dmAdvCb.advType[i] = dmExtAdvCb[i].advType; + dmAdvCb.advState[i] = DM_ADV_STATE_ADVERTISING; + } + else + { + dmAdvCb.advState[i] = DM_ADV_STATE_IDLE; + } + + /* if not connectable directed advertising */ + if (!DM_ADV_CONN_DIRECTED(dmExtAdvCb[i].advType)) + { + cbackEvent = DM_ADV_SET_START_IND; + } + break; + + case DM_ADV_STATE_REMOVING_SET: + case DM_ADV_STATE_CLEARING_SETS: + if (dmMsg.hdr.status == HCI_SUCCESS) + { + dmAdvCbInit(i); + dmExtAdvCbInit(i); + + if (dmAdvCb.advState[i] == DM_ADV_STATE_REMOVING_SET) + { + HciLeRemoveAdvSet(i); + + /* pass advertising set removed to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_ADV_SET_REMOVE, i, 0); + } + else + { + clearSets = TRUE; + } + + dmAdvCb.advType[i] = DM_ADV_NONE; + dmAdvCb.advState[i] = DM_ADV_STATE_IDLE; + dmExtAdvCb[i].connId = DM_CONN_ID_NONE; + } + else + { + dmAdvCb.advState[i] = DM_ADV_STATE_ADVERTISING; + } + break; + + default: + break; + } + } + + /* clear all advertising sets */ + if (clearSets) + { + HciLeClearAdvSets(); + + /* pass advertising sets cleared to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_ADV_SETS_CLEAR, 0, 0); + } + + /* call app callback */ + if (cbackEvent) + { + dmMsg.hdr.event = cbackEvent; + (*dmCb.cback)((dmEvt_t *) &dmMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM extended advertising HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvHciHandler(hciEvt_t *pEvent) +{ + if (pEvent->hdr.event == HCI_LE_ADV_SET_TERM_CBACK_EVT) + { + uint8_t advHandle = pEvent->leAdvSetTerm.advHandle; + uint8_t advType = dmAdvCb.advType[advHandle]; + + DM_TRACE_INFO2("dmExtAdvHciHandler: event: %d state: %d", pEvent->hdr.event, dmAdvCb.advState[advHandle]); + + /* clear advertising info */ + dmAdvCb.advType[advHandle] = DM_ADV_NONE; + dmAdvCb.advState[advHandle] = DM_ADV_STATE_IDLE; + dmExtAdvCb[advHandle].connId = DM_CONN_ID_NONE; + + /* pass advertising stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_ADV_SET_STOP_IND, advHandle, 0); + + if (advType != DM_ADV_NONE) + { + /* if not connectable directed advertising */ + if (!DM_ADV_CONN_DIRECTED(advType)) + { + pEvent->hdr.event = DM_ADV_SET_STOP_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + /* else if low duty cycle directed advertising failed to create connection */ + else if (pEvent->leAdvSetTerm.status != HCI_SUCCESS) + { + /* generate connection compelete event */ + dmAdvGenConnCmpl(advHandle, pEvent->leAdvSetTerm.status); + } + } + } + else if (pEvent->hdr.event == HCI_LE_SCAN_REQ_RCVD_CBACK_EVT) + { + DM_TRACE_INFO2("dmExtAdvHciHandler: event: %d state: %d", pEvent->hdr.event, dmAdvCb.advState[pEvent->leScanReqRcvd.advHandle]); + + pEvent->hdr.event = DM_SCAN_REQ_RCVD_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + else if (pEvent->hdr.event == HCI_LE_EXT_ADV_ENABLE_CMD_CMPL_CBACK_EVT) + { + DM_TRACE_INFO1("dmExtAdvHciHandler: event: %d", pEvent->hdr.event); + + dmExtAdvActHciEnableCmpl(pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM extended adv event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmAdvAct[DM_MSG_MASK(pMsg->event)])((dmAdvMsg_t *)pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the extended advertising module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvReset(void) +{ + hciLeAdvSetTermEvt_t advSetStop; + uint8_t i; + + /* generate advertising set stopped event */ + advSetStop.hdr.event = DM_ADV_SET_STOP_IND; + advSetStop.hdr.status = advSetStop.status = HCI_SUCCESS; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + /* if stopping advertisement or advertising */ + if ((dmAdvCb.advState[i] == DM_ADV_STATE_STOPPING) || + (dmAdvCb.advState[i] == DM_ADV_STATE_STOPPING_DIRECTED) || + (dmAdvCb.advState[i] == DM_ADV_STATE_ADVERTISING)) + { + /* set advertising handle */ + advSetStop.hdr.param = advSetStop.advHandle = i; + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) &advSetStop); + } + + /* initialize extended control block */ + dmExtAdvCbInit(i); + } + + /* reset legacy adv module */ + dmAdvInit(); +} + +/*************************************************************************************************/ +/*! + * \brief DM periodic advertising HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvHciHandler(hciEvt_t *pEvent) +{ + dmEvt_t dmMsg; + + memcpy(&dmMsg, &pEvent->hdr, sizeof(wsfMsgHdr_t)); + + if (dmMsg.hdr.event == HCI_LE_PER_ADV_ENABLE_CMD_CMPL_CBACK_EVT) + { + uint8_t advHandle = dmPerAdvCmdCmplPending(); + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS) + + switch (dmPerAdvCb[advHandle].advState) + { + case DM_ADV_PER_STATE_STARTING: + dmMsg.perAdvSetStart.advHandle = advHandle; + dmMsg.hdr.event = DM_PER_ADV_SET_START_IND; + dmPerAdvCb[advHandle].advState = (dmMsg.hdr.status == HCI_SUCCESS) ? \ + DM_ADV_PER_STATE_ADVERTISING : DM_ADV_PER_STATE_IDLE; + + /* call client callback */ + (*dmCb.cback)(&dmMsg); + break; + + case DM_ADV_PER_STATE_STOPPING: + dmMsg.perAdvSetStop.advHandle = advHandle; + dmMsg.hdr.event = DM_PER_ADV_SET_STOP_IND; + /* coverity[overrun-local] */ + dmPerAdvCb[advHandle].advState = (dmMsg.hdr.status == HCI_SUCCESS) ? \ + DM_ADV_PER_STATE_IDLE : DM_ADV_PER_STATE_ADVERTISING; + + /* call client callback */ + (*dmCb.cback)(&dmMsg); + break; + + default: + /* Should not happen */ + WSF_ASSERT(0); + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM periodic adv event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmPerAdvAct[DM_MSG_MASK(pMsg->event)])((dmAdvMsg_t *)pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the periodic advertising module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPerAdvReset(void) +{ + dmPerAdvSetStopEvt_t perAdvSetStop; + uint8_t i; + + /* generate periodic advertising set stopped event */ + perAdvSetStop.hdr.event = DM_PER_ADV_SET_STOP_IND; + perAdvSetStop.hdr.status = HCI_SUCCESS; + + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + /* if periodic advertising enabled */ + if ((dmPerAdvCb[i].advState == DM_ADV_PER_STATE_STOPPING) || + (dmPerAdvCb[i].advState == DM_ADV_PER_STATE_ADVERTISING)) + { + /* set advertising handle */ + perAdvSetStop.hdr.param = perAdvSetStop.advHandle = i; + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) &perAdvSetStop); + } + + /* initialize periodic control block */ + dmPerAdvCbInit(i); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start directed extended advertising. + * + * \param connId Connection identifer. + * \param advHandle Advertising handle. + * \param advType Advertising type. + * \param duration Advertising duration (in milliseconds). + * \param maxEaEvents Maximum number of extended advertising events. + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvStartDirected(dmConnId_t connId, uint8_t advHandle, uint8_t advType, uint16_t duration, + uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr) +{ + if (dmExtAdvCmdCmplPending() || dmExtAdvCheckState(1, &advHandle, DM_ADV_STATE_IDLE) == FALSE) + { + return; + } + + /* start directed advertising */ + dmAdvStart(1, &advHandle, &duration, &maxEaEvents, ((advType == DM_ADV_CONN_DIRECT) ? \ + DM_ADV_STATE_STARTING_DIRECTED : DM_ADV_STATE_STARTING)); + + /* store advertising info */ + BdaCpy(dmAdvCb.peerAddr[advHandle], pAddr); + dmAdvCb.peerAddrType[DM_ADV_HANDLE_DEFAULT] = addrType; + dmExtAdvCb[advHandle].connId = connId; +} + +/*************************************************************************************************/ +/*! + * \brief Stop directed extended advertising. + * + * \param connId Connection identifer. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvStopDirected(dmConnId_t connId) +{ + uint8_t advHandle; + + if (dmExtAdvCmdCmplPending()) + { + return; + } + + /* see if high duty cycle directed advertising's enabled */ + advHandle = dmAdvDirectedByConnId(connId); + if (advHandle < DM_NUM_ADV_SETS) + { + /* stop directed advertising */ + dmAdvStop(1, &advHandle, ((dmAdvCb.advType[advHandle] == DM_ADV_CONN_DIRECT) ? \ + DM_ADV_STATE_STOPPING_DIRECTED : DM_ADV_STATE_STOPPING)); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called when a connection is established from directed advertising. + * + * \param connId Connection identifer. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvConnected(dmConnId_t connId) +{ + dmAdvDirectedDisable(connId); +} + +/*************************************************************************************************/ +/*! + * \brief This function is called when a directed advertising connection fails. + * + * \param connId Connection identifer. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtAdvConnectFailed(dmConnId_t connId) +{ + dmAdvDirectedDisable(connId); +} + +/*************************************************************************************************/ +/*! + * \brief Set the advertising parameters for periodic advertising. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvConfig(uint8_t advHandle) +{ + dmAdvPerApiConfig_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiConfig_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_PER_MSG_API_CONFIG; + pMsg->advHandle = advHandle; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the advertising data to the given data for periodic advertising. + * + * \param advHandle Advertising handle. + * \param op Data operation. + * \param len Length of the data. Maximum length is 236 bytes. + * \param pData Pointer to the data. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvSetData(uint8_t advHandle, uint8_t op, uint8_t len, uint8_t *pData) +{ + dmAdvPerApiSetData_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + WSF_ASSERT(len <= HCI_PER_ADV_DATA_LEN); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiSetData_t) + len)) != NULL) + { + pMsg->hdr.event = DM_ADV_PER_MSG_API_SET_DATA; + pMsg->advHandle = advHandle; + pMsg->op = op; + pMsg->len = len; + memcpy(pMsg->pData, pData, len); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start periodic advertising for the advertising set specified by the advertising handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvStart(uint8_t advHandle) +{ + dmAdvPerApiStart_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiStart_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_PER_MSG_API_START; + pMsg->advHandle = advHandle; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop periodic advertising for the advertising set specified by the advertising handle. + * + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvStop(uint8_t advHandle) +{ + dmAdvPerApiStop_t *pMsg; + + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + if ((pMsg = WsfMsgAlloc(sizeof(dmAdvPerApiStop_t))) != NULL) + { + pMsg->hdr.event = DM_ADV_PER_MSG_API_STOP; + pMsg->advHandle = advHandle; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set whether or not to use legacy advertising PDUs with extended advertising. + * + * \param advHandle Advertising handle. + * \param useLegacyPdu Whether to use legacy advertising PDUs (default value is TRUE). + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvUseLegacyPdu(uint8_t advHandle, bool_t useLegacyPdu) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].useLegacyPdu = useLegacyPdu; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set whether or not to omit advertiser's address from all PDUs (anonymous advertising). + * + * \param advHandle Advertising handle. + * \param omitAdvAddr Whether to omit advertiser's address from all PDUs (default value is FALSE). + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvOmitAdvAddr(uint8_t advHandle, bool_t omitAdvAddr) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].omitAdvAddr = omitAdvAddr; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set whether or not to include TxPower in extended header of advertising PDU. + * + * \param advHandle Advertising handle. + * \param incTxPwr Whether to include TxPower in extended header of advertising PDU (default + * value is FALSE). + * \param advTxPwr Advertising tx power (127 = no preference). + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr, int8_t advTxPwr) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].incTxPwr = incTxPwr; + dmExtAdvCb[advHandle].advTxPwr = advTxPwr; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set extended advertising PHY parameters. + * + * \param advHandle Advertising handle. + * \param priAdvPhy Primary advertising Phy. + * \param secAdvMaxSkip Maximum advertising events Controller can skip before sending AUX_ADV_IND + * on secondary advertising channel (0 = AUX_ADV_IND will be sent prior to + * next advertising event). + * \param secAdvPhy Secondary advertising Phy. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetPhyParam(uint8_t advHandle, uint8_t priAdvPhy, uint8_t secAdvMaxSkip, uint8_t secAdvPhy) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].priAdvPhy = priAdvPhy; + dmExtAdvCb[advHandle].secAdvMaxSkip = secAdvMaxSkip; + dmExtAdvCb[advHandle].secAdvPhy = secAdvPhy; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set scan request notification enable. + * + * \param advHandle Advertising handle. + * \param scanReqNotifEna Scan request notification enable. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvScanReqNotifEnable(uint8_t advHandle, bool_t scanReqNotifEna) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].scanReqNotifEna = scanReqNotifEna; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set fragment preference for advertising data. + * + * \param advHandle Advertising handle. + * \param fragPref Fragment preference. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvSetFragPref(uint8_t advHandle, uint8_t fragPref) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmExtAdvCb[advHandle].fragPref = fragPref; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the minimum and maximum advertising intervals for periodic advertising. + * + * \param advHandle Advertising handle. + * \param intervalMin Minimum advertising interval. + * \param intervalMax Maximum advertising interval. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvSetInterval(uint8_t advHandle, uint16_t intervalMin, uint16_t intervalMax) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmPerAdvCb[advHandle].intervalMin = intervalMin; + dmPerAdvCb[advHandle].intervalMax = intervalMax; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set whether or not to include TxPower in extended header of advertising PDU for + * periodic advertising. + * + * \param advHandle Advertising handle. + * \param incTxPwr Whether to include TxPower in extended header of advertising PDU (default + * value is FALSE). + * + * \return None. + */ +/*************************************************************************************************/ +void DmPerAdvIncTxPwr(uint8_t advHandle, bool_t incTxPwr) +{ + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + WsfTaskLock(); + dmPerAdvCb[advHandle].incTxPwr = incTxPwr; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Get the maximum advertising data length supported by Controller for a given advertising + * type. + * + * \param advType Advertising type. + * \param useLegacyPdu Whether to use legacy advertising PDUs with extended advertising. + * + * \return Maximum advertising data length. + */ +/*************************************************************************************************/ +uint16_t DmExtMaxAdvDataLen(uint8_t advType, bool_t useLegacyPdu) +{ + return dmExtMaxAdvDataLen(advType, useLegacyPdu, FALSE); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM extended advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtAdvInit(void) +{ + WsfTaskLock(); + + /* set function interface table */ + dmFcnIfTbl[DM_ID_ADV] = (dmFcnIf_t *) &dmAdvFcnIf; + dmFcnIfTbl[DM_ID_ADV_PER] = (dmFcnIf_t *) &dmPerAdvFcnIf; + + /* initialize extended/periodic adv modules */ + dmExtAdvInit(); + dmPerAdvInit(); + + /* register set advertising set random address callback with DM Dev Privacy */ + dmDevCb.advSetRandAddrCback = HciLeSetAdvSetRandAddrCmd; + + /* initialize HCI VS AE module */ + HciVsAeInit(0); + + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Whether DM advertising is in extended mode. + * + * \return TRUE if DM advertising is in extended mode. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t DmAdvModeExt(void) +{ + return (dmFcnIfTbl[DM_ID_ADV] == (dmFcnIf_t *) &dmAdvFcnIf) ? TRUE : FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_leg.c new file mode 100644 index 0000000000000000000000000000000000000000..ae45fc603b70c60ce72d85220c24abf3538992ec --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_adv_leg.c @@ -0,0 +1,560 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager advertising module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_adv.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Control block for legacy advertising module */ +typedef struct +{ + uint8_t advType; /*!< Advertising type. */ +} dmLegAdvCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* action function table */ +static const dmAdvAct_t dmAdvAct[] = +{ + dmAdvActConfig, + dmAdvActSetData, + dmAdvActStart, + dmAdvActStop, + dmAdvActRemoveSet, + dmAdvActClearSets, + dmAdvActSetRandAddr, + dmAdvActTimeout +}; + +/* Component function interface */ +static const dmFcnIf_t dmAdvFcnIf = +{ + dmAdvReset, + dmAdvHciHandler, + dmAdvMsgHandler +}; + +/* control block */ +static dmLegAdvCb_t dmLegAdvCb; + +/*************************************************************************************************/ +/*! + * \brief Set the advertising parameters using the given advertising type, and peer address. + * + * \param advType Advertising type. + * \param peerAddrType Peer address type. + * \param pPeerAddr Peer address. + * + * \return None. +*/ +/*************************************************************************************************/ +static void dmAdvConfig(uint8_t advType, uint8_t peerAddrType, uint8_t *pPeerAddr) +{ + /* set advertising parameters */ + HciLeSetAdvParamCmd(dmAdvCb.intervalMin[DM_ADV_HANDLE_DEFAULT], /* advIntervalMin */ + dmAdvCb.intervalMax[DM_ADV_HANDLE_DEFAULT], /* advIntervalMax */ + advType, /* advType */ + DmLlAddrType(dmCb.advAddrType), /* ownAddrType */ + peerAddrType, /* peerAddrType */ + pPeerAddr, /* pPeerAddr */ + dmAdvCb.channelMap[DM_ADV_HANDLE_DEFAULT], /* advChanMap */ + dmCb.advFiltPolicy[DM_ADV_HANDLE_DEFAULT]); /* advFiltPolicy */ + + /* store advertising type */ + dmLegAdvCb.advType = advType; +} + +/*************************************************************************************************/ +/*! + * \brief Start advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActConfig(dmAdvMsg_t *pMsg) +{ + DM_TRACE_INFO1("dmAdvActConfig: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE) + { + /* if doing directed advertising ignore the request */ + if ((dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT) || + (dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT_LO_DUTY)) + { + DM_TRACE_WARN0("DmAdvConfig during directed advertising!"); + return; + } + + /* set advertising parameters */ + dmAdvConfig(pMsg->apiConfig.advType, pMsg->apiConfig.peerAddrType, pMsg->apiConfig.peerAddr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the advertising or scan response data to the given data. + * + * \param location Data location. + * \param len Length of the data. Maximum length is 31 bytes. + * \param pData Pointer to the data. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActSetData(dmAdvMsg_t *pMsg) +{ + WSF_ASSERT(pMsg->apiSetData.len <= HCI_ADV_DATA_LEN); + + DM_TRACE_INFO1("dmAdvActSetData: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE) + { + /* set new data in HCI */ + if (pMsg->apiSetData.location == DM_DATA_LOC_ADV) + { + HciLeSetAdvDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); + } + else + { + HciLeSetScanRespDataCmd(pMsg->apiSetData.len, pMsg->apiSetData.pData); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Start advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActStart(dmAdvMsg_t *pMsg) +{ + DM_TRACE_INFO1("dmAdvActStart: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE) + { + /* if doing directed advertising ignore the request */ + if ((dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT) || + (dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT_LO_DUTY)) + { + DM_TRACE_WARN0("dmAdvActStart during directed advertising!"); + return; + } + + /* start advertising */ + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_STARTING; + dmAdvCb.advDuration[DM_ADV_HANDLE_DEFAULT] = pMsg->apiStart.duration[DM_ADV_HANDLE_DEFAULT]; + HciLeSetAdvEnableCmd(TRUE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop advertising action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActStop(dmAdvMsg_t *pMsg) +{ + DM_TRACE_INFO1("dmAdvActStop: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_ADVERTISING) + { + /* if doing directed advertising ignore the request */ + if ((dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT) || + (dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] == DM_ADV_CONN_DIRECT_LO_DUTY)) + { + DM_TRACE_WARN0("DmAdvStop during directed advertising!"); + return; + } + + /* disable advertising */ + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_STOPPING; + HciLeSetAdvEnableCmd(FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove an advertising set action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActRemoveSet(dmAdvMsg_t *pMsg) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief Clear advertising sets action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActClearSets(dmAdvMsg_t *pMsg) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! +* \brief Set the random device address for a given advertising set. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmAdvActSetRandAddr(dmAdvMsg_t *pMsg) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief Handle an advertising timeout. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvActTimeout(dmAdvMsg_t *pMsg) +{ + DM_TRACE_INFO0("dmAdvActTimeout!"); + + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_ADVERTISING) + { + /* disable advertising */ + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_STOPPING; + HciLeSetAdvEnableCmd(FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Reset the legacy adv module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvReset(void) +{ + wsfMsgHdr_t advStop; + + /* if stopping undirected advertisement or advertising but not high duty cycle directed adv */ + if ((dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_STOPPING) || + ((dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_ADVERTISING) && + (dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] != DM_ADV_CONN_DIRECT))) + { + /* stop advertising timer */ + WsfTimerStop(&dmAdvCb.advTimer); + + /* generate advertising stop event */ + advStop.status = HCI_SUCCESS; + advStop.event = DM_ADV_STOP_IND; + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) &advStop); + } + + /* reset legacy adv module */ + dmAdvInit(); +} + +/*************************************************************************************************/ +/*! + * \brief DM adv HCI event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvHciHandler(hciEvt_t *pEvent) +{ + if (pEvent->hdr.event == HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT) + { + uint8_t cbackEvent = 0; + + DM_TRACE_INFO1("HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + switch (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]) + { + case DM_ADV_STATE_STARTING: + case DM_ADV_STATE_STARTING_DIRECTED: + if (pEvent->hdr.status == HCI_SUCCESS) + { + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_STARTING) + { + /* start advertising timer if applicable */ + if (dmAdvCb.advDuration[DM_ADV_HANDLE_DEFAULT] > 0) + { + dmAdvCb.advTimer.msg.event = DM_ADV_MSG_TIMEOUT; + WsfTimerStartMs(&dmAdvCb.advTimer, dmAdvCb.advDuration[DM_ADV_HANDLE_DEFAULT]); + } + + /* Application callbacks only sent in undirected state */ + if (dmLegAdvCb.advType != DM_ADV_CONN_DIRECT_LO_DUTY) + { + cbackEvent = DM_ADV_START_IND; + } + } + + /* pass advertising start event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_START, DM_ADV_START_IND, 0, 0); + + /* store advertising type and state */ + dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] = dmLegAdvCb.advType; + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_ADVERTISING; + } + else + { + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_IDLE; + } + break; + + case DM_ADV_STATE_STOPPING: + case DM_ADV_STATE_STOPPING_DIRECTED: + if (pEvent->hdr.status == HCI_SUCCESS) + { + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_STOPPING) + { + /* stop advertising timer */ + WsfTimerStop(&dmAdvCb.advTimer); + + /* Application and DM callbacks only sent in undirected or low duty cycle directed state */ + if (dmLegAdvCb.advType == DM_ADV_CONN_DIRECT_LO_DUTY) + { + cbackEvent = HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT; + } + else + { + cbackEvent = DM_ADV_STOP_IND; + } + } + + /* pass advertising stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_ADV_STOP_IND, 0, 0); + + /* store advertising type and state */ + dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] = DM_ADV_NONE; + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_IDLE; + } + else + { + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_ADVERTISING; + } + break; + + default: + /* ignore the event */ + break; + } + + /* if DM conn notify needed */ + if (cbackEvent == HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT) + { + dmAdvGenConnCmpl(DM_ADV_HANDLE_DEFAULT, HCI_ERR_ADV_TIMEOUT); + } + /* else if app callback needed */ + else if (cbackEvent) + { + pEvent->hdr.event = cbackEvent; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM adv event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmAdvAct[DM_MSG_MASK(pMsg->event)])((dmAdvMsg_t *)pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Start directed advertising. + * + * \param advType Advertising type. + * \param duration Advertising duration (in ms). + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvStartDirected(uint8_t advType, uint16_t duration, uint8_t addrType, uint8_t *pAddr) +{ + DM_TRACE_INFO1("dmAdvStartDirected: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + /* if not advertising */ + if (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_IDLE) + { + /* start advertising */ + HciLeSetAdvEnableCmd(TRUE); + + /* store advertising info */ + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = (advType == DM_ADV_CONN_DIRECT) ? \ + DM_ADV_STATE_STARTING_DIRECTED : DM_ADV_STATE_STARTING; + + dmAdvCb.advDuration[DM_ADV_HANDLE_DEFAULT] = duration; + BdaCpy(dmAdvCb.peerAddr[DM_ADV_HANDLE_DEFAULT], pAddr); + dmAdvCb.peerAddrType[DM_ADV_HANDLE_DEFAULT] = addrType; + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop directed advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvStopDirected(void) +{ + DM_TRACE_INFO1("dmAdvStopDirected: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + /* if advertising or starting advertising */ + if ((dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_ADVERTISING) || + (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_STARTING) || + (dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] == DM_ADV_STATE_STARTING_DIRECTED)) + { + /* disable advertising */ + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = (dmLegAdvCb.advType == DM_ADV_CONN_DIRECT) ? \ + DM_ADV_STATE_STOPPING_DIRECTED : DM_ADV_STATE_STOPPING; + HciLeSetAdvEnableCmd(FALSE); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called when a connection is established from directed advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvConnected(void) +{ + DM_TRACE_INFO1("dmAdvConnected: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + WsfTimerStop(&dmAdvCb.advTimer); + + /* pass advertising stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_ADV_STOP_IND, 0, 0); + + dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] = DM_ADV_NONE; + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_IDLE; +} + +/*************************************************************************************************/ +/*! + * \brief This function is called when a directed advertising connection fails. + * + * \return None. + */ +/*************************************************************************************************/ +void dmAdvConnectFailed(void) +{ + DM_TRACE_INFO1("dmAdvConnectFailed: state: %d", dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT]); + + WsfTimerStop(&dmAdvCb.advTimer); + + /* pass advertising stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_ADV_STOP_IND, 0, 0); + + dmAdvCb.advType[DM_ADV_HANDLE_DEFAULT] = DM_ADV_NONE; + dmAdvCb.advState[DM_ADV_HANDLE_DEFAULT] = DM_ADV_STATE_IDLE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM legacy advertising. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAdvInit(void) +{ + WsfTaskLock(); + + /* set function interface table */ + dmFcnIfTbl[DM_ID_ADV] = (dmFcnIf_t *) &dmAdvFcnIf; + + /* initialize legacy adv module */ + dmAdvInit(); + + /* clear set advertising set random address callback */ + dmDevCb.advSetRandAddrCback = NULL; + + /* initialize HCI VS module */ + HciVsInit(0); + + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Whether DM advertising is in legacy mode. + * + * \return TRUE if DM advertising is in legacy mode. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t DmAdvModeLeg(void) +{ + return (dmFcnIfTbl[DM_ID_ADV] == (dmFcnIf_t *) &dmAdvFcnIf) ? TRUE : FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.c new file mode 100644 index 0000000000000000000000000000000000000000..fd600d0f945b689e99131646093cdfc83dc9c523 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.c @@ -0,0 +1,1593 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" +#include "dm_conn.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Translate HCI event to state machine message */ +#define DM_CONN_HCI_EVT_2_MSG(evt) (DM_CONN_MSG_HCI_DISCONNECT_CMPL - 3 + (evt)) + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Conn spec defaults */ +static const hciConnSpec_t dmConnSpecDefaults = +{ + DM_GAP_INITIAL_CONN_INT_MIN, + DM_GAP_INITIAL_CONN_INT_MAX, + DM_GAP_CONN_EST_LATENCY, + DM_DEFAULT_EST_SUP_TIMEOUT, + DM_GAP_CONN_EST_MIN_CE_LEN, + DM_GAP_CONN_EST_MAX_CE_LEN +}; + +/* Action set for this module */ +static const dmConnAct_t dmConnActSetMain[] = +{ + dmConnSmActNone, + dmConnSmActClose, + dmConnSmActConnOpened, + dmConnSmActConnFailed, + dmConnSmActConnClosed, + dmConnSmActHciUpdated +}; + +/* Component function interface */ +static const dmFcnIf_t dmConnFcnIf = +{ + dmConnReset, + dmConnHciHandler, + dmConnMsgHandler +}; + +/* Component 2 function interface */ +static const dmFcnIf_t dmConn2FcnIf = +{ + dmEmptyReset, + dmConn2HciHandler, + dmConn2MsgHandler +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +dmConnCb_t dmConnCb; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ +static void dmConn2ActRssiRead(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActRemoteConnParamReq(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActDataLenChange(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActWriteAuthToCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActAuthToExpired(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActReadRemoteFeaturesCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmConn2ActReadRemoteVerInfoCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent); + +/*************************************************************************************************/ +/*! + * \brief Return the CCB with particular state conditions. + * + * \return Pointer to CCB or NULL if failure. + */ +/*************************************************************************************************/ +static dmConnCcb_t *dmConnCmplStates(void) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i; + + /* if there's a ccb in accepting state */ + for (i = DM_CONN_MAX; i > 0; i--, pCcb++) + { + /* look for connection in accepting state or disconnecting state, cancelled connection */ + if (pCcb->inUse && + ((pCcb->state == DM_CONN_SM_ST_ACCEPTING) || + ((pCcb->state == DM_CONN_SM_ST_DISCONNECTING) && (pCcb->handle == DM_CONN_HCI_HANDLE_NONE)))) + { + DM_TRACE_INFO1("dmConnCmplStates %d", pCcb->connId); + return pCcb; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a DM connection control block. + * + * \param pAddr BD address for connection. + * + * \return Pointer to CCB or NULL if failure. + */ +/*************************************************************************************************/ +dmConnCcb_t *dmConnCcbAlloc(uint8_t *pAddr) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i; + + for (i = 0; i < DM_CONN_MAX; i++, pCcb++) + { + if (pCcb->inUse == FALSE) + { + memset(pCcb, 0, sizeof(dmConnCcb_t)); + + BdaCpy(pCcb->peerAddr, pAddr); + pCcb->handle = DM_CONN_HCI_HANDLE_NONE; + pCcb->connId = i + 1; + pCcb->updating = FALSE; + pCcb->inUse = TRUE; + pCcb->featuresPresent = FALSE; + + DM_TRACE_ALLOC1("dmConnCcbAlloc %d", pCcb->connId); + + return pCcb; + } + } + + DM_TRACE_ERR0("dmConnCcbAlloc failed"); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Deallocate a DM connection control block. + * + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnCcbDealloc(dmConnCcb_t *pCcb) +{ + DM_TRACE_FREE1("dmConnCcbDealloc %d", pCcb->connId); + + pCcb->inUse = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Find a connection control block with matching handle. + * + * \param handle Handle to find. + * + * \return Pointer to CCB or NULL if failure. + */ +/*************************************************************************************************/ +dmConnCcb_t *dmConnCcbByHandle(uint16_t handle) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i; + + for (i = DM_CONN_MAX; i > 0; i--, pCcb++) + { + if (pCcb->inUse && (pCcb->handle == handle)) + { + return pCcb; + } + } + + DM_TRACE_WARN1("dmConnCcbByHandle not found 0x%04x", handle); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Find a connection control block with BD address. + * + * \param pAddr BD address to find. + * + * \return Pointer to CCB or NULL if failure. + */ +/*************************************************************************************************/ +dmConnCcb_t *dmConnCcbByBdAddr(uint8_t *pAddr) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i; + + for (i = DM_CONN_MAX; i > 0; i--, pCcb++) + { + if (pCcb->inUse && BdaCmp(pCcb->peerAddr, pAddr)) + { + return pCcb; + } + } + + DM_TRACE_INFO0("dmConnIdByBdAddr not found"); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the given connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to CCB or NULL if failure. + */ +/*************************************************************************************************/ +dmConnCcb_t *dmConnCcbById(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + connId--; + if (dmConnCb.ccb[connId].inUse) + { + return &dmConnCb.ccb[connId]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Return the number of active connections. + * + * \return Number of connections. + */ +/*************************************************************************************************/ +uint8_t dmConnNum(void) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i, j; + + for (i = DM_CONN_MAX, j = 0; i > 0; i--, pCcb++) + { + if (pCcb->inUse) + { + j++; + } + } + + return j; +} + +/*************************************************************************************************/ +/*! + * \brief Execute all registered DM connection callbacks. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnExecCback(dmConnMsg_t *pMsg) +{ + uint8_t i; + + for (i = 0; i < DM_CLIENT_ID_MAX; i++) + { + if (dmConnCb.connCback[i] != NULL) + { + (*dmConnCb.connCback[i])((dmEvt_t *) pMsg); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief This utility function is called to open or accept a connection. + * + * \param clientId The client identifier. + * \param initPhys Initiator PHYs. + * \param advHandle Advertising handle. + * \param advType Advertising type. + * \param duration Advertising duration (in ms). + * \param maxEaEvents Maximum number of extended advertising events. + * \param addrType Address type. + * \param pAddr Peer device address. + * \param role Device role. + * + * \return Connection identifier. + */ +/*************************************************************************************************/ +dmConnId_t dmConnOpenAccept(uint8_t clientId, uint8_t initPhys, uint8_t advHandle, uint8_t advType, + uint16_t duration, uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr, + uint8_t role) +{ + dmConnCcb_t *pCcb = NULL; + dmConnApiOpen_t *pMsg; + + /* make sure ccb not already allocated */ + WsfTaskLock(); + if ((pCcb = dmConnCcbByBdAddr(pAddr)) == NULL) + { + /* allocate ccb */ + pCcb = dmConnCcbAlloc(pAddr); + } + WsfTaskUnlock(); + + if (pCcb != NULL) + { + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiOpen_t))) != NULL) + { + pMsg->hdr.param = pCcb->connId; + pMsg->hdr.event = (role == DM_ROLE_MASTER) ? + DM_CONN_MSG_API_OPEN : DM_CONN_MSG_API_ACCEPT; + pMsg->initPhys = initPhys; + pMsg->advHandle = advHandle; + pMsg->advType = advType; + pMsg->duration = duration; + pMsg->maxEaEvents = maxEaEvents; + BdaCpy(pMsg->peerAddr, pAddr); + pMsg->addrType = addrType; + pMsg->clientId = clientId; + WsfMsgSend(dmCb.handlerId, pMsg); + + /* set role */ + WsfTaskLock(); + pCcb->role = role; + WsfTaskUnlock(); + + /* return connection id */ + return pCcb->connId; + } + else + { + WsfTaskLock(); + dmConnCcbDealloc(pCcb); + WsfTaskUnlock(); + } + } + + /* open failed */ + return DM_CONN_ID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Empty action. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActNone(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Close a connection. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActClose(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + HciDisconnectCmd(pCcb->handle, pMsg->apiClose.reason); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a connection complete event from HCI. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActConnOpened(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* store peer address, handle, and role */ + BdaCpy(pCcb->peerAddr, pMsg->hciLeConnCmpl.peerAddr); + pCcb->handle = pMsg->hciLeConnCmpl.handle; + pCcb->peerAddrType = DmHostAddrType(pMsg->hciLeConnCmpl.addrType); + pCcb->role = pMsg->hciLeConnCmpl.role; + + /* set local address type of connection */ + if (pCcb->role == DM_ROLE_MASTER) + { + pCcb->localAddrType = dmCb.connAddrType; + } + else + { + pCcb->localAddrType = dmCb.advAddrType; + } + + /* set local address of connection */ + if (pCcb->localAddrType == DM_ADDR_PUBLIC) + { + BdaCpy(pCcb->localAddr, HciGetBdAddr()); + } + else + { + BdaCpy(pCcb->localAddr, dmCb.localAddr); + } + + /* store enhanced fields */ + BdaCpy(pCcb->localRpa, pMsg->hciLeConnCmpl.localRpa); + BdaCpy(pCcb->peerRpa, pMsg->hciLeConnCmpl.peerRpa); + + /* initialize idle state */ + pCcb->idleMask = 0; + + /* if central */ + if (pCcb->role == DM_ROLE_MASTER) + { + /* pass connection initiation completed to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_CONN_INIT_STOP, 0 , 0); + + /* if first connection opened */ + if (dmConnNum() == 1) + { + /* pass conn open event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_START, DM_CONN_OPEN_IND, 0, 0); + } + } + + /* pass conn open event to Connection CTE */ + dmDevPassEvtToConnCte(DM_CONN_OPEN_IND, pCcb->connId); + + pMsg->hdr.event = DM_CONN_OPEN_IND; + dmConnExecCback(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a connection complete failure event from HCI. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActConnFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* deallocate ccb */ + dmConnCcbDealloc(pCcb); + + /* if central */ + if (pCcb->role == DM_ROLE_MASTER) + { + /* pass connection initiation completed to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_CONN_INIT_STOP, 0, 0); + + /* if last connection closed */ + if (dmConnNum() == 0) + { + /* pass conn close event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_CONN_CLOSE_IND, 0 , 0); + } + } + + pMsg->hdr.event = DM_CONN_CLOSE_IND; + pMsg->hciLeConnCmpl.handle = pMsg->hciLeConnCmpl.role = 0; + dmConnExecCback(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a disconnect complete event from HCI. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActConnClosed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* pass conn close event to Connection CTE */ + dmDevPassEvtToConnCte(DM_CONN_CLOSE_IND, pCcb->connId); + + /* deallocate ccb */ + dmConnCcbDealloc(pCcb); + + /* if central and last connection closed */ + if ((pCcb->role == DM_ROLE_MASTER) && (dmConnNum() == 0)) + { + /* pass conn close event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_CONN_CLOSE_IND, 0, 0); + } + + pMsg->hdr.event = DM_CONN_CLOSE_IND; + dmConnExecCback(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a connection update event from HCI. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActHciUpdated(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* call callback */ + pMsg->hdr.event = DM_CONN_UPDATE_IND; + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the scan module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnReset(void) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + hciDisconnectCmplEvt_t disconnectCmpl; + uint8_t i; + + /* generate HCI disconnect complete event */ + disconnectCmpl.hdr.event = HCI_DISCONNECT_CMPL_CBACK_EVT; + disconnectCmpl.hdr.status = disconnectCmpl.status = HCI_SUCCESS; + disconnectCmpl.reason = HCI_ERR_LOCAL_TERMINATED; + + for (i = DM_CONN_MAX; i > 0; i--, pCcb++) + { + if (pCcb->inUse) + { + /* set connection id */ + disconnectCmpl.hdr.param = disconnectCmpl.handle = pCcb->handle; + + /* handle the event */ + dmConnHciHandler((hciEvt_t *) &disconnectCmpl); + } + } + + /* initialize control block */ + for (i = 0; i < DM_NUM_PHYS; i++) + { + dmConnCb.scanInterval[i] = DM_GAP_SCAN_FAST_INT_MIN; + dmConnCb.scanWindow[i] = DM_GAP_SCAN_FAST_WINDOW; + dmConnCb.connSpec[i] = dmConnSpecDefaults; + } + + dmCb.initFiltPolicy = HCI_FILT_NONE; + dmCb.connAddrType = DM_ADDR_PUBLIC; +} + +/*************************************************************************************************/ +/*! + * \brief DM Conn WSF message handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnMsgHandler(wsfMsgHdr_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById((dmConnId_t) pMsg->param)) != NULL) + { + /* execute state machine */ + dmConnSmExecute(pCcb, (dmConnMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM Conn HCI callback event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnHciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb; + + /* handle special cases for connection complete event */ + if ((pEvent->hdr.event == HCI_LE_CONN_CMPL_CBACK_EVT) || + (pEvent->hdr.event == HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT)) + { + /* first check if ccb exists for this bd addr */ + if ((pCcb = dmConnCcbByBdAddr(pEvent->leConnCmpl.peerAddr)) == NULL) + { + /* check for special case states */ + if ((pCcb = dmConnCmplStates()) == NULL) + { + /* else default case for slave, allocate new ccb */ + if ((pEvent->hdr.status == HCI_SUCCESS) && (pEvent->leConnCmpl.role == HCI_ROLE_SLAVE)) + { + pCcb = dmConnCcbAlloc(pEvent->leConnCmpl.peerAddr); + } + } + } + + /* translate HCI event to state machine event */ + if (pEvent->hdr.status == HCI_SUCCESS) + { + pEvent->hdr.event = DM_CONN_MSG_HCI_LE_CONN_CMPL; + } + else + { + pEvent->hdr.event = DM_CONN_MSG_HCI_LE_CONN_CMPL_FAIL; + } + } + else + { + pCcb = dmConnCcbByHandle(pEvent->hdr.param); + + /* translate HCI event to state machine message */ + pEvent->hdr.event = DM_CONN_HCI_EVT_2_MSG(pEvent->hdr.event); + } + + /* if ccb found */ + if (pCcb != NULL) + { + /* set conn id */ + pEvent->hdr.param = pCcb->connId; + + /* execute state machine */ + dmConnSmExecute(pCcb, (dmConnMsg_t *) pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM Conn 2 WSF message handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConn2MsgHandler(wsfMsgHdr_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById((dmConnId_t) pMsg->param)) != NULL) + { + dmConn2Msg_t *pConn2Msg = (dmConn2Msg_t *) pMsg; + + /* handle incoming message */ + switch (pMsg->event) + { + case DM_CONN_MSG_API_READ_RSSI: + HciReadRssiCmd(pCcb->handle); + break; + + case DM_CONN_MSG_API_REM_CONN_PARAM_REQ_REPLY: + { + hciConnSpec_t *pConnSpec = &pConn2Msg->apiRemConnParamReqReply.connSpec; + + HciLeRemoteConnParamReqReply(pCcb->handle, pConnSpec->connIntervalMin, + pConnSpec->connIntervalMax, pConnSpec->connLatency, + pConnSpec->supTimeout, pConnSpec->minCeLen, + pConnSpec->maxCeLen); + } + break; + + case DM_CONN_MSG_API_REM_CONN_PARAM_REQ_NEG_REPLY: + HciLeRemoteConnParamReqNegReply(pCcb->handle, pConn2Msg->apiRemConnParamReqNegReply.reason); + break; + + case DM_CONN_MSG_API_SET_DATA_LEN: + { + dmConnApiSetDataLen_t *pDataLen = &pConn2Msg->apiSetDataLen; + + HciLeSetDataLen(pCcb->handle, pDataLen->txOctets, pDataLen->txTime); + } + break; + + case DM_CONN_MSG_API_WRITE_AUTH_TO: + HciWriteAuthPayloadTimeout(pCcb->handle, pConn2Msg->apiWriteAuthPayloadTo.timeout); + break; + + default: + /* should never get here */ + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM Conn 2 HCI callback event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConn2HciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn handle */ + if ((pCcb = dmConnCcbByHandle(pEvent->hdr.param)) != NULL) + { + /* handle incoming event */ + switch (pEvent->hdr.event) + { + case HCI_READ_RSSI_CMD_CMPL_CBACK_EVT: + dmConn2ActRssiRead(pCcb, pEvent); + break; + + case HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT: + dmConn2ActRemoteConnParamReq(pCcb, pEvent); + break; + + case HCI_LE_DATA_LEN_CHANGE_CBACK_EVT: + dmConn2ActDataLenChange(pCcb, pEvent); + break; + + case HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT: + dmConn2ActWriteAuthToCmpl(pCcb, pEvent); + break; + + case HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT: + dmConn2ActAuthToExpired(pCcb, pEvent); + break; + + case HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT: + dmConn2ActReadRemoteFeaturesCmpl(pCcb, pEvent); + break; + + case HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT: + dmConn2ActReadRemoteVerInfoCmpl(pCcb, pEvent); + break; + + default: + /* should never get here */ + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle a read RSSI event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActRssiRead(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciReadRssiCmdCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_CONN_READ_RSSI_IND; + evt.hdr.param = pCcb->connId; + evt.status = evt.hdr.status = (uint8_t) pEvent->readRssiCmdCmpl.status; + evt.handle = pCcb->handle; + evt.rssi = pEvent->readRssiCmdCmpl.rssi; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a remote connection parameter request event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActRemoteConnParamReq(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciLeRemConnParamReqEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_REM_CONN_PARAM_REQ_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + evt.handle = pCcb->handle; + evt.intervalMin = pEvent->leRemConnParamReq.intervalMin; + evt.intervalMax = pEvent->leRemConnParamReq.intervalMax; + evt.latency = pEvent->leRemConnParamReq.latency; + evt.timeout = pEvent->leRemConnParamReq.timeout; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a data length change event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActDataLenChange(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciLeDataLenChangeEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_CONN_DATA_LEN_CHANGE_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + evt.handle = pCcb->handle; + evt.maxTxOctets = pEvent->leDataLenChange.maxTxOctets; + evt.maxTxTime = pEvent->leDataLenChange.maxTxTime; + evt.maxRxOctets = pEvent->leDataLenChange.maxRxOctets; + evt.maxRxTime = pEvent->leDataLenChange.maxRxTime; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a Write Authenticated Payload Timeout Command Complete event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActWriteAuthToCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciWriteAuthPayloadToCmdCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_CONN_WRITE_AUTH_TO_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + evt.handle = pEvent->writeAuthPayloadToCmdCmpl.handle; + evt.status = pEvent->writeAuthPayloadToCmdCmpl.status; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an Authenticated Payload Timeout Expired event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActAuthToExpired(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciAuthPayloadToExpiredEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_CONN_AUTH_TO_EXPIRED_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + evt.handle = pEvent->authPayloadToExpired.handle; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an Authenticated Payload Timeout Expired event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActReadRemoteFeaturesCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciLeReadRemoteFeatCmplEvt_t evt; + + /* Save the features */ + BYTES_TO_UINT32(pCcb->features, pEvent->leReadRemoteFeatCmpl.features); + pCcb->featuresPresent = TRUE; + + /* call callback */ + evt.hdr.event = DM_REMOTE_FEATURES_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + + evt.status = pEvent->leReadRemoteFeatCmpl.status; + evt.handle = pEvent->leReadRemoteFeatCmpl.handle; + memcpy(evt.features, pEvent->leReadRemoteFeatCmpl.features, sizeof(evt.features)); + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an Authenticated Payload Timeout Expired event from HCI. + * + * \param pCcb Connection control block. + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConn2ActReadRemoteVerInfoCmpl(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciReadRemoteVerInfoCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_READ_REMOTE_VER_INFO_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + + evt.status = pEvent->readRemoteVerInfoCmpl.status; + evt.handle = pEvent->readRemoteVerInfoCmpl.handle; + evt.version = pEvent->readRemoteVerInfoCmpl.version; + evt.mfrName = pEvent->readRemoteVerInfoCmpl.mfrName; + evt.subversion = pEvent->readRemoteVerInfoCmpl.subversion; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM connection manager. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnInit(void) +{ + dmFcnIfTbl[DM_ID_CONN] = (dmFcnIf_t *) &dmConnFcnIf; + dmFcnIfTbl[DM_ID_CONN_2] = (dmFcnIf_t *) &dmConn2FcnIf; + dmConnActSet[DM_CONN_ACT_SET_MAIN] = (dmConnAct_t *) dmConnActSetMain; +} + +/*************************************************************************************************/ +/*! + * \brief register with the DM connection manager. + * + * \param clientId The client identifier. + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnRegister(uint8_t clientId, dmCback_t cback) +{ + WSF_ASSERT(clientId < DM_CLIENT_ID_MAX); + + /* store callback */ + WsfTaskLock(); + dmConnCb.connCback[clientId] = cback; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Close the connection with the give connection identifier. + * + * \param clientId The client identifier. + * \param connId Connection identifier. + * \param reason Reason connection is being closed. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnClose(uint8_t clientId, dmConnId_t connId, uint8_t reason) +{ + dmConnApiClose_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiClose_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_CLOSE; + pMsg->hdr.param = connId; + pMsg->hdr.status = pMsg->reason = reason; + pMsg->clientId = clientId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Read the features of the remote device. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmReadRemoteFeatures(dmConnId_t connId) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn handle */ + if ((pCcb = dmConnCcbById(connId)) != NULL) + { + if (pCcb->featuresPresent) + { + hciLeReadRemoteFeatCmplEvt_t evt; + uint8_t *p = evt.features; + + /* call callback */ + evt.hdr.event = DM_REMOTE_FEATURES_IND; + evt.hdr.param = pCcb->connId; + evt.hdr.status = HCI_SUCCESS; + + evt.status = HCI_SUCCESS; + evt.handle = pCcb->handle; + UINT32_TO_BSTREAM(p, pCcb->features); + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); + } + else + { + /* Request the remote features from the peer */ + HciLeReadRemoteFeatCmd(pCcb->handle); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Read the version info of the remote device. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmReadRemoteVerInfo(dmConnId_t connId) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn handle */ + if ((pCcb = dmConnCcbById(connId)) != NULL) + { + /* Request the version info from the peer */ + HciReadRemoteVerInfoCmd(pCcb->handle); + } +} + +/*************************************************************************************************/ +/*! + * \brief Update the connection parameters of an open connection + * + * \param connId Connection identifier. + * \param pConnSpec Connection specification. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnUpdate(dmConnId_t connId, hciConnSpec_t *pConnSpec) +{ + dmConnApiUpdate_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiUpdate_t))) != NULL) + { + pMsg->hdr.event = (DmConnRole(connId) == DM_ROLE_MASTER) ? + DM_CONN_MSG_API_UPDATE_MASTER : DM_CONN_MSG_API_UPDATE_SLAVE; + pMsg->hdr.param = connId; + memcpy(&pMsg->connSpec, pConnSpec, sizeof(hciConnSpec_t)); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the connection spec parameters for created connections created with DmConnOpen(). + * + * \param initPhy The initiator PHY. + * \param pConnSpec Connection spec parameters. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnSetConnSpec(uint8_t initPhy, hciConnSpec_t *pConnSpec) +{ + WSF_ASSERT((initPhy == HCI_INIT_PHY_LE_1M_BIT) || + (initPhy == HCI_INIT_PHY_LE_2M_BIT) || + (initPhy == HCI_INIT_PHY_LE_CODED_BIT)); + + WsfTaskLock(); + dmConnCb.connSpec[DmInitPhyToIdx(initPhy)] = *pConnSpec; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the scan interval and window for created connections created with DmConnOpen(). + * + * \param initPhy The initiator PHY. + * \param scanInterval The scan interval. + * \param scanWindow The scan window. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnSetScanInterval(uint8_t initPhy, uint16_t scanInterval, uint16_t scanWindow) +{ + uint8_t phyIdx; + + WSF_ASSERT((initPhy == HCI_INIT_PHY_LE_1M_BIT) || (initPhy == HCI_INIT_PHY_LE_CODED_BIT)); + + WsfTaskLock(); + phyIdx = DmInitPhyToIdx(initPhy); + dmConnCb.scanInterval[phyIdx] = scanInterval; + dmConnCb.scanWindow[phyIdx] = scanWindow; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the scan interval and window for connections to be created with DmConnOpen(). + * + * \param scanInterval The scan interval. + * \param scanWindow The scan window. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnSetScanInterval(uint16_t scanInterval, uint16_t scanWindow) +{ + dmConnSetScanInterval(HCI_INIT_PHY_LE_1M_BIT, scanInterval, scanWindow); +} + +/*************************************************************************************************/ +/*! + * \brief Set the scan interval and window for extended connections to be created with + * DmConnOpen(). + * + * \param initPhy Initiator PHYs. + * \param pScanInterval Scan interval array. + * \param pScanWindow Scan window array. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtConnSetScanInterval(uint8_t initPhys, uint16_t *pScanInterval, uint16_t *pScanWindow) +{ + uint8_t i; /* initPhy bit position */ + uint8_t idx; /* param array index */ + + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (initPhys & (1 << i)) + { + dmConnSetScanInterval((1 << i), pScanInterval[idx], pScanWindow[idx]); + idx++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the connection spec parameters for connections to be created with DmConnOpen(). + * + * \param pConnSpec Connection spec parameters. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnSetConnSpec(hciConnSpec_t *pConnSpec) +{ + dmConnSetConnSpec(HCI_INIT_PHY_LE_1M_BIT, pConnSpec); +} + +/*************************************************************************************************/ +/*! + * \brief Set the extended connection spec parameters for extended connections to be created + * with DmConnOpen(). + * + * \param initPhys The initiator PHYs. + * \param pConnSpec Connection spec parameters array. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtConnSetConnSpec(uint8_t initPhys, hciConnSpec_t *pConnSpec) +{ + uint8_t i; /* initPhy bit position */ + uint8_t idx; /* param array index */ + + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (initPhys & (1 << i)) + { + dmConnSetConnSpec((1 << i), &(pConnSpec[idx])); + idx++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Read RSSI of a given connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnReadRssi(dmConnId_t connId) +{ + dmConnApiReadRssi_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiReadRssi_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_READ_RSSI; + pMsg->hdr.param = connId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! +* \brief Reply to the HCI remote connection parameter request event. This command is used to +* indicate that the Host has accepted the remote device's request to change connection +* parameters. +* +* \param connId Connection identifier. +* \param pConnSpec Connection specification. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmRemoteConnParamReqReply(dmConnId_t connId, hciConnSpec_t *pConnSpec) +{ + dmConnApiRemConnParamReqReply_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiRemConnParamReqReply_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_REM_CONN_PARAM_REQ_REPLY; + pMsg->hdr.param = connId; + memcpy(&pMsg->connSpec, pConnSpec, sizeof(hciConnSpec_t)); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! +* \brief Negative reply to the HCI remote connection parameter request event. This command +* is used to indicate that the Host has rejected the remote device's request to change +* connection parameters. +* +* \param connId Connection identifier. +* \param reason Reason for rejection. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmRemoteConnParamReqNegReply(dmConnId_t connId, uint8_t reason) +{ + dmConnApiRemConnParamReqNegReply_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiRemConnParamReqNegReply_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_REM_CONN_PARAM_REQ_NEG_REPLY; + pMsg->hdr.param = connId; + pMsg->reason = reason; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! +* \brief Set data length for a given connection. +* +* \param connId Connection identifier. +* \param txOctets Maximum number of payload octets for a Data PDU. +* \param txTime Maximum number of microseconds for a Data PDU. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmConnSetDataLen(dmConnId_t connId, uint16_t txOctets, uint16_t txTime) +{ + dmConnApiSetDataLen_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiSetDataLen_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_SET_DATA_LEN; + pMsg->hdr.param = connId; + pMsg->txOctets = txOctets; + pMsg->txTime = txTime; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! +* \brief Set authenticated payload timeout for a given connection. +* +* \param connId Connection identifier. +* \param timeout Timeout period in units of 10ms +* +* \return None. +*/ +/*************************************************************************************************/ +void DmWriteAuthPayloadTimeout(dmConnId_t connId, uint16_t timeout) +{ + dmConnApiWriteAuthPayloadTo_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnApiWriteAuthPayloadTo_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_MSG_API_WRITE_AUTH_TO; + pMsg->hdr.param = connId; + pMsg->timeout = timeout; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Find the connection ID with matching handle. + * + * \param handle Handle to find. + * + * \return Connection ID or DM_CONN_ID_NONE if error. + */ +/*************************************************************************************************/ +dmConnId_t DmConnIdByHandle(uint16_t handle) +{ + dmConnCcb_t *pCcb = dmConnCb.ccb; + uint8_t i; + + for (i = DM_CONN_MAX; i > 0; i--, pCcb++) + { + if (pCcb->inUse && (pCcb->handle == handle)) + { + return pCcb->connId; + } + } + + DM_TRACE_WARN1("DmConnIdByHandle not found 0x%04x", handle); + + return DM_CONN_ID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Return TRUE if the connection is in use. + * + * \param connId Connection ID. + * + * \return TRUE if the connection is in use, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t DmConnInUse(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].inUse; +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Return the peer address type. + * + * \param connId Connection ID. + * + * \return Peer address type. + */ +/*************************************************************************************************/ +uint8_t DmConnPeerAddrType(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].peerAddrType; +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Return the peer device address. + * + * \param connId Connection ID. + * + * \return Pointer to peer device address. + */ +/*************************************************************************************************/ +uint8_t *DmConnPeerAddr(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].peerAddr; +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Return the local address type. + * + * \param connId Connection ID. + * + * \return Local address type. + */ +/*************************************************************************************************/ +uint8_t DmConnLocalAddrType(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].localAddrType; +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Return the local address. + * + * \param connId Connection ID. + * + * \return Pointer to local address. + */ +/*************************************************************************************************/ +uint8_t *DmConnLocalAddr(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].localAddr; +} + +/*************************************************************************************************/ +/*! +* \brief For internal use only. Return the peer resolvable private address (RPA). +* +* \param connId Connection ID. +* +* \return Pointer to peer RPA. +*/ +/*************************************************************************************************/ +uint8_t *DmConnPeerRpa(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId - 1].peerRpa; +} + +/*************************************************************************************************/ +/*! +* \brief For internal use only. Return the local resolvable private address (RPA). +* +* \param connId Connection ID. +* +* \return Pointer to local RPA. +*/ +/*************************************************************************************************/ +uint8_t *DmConnLocalRpa(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId - 1].localRpa; +} + +/*************************************************************************************************/ +/*! + * \brief Return the security level of the connection. + * + * \param connId Connection ID. + * + * \return Security level of the connection. + */ +/*************************************************************************************************/ +uint8_t DmConnSecLevel(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].secLevel; +} + +/*************************************************************************************************/ +/*! + * \brief Configure a bit in the connection idle state mask as busy or idle. + * + * \param connId Connection identifier. + * \param idleMask Bit in the idle state mask to configure. + * \param idle DM_CONN_BUSY or DM_CONN_IDLE. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnSetIdle(dmConnId_t connId, uint16_t idleMask, uint8_t idle) +{ + WsfTaskLock(); + + if (DmConnInUse(connId)) + { + if (idle == DM_CONN_IDLE) + { + /* clear bit if idle */ + dmConnCb.ccb[connId-1].idleMask &= ~idleMask; + } + else + { + /* set bit if busy */ + dmConnCb.ccb[connId-1].idleMask |= idleMask; + } + } + + WsfTaskUnlock(); + + DM_TRACE_INFO2("connId=%d idleMask=0x%04x", connId, dmConnCb.ccb[connId-1].idleMask); +} + +/*************************************************************************************************/ +/*! + * \brief Check if a connection is idle. + * + * \param connId Connection identifier. + * + * \return Zero if connection is idle, nonzero if busy. + */ +/*************************************************************************************************/ +uint16_t DmConnCheckIdle(dmConnId_t connId) +{ + uint16_t idleMask; + + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + WsfTaskLock(); + idleMask = dmConnCb.ccb[connId-1].idleMask; + WsfTaskUnlock(); + + return idleMask; +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection role indicating master or slave. + * + * \param connId Connection identifier. + * + * \return Connection role. + */ +/*************************************************************************************************/ +uint8_t DmConnRole(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return dmConnCb.ccb[connId-1].role; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.h new file mode 100644 index 0000000000000000000000000000000000000000..8cb97b0e01e138c2598513f1a011b0f1c645228e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn.h @@ -0,0 +1,367 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM connection management module. + */ +/*************************************************************************************************/ +#ifndef DM_CONN_H +#define DM_CONN_H + +#include "dm_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Uninitialized HCI handle */ +#define DM_CONN_HCI_HANDLE_NONE 0xFFFF + +/* Action set initializer */ +#define DM_CONN_ACT_SET_INIT(n) ((n) << 4) + +/* Get action set ID from action */ +#define DM_CONN_ACT_SET_ID(action) ((action) >> 4) + +/* Get action ID from action */ +#define DM_CONN_ACT_ID(action) ((action) & 0x0F) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! DM conn event handler messages for state machine */ +enum +{ + /* messages from API */ + DM_CONN_MSG_API_OPEN = DM_MSG_START(DM_ID_CONN), /*!< Open Connection */ + DM_CONN_MSG_API_CLOSE, /*!< Close Connection */ + DM_CONN_MSG_API_ACCEPT, /*!< Accept Connection */ + DM_CONN_MSG_API_UPDATE_MASTER, /*!< Master Connection Parameter Update */ + DM_CONN_MSG_API_UPDATE_SLAVE, /*!< Slave Connecteion Parameter Update */ + + /* messages from L2C */ + DM_CONN_MSG_L2C_UPDATE_IND, /*!< L2CAP Parameter update indication */ + DM_CONN_MSG_L2C_UPDATE_CNF, /*!< L2CAP Parameter update confirmation */ + + /* messages from HCI */ + DM_CONN_MSG_HCI_LE_CONN_CMPL_FAIL, /*!< HCI LE Connection Complete Failure Event */ + DM_CONN_MSG_HCI_LE_CONN_CMPL, /*!< HCI LE Connection Compelte Event */ + DM_CONN_MSG_HCI_DISCONNECT_CMPL, /*!< HCI Disconnection Complete Event */ + DM_CONN_MSG_HCI_LE_CONN_UPDATE_CMPL, /*!< HCI LE Connection Update Complete Event */ + DM_CONN_MSG_HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL, /*!< HCI LE Create Connection Cancel Command Complet Event */ + + /* other internal messages */ + DM_CONN_MSG_INT_UPDATE_TIMEOUT /*!< Internal Update Timeout */ +}; + +/* Number of messages */ +#define DM_CONN_NUM_MSGS (DM_CONN_MSG_INT_UPDATE_TIMEOUT - DM_CONN_MSG_API_OPEN + 1) + +/* DM conn event handler messages, non-state machine */ +enum +{ + DM_CONN_MSG_API_FEAT = DM_MSG_START(DM_ID_CONN_2), + DM_CONN_MSG_API_READ_RSSI, + DM_CONN_MSG_API_REM_CONN_PARAM_REQ_REPLY, + DM_CONN_MSG_API_REM_CONN_PARAM_REQ_NEG_REPLY, + DM_CONN_MSG_API_SET_DATA_LEN, + DM_CONN_MSG_API_WRITE_AUTH_TO, + + /* messages from HCI */ + DM_CONN_MSG_HCI_READ_RSSI_CMPL, + DM_CONN_MSG_HCI_FEAT_CMPL +}; + +/* State machine action function sets */ +enum +{ + DM_CONN_ACT_SET_MAIN, + DM_CONN_ACT_SET_MASTER, + DM_CONN_ACT_SET_SLAVE, + DM_CONN_NUM_ACT_SETS +}; + +/*! State machine actions */ +enum +{ + DM_CONN_SM_ACT_NONE = DM_CONN_ACT_SET_INIT(DM_CONN_ACT_SET_MAIN), /*!< No Action */ + DM_CONN_SM_ACT_CLOSE, /*!< Process Connection Close */ + DM_CONN_SM_ACT_CONN_OPENED, /*!< Procoess Connection Opened */ + DM_CONN_SM_ACT_CONN_FAILED, /*!< Process Connection Failed */ + DM_CONN_SM_ACT_CONN_CLOSED, /*!< Process Connection Closed */ + DM_CONN_SM_ACT_HCI_UPDATED, /*!< Process HCI Connection Update */ + + DM_CONN_SM_ACT_OPEN = DM_CONN_ACT_SET_INIT(DM_CONN_ACT_SET_MASTER), /*!< Process Master Connection Open */ + DM_CONN_SM_ACT_CANCEL_OPEN, /*!< Process Master Cancel Connection Open */ + DM_CONN_SM_ACT_UPDATE_MASTER, /*!< Process Master Connection Parameter Update */ + DM_CONN_SM_ACT_L2C_UPDATE_IND, /*!< Process Master L2CAP Connection Parameter Update Indication */ + + DM_CONN_SM_ACT_ACCEPT = DM_CONN_ACT_SET_INIT(DM_CONN_ACT_SET_SLAVE), /*!< Process Slave Connection Accept */ + DM_CONN_SM_ACT_CANCEL_ACCEPT, /*!< Process Slave Cancel Connection Accept */ + DM_CONN_SM_ACT_UPDATE_SLAVE, /*!< Process Slave Connection Update */ + DM_CONN_SM_ACT_CONN_ACCEPTED, /*!< Process Slave Connection Accepted */ + DM_CONN_SM_ACT_ACCEPT_FAILED, /*!< Process Slave Connection Accept Failure */ + DM_CONN_SM_ACT_L2C_UPDATE_CNF /*!< Process Slave L2CAP Connection Parameter Update Confirmation */ +}; + +/*! State machine states */ +enum +{ + DM_CONN_SM_ST_IDLE, /*!< Idle State */ + DM_CONN_SM_ST_CONNECTING, /*!< Connecting State */ + DM_CONN_SM_ST_ACCEPTING, /*!< Accepting State */ + DM_CONN_SM_ST_CONNECTED, /*!< Connected State */ + DM_CONN_SM_ST_DISCONNECTING, /*!< Disconnecting State */ + DM_CONN_SM_NUM_STATES +}; + +/* Data structure for DM_CONN_MSG_API_OPEN and DM_CONN_MSG_API_ACCEPT */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t initPhys; + uint8_t advHandle; + uint8_t advType; + uint16_t duration; + uint8_t maxEaEvents; + bdAddr_t peerAddr; + uint8_t addrType; + uint8_t clientId; +} dmConnApiOpen_t; + +/*! Data structure for DM_CONN_MSG_API_CLOSE */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t reason; + uint8_t clientId; +} dmConnApiClose_t; + +/*! Data structure for DM_CONN_MSG_API_UPDATE_MASTER and SLAVE */ +typedef struct +{ + wsfMsgHdr_t hdr; + hciConnSpec_t connSpec; +} dmConnApiUpdate_t; + +/*! Data structure for DM_CONN_MSG_L2C_UPDATE_IND */ +typedef struct +{ + wsfMsgHdr_t hdr; + hciConnSpec_t *pConnSpec; + uint8_t identifier; +} dmConnL2cUpdateInd_t; + +/*! Data structure for DM_CONN_MSG_L2C_UPDATE_CNF */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t result; +} dmConnL2cUpdateCnf_t; + +/*! Union of all DM Conn state machine messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmConnApiOpen_t apiOpen; + dmConnApiClose_t apiClose; + dmConnApiUpdate_t apiUpdate; + dmConnL2cUpdateInd_t l2cUpdateInd; + dmConnL2cUpdateCnf_t l2cUpdateCnf; + hciLeConnCmplEvt_t hciLeConnCmpl; + hciDisconnectCmplEvt_t hciDisconnectCmpl; + hciLeConnUpdateCmplEvt_t hciLeConnUpdateCmpl; +} dmConnMsg_t; + +/*! Data structure for DM_CONN_MSG_API_FEAT */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t handle; + uint8_t type; + uint8_t feature; +} dmConnApiFeat_t; + +/*! Data structure for DM_CONN_MSG_API_READ_RSSI */ +typedef struct +{ + wsfMsgHdr_t hdr; +} dmConnApiReadRssi_t; + +/*! Data structure for DM_CONN_MSG_API_REM_CONN_PARAM_REQ_REPLY */ +typedef struct +{ + wsfMsgHdr_t hdr; + hciConnSpec_t connSpec; +} dmConnApiRemConnParamReqReply_t; + +/*! Data structure for DM_CONN_MSG_API_REM_CONN_PARAM_REQ_NEG_REPLY */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t reason; +} dmConnApiRemConnParamReqNegReply_t; + +/*! Data structure for DM_CONN_MSG_API_SET_DATA_LEN */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t txOctets; + uint16_t txTime; +} dmConnApiSetDataLen_t; + +/*! Data structure for DM_CONN_MSG_API_WRITE_AUTH_TO */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t timeout; +} dmConnApiWriteAuthPayloadTo_t; + +/*! Union of all DM Conn 2 messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmConnApiFeat_t apiFeat; + dmConnApiReadRssi_t apiReadRssi; + dmConnApiRemConnParamReqReply_t apiRemConnParamReqReply; + dmConnApiRemConnParamReqNegReply_t apiRemConnParamReqNegReply; + dmConnApiSetDataLen_t apiSetDataLen; + dmConnApiWriteAuthPayloadTo_t apiWriteAuthPayloadTo; +} dmConn2Msg_t; + +/*! Connection control block */ +typedef struct +{ + bdAddr_t peerAddr; + bdAddr_t localAddr; + uint16_t handle; + uint16_t idleMask; + dmConnId_t connId; + bool_t updating; + bool_t usingLtk; + uint8_t peerAddrType; + uint8_t localAddrType; + uint8_t state; + uint8_t inUse; + uint8_t secLevel; + uint8_t tmpSecLevel; + uint8_t role; + + /* enhanced fields */ + bdAddr_t localRpa; + bdAddr_t peerRpa; + + uint32_t features; + bool_t featuresPresent; +} dmConnCcb_t; + +/*! Action function */ +typedef void (*dmConnAct_t)(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/*! Control block of the DM conn module */ +typedef struct +{ + dmConnCcb_t ccb[DM_CONN_MAX]; + dmCback_t connCback[DM_CLIENT_ID_MAX]; + hciConnSpec_t connSpec[DM_NUM_PHYS]; + uint16_t scanInterval[DM_NUM_PHYS]; + uint16_t scanWindow[DM_NUM_PHYS]; +} dmConnCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! State machine action sets */ +extern dmConnAct_t *dmConnActSet[DM_CONN_NUM_ACT_SETS]; + +/*! Control block */ +extern dmConnCb_t dmConnCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* utility functions */ +dmConnCcb_t *dmConnCcbAlloc(uint8_t *pAddr); +void dmConnCcbDealloc(dmConnCcb_t *pCcb); +dmConnCcb_t *dmConnCcbByHandle(uint16_t handle); +dmConnCcb_t *dmConnCcbByBdAddr(uint8_t *pAddr); +dmConnCcb_t *dmConnCcbById(dmConnId_t connId); +uint8_t dmConnNum(void); +dmConnId_t dmConnOpenAccept(uint8_t clientId, uint8_t initPhys, uint8_t advHandle, uint8_t advType, + uint16_t duration, uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr, + uint8_t role); +void dmConnExecCback(dmConnMsg_t *pMsg); + +/* component inteface */ +void dmConnReset(void); +void dmConnMsgHandler(wsfMsgHdr_t *pMsg); +void dmConnHciHandler(hciEvt_t *pEvent); + +/* component 2 inteface */ +void dmConn2MsgHandler(wsfMsgHdr_t *pMsg); +void dmConn2HciHandler(hciEvt_t *pEvent); + +/* state machine */ +void dmConnSmExecute(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* main action functions */ +void dmConnSmActNone(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActClose(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActConnOpened(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActConnFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActConnClosed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActHciUpdated(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* common master action functions */ +void dmConnSmActCancelOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActUpdateMaster(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActL2cUpdateInd(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* legacy master action functions */ +void dmConnSmActOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* extended master action functions */ +void dmExtConnSmActOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* common slave action functions */ +void dmConnSmActUpdateSlave(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActL2cUpdateCnf(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* legacy slave action functions */ +void dmConnSmActAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActCancelAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActConnAccepted(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmConnSmActAcceptFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +/* extended slave action functions */ +void dmExtConnSmActAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmExtConnSmActCancelAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmExtConnSmActConnAccepted(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); +void dmExtConnSmActAcceptFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_CONN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_cte.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_cte.c new file mode 100644 index 0000000000000000000000000000000000000000..a99961d778431a6689f737533d5e5be542e8bb78 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_cte.c @@ -0,0 +1,838 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager Connection Constant Tone Extension (CTE) module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" +#include "dm_conn.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! DM connection CTE states */ +enum +{ + DM_CONN_CTE_STATE_IDLE, /*!< Idle */ + DM_CONN_CTE_STATE_INITIATING, /*!< Initiating CTE request */ + DM_CONN_CTE_STATE_RESPONDING, /*!< Responding to CTE request */ + DM_CONN_CTE_STATE_SAMPLING, /*!< Sampling received CTE */ + DM_CONN_CTE_STATE_STARTING, /*!< Starting CTE request, CTE response or sampling received CTE */ + DM_CONN_CTE_STATE_STOPPING /*!< Stopping CTE request, CTE response or sampling received CTE */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! Data structure for DM_CONN_CTE_MSG_API_RX_SAMPLE_START */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ + uint8_t slotDurations; /*!< Switching and sampling slot durations */ + uint8_t switchPatternLen; /*!< Number of Antenna IDs in switching pattern */ + uint8_t *pAntennaIDs; /*!< List of Antenna IDs in switching pattern */ +} dmConnCteApiRxSampleStart_t; + +/*! Data structure for DM_CONN_CTE_MSG_API_RX_SAMPLE_STOP */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ +} dmConnCteApiRxSampleStop_t; + +/*! Data structure for DM_CONN_CTE_MSG_API_TX_CFG */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ + uint8_t cteTypeBits; /*!< Permitted CTE type bits */ + uint8_t switchPatternLen; /*!< Number of Antenna IDs in switching pattern */ + uint8_t *pAntennaIDs; /*!< List of Antenna IDs in switching pattern */ +} dmConnCteApiTxConfig_t; + +/*! Data structure for DM_CONN_CTE_MSG_API_REQ_START */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ + uint16_t cteReqInt; /*!< CTE request interval */ + uint8_t reqCteLen; /*!< Minimum length of CTE being requested in 8 us units */ + uint8_t reqCteType; /*!< Requested CTE type */ +} dmConnCteApiReqStart_t; + +/*! Data structure for DM_CONN_CTE_MSG_API_REQ_STOP */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ +} dmConnCteApiReqStop_t; + +/*! Data structure for DM_CONN_CTE_MSG_API_RSP_START and DM_CONN_CTE_MSG_API_RSP_STOP */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnId_t connId; /*!< Connection id */ +} dmConnCteApiRspEnable_t; + +/*! Union of all DM Connection CTE API messages */ +typedef union +{ + wsfMsgHdr_t hdr; /*!< Header */ + dmConnCteApiRxSampleStart_t rxSampleStart; /*!< Start sampling received CTE, and configure CTE Rx parameters to be used */ + dmConnCteApiRxSampleStop_t rxSampleStop; /*!< Stop sampling received CTE */ + dmConnCteApiTxConfig_t txCfg; /*!< Configure CTE Tx parameters */ + dmConnCteApiReqStart_t reqStart; /*!< Start initiating CTE request */ + dmConnCteApiReqStop_t reqStop; /*!< Stop initiating CTE request */ + dmConnCteApiRspEnable_t rspEnable; /*!< Start or stop responding to CTE request */ +} dmConnCteMsg_t; + +/*! Action function */ +typedef void (*dmConnCteAct_t)(dmConnCteMsg_t *pMsg); + +/*! Control block for connection CTE module */ +typedef struct +{ + uint8_t rxSampleState; /*!< Sampling received CTE state */ + uint8_t reqState; /*!< Connection CTE Request state */ + uint8_t rspState; /*!< Connection CTE Response state */ +} dmConnCteCb_t; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +void dmConnCteInit(void); +void dmConnCteReset(void); +void dmConnCteHciHandler(hciEvt_t *pEvent); +void dmConnCteMsgHandler(wsfMsgHdr_t *pMsg); + +/*! Action functions */ +static void dmConnCteActRxSampleStart(dmConnCteMsg_t *pMsg); +static void dmConnCteActRxSampleStop(dmConnCteMsg_t *pMsg); +static void dmConnCteActTxCfg(dmConnCteMsg_t *pMsg); +static void dmConnCteActReqStart(dmConnCteMsg_t *pMsg); +static void dmConnCteActReqStop(dmConnCteMsg_t *pMsg); +static void dmConnCteActRspStart(dmConnCteMsg_t *pMsg); +static void dmConnCteActRspStop(dmConnCteMsg_t *pMsg); +static void dmConnCteActState(dmConnCteMsg_t *pMsg); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/*! Action function table */ +static const dmConnCteAct_t dmConnCteAct[] = +{ + dmConnCteActRxSampleStart, + dmConnCteActRxSampleStop, + dmConnCteActTxCfg, + dmConnCteActReqStart, + dmConnCteActReqStop, + dmConnCteActRspStart, + dmConnCteActRspStop, + dmConnCteActState +}; + +/*! DM Connection CTE component function interface */ +static const dmFcnIf_t dmConnCteFcnIf = +{ + dmConnCteReset, + dmConnCteHciHandler, + dmConnCteMsgHandler +}; + +/*! Connection CTE control block */ +static dmConnCteCb_t dmConnCteCb[DM_CONN_MAX]; + +/*************************************************************************************************/ +/*! + * \brief Initialize connection CTE control block entry. + * + * \param pCteCb Pointer to connection CTE control block structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteCbInit(dmConnCteCb_t *pCteCb) +{ + pCteCb->rxSampleState = DM_CONN_CTE_STATE_IDLE; + pCteCb->reqState = DM_CONN_CTE_STATE_IDLE; + pCteCb->rspState = DM_CONN_CTE_STATE_IDLE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize connection CTE control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnCteInit(void) +{ + uint8_t i; + + /* initialize control block */ + for (i = 0; i < DM_CONN_MAX; i++) + { + dmConnCteCbInit(&dmConnCteCb[i]); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM Connection Constant Tone Extension (CTE) module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteInit(void) +{ + /* set function interface table */ + dmFcnIfTbl[DM_ID_CONN_CTE] = (dmFcnIf_t *) &dmConnCteFcnIf; + + /* initialize control block */ + dmConnCteInit(); +} + +/*************************************************************************************************/ +/*! +* \brief Reset the connection CTE module. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmConnCteReset(void) +{ + /* reset control block */ + dmConnCteInit(); +} + +/*************************************************************************************************/ +/*! + * \brief DM PAST HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnCteHciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb; + + if (pEvent->hdr.event == HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT) + { + pEvent->hdr.event = DM_READ_ANTENNA_INFO_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + return; + } + + /* if ccb found */ + if ((pCcb = dmConnCcbByHandle(pEvent->hdr.param)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* set conn id */ + pEvent->hdr.param = pCcb->connId; + + switch (pEvent->hdr.event) + { + case HCI_LE_CONN_IQ_REPORT_CBACK_EVT: + pEvent->hdr.event = DM_CONN_IQ_REPORT_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + case HCI_LE_CTE_REQ_FAILED_CBACK_EVT: + pEvent->hdr.event = DM_CTE_REQ_FAIL_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + case HCI_LE_SET_CONN_CTE_RX_PARAMS_CMD_CMPL_CBACK_EVT: + /* if enabling sampling */ + if (pCteCb->rxSampleState == DM_CONN_CTE_STATE_STARTING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->rxSampleState = DM_CONN_CTE_STATE_SAMPLING; + } + else + { + pCteCb->rxSampleState = DM_CONN_CTE_STATE_IDLE; + } + + pEvent->hdr.event = DM_CONN_CTE_RX_SAMPLE_START_IND; + } + /* else if disabling sampling */ + else if (pCteCb->rxSampleState == DM_CONN_CTE_STATE_STOPPING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->rxSampleState = DM_CONN_CTE_STATE_IDLE; + } + else + { + pCteCb->rxSampleState = DM_CONN_CTE_STATE_SAMPLING; + } + + pEvent->hdr.event = DM_CONN_CTE_RX_SAMPLE_STOP_IND; + } + + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + case HCI_LE_SET_CONN_CTE_TX_PARAMS_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_CONN_CTE_TX_CFG_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + case HCI_LE_CONN_CTE_REQ_ENABLE_CMD_CMPL_CBACK_EVT: + /* if enabling request */ + if (pCteCb->reqState == DM_CONN_CTE_STATE_STARTING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->reqState = DM_CONN_CTE_STATE_INITIATING; + } + else + { + pCteCb->reqState = DM_CONN_CTE_STATE_IDLE; + } + + pEvent->hdr.event = DM_CONN_CTE_REQ_START_IND; + } + /* else if disabing request */ + else if (pCteCb->reqState == DM_CONN_CTE_STATE_STOPPING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->reqState = DM_CONN_CTE_STATE_IDLE; + } + else + { + pCteCb->reqState = DM_CONN_CTE_STATE_INITIATING; + } + + pEvent->hdr.event = DM_CONN_CTE_REQ_STOP_IND; + } + + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + case HCI_LE_CONN_CTE_RSP_ENABLE_CMD_CMPL_CBACK_EVT: + /* if enabling response */ + if (pCteCb->rspState == DM_CONN_CTE_STATE_STARTING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->rspState = DM_CONN_CTE_STATE_RESPONDING; + } + else + { + pCteCb->rspState = DM_CONN_CTE_STATE_IDLE; + } + + pEvent->hdr.event = DM_CONN_CTE_RSP_START_IND; + } + /* else if disabling response */ + else if (pCteCb->rspState == DM_CONN_CTE_STATE_STOPPING) + { + if (pEvent->hdr.status == HCI_SUCCESS) + { + pCteCb->rspState = DM_CONN_CTE_STATE_IDLE; + } + else + { + pCteCb->rspState = DM_CONN_CTE_STATE_RESPONDING; + } + + pEvent->hdr.event = DM_CONN_CTE_RSP_STOP_IND; + } + + (*dmCb.cback)((dmEvt_t *) pEvent); + break; + + default: + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM Connection CTE event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnCteMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmConnCteAct[DM_MSG_MASK(pMsg->event)])((dmConnCteMsg_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Start sampling received CTE, and configure CTE receive parameters action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActRxSampleStart(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->rxSampleStart.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently idle */ + if (pCteCb->rxSampleState == DM_CONN_CTE_STATE_IDLE) + { + HciLeSetConnCteRxParamsCmd(pCcb->handle, TRUE, pMsg->rxSampleStart.slotDurations, + pMsg->rxSampleStart.switchPatternLen, + pMsg->rxSampleStart.pAntennaIDs); + + pCteCb->rxSampleState = DM_CONN_CTE_STATE_STARTING; + } + else + { + DM_TRACE_WARN0("DmConnCteRxSampleStart ignored due to rxSampleState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Stop sampling received CTE action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmConnCteActRxSampleStop(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->rxSampleStop.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently sampling */ + if (pCteCb->rxSampleState == DM_CONN_CTE_STATE_SAMPLING) + { + HciLeSetConnCteRxParamsCmd(pCcb->handle, FALSE, 0, 0, NULL); + + pCteCb->rxSampleState = DM_CONN_CTE_STATE_STOPPING; + } + else + { + DM_TRACE_WARN0("DmConnCteRxSampleStop ignored due to rxSampleState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Configure connection CTE transmit action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmConnCteActTxCfg(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->txCfg.connId)) != NULL) + { + HciLeSetConnCteTxParamsCmd(pCcb->handle, pMsg->txCfg.cteTypeBits, pMsg->txCfg.switchPatternLen, + pMsg->txCfg.pAntennaIDs); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start initiating CTE request action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActReqStart(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->reqStart.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently idle */ + if (pCteCb->reqState == DM_CONN_CTE_STATE_IDLE) + { + HciLeConnCteReqEnableCmd(pCcb->handle, TRUE, pMsg->reqStart.cteReqInt, + pMsg->reqStart.reqCteLen, pMsg->reqStart.reqCteType); + + pCteCb->reqState = DM_CONN_CTE_STATE_STARTING; + } + else + { + DM_TRACE_WARN0("DmConnCteReqStart ignored due to reqState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop initiating CTE request action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActReqStop(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->reqStop.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently initiating */ + if (pCteCb->reqState == DM_CONN_CTE_STATE_INITIATING) + { + HciLeConnCteReqEnableCmd(pCcb->handle, FALSE, 0, 0, 0); + + pCteCb->reqState = DM_CONN_CTE_STATE_STOPPING; + } + else + { + DM_TRACE_WARN0("DmConnCteReqStop ignored due to reqState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Start responding to CTE request action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActRspStart(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->rspEnable.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently idle */ + if (pCteCb->rspState == DM_CONN_CTE_STATE_IDLE) + { + HciLeConnCteRspEnableCmd(pCcb->handle, TRUE); + + pCteCb->rspState = DM_CONN_CTE_STATE_STARTING; + } + else + { + DM_TRACE_WARN0("DmConnCteRspStart ignored due to rspState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop responding to CTE request action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActRspStop(dmConnCteMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->rspEnable.connId)) != NULL) + { + dmConnCteCb_t *pCteCb = &dmConnCteCb[pCcb->connId - 1]; + + /* if currently responding */ + if (pCteCb->rspState == DM_CONN_CTE_STATE_RESPONDING) + { + HciLeConnCteRspEnableCmd(pCcb->handle, FALSE); + + pCteCb->rspState = DM_CONN_CTE_STATE_STOPPING; + } + else + { + DM_TRACE_WARN0("DmConnCteRspStop ignored due to rspState or pending command complete"); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Connection state change action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnCteActState(dmConnCteMsg_t *pMsg) +{ + /* if connection closed */ + if (pMsg->hdr.status == DM_CONN_CLOSE_IND) + { + /* reset all states */ + dmConnCteCbInit(&dmConnCteCb[pMsg->hdr.param - 1]); + } +} + +/*************************************************************************************************/ +/*! + * \brief Enable sampling received CTE fields on the specified connection, and configure the + * antenna switching pattern, and switching and sampling slot durations to be used. + * + * \param connId Connection identifier. + * \param slotDurations Switching and sampling slot durations to be used while receiving CTE. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRxSampleStart(dmConnId_t connId, uint8_t slotDurations, uint8_t switchPatternLen, + uint8_t *pAntennaIDs) +{ + dmConnCteApiRxSampleStart_t *pMsg; + + WSF_ASSERT((switchPatternLen >= HCI_MIN_NUM_ANTENNA_IDS) && \ + (switchPatternLen <= HCI_MAX_NUM_ANTENNA_IDS)); + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiRxSampleStart_t) + switchPatternLen)) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_RX_SAMPLE_START; + pMsg->connId = connId; + pMsg->slotDurations = slotDurations; + pMsg->switchPatternLen = switchPatternLen; + + /* Copy antenna IDs to space after end of config struct */ + pMsg->pAntennaIDs = (uint8_t *)(pMsg + 1); + memcpy(pMsg->pAntennaIDs, pAntennaIDs, switchPatternLen); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Disable sampling received CTE fields on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRxSampleStop(dmConnId_t connId) +{ + dmConnCteApiRxSampleStop_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiRxSampleStop_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_RX_SAMPLE_STOP; + pMsg->connId = connId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Configure the antenna switching pattern, and permitted CTE types used for transmitting + * CTEs requested by the peer device on the specified connection. + * + * \param connId Connection identifier. + * \param cteTypeBits Permitted CTE type bits used for transmitting CTEs requested by peer. + * \param switchPatternLen Number of Antenna IDs in switching pattern. + * \param pAntennaIDs List of Antenna IDs in switching pattern. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteTxConfig(dmConnId_t connId, uint8_t cteTypeBits, uint8_t switchPatternLen, + uint8_t *pAntennaIDs) +{ + dmConnCteApiTxConfig_t *pMsg; + + WSF_ASSERT((switchPatternLen >= HCI_MIN_NUM_ANTENNA_IDS) && \ + (switchPatternLen <= HCI_MAX_NUM_ANTENNA_IDS)); + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiTxConfig_t) + switchPatternLen)) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_TX_CFG; + pMsg->connId = connId; + pMsg->cteTypeBits = cteTypeBits; + pMsg->switchPatternLen = switchPatternLen; + + /* Copy antenna IDs to space after end of config struct */ + pMsg->pAntennaIDs = (uint8_t *)(pMsg + 1); + memcpy(pMsg->pAntennaIDs, pAntennaIDs, switchPatternLen); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initiate the CTE Request procedure on the specified connection. + * + * \param connId Connection identifier. + * \param cteReqInt CTE request interval. + * \param reqCteLen Minimum length of CTE being requested in 8 us units. + * \param reqCteType Requested CTE type. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteReqStart(dmConnId_t connId, uint16_t cteReqInt, uint8_t reqCteLen, + uint8_t reqCteType) +{ + dmConnCteApiReqStart_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiReqStart_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_REQ_START; + pMsg->connId = connId; + pMsg->cteReqInt = cteReqInt; + pMsg->reqCteLen = reqCteLen; + pMsg->reqCteType = reqCteType; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop initiating the CTE Request procedure on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteReqStop(dmConnId_t connId) +{ + dmConnCteApiReqStop_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiReqStop_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_REQ_STOP; + pMsg->connId = connId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRspStart(dmConnId_t connId) +{ + dmConnCteApiRspEnable_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiRspEnable_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_RSP_START; + pMsg->connId = connId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop responding to LL_CTE_REQ PDUs with LL_CTE_RSP PDUs on the specified connection. + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnCteRspStop(dmConnId_t connId) +{ + dmConnCteApiRspEnable_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmConnCteApiRspEnable_t))) != NULL) + { + pMsg->hdr.event = DM_CONN_CTE_MSG_API_RSP_STOP; + pMsg->connId = connId; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Read the switching rates, the sampling rates, the number of antennae, and the maximum + * length of a transmitted Constant Tone Extension supported by the Controller. + * + * \return None. + * + * \note The antenna info will be returned with DM indication \ref DM_READ_ANTENNA_INFO_IND. + */ +/*************************************************************************************************/ +void DmReadAntennaInfo(void) +{ + HciLeReadAntennaInfoCmd(); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master.c new file mode 100644 index 0000000000000000000000000000000000000000..a84182160adb59059550f0e3835cd2c9a96af78b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master.c @@ -0,0 +1,143 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management for master. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "l2c_api.h" + +/*************************************************************************************************/ +/*! + * \brief Cancel an opening connection. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActCancelOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* cancel create connection */ + HciLeCreateConnCancelCmd(); + + /* pass connection initiation stopped to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_CONN_INIT_STOP, 0, 0); +} + +/*************************************************************************************************/ +/*! + * \brief Update a connection as a master. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActUpdateMaster(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* send HCI command */ + HciLeConnUpdateCmd(pCcb->handle, &pMsg->apiUpdate.connSpec); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an L2CAP connection update indication. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActL2cUpdateInd(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* always send back response */ + L2cDmConnUpdateRsp(pMsg->l2cUpdateInd.identifier, pCcb->handle, L2C_CONN_PARAM_ACCEPTED); + + /* send HCI command */ + HciLeConnUpdateCmd(pCcb->handle, pMsg->l2cUpdateInd.pConnSpec); +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. L2C calls this function when it receives a connection update + * request from a peer device. + * + * \param identifier Identifier value. + * \param handle Connection handle. + * \param pConnSpec Connection spec parameters. + * \return None. + */ +/*************************************************************************************************/ +void DmL2cConnUpdateInd(uint8_t identifier, uint16_t handle, hciConnSpec_t *pConnSpec) +{ + dmConnL2cUpdateInd_t updateInd; + dmConnCcb_t *pCcb; + + if ((pCcb = dmConnCcbByHandle(handle)) != NULL) + { + updateInd.hdr.event = DM_CONN_MSG_L2C_UPDATE_IND; + updateInd.pConnSpec = pConnSpec; + updateInd.identifier = identifier; + + dmConnSmExecute(pCcb, (dmConnMsg_t *) &updateInd); + } +} + +/*************************************************************************************************/ +/*! + * \brief Open a connection to a peer device with the given address. + * + * \param clientId The client identifier. + * \param initPhys Initiator PHYs. + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return Connection identifier. + */ +/*************************************************************************************************/ +dmConnId_t DmConnOpen(uint8_t clientId, uint8_t initPhys, uint8_t addrType, uint8_t *pAddr) +{ + return dmConnOpenAccept(clientId, initPhys, 0, 0, 0, 0, addrType, pAddr, DM_ROLE_MASTER); +} + +/*************************************************************************************************/ +/*! + * \brief Set the local address type used for connections created with DmConnOpen(). + * + * \param addrType Address type. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnSetAddrType(uint8_t addrType) +{ + WsfTaskLock(); + dmCb.connAddrType = addrType; + WsfTaskUnlock(); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..f3d0b41903da0a816bce246fd4302bfeb2ba2089 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c @@ -0,0 +1,116 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management module for extended master. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" +#include "dm_conn.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Action set for this module */ +static const dmConnAct_t dmConnActSetMaster[] = +{ + dmExtConnSmActOpen, + dmConnSmActCancelOpen, + dmConnSmActUpdateMaster, + dmConnSmActL2cUpdateInd +}; + +/*************************************************************************************************/ +/*! + * \brief Open a connection to a peer device with the given address. + * + * \param initPhys Initiating PHYs. + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return Connection identifier. + */ +/*************************************************************************************************/ +static void dmExtConnOpen(uint8_t initPhys, uint8_t addrType, uint8_t *pAddr) +{ + uint8_t i; + uint8_t idx; + uint8_t phyIdx; + hciExtInitParam_t initParam; + hciConnSpec_t connSpec[DM_NUM_PHYS]; + hciExtInitScanParam_t scanParam[DM_NUM_PHYS]; + + /* set initiating parameters */ + initParam.filterPolicy = dmCb.initFiltPolicy; + initParam.ownAddrType = DmLlAddrType(dmCb.connAddrType); + initParam.peerAddrType = addrType; + initParam.pPeerAddr = pAddr; + initParam.initPhys = initPhys; + + /* see advertising packets to be received on which PHY */ + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (initPhys & (1 << i)) + { + phyIdx = DmInitPhyToIdx(1 << i); + + /* set extended create conection parameters for this PHY */ + scanParam[idx].scanInterval = dmConnCb.scanInterval[phyIdx]; + scanParam[idx].scanWindow = dmConnCb.scanWindow[phyIdx]; + connSpec[idx] = dmConnCb.connSpec[phyIdx]; + idx++; + } + } + + /* Create connection */ + HciLeExtCreateConnCmd(&initParam, scanParam, connSpec); + + /* pass connection initiation started to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_CONN_INIT_START, 0, 0); +} + +/*************************************************************************************************/ +/*! +* \brief Open a connection. +* +* \param pMsg WSF message. +* \param pCcb Connection control block. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmExtConnSmActOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmExtConnOpen(pMsg->apiOpen.initPhys, pMsg->apiOpen.addrType, pMsg->apiOpen.peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM connection manager for operation as extended master. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtConnMasterInit(void) +{ + dmConnActSet[DM_CONN_ACT_SET_MASTER] = (dmConnAct_t *) dmConnActSetMaster; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c new file mode 100644 index 0000000000000000000000000000000000000000..a47dbd3c91b3b08fd838c159640ecf2dc4b8b16e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c @@ -0,0 +1,90 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management module for legacy master. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" +#include "dm_conn.h" + +/************************************************************************************************** +Local Variables +**************************************************************************************************/ + +/* Action set for this module */ +static const dmConnAct_t dmConnActSetMaster[] = +{ + dmConnSmActOpen, + dmConnSmActCancelOpen, + dmConnSmActUpdateMaster, + dmConnSmActL2cUpdateInd +}; + +/*************************************************************************************************/ +/*! + * \brief Open a connection to a peer device with the given address. + * + * \param initPhys Initiating PHYs. + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return Connection identifier. + */ +/*************************************************************************************************/ +static void dmConnOpen(uint8_t initPhys, uint8_t addrType, uint8_t *pAddr) +{ + uint8_t phyIdx = DmScanPhyToIdx(HCI_SCAN_PHY_LE_1M_BIT); + + /* Create connection */ + HciLeCreateConnCmd(dmConnCb.scanInterval[phyIdx], dmConnCb.scanWindow[phyIdx], dmCb.initFiltPolicy, + addrType, pAddr, DmLlAddrType(dmCb.connAddrType), &(dmConnCb.connSpec[phyIdx])); + + /* pass connection initiation started to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_CTRL, DM_DEV_PRIV_MSG_CONN_INIT_START, 0, 0); +} + +/*************************************************************************************************/ +/*! + * \brief Open a connection. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. +*/ +/*************************************************************************************************/ +void dmConnSmActOpen(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmConnOpen(pMsg->apiOpen.initPhys, pMsg->apiOpen.addrType, pMsg->apiOpen.peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM connection manager for operation as legacy master. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnMasterInit(void) +{ + dmConnActSet[DM_CONN_ACT_SET_MASTER] = (dmConnAct_t *) dmConnActSetMaster; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..cd6b87c16fb9b5382883074248f8494f01c00fba --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave.c @@ -0,0 +1,180 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager slave connection management for slave. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_adv.h" +#include "l2c_api.h" + +/*************************************************************************************************/ +/*! + * \brief Call application callback with the connection update complete event. + * + * \param pCcb Connection control block. + * \param status Status. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmConnUpdateCback(dmConnCcb_t *pCcb, uint8_t status) +{ + hciLeConnUpdateCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_CONN_UPDATE_IND; + evt.hdr.param = pCcb->connId; + evt.status = evt.hdr.status = status; + evt.handle = pCcb->handle; + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Update a connection as a slave. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActUpdateSlave(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + if ((pCcb->features & HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC) && + (HciGetLeSupFeat() & HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC)) + { + HciLeConnUpdateCmd(pCcb->handle, &pMsg->apiUpdate.connSpec); + } + /* else if L2CAP connection update not already in progress */ + else if (!pCcb->updating) + { + pCcb->updating = TRUE; + + /* send request via L2CAP */ + L2cDmConnUpdateReq(pCcb->handle, &pMsg->apiUpdate.connSpec); + } + /* else L2CAP connection update pending */ + else + { + /* call callback */ + dmConnUpdateCback(pCcb, (uint8_t) HCI_ERR_CMD_DISALLOWED); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle an L2CAP connection update confirm. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActL2cUpdateCnf(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + /* if connection update in progress */ + if (pCcb->updating) + { + pCcb->updating = FALSE; + + /* if reason indicates failure */ + if (pMsg->l2cUpdateCnf.result != L2C_CONN_PARAM_ACCEPTED) + { + /* call callback */ + dmConnUpdateCback(pCcb, (uint8_t) pMsg->l2cUpdateCnf.result); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. L2C calls this function to send the result of an L2CAP + * connection update response to DM. + * + * \param handle Connection handle. + * \param result Connection update result code. + * + * \return None. + */ +/*************************************************************************************************/ +void DmL2cConnUpdateCnf(uint16_t handle, uint16_t result) +{ + dmConnL2cUpdateCnf_t updateCnf; + dmConnCcb_t *pCcb; + + if ((pCcb = dmConnCcbByHandle(handle)) != NULL) + { + updateCnf.hdr.event = DM_CONN_MSG_L2C_UPDATE_CNF; + updateCnf.result = result; + + dmConnSmExecute(pCcb, (dmConnMsg_t *) &updateCnf); + } +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. L2C calls this function to send the result of an L2CAP + * Command Reject indication up to the application. + * + * \param handle Connection handle. + * \param result Connection update result code. + * + * \return None. + */ +/*************************************************************************************************/ +void DmL2cCmdRejInd(uint16_t handle, uint16_t result) +{ + dmL2cCmdRejEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_L2C_CMD_REJ_IND; + evt.hdr.status = HCI_SUCCESS; + evt.reason = result; + evt.handle = handle; + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Accept a connection from the given peer device by initiating directed advertising. + * + * \param clientId The client identifier. + * \param advHandle Advertising handle. + * \param advType Advertising type. + * \param duration Advertising duration (in ms). + * \param maxEaEvents Maximum number of extended advertising events. + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return Connection identifier. + */ +/*************************************************************************************************/ +dmConnId_t DmConnAccept(uint8_t clientId, uint8_t advHandle, uint8_t advType, uint16_t duration, + uint8_t maxEaEvents, uint8_t addrType, uint8_t *pAddr) +{ + return dmConnOpenAccept(clientId, 0, advHandle, advType, duration, maxEaEvents, addrType, pAddr, + DM_ROLE_SLAVE); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..9993934efbfaf72d9785cc3ddf945599a06808ca --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c @@ -0,0 +1,124 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management for extended slave. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_adv.h" +#include "l2c_api.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Action set for this module */ +static const dmConnAct_t dmConnActSetSlave[] = +{ + dmExtConnSmActAccept, + dmExtConnSmActCancelAccept, + dmConnSmActUpdateSlave, + dmExtConnSmActConnAccepted, + dmExtConnSmActAcceptFailed, + dmConnSmActL2cUpdateCnf +}; + +/*************************************************************************************************/ +/*! + * \brief Accept a connection. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtConnSmActAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmExtAdvStartDirected(pCcb->connId, pMsg->apiOpen.advHandle, pMsg->apiOpen.advType, + pMsg->apiOpen.duration, pMsg->apiOpen.maxEaEvents, pMsg->apiOpen.addrType, + pMsg->apiOpen.peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Cancel a connection accept. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtConnSmActCancelAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmExtAdvStopDirected(pCcb->connId); + + dmConnSmActConnFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Connection accepted. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtConnSmActConnAccepted(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmExtAdvConnected(pCcb->connId); + + dmConnSmActConnOpened(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Connection accept failed. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtConnSmActAcceptFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmExtAdvConnectFailed(pCcb->connId); + + dmConnSmActConnFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM connection manager for operation as extended slave. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtConnSlaveInit(void) +{ + dmConnActSet[DM_CONN_ACT_SET_SLAVE] = (dmConnAct_t *) dmConnActSetSlave; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c new file mode 100644 index 0000000000000000000000000000000000000000..2607e1e9e5ad7ddf9d352cce4945f164e3271995 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c @@ -0,0 +1,123 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management for legacy slave. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_adv.h" +#include "l2c_api.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Action set for this module */ +static const dmConnAct_t dmConnActSetSlave[] = +{ + dmConnSmActAccept, + dmConnSmActCancelAccept, + dmConnSmActUpdateSlave, + dmConnSmActConnAccepted, + dmConnSmActAcceptFailed, + dmConnSmActL2cUpdateCnf +}; + +/*************************************************************************************************/ +/*! + * \brief Accept a connection. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmAdvStartDirected(pMsg->apiOpen.advType, pMsg->apiOpen.duration, pMsg->apiOpen.addrType, + pMsg->apiOpen.peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Cancel a connection accept. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActCancelAccept(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmAdvStopDirected(); + + dmConnSmActConnFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Connection accepted. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActConnAccepted(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmAdvConnected(); + + dmConnSmActConnOpened(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Connection accept failed. + * + * \param pMsg WSF message. + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmActAcceptFailed(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmAdvConnectFailed(); + + dmConnSmActConnFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM connection manager for operation as legacy slave. + * + * \return None. + */ +/*************************************************************************************************/ +void DmConnSlaveInit(void) +{ + dmConnActSet[DM_CONN_ACT_SET_SLAVE] = (dmConnAct_t *) dmConnActSetSlave; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_sm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_sm.c new file mode 100644 index 0000000000000000000000000000000000000000..c4ff8bffaf103b98ff3f12a970b49a5e8ca68aa3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_conn_sm.c @@ -0,0 +1,185 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager connection management state machine. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Column position of next state */ +#define DM_CONN_NEXT_STATE 0 + +/*! Column position of action */ +#define DM_CONN_ACTION 1 + +/*! Number of columns in the state machine state tables */ +#define DM_CONN_NUM_COLS 2 + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/*! DM Conn state machine state tables */ +static const uint8_t dmConnStateTbl[DM_CONN_SM_NUM_STATES][DM_CONN_NUM_MSGS][DM_CONN_NUM_COLS] = +{ + /* Idle state */ + { + /* Event Next state Action */ + /* API_OPEN */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_OPEN}, + /* API_CLOSE */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* API_ACCEPT */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_ACCEPT}, + /* API_UPDATE_MASTER */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_SLAVE */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_IND */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_CNF */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL_FAIL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_CONN_ACCEPTED}, + /* HCI_DISCONNECT_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_UPDATE_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE}, + /* INT_UPDATE_TIMEOUT */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_NONE} + }, + /* Connecting state */ + { + /* Event Next state Action */ + /* API_OPEN */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_CLOSE */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_CANCEL_OPEN}, + /* API_ACCEPT */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_MASTER */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_SLAVE */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_IND */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_CNF */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL_FAIL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CONN_FAILED}, + /* HCI_LE_CONN_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_CONN_OPENED}, + /* HCI_DISCONNECT_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CONN_FAILED}, + /* HCI_LE_CONN_UPDATE_CMPL */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE}, + /* INT_UPDATE_TIMEOUT */ {DM_CONN_SM_ST_CONNECTING, DM_CONN_SM_ACT_NONE} + }, + /* Accepting state */ + { + /* Event Next state Action */ + /* API_OPEN */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* API_CLOSE */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CANCEL_ACCEPT}, + /* API_ACCEPT */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_MASTER */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_SLAVE */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_IND */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_CNF */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL_FAIL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_ACCEPT_FAILED}, + /* HCI_LE_CONN_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_CONN_ACCEPTED}, + /* HCI_DISCONNECT_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_ACCEPT_FAILED}, + /* HCI_LE_CONN_UPDATE_CMPL */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE}, + /* INT_UPDATE_TIMEOUT */ {DM_CONN_SM_ST_ACCEPTING, DM_CONN_SM_ACT_NONE} + }, + /* Connected state */ + { + /* Event Next state Action */ + /* API_OPEN */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_NONE}, + /* API_CLOSE */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_CLOSE}, + /* API_ACCEPT */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_MASTER */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_UPDATE_MASTER}, + /* API_UPDATE_SLAVE */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_UPDATE_SLAVE}, + /* L2C_UPDATE_IND */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_L2C_UPDATE_IND}, + /* L2C_UPDATE_CNF */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_L2C_UPDATE_CNF}, + /* HCI_LE_CONN_CMPL_FAIL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_NONE}, + /* HCI_DISCONNECT_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CONN_CLOSED}, + /* HCI_LE_CONN_UPDATE_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_HCI_UPDATED}, + /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_NONE}, + /* INT_UPDATE_TIMEOUT */ {DM_CONN_SM_ST_CONNECTED, DM_CONN_SM_ACT_HCI_UPDATED} + }, + /* Disconnecting state */ + { + /* Event Next state Action */ + /* API_OPEN */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_CLOSE */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_ACCEPT */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_MASTER */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* API_UPDATE_SLAVE */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_IND */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* L2C_UPDATE_CNF */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CONN_CMPL_FAIL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CONN_CLOSED}, + /* HCI_LE_CONN_CMPL */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_CLOSE}, + /* HCI_DISCONNECT_CMPL */ {DM_CONN_SM_ST_IDLE, DM_CONN_SM_ACT_CONN_CLOSED}, + /* HCI_LE_CONN_UPDATE_CMPL */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE}, + /* INT_UPDATE_TIMEOUT */ {DM_CONN_SM_ST_DISCONNECTING, DM_CONN_SM_ACT_NONE} + } +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! State machine action set array */ +dmConnAct_t *dmConnActSet[DM_CONN_NUM_ACT_SETS]; + +/*************************************************************************************************/ +/*! + * \brief Execute the DM connection state machine. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmConnSmExecute(dmConnCcb_t *pCcb, dmConnMsg_t *pMsg) +{ + dmConnAct_t *actSet; + uint8_t action; + uint8_t event; + + DM_TRACE_INFO2("dmConnSmExecute event=%d state=%d", pMsg->hdr.event, pCcb->state); + + /* get the event */ + event = DM_MSG_MASK(pMsg->hdr.event); + + /* get action */ + action = dmConnStateTbl[pCcb->state][event][DM_CONN_ACTION]; + + /* set next state */ + pCcb->state = dmConnStateTbl[pCcb->state][event][DM_CONN_NEXT_STATE]; + + /* look up action set */ + actSet = dmConnActSet[DM_CONN_ACT_SET_ID(action)]; + + /* if action set present */ + if (actSet != NULL) + { + /* execute action function in action set */ + (*actSet[DM_CONN_ACT_ID(action)])(pCcb, pMsg); + } + else + { + /* no action */ + dmConnSmActNone(pCcb, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.c new file mode 100644 index 0000000000000000000000000000000000000000..857ac1f818373f23caece48245e76c2b48a4836e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.c @@ -0,0 +1,422 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM local device management module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* action function table */ +static const dmDevAct_t dmDevAct[] = +{ + dmDevActReset +}; + +/* Component function interface */ +const dmFcnIf_t dmDevFcnIf = +{ + dmEmptyReset, + dmDevHciHandler, + dmDevMsgHandler +}; + +/* Control block */ +dmDevCb_t dmDevCb; + +/*************************************************************************************************/ +/*! + * \brief Reset action function. + * + * \param pMsg WSF message. + * + * \return None. +*/ +/*************************************************************************************************/ +void dmDevActReset(wsfMsgHdr_t *pMsg) +{ + uint8_t i; + + /* if DM not resetting */ + if (!dmCb.resetting) + { + /* set resetting state */ + dmCb.resetting = TRUE; + + /* for each DM component */ + for (i = 0; i < DM_NUM_IDS; i++) + { + /* call component's reset function */ + (*(dmFcnIfTbl[i]->reset))(); + } + + /* start HCI reset sequence */ + HciResetSequence(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle a reset complete event from HCI. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevHciEvtReset(hciEvt_t *pEvent) +{ + /* reset resetting state */ + dmCb.resetting = FALSE; + + pEvent->hdr.event = DM_RESET_CMPL_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a vendor specific event from HCI. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevHciEvtVendorSpec(hciEvt_t *pEvent) +{ + pEvent->hdr.event = DM_VENDOR_SPEC_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an hardware error event from HCI. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevHciEvtHwError(hciEvt_t *pEvent) +{ + pEvent->hdr.event = DM_HW_ERROR_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); +} + +/*************************************************************************************************/ +/*! + * \brief DM dev HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevHciHandler(hciEvt_t *pEvent) +{ + switch (pEvent->hdr.event) + { + case HCI_RESET_SEQ_CMPL_CBACK_EVT: + dmDevHciEvtReset(pEvent); + break; + + case HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT: + case HCI_VENDOR_SPEC_CBACK_EVT: + dmDevHciEvtVendorSpec(pEvent); + break; + + case HCI_HW_ERROR_CBACK_EVT: + dmDevHciEvtHwError(pEvent); + break; + + default: + /* ignore event */ + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief DM dev event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmDevAct[DM_MSG_MASK(pMsg->event)])(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Pass an event to the device privacy module. + * + * \param event Device privacy event. + * \param param DM or Privacy event. + * \param advHandle Advertising handle. + * \param connectable TRUE if connectable extended advertising. FALSE, otherwise. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPassEvtToDevPriv(uint8_t event, uint8_t param, uint8_t advHandle, bool_t connectable) +{ + dmDevPrivMsg_t evt; + + DM_TRACE_INFO3("dmDevPassEvtToDevPriv: event: %d, param: %d, advHandle: %d", event, param, advHandle); + + /* build event */ + evt.hdr.event = event; + evt.hdr.param = param; + evt.privCtrl.advHandle = advHandle; + evt.privCtrl.connectable = connectable; + + /* pass event to device privacy */ + (*(dmFcnIfTbl[DM_ID_DEV_PRIV]->msgHandler))((wsfMsgHdr_t *) &evt); +} + +/*************************************************************************************************/ +/*! + * \brief Pass a connection state change event to the Connection CTE module. + * + * \param state Connection state. + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPassEvtToConnCte(uint8_t state, dmConnId_t connId) +{ + wsfMsgHdr_t evt; + + /* build event */ + evt.event = DM_CONN_CTE_MSG_STATE; + evt.status = state; + evt.param = connId; + + /* pass event to Connection CTE */ + (*(dmFcnIfTbl[DM_ID_CONN_CTE]->msgHandler))(&evt); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the device. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevReset(void) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->event = DM_DEV_MSG_API_RESET; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the random address to be used by the local device. + * + * \param pAddr Random address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevSetRandAddr(uint8_t *pAddr) +{ + BdaCpy(dmCb.localAddr, pAddr); + HciLeSetRandAddrCmd(pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Add a peer device to the white list. Note that this function cannot be called + * while advertising, scanning, or connecting with white list filtering active. + * + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevWhiteListAdd(uint8_t addrType, uint8_t *pAddr) +{ + HciLeAddDevWhiteListCmd(addrType, pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Remove a peer device from the white list. Note that this function cannot be called + * while advertising, scanning, or connecting with white list filtering active. + * + * \param addrType Address type. + * \param pAddr Peer device address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevWhiteListRemove(uint8_t addrType, uint8_t *pAddr) +{ + HciLeRemoveDevWhiteListCmd(addrType, pAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Clear the white list. Note that this function cannot be called while + * advertising, scanning, or connecting with white list filtering active. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevWhiteListClear(void) +{ + HciLeClearWhiteListCmd(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the Advertising, Scanning or Initiator filter policy. + * + * \param advHandle Advertising handle (only applicable to advertising). + * \param mode Policy mode. + * \param policy Filter policy. + * + * \return TRUE if the filter policy was successfully set, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t dmDevSetFilterPolicy(uint8_t advHandle, uint8_t mode, uint8_t policy) +{ + bool_t policySet = FALSE; + + switch (mode) + { + case DM_FILT_POLICY_MODE_ADV: + /* if Advertising filter policy is valid */ + if (policy <= HCI_ADV_FILT_ALL) + { + WSF_ASSERT(advHandle < DM_NUM_ADV_SETS); + + /* update the filter policy */ + dmCb.advFiltPolicy[advHandle] = policy; + policySet = TRUE; + } + break; + + case DM_FILT_POLICY_MODE_SCAN: + /* if Scanning filter policy is valid */ + if (policy <= HCI_FILT_WHITE_LIST_RES_INIT) + { + /* update the filter policy */ + dmCb.scanFiltPolicy = policy; + policySet = TRUE; + } + break; + + case DM_FILT_POLICY_MODE_INIT: + /* if Initiator filter policy is valid */ + if (policy <= HCI_FILT_WHITE_LIST) + { + /* update the filter policy */ + dmCb.initFiltPolicy = policy; + policySet = TRUE; + } + break; + + case DM_FILT_POLICY_MODE_SYNC: + /* if Synchronization filter policy is valid */ + if (policy <= HCI_FILT_PER_ADV_LIST) + { + /* clear the filter policy bit */ + dmCb.syncOptions &= ~HCI_OPTIONS_FILT_POLICY_BIT; + + /* set the filter policy bit */ + dmCb.syncOptions |= policy; + policySet = TRUE; + } + break; + + default: + /* invalid filter policy mode */ + break; + } + + return policySet; +} + +/*************************************************************************************************/ +/*! + * \brief Set the Advertising, Scanning or Initiator filter policy. + * + * \param mode Policy mode. + * \param policy Filter policy. + * + * \return TRUE if the filter policy was successfully set, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t DmDevSetFilterPolicy(uint8_t mode, uint8_t policy) +{ + return dmDevSetFilterPolicy(DM_ADV_HANDLE_DEFAULT, mode, policy); +} + +/*************************************************************************************************/ +/*! + * \brief Set the Advertising filter policy for the given advertising, Scanning or Initiator + * filter policy. + * + * \param advHandle Advertising handle (only applicable to advertising). + * \param mode Policy mode. + * \param policy Filter policy. + * + * \return TRUE if the filter policy was successfully set, FALSE otherwise. +*/ +/*************************************************************************************************/ +bool_t DmDevSetExtFilterPolicy(uint8_t advHandle, uint8_t mode, uint8_t policy) +{ + return dmDevSetFilterPolicy(advHandle, mode, policy); +} + +/*************************************************************************************************/ +/*! + * \brief Vendor-specific controller initialization function. + * + * \param param Vendor-specific parameter. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevVsInit(uint8_t param) +{ + HciVsInit(param); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.h new file mode 100644 index 0000000000000000000000000000000000000000..8274c0bf3916452e0d2416247ce0414b5f7fcbd3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev.h @@ -0,0 +1,162 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM local device management module. + */ +/*************************************************************************************************/ +#ifndef DM_DEV_H +#define DM_DEV_H + +#include "dm_main.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM device event handler messages */ +enum +{ + DM_DEV_MSG_API_RESET = DM_MSG_START(DM_ID_DEV) +}; + +/* DM device privacy event handler messages */ +enum +{ + DM_DEV_PRIV_MSG_API_START = DM_MSG_START(DM_ID_DEV_PRIV), + DM_DEV_PRIV_MSG_API_STOP, + DM_DEV_PRIV_MSG_TIMEOUT, + DM_DEV_PRIV_MSG_AES_CMPL, + DM_DEV_PRIV_MSG_RPA_START, + DM_DEV_PRIV_MSG_RPA_STOP, + DM_DEV_PRIV_MSG_CTRL +}; + +/* DM device privacy control messages */ +enum +{ + DM_DEV_PRIV_MSG_CONN_INIT_START, /* connection initiation started */ + DM_DEV_PRIV_MSG_CONN_INIT_STOP, /* connection initiation stopped */ + DM_DEV_PRIV_MSG_ADV_SET_ADD, /* advertising set created */ + DM_DEV_PRIV_MSG_ADV_SET_REMOVE, /* advertising set removed */ + DM_DEV_PRIV_MSG_ADV_SETS_CLEAR /* advertising sets cleared */ +}; + +/*! DM connection CTE event handler messages */ +enum +{ + /* messages from API */ + DM_CONN_CTE_MSG_API_RX_SAMPLE_START = DM_MSG_START(DM_ID_CONN_CTE), /*!< Start sampling received CTE, and configure CTE Rx parameters to be used */ + DM_CONN_CTE_MSG_API_RX_SAMPLE_STOP, /*!< Stop sampling received CTE */ + DM_CONN_CTE_MSG_API_TX_CFG, /*!< Configure CTE Tx parameters */ + DM_CONN_CTE_MSG_API_REQ_START, /*!< Start initiating CTE request */ + DM_CONN_CTE_MSG_API_REQ_STOP, /*!< Stop initiating CTE request */ + DM_CONN_CTE_MSG_API_RSP_START, /*!< Start responding to CTE request */ + DM_CONN_CTE_MSG_API_RSP_STOP, /*!< Stop responding to CTE request */ + DM_CONN_CTE_MSG_STATE /*!< DM connection state change event */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data structure for DM_DEV_PRIV_MSG_API_START */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t changeInterval; +} dmDevPrivApiStart_t; + +/* Data structure for DM_DEV_PRIV_MSG_CTRL */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advHandle; + bool_t connectable; +} dmDevPrivCtrl_t; + +/* Union of all dev priv messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmDevPrivApiStart_t apiPrivStart; + dmDevPrivCtrl_t privCtrl; + secAes_t aes; +} dmDevPrivMsg_t; + +/* Action function */ +typedef void (*dmDevAct_t)(wsfMsgHdr_t *pMsg); +typedef void (*dmDevPrivAct_t)(dmDevPrivMsg_t *pMsg); + +/* DM device set advertising set random address callback type */ +typedef void (*dmDevAdvSetRandAddrCback_t)(uint8_t advHandle, const uint8_t *pAddr); + +/* Main control block of the DM Dev subsystem */ +typedef struct +{ + /* Set advertising set random address callback */ + dmDevAdvSetRandAddrCback_t advSetRandAddrCback; +} dmDevCb_t; + +/************************************************************************************************** + Global variables +**************************************************************************************************/ + +/* Component function interface */ +extern const dmFcnIf_t dmDevFcnIf; + +/* Control block */ +extern dmDevCb_t dmDevCb; + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* dev component inteface */ +void dmDevActReset(wsfMsgHdr_t *pMsg); + +/* dev action functions */ +void dmDevMsgHandler(wsfMsgHdr_t *pMsg); +void dmDevHciHandler(hciEvt_t *pEvent); + +/* dev priv component inteface */ +void dmDevPrivHciHandler(hciEvt_t *pEvent); +void dmDevPrivMsgHandler(wsfMsgHdr_t *pMsg); +void dmDevPrivReset(void); + +/* dev priv action functions */ +void dmDevPrivActStart(dmDevPrivMsg_t *pMsg); +void dmDevPrivActStop(dmDevPrivMsg_t *pMsg); +void dmDevPrivActTimeout(dmDevPrivMsg_t *pMsg); +void dmDevPrivActAesCmpl(dmDevPrivMsg_t *pMsg); +void dmDevPrivActRpaStart(dmDevPrivMsg_t *pMsg); +void dmDevPrivActRpaStop(dmDevPrivMsg_t *pMsg); +void dmDevPrivActCtrl(dmDevPrivMsg_t *pMsg); + +/* utility function */ +void dmDevPassEvtToDevPriv(uint8_t event, uint8_t param, uint8_t advHandle, bool_t connectable); +void dmDevPassEvtToConnCte(uint8_t state, dmConnId_t connId); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_DEV_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev_priv.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..f5c3b0fd64327d8fb8f77cd1c1a7b1590d45efe2 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_dev_priv.c @@ -0,0 +1,651 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager device privacy module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_timer.h" +#include "hci_api.h" +#include "dm_api.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Structure for extended advertising */ +typedef struct +{ + bool_t configured; + bool_t connectable; + bool_t advertising; +} dmDevPrivExtAdv_t; + +/* Control block for device privacy module */ +typedef struct +{ + wsfTimer_t addrTimer; + bool_t addrTimerStarted; + uint8_t prand[DM_PRIV_PRAND_LEN]; + uint16_t changeInterval; + bool_t useResolvable; + bool_t addrInitialized; + bdAddr_t pendingAddr; + bool_t advertising; + bool_t scanning; + bool_t connecting; + bool_t connected; + dmDevPrivExtAdv_t extAdv[DM_NUM_ADV_SETS]; +} dmDevPrivCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* action function table */ +static const dmDevPrivAct_t dmDevPrivAct[] = +{ + dmDevPrivActStart, + dmDevPrivActStop, + dmDevPrivActTimeout, + dmDevPrivActAesCmpl, + dmDevPrivActRpaStart, + dmDevPrivActRpaStop, + dmDevPrivActCtrl +}; + +/* Component function interface */ +static const dmFcnIf_t dmDevPrivFcnIf = +{ + dmDevPrivReset, + dmDevPrivHciHandler, + dmDevPrivMsgHandler +}; + +/* control block */ +static dmDevPrivCb_t dmDevPrivCb; + +/*************************************************************************************************/ +/*! + * \brief Whether the legacy advertising or an advertising set using (non)connectable advertising + * is enabled. + * + * \param nonconnectable Non-connectable advertising. + * + * \return TRUE if advertising is enabled. FALSE, otherwise. + */ +/*************************************************************************************************/ +static bool_t dmDevPrivAdvertising(bool_t nonconnectable) +{ + uint8_t i; + + /* if legacy advertising enabled */ + if (dmDevPrivCb.advertising) + { + return TRUE; + } + + /* if (non)connectable extended advertising is enabled */ + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if (dmDevPrivCb.extAdv[i].configured && + dmDevPrivCb.extAdv[i].advertising && + (dmDevPrivCb.extAdv[i].connectable || nonconnectable)) + { + return TRUE; + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Start the address generation timer. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevPrivTimerStart(void) +{ + /* if LL Privacy not enabled and device advertising, scanning or connected */ + if (!dmCb.llPrivEnabled && (dmDevPrivAdvertising(TRUE) || dmDevPrivCb.scanning || dmDevPrivCb.connected)) + { + /* start address generation timer */ + dmDevPrivCb.addrTimerStarted = TRUE; + dmDevPrivCb.addrTimer.msg.event = DM_DEV_PRIV_MSG_TIMEOUT; + WsfTimerStartSec(&dmDevPrivCb.addrTimer, dmDevPrivCb.changeInterval); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start resolvable address calculation. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevPrivAddrCalc(void) +{ + uint8_t buf[DM_PRIV_PLAINTEXT_LEN]; + + /* get random number */ + SecRand(buf, DM_PRIV_PRAND_LEN); + + /* set address type in random number */ + buf[2] = (buf[2] & 0x3F) | DM_RAND_ADDR_RESOLV; + + /* pad buffer */ + memset(buf + DM_PRIV_PRAND_LEN, 0, (DM_PRIV_PLAINTEXT_LEN - DM_PRIV_PRAND_LEN)); + + /* run calculation */ + SecAes(DmSecGetLocalIrk(), buf, dmCb.handlerId, 0, DM_DEV_PRIV_MSG_AES_CMPL); + + /* store random number */ + memcpy(dmDevPrivCb.prand, buf, DM_PRIV_PRAND_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Set the RPA to be used by the local device. + * + * \param pAddr New RPA. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevPrivSetRpa(uint8_t *pAddr) +{ + uint8_t i; + + /* set new RPA as local address */ + BdaCpy(dmCb.localAddr, pAddr); + + /* set RPA in device */ + HciLeSetRandAddrCmd(dmCb.localAddr); + + if (dmDevCb.advSetRandAddrCback) + { + for (i = 0; i < DM_NUM_ADV_SETS; i++) + { + if (dmDevPrivCb.extAdv[i].configured) + { + /* set RPA for advertising set */ + (*dmDevCb.advSetRandAddrCback)(i, dmCb.localAddr); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the pending RPA to be used by the local device. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmDevPrivSetPendingRpa(void) +{ + /* if not advertising, scanning or initiating connection, and new RPA has been generated */ + if (!(dmDevPrivAdvertising(FALSE) || dmDevPrivCb.scanning || dmDevPrivCb.connecting) && + !BdaIsZeros(dmDevPrivCb.pendingAddr)) + { + /* use pending RPA as local address */ + dmDevPrivSetRpa(dmDevPrivCb.pendingAddr); + + /* clear out pending RPA */ + memset(dmDevPrivCb.pendingAddr, 0, BDA_ADDR_LEN); + } +} + +/*************************************************************************************************/ +/*! + * \brief Start device privacy action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActStart(dmDevPrivMsg_t *pMsg) +{ + /* initialize and store parameters */ + dmDevPrivCb.useResolvable = TRUE; + dmDevPrivCb.changeInterval = pMsg->apiPrivStart.changeInterval; + dmDevPrivCb.addrTimer.handlerId = dmCb.handlerId; + + /* set the local address type to random */ + DmAdvSetAddrType(DM_ADDR_RANDOM); + DmScanSetAddrType(DM_ADDR_RANDOM); + DmConnSetAddrType(DM_ADDR_RANDOM); + + /* start the address generation timer if applicable */ + if (dmDevPrivCb.changeInterval > 0) + { + /* start address generation timer */ + dmDevPrivTimerStart(); + + /* if LL Privacy is supported */ + if (HciLlPrivacySupported()) + { + /* Set LL resolvable private address timeout */ + DmPrivSetResolvablePrivateAddrTimeout(dmDevPrivCb.changeInterval); + } + } + + /* if private address has never been generated */ + if (dmDevPrivCb.addrInitialized == FALSE) + { + /* start address calculation */ + dmDevPrivAddrCalc(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop device privacy action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActStop(dmDevPrivMsg_t *pMsg) +{ + /* stop address generation timer */ + dmDevPrivCb.addrTimerStarted = FALSE; + WsfTimerStop(&dmDevPrivCb.addrTimer); + + dmDevPrivCb.useResolvable = FALSE; + memset(dmDevPrivCb.pendingAddr, 0, BDA_ADDR_LEN); + + /* set the local address type to public */ + DmAdvSetAddrType(DM_ADDR_PUBLIC); + DmScanSetAddrType(DM_ADDR_PUBLIC); + DmConnSetAddrType(DM_ADDR_PUBLIC); + + /* if LL Privacy is supported */ + if (HciLlPrivacySupported()) + { + /* remove all devices from resolving list and disable LL Privacy */ + DmPrivClearResList(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle a private address generation timeout. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActTimeout(dmDevPrivMsg_t *pMsg) +{ + /* if Host Privacy still enabled */ + if (dmDevPrivCb.useResolvable) + { + /* address generation timer has timed out */ + dmDevPrivCb.addrTimerStarted = FALSE; + + /* restart address generation timer */ + dmDevPrivTimerStart(); + + /* start address calculation */ + dmDevPrivAddrCalc(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle AES calculation complete. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActAesCmpl(dmDevPrivMsg_t *pMsg) +{ + bdAddr_t localAddr; + + if (dmDevPrivCb.useResolvable) + { + /* build and store address; hash is in ls bytes, random part in ms bytes */ + memcpy(localAddr, pMsg->aes.pCiphertext, DM_PRIV_HASH_LEN); + memcpy(&localAddr[DM_PRIV_HASH_LEN], dmDevPrivCb.prand, DM_PRIV_PRAND_LEN); + + /* set generated address as random resolvable */ + DM_RAND_ADDR_SET(localAddr, DM_RAND_ADDR_RESOLV); + + /* if not advertising, scanning or initiating connection */ + if (!(dmDevPrivAdvertising(FALSE) || dmDevPrivCb.scanning || dmDevPrivCb.connecting)) + { + /* use new RPA as local address */ + dmDevPrivSetRpa(localAddr); + } + else + { + /* save new RPA for later */ + BdaCpy(dmDevPrivCb.pendingAddr, localAddr); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle a device privacy RPA start event. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActRpaStart(dmDevPrivMsg_t *pMsg) +{ + switch (pMsg->hdr.param) + { + case DM_ADV_START_IND: + /* advertising started */ + dmDevPrivCb.advertising = TRUE; + break; + + case DM_ADV_SET_START_IND: + /* extended advertising started */ + WSF_ASSERT(pMsg->privCtrl.advHandle < DM_NUM_ADV_SETS); + + dmDevPrivCb.extAdv[pMsg->privCtrl.advHandle].advertising = TRUE; + break; + + case DM_SCAN_START_IND: + case DM_EXT_SCAN_START_IND: + /* scanning started */ + dmDevPrivCb.scanning = TRUE; + break; + + case DM_CONN_OPEN_IND: + /* connection opened */ + dmDevPrivCb.connected = TRUE; + break; + + default: + /* LL Privacy disabled */ + break; + } + + /* if Host Privacy enabled and address generation timer not already running */ + if (dmDevPrivCb.useResolvable && !dmDevPrivCb.addrTimerStarted) + { + /* start address generation timer */ + dmDevPrivTimerStart(); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle a device privacy RPA stop event. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActRpaStop(dmDevPrivMsg_t *pMsg) +{ + switch (pMsg->hdr.param) + { + case DM_ADV_STOP_IND: + /* advertising stopped */ + dmDevPrivCb.advertising = FALSE; + + /* use pending RPA */ + dmDevPrivSetPendingRpa(); + break; + + case DM_ADV_SET_STOP_IND: + WSF_ASSERT(pMsg->privCtrl.advHandle < DM_NUM_ADV_SETS); + + /* extended advertising stopped */ + dmDevPrivCb.extAdv[pMsg->privCtrl.advHandle].advertising = FALSE; + + /* use pending RPA */ + dmDevPrivSetPendingRpa(); + break; + + case DM_SCAN_STOP_IND: + case DM_EXT_SCAN_STOP_IND: + /* scanning stopped */ + dmDevPrivCb.scanning = FALSE; + + /* use pending RPA */ + dmDevPrivSetPendingRpa(); + break; + + case DM_CONN_CLOSE_IND: + /* connection closed */ + dmDevPrivCb.connected = FALSE; + break; + + default: + /* LL Privacy enabled see if address generation timer running */ + if (dmDevPrivCb.addrTimerStarted) + { + /* stop address generation timer (LL will generate RPAs) */ + dmDevPrivCb.addrTimerStarted = FALSE; + WsfTimerStop(&dmDevPrivCb.addrTimer); + } + break; + } + + /* let address generation timer timeout (if still running) and update address */ +} + +/*************************************************************************************************/ +/*! + * \brief Handle a device privacy control event. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivActCtrl(dmDevPrivMsg_t *pMsg) +{ + switch (pMsg->hdr.param) + { + case DM_DEV_PRIV_MSG_CONN_INIT_START: + /* connection initiation started */ + dmDevPrivCb.connecting = TRUE; + break; + + case DM_DEV_PRIV_MSG_CONN_INIT_STOP: + /* connection initiation stopped */ + dmDevPrivCb.connecting = FALSE; + + /* use pending RPA */ + dmDevPrivSetPendingRpa(); + break; + + case DM_DEV_PRIV_MSG_ADV_SET_ADD: + /* advertising set created */ + WSF_ASSERT(pMsg->privCtrl.advHandle < DM_NUM_ADV_SETS); + + dmDevPrivCb.extAdv[pMsg->privCtrl.advHandle].configured = TRUE; + dmDevPrivCb.extAdv[pMsg->privCtrl.advHandle].connectable = pMsg->privCtrl.connectable; + + /* if Host Privacy enabled and private address has been generated */ + if (dmDevPrivCb.useResolvable && dmDevPrivCb.addrInitialized) + { + WSF_ASSERT(dmDevCb.advSetRandAddrCback != NULL); + + /* set RPA for advertising set */ + (*dmDevCb.advSetRandAddrCback)(pMsg->privCtrl.advHandle, dmCb.localAddr); + } + break; + + case DM_DEV_PRIV_MSG_ADV_SET_REMOVE: + /* advertising set removed */ + WSF_ASSERT(pMsg->privCtrl.advHandle < DM_NUM_ADV_SETS); + + /* clear advertising set */ + /* note: advertising handle is checked before reaching this function */ + /* coverity[overrun-buffer-arg] */ + memset(&dmDevPrivCb.extAdv[pMsg->privCtrl.advHandle], 0, sizeof(dmDevPrivExtAdv_t)); + break; + + case DM_DEV_PRIV_MSG_ADV_SETS_CLEAR: + /* clear advertising sets */ + memset(dmDevPrivCb.extAdv, 0, sizeof(dmDevPrivCb.extAdv)); + break; + + default: + /* unknown state message */ + break; + } +} + +/*************************************************************************************************/ +/*! + * \brief DM device priv HCI callback event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivHciHandler(hciEvt_t *pEvent) +{ + /* if Host Privacy enabled */ + if (dmDevPrivCb.useResolvable) + { + /* handle incoming event */ + if (pEvent->hdr.event == HCI_LE_SET_RAND_ADDR_CMD_CMPL_CBACK_EVT) + { + dmAdvNewAddrIndEvt_t msg; + + msg.hdr.event = DM_ADV_NEW_ADDR_IND; + msg.hdr.status = pEvent->hdr.status; + BdaCpy(msg.addr, dmCb.localAddr); + msg.firstTime = !dmDevPrivCb.addrInitialized; + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) &msg); + + dmDevPrivCb.addrInitialized = TRUE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM device privacy event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmDevPrivAct[DM_MSG_MASK(pMsg->event)])((dmDevPrivMsg_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the device privacy module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPrivReset(void) +{ + if (dmDevPrivCb.useResolvable) + { + /* stop address generation timer */ + WsfTimerStop(&dmDevPrivCb.addrTimer); + } + + /* initialize control block */ + memset(&dmDevPrivCb, 0, sizeof(dmDevPrivCb)); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize device privacy module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevPrivInit(void) +{ + dmFcnIfTbl[DM_ID_DEV_PRIV] = (dmFcnIf_t *) &dmDevPrivFcnIf; + + /* initialize set advertising set random address callback */ + dmDevCb.advSetRandAddrCback = NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Start using a private resolvable address. + * + * \param changeInterval Interval between automatic address changes, in seconds. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevPrivStart(uint16_t changeInterval) +{ + dmDevPrivApiStart_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmDevPrivApiStart_t))) != NULL) + { + pMsg->hdr.event = DM_DEV_PRIV_MSG_API_START; + pMsg->changeInterval = changeInterval; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop using a private resolvable address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmDevPrivStop(void) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->event = DM_DEV_PRIV_MSG_API_STOP; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.c new file mode 100644 index 0000000000000000000000000000000000000000..12047f1d0f13490fe48407a7767e7a09c73ce107 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.c @@ -0,0 +1,578 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager main module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "hci_api.h" +#include "l2c_defs.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_scan.h" +#include "dm_adv.h" +#include "dm_dev.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* HCI callback event routing table */ +static const uint8_t dmHciToIdTbl[] = +{ + DM_ID_DEV, /* HCI_RESET_SEQ_CMPL_CBACK_EVT */ + DM_ID_CONN, /* HCI_LE_CONN_CMPL_CBACK_EVT */ + DM_ID_CONN, /* HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT */ + DM_ID_CONN, /* HCI_DISCONNECT_CMPL_CBACK_EVT */ + DM_ID_CONN, /* HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT */ + DM_ID_CONN, /* HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT */ + DM_ID_SCAN, /* HCI_LE_ADV_REPORT_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_READ_RSSI_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_ENC_CHANGE_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_LTK_REQ_CBACK_EVT */ + DM_ID_DEV, /* HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT */ + DM_ID_DEV, /* HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT */ + DM_ID_DEV, /* HCI_VENDOR_SPEC_CBACK_EVT */ + DM_ID_DEV, /* HCI_HW_ERROR_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT */ + DM_ID_PRIV, /* HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_RAND_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_REM_CONN_PARAM_REP_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_REM_CONN_PARAM_NEG_REP_CMD_CMPL_CBACK_EVT */ + DM_ID_DEV, /* HCI_LE_READ_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT */ + DM_ID_DEV, /* HCI_LE_WRITE_DEF_DATA_LEN_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_SET_DATA_LEN_CMD_CMPL_CBACK_EVT */ + DM_ID_DEV, /* HCI_LE_READ_MAX_DATA_LEN_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_LE_DATA_LEN_CHANGE_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT */ + DM_ID_SEC, /* HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_2, /* HCI_AUTH_PAYLOAD_TO_EXPIRED_EVT */ + DM_ID_PHY, /* HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT */ + DM_ID_PHY, /* HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT */ + DM_ID_PHY, /* HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT */ + DM_ID_SCAN, /* HCI_LE_EXT_ADV_REPORT_CBACK_EVT */ + DM_ID_SCAN, /* HCI_LE_SCAN_TIMEOUT_CBACK_EVT */ + DM_ID_ADV, /* HCI_LE_ADV_SET_TERM_CBACK_EVT */ + DM_ID_ADV, /* HCI_LE_SCAN_REQ_RCVD_CBACK_EVT */ + DM_ID_SYNC, /* HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT */ + DM_ID_SYNC, /* HCI_LE_PER_ADV_REPORT_CBACK_EVT */ + DM_ID_SYNC, /* HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT */ + DM_ID_DEV, /* HCI_LE_CH_SEL_ALGO_CBACK_EVT */ + DM_ID_SCAN, /* HCI_LE_SCAN_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_ADV, /* HCI_LE_ADV_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_SCAN, /* HCI_LE_EXT_SCAN_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_ADV, /* HCI_LE_EXT_ADV_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_ADV_PER, /* HCI_LE_PER_ADV_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_DEV_PRIV, /* HCI_LE_SET_RAND_ADDR_CMD_CMPL_CBACK_EVT */ + DM_ID_SYNC, /* HCI_LE_PER_SYNC_TRSF_RCVD_CBACK_EVT */ + DM_ID_PAST, /* HCI_LE_PER_ADV_SYNC_TRSF_CMD_CMPL_CBACK_EVT */ + DM_ID_PAST, /* HCI_LE_PER_ADV_SET_INFO_TRSF_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_CONN_IQ_REPORT_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_CTE_REQ_FAILED_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_SET_CONN_CTE_RX_PARAMS_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_SET_CONN_CTE_TX_PARAMS_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_CONN_CTE_REQ_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_CTE, /* HCI_LE_CONN_CTE_RSP_ENABLE_CMD_CMPL_CBACK_EVT */ + DM_ID_CONN_CTE /* HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT */ +}; + +/* DM callback event length table */ +static const uint16_t dmEvtCbackLen[] = +{ + sizeof(wsfMsgHdr_t), /* DM_RESET_CMPL_IND */ + sizeof(wsfMsgHdr_t), /* DM_ADV_START_IND */ + sizeof(wsfMsgHdr_t), /* DM_ADV_STOP_IND */ + sizeof(dmAdvNewAddrIndEvt_t), /* DM_ADV_NEW_ADDR_IND */ + sizeof(wsfMsgHdr_t), /* DM_SCAN_START_IND */ + sizeof(wsfMsgHdr_t), /* DM_SCAN_STOP_IND */ + sizeof(hciLeAdvReportEvt_t), /* DM_SCAN_REPORT_IND */ + sizeof(hciLeConnCmplEvt_t), /* DM_CONN_OPEN_IND */ + sizeof(hciDisconnectCmplEvt_t), /* DM_CONN_CLOSE_IND */ + sizeof(hciLeConnUpdateCmplEvt_t), /* DM_CONN_UPDATE_IND */ + sizeof(dmSecPairCmplIndEvt_t), /* DM_SEC_PAIR_CMPL_IND */ + sizeof(wsfMsgHdr_t), /* DM_SEC_PAIR_FAIL_IND */ + sizeof(dmSecEncryptIndEvt_t), /* DM_SEC_ENCRYPT_IND */ + sizeof(wsfMsgHdr_t), /* DM_SEC_ENCRYPT_FAIL_IND */ + sizeof(dmSecAuthReqIndEvt_t), /* DM_SEC_AUTH_REQ_IND */ + sizeof(dmSecKeyIndEvt_t), /* DM_SEC_KEY_IND */ + sizeof(hciLeLtkReqEvt_t), /* DM_SEC_LTK_REQ_IND */ + sizeof(dmSecPairIndEvt_t), /* DM_SEC_PAIR_IND */ + sizeof(dmSecSlaveIndEvt_t), /* DM_SEC_SLAVE_REQ_IND */ + sizeof(dmSecOobCalcIndEvt_t), /* DM_SEC_CALC_OOB_IND */ + sizeof(secEccMsg_t), /* DM_SEC_ECC_KEY_IND */ + sizeof(dmSecCnfIndEvt_t), /* DM_SEC_COMPARE_IND */ + sizeof(dmSecKeypressIndEvt_t), /* DM_SEC_KEYPRESS_IND */ + sizeof(wsfMsgHdr_t), /* DM_PRIV_RESOLVED_ADDR_IND */ + sizeof(dmPrivGenAddrIndEvt_t), /* DM_PRIV_GENERATE_RPA_IND */ + sizeof(hciReadRssiCmdCmplEvt_t), /* DM_CONN_READ_RSSI_IND */ + sizeof(hciLeAddDevToResListCmdCmplEvt_t), /* DM_PRIV_ADD_DEV_TO_RES_LIST_IND */ + sizeof(hciLeRemDevFromResListCmdCmplEvt_t), /* DM_PRIV_REM_DEV_FROM_RES_LIST_IND */ + sizeof(hciLeClearResListCmdCmplEvt_t), /* DM_PRIV_CLEAR_RES_LIST_IND */ + sizeof(hciLeReadPeerResAddrCmdCmplEvt_t), /* DM_PRIV_READ_PEER_RES_ADDR_IND */ + sizeof(hciLeReadLocalResAddrCmdCmplEvt_t), /* DM_PRIV_READ_LOCAL_RES_ADDR_IND */ + sizeof(hciLeSetAddrResEnableCmdCmplEvt_t), /* DM_PRIV_SET_ADDR_RES_ENABLE_IND */ + sizeof(hciLeRemConnParamReqEvt_t), /* DM_REM_CONN_PARAM_REQ_IND */ + sizeof(hciLeDataLenChangeEvt_t), /* DM_CONN_DATA_LEN_CHANGE_IND */ + sizeof(hciWriteAuthPayloadToCmdCmplEvt_t), /* DM_CONN_WRITE_AUTH_TO_IND */ + sizeof(hciAuthPayloadToExpiredEvt_t), /* DM_CONN_AUTH_TO_EXPIRED_IND */ + sizeof(hciLeReadPhyCmdCmplEvt_t), /* DM_PHY_READ_IND */ + sizeof(hciLeSetDefPhyCmdCmplEvt_t), /* DM_PHY_SET_DEF_IND */ + sizeof(hciLePhyUpdateEvt_t), /* DM_PHY_UPDATE_IND */ + sizeof(dmAdvSetStartEvt_t), /* DM_ADV_SET_START_IND */ + sizeof(hciLeAdvSetTermEvt_t), /* DM_ADV_SET_STOP_IND */ + sizeof(hciLeScanReqRcvdEvt_t), /* DM_SCAN_REQ_RCVD_IND */ + sizeof(wsfMsgHdr_t), /* DM_EXT_SCAN_START_IND */ + sizeof(wsfMsgHdr_t), /* DM_EXT_SCAN_STOP_IND */ + sizeof(hciLeExtAdvReportEvt_t), /* DM_EXT_SCAN_REPORT_IND */ + sizeof(dmPerAdvSetStartEvt_t), /* DM_PER_ADV_SET_START_IND */ + sizeof(dmPerAdvSetStopEvt_t), /* DM_PER_ADV_SET_STOP_IND */ + sizeof(hciLePerAdvSyncEstEvt_t), /* DM_PER_ADV_SYNC_EST_IND */ + sizeof(hciLePerAdvSyncEstEvt_t), /* DM_PER_ADV_SYNC_EST_FAIL_IND */ + sizeof(hciLePerAdvSyncLostEvt_t), /* DM_PER_ADV_SYNC_LOST_IND */ + sizeof(HciLePerAdvSyncTrsfRcvdEvt_t), /* DM_PER_ADV_SYNC_TRSF_EST_IND */ + sizeof(HciLePerAdvSyncTrsfRcvdEvt_t), /* DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND */ + sizeof(hciLePerAdvSyncTrsfCmdCmplEvt_t), /* DM_PER_ADV_SYNC_TRSF_IND */ + sizeof(hciLePerAdvSetInfoTrsfCmdCmplEvt_t), /* DM_PER_ADV_SET_INFO_TRSF_IND */ + sizeof(hciLePerAdvReportEvt_t), /* DM_PER_ADV_REPORT_IND */ + sizeof(hciLeReadRemoteFeatCmplEvt_t), /* DM_REMOTE_FEATURES_IND */ + sizeof(hciReadRemoteVerInfoCmplEvt_t), /* DM_READ_REMOTE_VER_INFO_IND */ + sizeof(hciLeConnIQReportEvt_t), /* DM_CONN_IQ_REPORT_IND */ + sizeof(hciLeCteReqFailedEvt_t), /* DM_CTE_REQ_FAIL_IND */ + sizeof(hciLeSetConnCteRxParamsCmdCmplEvt_t), /* DM_CONN_CTE_RX_SAMPLE_START_IND */ + sizeof(hciLeSetConnCteRxParamsCmdCmplEvt_t), /* DM_CONN_CTE_RX_SAMPLE_START_IND */ + sizeof(hciLeSetConnCteTxParamsCmdCmplEvt_t), /* DM_CONN_CTE_TX_CFG_IND */ + sizeof(hciLeConnCteReqEnableCmdCmplEvt_t), /* DM_CONN_CTE_REQ_START_IND */ + sizeof(hciLeConnCteReqEnableCmdCmplEvt_t), /* DM_CONN_CTE_REQ_STOP_IND */ + sizeof(hciLeConnCteRspEnableCmdCmplEvt_t), /* DM_CONN_CTE_RSP_START_IND */ + sizeof(hciLeConnCteRspEnableCmdCmplEvt_t), /* DM_CONN_CTE_RSP_STOP_IND */ + sizeof(hciLeReadAntennaInfoCmdCmplEvt_t), /* DM_READ_ANTENNA_INFO_IND */ + sizeof(dmL2cCmdRejEvt_t), /* DM_L2C_CMD_REJ_IND */ + sizeof(wsfMsgHdr_t), /* DM_ERROR_IND */ + sizeof(hciHwErrorEvt_t), /* DM_HW_ERROR_IND */ + sizeof(hciVendorSpecEvt_t) /* DM_VENDOR_SPEC_IND */ +}; + +/* Default component function inteface */ +static const dmFcnIf_t dmFcnDefault = +{ + dmEmptyReset, + (dmHciHandler_t) dmEmptyHandler, + (dmMsgHandler_t) dmEmptyHandler +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Component function interface table indexed DM component ID */ +dmFcnIf_t *dmFcnIfTbl[DM_NUM_IDS] = +{ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_ADV */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_DEV_PRIV */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_SCAN */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_CONN */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_CONN_2 */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_SEC */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_PRIV */ + (dmFcnIf_t *) &dmDevFcnIf, /* DM_ID_DEV */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_LESC */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_PHY */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_ADV_PER */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_SYNC */ + (dmFcnIf_t *) &dmFcnDefault, /* DM_ID_PAST */ + (dmFcnIf_t *) &dmFcnDefault /* DM_ID_CONN_CTE */ +}; + +/* Control block */ +dmCb_t dmCb; + +/*************************************************************************************************/ +/*! + * \brief HCI event callback function. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmHciEvtCback(hciEvt_t *pEvent) +{ + WSF_ASSERT(pEvent->hdr.event <= HCI_LE_READ_ANTENNA_INFO_CMD_CMPL_CBACK_EVT); + + /* if DM not resetting or resetting but incoming event is HCI reset sequence complete event */ + if (!dmCb.resetting || (pEvent->hdr.event == HCI_RESET_SEQ_CMPL_CBACK_EVT)) + { + /* route event to DM component handling function */ + (*(dmFcnIfTbl[dmHciToIdTbl[pEvent->hdr.event]]->hciHandler))(pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM empty reset handler. + * + * \return None. + */ +/*************************************************************************************************/ +void dmEmptyReset(void) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief DM empty event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmEmptyHandler(wsfMsgHdr_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Pass an HCI event to the DM connection management module. + * + * \param pEvent HCI event. + * + * \return None. + */ +/*************************************************************************************************/ +void dmDevPassHciEvtToConn(hciEvt_t *pEvent) +{ + /* pass event to DM connection management module */ + (*(dmFcnIfTbl[DM_ID_CONN]->hciHandler))(pEvent); +} + +/*************************************************************************************************/ +/*! + * \brief Register a callback with DM for scan and advertising events. + * + * \param cback Client callback function. + * + * \return None. + */ +/*************************************************************************************************/ +void DmRegister(dmCback_t cback) +{ + dmCb.cback = cback; + + /* if LESC is enabled */ + if (dmFcnIfTbl[DM_ID_LESC] != &dmFcnDefault) + { + /* if largest LESC key length is larger than maximum RX PDU length */ + if (SMP_PUB_KEY_MSG_LEN > (HciGetMaxRxAclLen() - L2C_HDR_LEN)) + { + dmEvt_t evt; + + evt.hdr.param = 0; + evt.hdr.event = DM_ERROR_IND; + evt.hdr.status = DM_ERR_SMP_RX_PDU_LEN_EXCEEDED; + + (*dmCb.cback)(&evt); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Find an advertising data element in the given advertising or scan response data. + * + * \param adType Advertising data element type to find. + * \param dataLen Data length. + * \param pData Pointer to advertising or scan response data. + * + * \return Pointer to advertising data element byte array or NULL if not found. + */ +/*************************************************************************************************/ +uint8_t *DmFindAdType(uint8_t adType, uint16_t dataLen, uint8_t *pData) +{ + /* while not at end of data and + * data element length is not zero and + * data element length is not erroneously more than the data length + */ + while ((dataLen != 0) && (pData[DM_AD_LEN_IDX] != 0) && (pData[DM_AD_LEN_IDX] < dataLen)) + { + /* if found */ + if (pData[DM_AD_TYPE_IDX] == adType) + { + return pData; + } + + /* else go to next element */ + dataLen = dataLen - pData[DM_AD_LEN_IDX] - 1; + pData = pData + pData[DM_AD_LEN_IDX] + 1; + } + + /* not found */ + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief DM handler init function called during system initialization. + * + * \param handlerID WSF handler ID for DM. + * + * \return None. + */ +/*************************************************************************************************/ +void DmHandlerInit(wsfHandlerId_t handlerId) +{ + /* store handler ID */ + dmCb.handlerId = handlerId; + + dmCb.llPrivEnabled = FALSE; + dmCb.resetting = FALSE; + + /* register with the HCI event interface */ + HciEvtRegister(dmHciEvtCback); +} + +/*************************************************************************************************/ +/*! + * \brief WSF event handler for DM. + * + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void DmHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + /* Handle message */ + if (pMsg != NULL) + { + WSF_ASSERT(DM_ID_FROM_MSG(pMsg->event) < DM_NUM_IDS); + + /* if DM not resetting */ + if (!dmCb.resetting) + { + /* route message to DM component handling function */ + (*(dmFcnIfTbl[DM_ID_FROM_MSG(pMsg->event)]->msgHandler))(pMsg); + } + } + /* Handle events */ + else if (event) + { + + } +} + +/*************************************************************************************************/ +/*! + * \brief Whether LL Privacy is enabled. + * + * \return TRUE if LL Privacy is enabled. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t DmLlPrivEnabled(void) +{ + return dmCb.llPrivEnabled; +} + +/*************************************************************************************************/ +/*! + * \brief Map an address type to a type used by LL. + * + * \param addrType Address type used by Host. + * + * \return Address type used by LL. + */ +/*************************************************************************************************/ +uint8_t DmLlAddrType(uint8_t addrType) +{ + uint8_t llAddrType = addrType; + + /* if LL Privacy is enabled */ + if (dmCb.llPrivEnabled) + { + if (addrType == DM_ADDR_PUBLIC) + { + llAddrType = DM_ADDR_PUBLIC_IDENTITY; + } + else if (addrType == DM_ADDR_RANDOM) + { + llAddrType = DM_ADDR_RANDOM_IDENTITY; + } + } + + return llAddrType; +} + +/*************************************************************************************************/ +/*! + * \brief Map an address type to a type used by Host. + * + * \param addrType Address type used by LL. + * + * \return Address type used by Host. + */ +/*************************************************************************************************/ +uint8_t DmHostAddrType(uint8_t addrType) +{ + uint8_t hostAddrType = addrType; + + /* if LL Privacy is enabled */ + if (dmCb.llPrivEnabled) + { + if (addrType == DM_ADDR_PUBLIC_IDENTITY) + { + hostAddrType = DM_ADDR_PUBLIC; + } + else if (addrType == DM_ADDR_RANDOM_IDENTITY) + { + hostAddrType = DM_ADDR_RANDOM; + } + } + + return hostAddrType; +} + +/*************************************************************************************************/ +/*! + * \brief Return size of a DM callback event. + * + * \param pDmEvt DM callback event. + * + * \return Size of DM callback event. + */ +/*************************************************************************************************/ +uint16_t DmSizeOfEvt(dmEvt_t *pDmEvt) +{ + uint16_t len; + + /* if a valid DM event ID */ + if ((pDmEvt->hdr.event >= DM_CBACK_START) && (pDmEvt->hdr.event <= DM_CBACK_END)) + { + len = dmEvtCbackLen[pDmEvt->hdr.event - DM_CBACK_START]; + } + else + { + len = sizeof(wsfMsgHdr_t); + } + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Return the PHY index for the given scanner PHY. + * + * \param numPhys Number of scanner PHYs. + * \param scanPhy Scanner PHY. + * + * \return PHY index. + */ +/*************************************************************************************************/ +static uint8_t dmScanPhyToIdx(uint8_t numPhys, uint8_t scanPhy) +{ + /* if number of supported PHYs is 1 */ + if (numPhys == 1) + { + return 0; + } + + /* if number of supported PHYs is 2 */ + if (numPhys == 2) + { + return (scanPhy == HCI_SCAN_PHY_LE_1M_BIT) ? 0 : 1; + } + + /* all three PHYs are supported */ + return (scanPhy == HCI_SCAN_PHY_LE_1M_BIT) ? 0 : (scanPhy == HCI_SCAN_PHY_LE_2M_BIT) ? 1 : 2; +} + +/*************************************************************************************************/ +/*! + * \brief Return the PHY index for the given scanner PHY. + * + * \param scanPhy Scanner PHY. + * + * \return PHY index. + */ +/*************************************************************************************************/ +uint8_t DmScanPhyToIdx(uint8_t scanPhy) +{ + return dmScanPhyToIdx(DM_NUM_PHYS, scanPhy); +} + +/*************************************************************************************************/ +/*! + * \brief Return the PHY index for the given initiator PHY. + * + * \param numPhys Number of initiator PHYs. + * \param initPhy Initiator PHY. + * + * \return PHY index. + */ +/*************************************************************************************************/ +uint8_t dmInitPhyToIdx(uint8_t numPhys, uint8_t initPhy) +{ + /* if number of supported PHYs is 1 */ + if (numPhys == 1) + { + return 0; + } + + /* if number of supported PHYs is 2 */ + if (numPhys == 2) + { + return (initPhy == HCI_INIT_PHY_LE_1M_BIT) ? 0 : 1; + } + + /* all three PHYs are supported */ + return (initPhy == HCI_INIT_PHY_LE_1M_BIT) ? 0 : (initPhy == HCI_INIT_PHY_LE_2M_BIT) ? 1 : 2; +} + +/*************************************************************************************************/ +/*! + * \brief Return the PHY index for the given initiator PHY. + * + * \param initPhy Initiator PHY. + * + * \return PHY index. + */ +/*************************************************************************************************/ +uint8_t DmInitPhyToIdx(uint8_t initPhy) +{ + return dmInitPhyToIdx(DM_NUM_PHYS, initPhy); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.h new file mode 100644 index 0000000000000000000000000000000000000000..979c3773f905097863c5cb104526396c16174aaa --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_main.h @@ -0,0 +1,139 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM main module. + */ +/*************************************************************************************************/ +#ifndef DM_MAIN_H +#define DM_MAIN_H + +#include "util/bda.h" +#include "wsf_os.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM component IDs */ +#define DM_ID_ADV 0 +#define DM_ID_DEV_PRIV 1 +#define DM_ID_SCAN 2 +#define DM_ID_CONN 3 +#define DM_ID_CONN_2 4 +#define DM_ID_SEC 5 +#define DM_ID_PRIV 6 +#define DM_ID_DEV 7 +#define DM_ID_LESC 8 +#define DM_ID_PHY 9 +#define DM_ID_ADV_PER 10 +#define DM_ID_SYNC 11 +#define DM_ID_PAST 12 +#define DM_ID_CONN_CTE 13 +#define DM_NUM_IDS 14 + +/* Start of component message enumeration */ +#define DM_MSG_START(id) ((id) << 4) + +/* Get the component ID from a message ID */ +#define DM_ID_FROM_MSG(msg) ((msg) >> 4) + +/* Mask off the ID from the message ID */ +#define DM_MSG_MASK(msg) ((msg) & 0x0F) + +/* Length of hash part of private resolvable address */ +#define DM_PRIV_HASH_LEN 3 + +/* Length of random part of private resolvable address */ +#define DM_PRIV_PRAND_LEN 3 + +/* Length of plaintext used for private resolvable address calculation */ +#define DM_PRIV_PLAINTEXT_LEN 16 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* DM reset function type */ +typedef void (*dmReset_t)(void); + +/* DM message handling function types */ +typedef void (*dmMsgHandler_t)(wsfMsgHdr_t *pMsg); +typedef void (*dmHciHandler_t)(hciEvt_t *pEvent); + +/* DM component reset and handler function interface */ +typedef struct +{ + dmReset_t reset; + dmHciHandler_t hciHandler; + dmMsgHandler_t msgHandler; +} dmFcnIf_t; + +/* Main control block of the DM subsystem */ +typedef struct +{ + bdAddr_t localAddr; + dmCback_t cback; + wsfHandlerId_t handlerId; + uint8_t connAddrType; + uint8_t advAddrType; + uint8_t scanAddrType; + bool_t resetting; + + /* Filter policies for Advertising, Scanning, Initiator and Synchronization */ + uint8_t advFiltPolicy[DM_NUM_ADV_SETS]; + uint8_t scanFiltPolicy; + uint8_t initFiltPolicy; + + /* Options (filter policies and periodic advertising report enablement) for Synchronization */ + uint8_t syncOptions; + + /* LL Privacy */ + bool_t llPrivEnabled; +} dmCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Component function interface table indexed DM component ID */ +extern dmFcnIf_t *dmFcnIfTbl[DM_NUM_IDS]; + +/* Control block */ +extern dmCb_t dmCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void dmEmptyReset(void); +void dmEmptyHandler(wsfMsgHdr_t *pMsg); + +/* utility functions */ +uint8_t DmScanPhyToIdx(uint8_t scanPhy); +uint8_t DmInitPhyToIdx(uint8_t initPhy); +void dmDevPassHciEvtToConn(hciEvt_t *pEvent); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_past.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_past.c new file mode 100644 index 0000000000000000000000000000000000000000..0a48145cdd06965e945c1d0bf895bdecde032372 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_past.c @@ -0,0 +1,378 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager periodic advertising sync transfer (PAST) module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_adv.h" +#include "dm_conn.h" +#include "dm_scan.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! DM past event handler messages */ +enum +{ + /* messages from API */ + DM_PAST_MSG_API_RCV_ENABLE = DM_MSG_START(DM_ID_PAST), /*!< Enable receiving report */ + DM_PAST_MSG_API_SYNC_TRSF, /*!< Transfer sync */ + DM_PAST_MSG_API_SET_INFO_TRSF, /*!< Transfer set info */ + DM_PAST_MSG_API_CFG, /*!< Configure PAST parameters */ + DM_PAST_MSG_API_DEFAULT_CFG /*!< Configure PAST default parameters */ +}; + + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* action function table */ +static const dmPastAct_t dmPastAct[] = +{ + dmPastActRptRcvEnable, + dmPastActSyncTsfr, + dmPastActSetInfoTrsf, + dmPastActConfig, + dmPastActDefaultConfig +}; + +/*! DM PAST component function interface */ +static const dmFcnIf_t dmPastFcnIf = +{ + dmEmptyReset, + dmPastHciHandler, + dmPastMsgHandler +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize DM Periodic Advertising Sync Transfer (PAST) module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastInit(void) +{ + /* set function interface table */ + dmFcnIfTbl[DM_ID_PAST] = (dmFcnIf_t *) &dmPastFcnIf; +} + +/*************************************************************************************************/ +/*! + * \brief DM PAST HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPastHciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb = dmConnCcbByHandle(pEvent->hdr.param); + + /* if ccb found */ + if (pCcb != NULL) + { + /* set conn id */ + pEvent->hdr.param = pCcb->connId; + + if (pEvent->hdr.event == HCI_LE_PER_ADV_SYNC_TRSF_CMD_CMPL_CBACK_EVT) + { + pEvent->hdr.event = DM_PER_ADV_SYNC_TRSF_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + else if (pEvent->hdr.event == HCI_LE_PER_ADV_SET_INFO_TRSF_CMD_CMPL_CBACK_EVT) + { + pEvent->hdr.event = DM_PER_ADV_SET_INFO_TRSF_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM PAST event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPastMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmPastAct[DM_MSG_MASK(pMsg->event)])((dmPastMsg_t *) pMsg); +} + +/*************************************************************************************************/ +/*! +* \brief Enable receiving report action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmPastActRptRcvEnable(dmPastMsg_t *pMsg) +{ + dmSyncCb_t *pScb; + + /* look up scb from sync id */ + if ((pScb = dmSyncCbById((dmSyncId_t) pMsg->hdr.param)) != NULL) + { + HciLeSetPerAdvRcvEnableCmd(pScb->handle, (pMsg->hdr.status ? TRUE : FALSE)); + } +} + +/*************************************************************************************************/ +/*! +* \brief Transfer sync action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmPastActSyncTsfr(dmPastMsg_t *pMsg) +{ + dmSyncCb_t *pScb; + + /* look up scb from sync id */ + if ((pScb = dmSyncCbById((dmSyncId_t) pMsg->hdr.param)) != NULL) + { + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->apiPastTrsf.connId)) != NULL) + { + HciLePerAdvSyncTrsfCmd(pCcb->handle, pMsg->apiPastTrsf.serviceData, pScb->handle); + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Transfer set info action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmPastActSetInfoTrsf(dmPastMsg_t *pMsg) +{ + uint8_t advHandle = (uint8_t) pMsg->hdr.param; + + /* if periodic advertising is currently in progress for the advertising set */ + if (dmPerAdvState(advHandle) == DM_ADV_PER_STATE_ADVERTISING) + { + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById(pMsg->apiPastTrsf.connId)) != NULL) + { + HciLePerAdvSetInfoTrsfCmd(pCcb->handle, pMsg->apiPastTrsf.serviceData, advHandle); + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Configure PAST action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmPastActConfig(dmPastMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb from conn id */ + if ((pCcb = dmConnCcbById((dmConnId_t) pMsg->hdr.param)) != NULL) + { + HciLeSetPerAdvSyncTrsfParamsCmd(pCcb->handle, pMsg->apiPastCfg.mode, pMsg->apiPastCfg.skip, + pMsg->apiPastCfg.syncTimeout, pMsg->apiPastCfg.cteType); + } +} + +/*************************************************************************************************/ +/*! +* \brief Configure default PAST action function. +* +* \param pMsg WSF message. +* +* \return None. +*/ +/*************************************************************************************************/ +void dmPastActDefaultConfig(dmPastMsg_t *pMsg) +{ + HciLeSetDefaultPerAdvSyncTrsfParamsCmd(pMsg->apiPastCfg.mode, pMsg->apiPastCfg.skip, + pMsg->apiPastCfg.syncTimeout, pMsg->apiPastCfg.cteType); +} + +/*************************************************************************************************/ +/*! + * \brief Enable or disable reports for the periodic advertising identified by the sync id. + * + * \param syncId Sync identifier. + * \param enable TRUE to enable reporting, FALSE to disable reporting. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastRptRcvEnable(dmSyncId_t syncId, bool_t enable) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->param = syncId; + pMsg->event = DM_PAST_MSG_API_RCV_ENABLE; + pMsg->status = enable; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send synchronization information about the periodic advertising identified by the + * sync id to a connected device. + * + * \param connId Connection identifier. + * \param serviceData Value provided by the Host. + * \param syncId Sync identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastSyncTrsf(dmConnId_t connId, uint16_t serviceData, dmSyncId_t syncId) +{ + dmPastApiTrsf_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPastApiTrsf_t))) != NULL) + { + pMsg->hdr.param = syncId; + pMsg->hdr.event = DM_PAST_MSG_API_SYNC_TRSF; + pMsg->serviceData = serviceData; + pMsg->connId = connId; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send synchronization information about the periodic advertising in an advertising + * set to a connected device. + * + * \param connId Connection identifier. + * \param serviceData Value provided by the Host. + * \param advHandle Advertising handle. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastSetInfoTrsf(dmConnId_t connId, uint16_t serviceData, uint8_t advHandle) +{ + dmPastApiTrsf_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPastApiTrsf_t))) != NULL) + { + pMsg->hdr.param = advHandle; + pMsg->hdr.event = DM_PAST_MSG_API_SET_INFO_TRSF; + pMsg->serviceData = serviceData; + pMsg->connId = connId; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Specify how the Controller should process periodic advertising synchronization + * information received from the device identified by the connection handle. + * + * \param connId Connection identifier. + * \param mode Action to be taken when periodic advertising info is received. + * \param skip Number of consecutive periodic advertising packets that the receiver + * may skip after successfully receiving a periodic advertising packet. + * \param syncTimeout Maximum permitted time between successful receives. If this time is + * exceeded, synchronization is lost. + * \param cteType Whether to only synchronize to periodic advertising with certain + * types of Constant Tone Extension. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastConfig(dmConnId_t connId, uint8_t mode, uint16_t skip, uint16_t syncTimeout, + uint8_t cteType) +{ + dmPastApiCfg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPastApiCfg_t))) != NULL) + { + pMsg->hdr.param = connId; + pMsg->hdr.event = DM_PAST_MSG_API_CFG; + pMsg->mode = mode; + pMsg->skip = skip; + pMsg->syncTimeout = syncTimeout; + pMsg->cteType = cteType; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Specify the initial value for the mode, skip, timeout, and Constant Tone Extension type + * to be used for all subsequent connections over the LE transport. + * + * \param mode Action to be taken when periodic advertising info is received. + * \param skip Number of consecutive periodic advertising packets that the receiver + * may skip after successfully receiving a periodic advertising packet. + * \param syncTimeout Maximum permitted time between successful receives. If this time is + * exceeded, synchronization is lost. + * \param cteType Whether to only synchronize to periodic advertising with certain + * types of Constant Tone Extension. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPastDefaultConfig(uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType) +{ + dmPastApiCfg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPastApiCfg_t))) != NULL) + { + pMsg->hdr.event = DM_PAST_MSG_API_DEFAULT_CFG; + pMsg->mode = mode; + pMsg->skip = skip; + pMsg->syncTimeout = syncTimeout; + pMsg->cteType = cteType; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.c new file mode 100644 index 0000000000000000000000000000000000000000..e27fbeaafa4a68c3c532af064208b7ea6acfd4ce --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.c @@ -0,0 +1,241 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM PHY module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_phy.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Component function interface */ +static const dmFcnIf_t dmPhyFcnIf = +{ + dmEmptyReset, + dmPhyHciHandler, + (dmMsgHandler_t)dmEmptyHandler +}; + +/************************************************************************************************** +Local Functions +**************************************************************************************************/ +static void dmPhyActDefPhySet(hciEvt_t *pEvent); +static void dmPhyActPhyRead(dmConnCcb_t *pCcb, hciEvt_t *pEvent); +static void dmPhyActPhyUpdate(dmConnCcb_t *pCcb, hciEvt_t *pEvent); + +/*************************************************************************************************/ +/*! + * \brief DM PHY HCI event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPhyHciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb; + + if (pEvent->hdr.event == HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT) + { + dmPhyActDefPhySet(pEvent); + } + /* look up ccb from conn handle */ + else if ((pCcb = dmConnCcbByHandle(pEvent->hdr.param)) != NULL) + { + /* handle incoming event */ + switch (pEvent->hdr.event) + { + case HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT: + dmPhyActPhyRead(pCcb, pEvent); + break; + + case HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT: + dmPhyActPhyUpdate(pCcb, pEvent); + break; + + default: + /* should never get here */ + break; + } + } +} + +/*************************************************************************************************/ +/*! +* \brief Handle a read PHY event from HCI. +* +* \param pCcb Connection control block. +* \param pEvent Pointer to HCI callback event structure. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmPhyActPhyRead(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciLeReadPhyCmdCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_PHY_READ_IND; + evt.hdr.param = pCcb->connId; + evt.status = evt.hdr.status = (uint8_t)pEvent->leReadPhyCmdCmpl.status; + evt.handle = pCcb->handle; + evt.txPhy = pEvent->leReadPhyCmdCmpl.txPhy; + evt.rxPhy = pEvent->leReadPhyCmdCmpl.rxPhy; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! +* \brief Handle a set default PHY event from HCI. +* +* \param pEvent Pointer to HCI callback event structure. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmPhyActDefPhySet(hciEvt_t *pEvent) +{ + hciLeSetDefPhyCmdCmplEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_PHY_SET_DEF_IND; + evt.hdr.param = 0; + evt.status = evt.hdr.status = (uint8_t)pEvent->leSetDefPhyCmdCmpl.status; + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! +* \brief Handle a PHY update event from HCI. +* +* \param pCcb Connection control block. +* \param pEvent Pointer to HCI callback event structure. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmPhyActPhyUpdate(dmConnCcb_t *pCcb, hciEvt_t *pEvent) +{ + hciLePhyUpdateEvt_t evt; + + /* call callback */ + evt.hdr.event = DM_PHY_UPDATE_IND; + evt.hdr.param = pCcb->connId; + evt.status = evt.hdr.status = (uint8_t)pEvent->lePhyUpdate.status; + evt.handle = pCcb->handle; + evt.txPhy = pEvent->lePhyUpdate.txPhy; + evt.rxPhy = pEvent->lePhyUpdate.rxPhy; + + (*dmConnCb.connCback[DM_CLIENT_ID_APP])((dmEvt_t *)&evt); +} + +/*************************************************************************************************/ +/*! +* \brief Read the current transmitter PHY and receiver PHY for a given connection. +* +* \param connId Connection identifier. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmReadPhy(dmConnId_t connId) +{ + dmConnCcb_t *pCcb; + + WsfTaskLock(); + /* look up ccb from conn id */ + pCcb = dmConnCcbById(connId); + WsfTaskUnlock(); + + /* if ccb found */ + if (pCcb != NULL) + { + HciLeReadPhyCmd(pCcb->handle); + } +} + +/*************************************************************************************************/ +/*! +* \brief Set the preferred values for the transmitter PHY and receiver PHY for all subsequent +* connections. +* +* \param allPhys All PHYs preferences. +* \param txPhys Preferred transmitter PHYs. +* \param rxPhys Preferred receiver PHYs. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys) +{ + HciLeSetDefaultPhyCmd(allPhys, txPhys, rxPhys); +} + +/*************************************************************************************************/ +/*! +* \brief Set the PHY preferences for a given connection. +* +* \param connId Connection identifier. +* \param allPhys All PHYs preferences. +* \param txPhys Preferred transmitter PHYs. +* \param rxPhys Preferred receiver PHYs. +* \param phyOptions PHY options. +* +* \return None. +*/ +/*************************************************************************************************/ +void DmSetPhy(dmConnId_t connId, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions) +{ + dmConnCcb_t *pCcb; + + WsfTaskLock(); + /* look up ccb from conn id */ + pCcb = dmConnCcbById(connId); + WsfTaskUnlock(); + + /* if ccb found */ + if (pCcb != NULL) + { + HciLeSetPhyCmd(pCcb->handle, allPhys, txPhys, rxPhys, phyOptions); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM PHY. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPhyInit(void) +{ + dmFcnIfTbl[DM_ID_PHY] = (dmFcnIf_t *) &dmPhyFcnIf; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.h new file mode 100644 index 0000000000000000000000000000000000000000..4b9cdf4416862a920ab96373f98da63d994fbfd4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_phy.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM PHY module. + */ +/*************************************************************************************************/ +#ifndef DM_PHY_H +#define DM_PHY_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* component interface */ +void dmPhyHciHandler(hciEvt_t *pEvent); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_PHY_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.c new file mode 100644 index 0000000000000000000000000000000000000000..16177f6f8dd2d7180b660bdf5adddc8752d18ae4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.c @@ -0,0 +1,696 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager privacy module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "util/calc128.h" +#include "dm_api.h" +#include "dm_priv.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* progress (dmPrivCb.inProgress) bitmask bits */ +#define DM_PRIV_INPROGRESS_RES_ADDR (1 << 0) /* resolve address in progress */ +#define DM_PRIV_INPROGRESS_GEN_ADDR (1 << 1) /* generate address in progress */ + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* action function table */ +static const dmPrivAct_t dmPrivAct[] = +{ + dmPrivActResolveAddr, + dmPrivActResAddrAesCmpl, + dmPrivActAddDevToResList, + dmPrivActRemDevFromResList, + dmPrivActClearResList, + dmPrivActSetAddrResEnable, + dmPrivActSetPrivacyMode, + dmPrivActGenAddr, + dmPrivActGenAddrAesCmpl +}; + +/* Component function interface */ +static const dmFcnIf_t dmPrivFcnIf = +{ + dmPrivReset, + dmPrivHciHandler, + dmPrivMsgHandler +}; + +/* Control block */ +dmPrivCb_t dmPrivCb; + +/************************************************************************************************** +Local Functions +**************************************************************************************************/ + +static void dmPrivSetAddrResEnable(bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Start address resolution procedure + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActResolveAddr(dmPrivMsg_t *pMsg) +{ + uint8_t buf[DM_PRIV_PLAINTEXT_LEN]; + + /* verify no resolution procedure currently in progress */ + if ((dmPrivCb.inProgress & DM_PRIV_INPROGRESS_RES_ADDR) == 0) + { + /* store hash */ + memcpy(dmPrivCb.hash, pMsg->apiResolveAddr.addr, DM_PRIV_HASH_LEN); + + /* copy random part of address with padding for address resolution calculation */ + memcpy(buf, &pMsg->apiResolveAddr.addr[3], DM_PRIV_PRAND_LEN); + memset(buf + DM_PRIV_PRAND_LEN, 0, (DM_PRIV_PLAINTEXT_LEN - DM_PRIV_PRAND_LEN)); + + /* set in progress */ + dmPrivCb.inProgress |= DM_PRIV_INPROGRESS_RES_ADDR; + + /* run calculation */ + SecAes(pMsg->apiResolveAddr.irk, buf, dmCb.handlerId, + pMsg->hdr.param, DM_PRIV_MSG_RESOLVE_AES_CMPL); + } + else + { + /* call callback with error (note hdr.param is already set) */ + pMsg->hdr.status = HCI_ERR_MEMORY_EXCEEDED; + pMsg->hdr.event = DM_PRIV_RESOLVED_ADDR_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Finish address resolution procedure upon completion of AES calculation. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActResAddrAesCmpl(dmPrivMsg_t *pMsg) +{ + /* compare calculated value with hash */ + if (memcmp(dmPrivCb.hash, pMsg->aes.pCiphertext, DM_PRIV_HASH_LEN) == 0) + { + pMsg->hdr.status = HCI_SUCCESS; + } + else + { + pMsg->hdr.status = HCI_ERR_AUTH_FAILURE; + } + + /* clear in progress */ + dmPrivCb.inProgress &= ~DM_PRIV_INPROGRESS_RES_ADDR; + + /* call client callback (note hdr.param is already set) */ + pMsg->hdr.event = DM_PRIV_RESOLVED_ADDR_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list command. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActAddDevToResList(dmPrivMsg_t *pMsg) +{ + dmPrivApiAddDevToResList_t *pDev = &pMsg->apiAddDevToResList; + + /* save whether asked to enable address resolution */ + dmPrivCb.enableLlPriv = pDev->enableLlPriv; + + /* save client-defined parameter for callback event */ + dmPrivCb.addDevToResListParam = pMsg->hdr.param; + + /* add device to resolving list */ + HciLeAddDeviceToResolvingListCmd(pDev->addrType, pDev->peerAddr, pDev->peerIrk, pDev->localIrk); +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list command. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActRemDevFromResList(dmPrivMsg_t *pMsg) +{ + dmPrivApiRemDevFromResList_t *pDev = &pMsg->apiRemDevFromResList; + + /* save client-defined parameter for callback event */ + dmPrivCb.remDevFromResListParam = pMsg->hdr.param; + + /* remove device from resolving list */ + HciLeRemoveDeviceFromResolvingList(pDev->addrType, pDev->peerAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list command. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActClearResList(dmPrivMsg_t *pMsg) +{ + /* clear resolving list */ + HciLeClearResolvingList(); +} + +/*************************************************************************************************/ +/*! + * \brief Set address resolution enable command. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActSetAddrResEnable(dmPrivMsg_t *pMsg) +{ + dmPrivApiSetAddrResEnable_t *pAddrRes = &pMsg->apiSetAddrResEnable; + + /* enable or disable address resolution in LL */ + dmPrivSetAddrResEnable(pAddrRes->enable); +} + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode command. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActSetPrivacyMode(dmPrivMsg_t *pMsg) +{ + dmPrivApiSetPrivacyMode_t *pPrivacyMode = &pMsg->apiSetPrivacyMode; + + /* set privacy mode */ + HciLeSetPrivacyModeCmd(pPrivacyMode->addrType, pPrivacyMode->peerAddr, pPrivacyMode->mode); +} + +/*************************************************************************************************/ +/*! + * \brief Start address generation procedure. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActGenAddr(dmPrivMsg_t *pMsg) +{ + if ((dmPrivCb.inProgress & DM_PRIV_INPROGRESS_GEN_ADDR) == 0) + { + /* get random number */ + SecRand(dmPrivCb.genAddrBuf, DM_PRIV_PRAND_LEN); + + /* set address type in random number */ + dmPrivCb.genAddrBuf[2] = (dmPrivCb.genAddrBuf[2] & 0x3F) | DM_RAND_ADDR_RESOLV; + + /* pad buffer */ + memset(dmPrivCb.genAddrBuf + DM_PRIV_PRAND_LEN, 0, (DM_PRIV_PLAINTEXT_LEN - DM_PRIV_PRAND_LEN)); + + /* set in progress */ + dmPrivCb.inProgress |= DM_PRIV_INPROGRESS_GEN_ADDR; + + /* run calculation */ + SecAes(pMsg->apiGenerateAddr.irk, dmPrivCb.genAddrBuf, dmCb.handlerId, + pMsg->hdr.param, DM_PRIV_MSG_GEN_ADDR_AES_CMPL); + } + else + { + /* call callback with error (note hdr.param is already set) */ + pMsg->hdr.status = HCI_ERR_MEMORY_EXCEEDED; + pMsg->hdr.event = DM_PRIV_GENERATE_ADDR_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Finish generate RPA procedure upon completion of AES calculation. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivActGenAddrAesCmpl(dmPrivMsg_t *pMsg) +{ + dmPrivGenAddrIndEvt_t *pAddrEvt = (dmPrivGenAddrIndEvt_t*) pMsg; + + /* copy the hash and address to buffer */ + memcpy(pAddrEvt->addr, pMsg->aes.pCiphertext, DM_PRIV_HASH_LEN); + memcpy(pAddrEvt->addr + DM_PRIV_HASH_LEN, dmPrivCb.genAddrBuf, DM_PRIV_PRAND_LEN); + + /* clear in progress */ + dmPrivCb.inProgress &= ~DM_PRIV_INPROGRESS_GEN_ADDR; + + /* call client callback */ + pAddrEvt->hdr.event = DM_PRIV_GENERATE_ADDR_IND; + pMsg->hdr.status = HCI_SUCCESS; + (*dmCb.cback)((dmEvt_t *) pAddrEvt); +} + +/*************************************************************************************************/ +/*! + * \brief DM priv HCI callback event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivHciHandler(hciEvt_t *pEvent) +{ + /* handle incoming event */ + switch (pEvent->hdr.event) + { + case HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_ADD_DEV_TO_RES_LIST_IND; + pEvent->hdr.param = dmPrivCb.addDevToResListParam; + + /* if LE add device to resolving list command succeeded and been asked to enable address + * resolution in LL and it's not enabled yet + */ + if ((pEvent->hdr.status == HCI_SUCCESS) && dmPrivCb.enableLlPriv && !dmCb.llPrivEnabled) + { + /* enable address resolution in LL */ + dmPrivSetAddrResEnable(TRUE); + } + break; + + case HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_REM_DEV_FROM_RES_LIST_IND; + pEvent->hdr.param = dmPrivCb.remDevFromResListParam; + break; + + case HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_CLEAR_RES_LIST_IND; + + /* if LE clear resolving list command succeeded and address resolution's enabled in LL */ + if ((pEvent->hdr.status == HCI_SUCCESS) && dmCb.llPrivEnabled) + { + /* disable address resolution in LL */ + dmPrivSetAddrResEnable(FALSE); + } + break; + + case HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_READ_PEER_RES_ADDR_IND; + break; + + case HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_READ_LOCAL_RES_ADDR_IND; + break; + + case HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT: + pEvent->hdr.event = DM_PRIV_SET_ADDR_RES_ENABLE_IND; + + /* if LE set address resoultion enable command succeeded */ + if (pEvent->hdr.status == HCI_SUCCESS) + { + /* update LL Privacy Enabled flag */ + dmCb.llPrivEnabled = dmPrivCb.addrResEnable; + + /* pass LL Privacy enable/disable event to dev priv */ + dmDevPassEvtToDevPriv(dmCb.llPrivEnabled ? DM_DEV_PRIV_MSG_RPA_STOP : DM_DEV_PRIV_MSG_RPA_START, + dmCb.llPrivEnabled ? TRUE : FALSE, 0, 0); + } + break; + + default: + /* should never get here */ + return; + } + + /* call callback (note hdr.status is already set) */ + (*dmCb.cback)((dmEvt_t *)pEvent); +} + +/*************************************************************************************************/ +/*! + * \brief Set address resolution enable command. + * + * \param enable Set to TRUE to enable address resolution or FALSE to disable it. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmPrivSetAddrResEnable(bool_t enable) +{ + /* save input parameter */ + dmPrivCb.addrResEnable = enable; + + /* enable or disable address resolution in LL */ + HciLeSetAddrResolutionEnable(enable); +} + +/*************************************************************************************************/ +/*! + * \brief DM priv event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmPrivAct[DM_MSG_MASK(pMsg->event)])((dmPrivMsg_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Reset the privacy module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmPrivReset(void) +{ + /* initialize control block */ + dmPrivCb.inProgress = 0; + dmCb.llPrivEnabled = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM privacy module. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivInit(void) +{ + dmFcnIfTbl[DM_ID_PRIV] = (dmFcnIf_t *) &dmPrivFcnIf; +} + +/*************************************************************************************************/ +/*! + * \brief Resolve a private resolvable address. When complete the client's callback function + * is called with a DM_PRIV_RESOLVED_ADDR_IND event. The client must wait to receive + * this event before executing this function again. + * + * \param pAddr Peer device address. + * \param pIrk The peer's identity resolving key. + * \param param client-defined parameter returned with callback event. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivResolveAddr(uint8_t *pAddr, uint8_t *pIrk, uint16_t param) +{ + dmPrivApiResolveAddr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivApiResolveAddr_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_RESOLVE_ADDR; + pMsg->hdr.param = param; + Calc128Cpy(pMsg->irk, pIrk); + BdaCpy(pMsg->addr, pAddr); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Add device to resolving list. When complete the client's callback function + * is called with a DM_PRIV_ADD_DEV_TO_RES_LIST_IND event. The client must wait + * to receive this event before executing this function again. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param pPeerIrk The peer's identity resolving key. + * \param pLocalIrk The local identity resolving key. + * \param enableLlPriv Set to TRUE to enable address resolution in LL. + * \param param client-defined parameter returned with callback event. + * + * \return None. + * + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + * + * \Note If the local or peer IRK associated with the peer Identity Address is all zeros then + * the Controller will use or accept the local or peer Identity Address respectively. + * + * \Note Parameter 'enableLlPriv' should be set to TRUE when the last device is being added + * to resolving list to enable address resolution in the Controller. + */ +/*************************************************************************************************/ +void DmPrivAddDevToResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t *pPeerIrk, + uint8_t *pLocalIrk, bool_t enableLlPriv, uint16_t param) +{ + dmPrivApiAddDevToResList_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivApiAddDevToResList_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_ADD_DEV_TO_RES_LIST; + pMsg->hdr.param = param; + pMsg->addrType = addrType; + BdaCpy(pMsg->peerAddr, pIdentityAddr); + Calc128Cpy(pMsg->peerIrk, pPeerIrk); + Calc128Cpy(pMsg->localIrk, pLocalIrk); + pMsg->enableLlPriv = enableLlPriv; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove device from resolving list. When complete the client's callback function + * is called with a DM_PRIV_REM_DEV_FROM_RES_LIST_IND event. The client must wait to + * receive this event before executing this function again. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param param client-defined parameter returned with callback event. + * + * \return None. + * + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + */ +/*************************************************************************************************/ +void DmPrivRemDevFromResList(uint8_t addrType, const uint8_t *pIdentityAddr, uint16_t param) +{ + dmPrivApiRemDevFromResList_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivApiRemDevFromResList_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_REM_DEV_FROM_RES_LIST; + pMsg->hdr.param = param; + pMsg->addrType = addrType; + BdaCpy(pMsg->peerAddr, pIdentityAddr); + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Clear resolving list. When complete the client's callback function is called with a + * DM_PRIV_CLEAR_RES_LIST_IND event. The client must wait to receive this event before + * executing this function again. + * + * \return None. + * + * \Note This command cannot be used when address resolution is enabled in the Controller and: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + * + * \Note Address resolution in the Controller will be disabled when resolving list's cleared + * successfully. + */ +/*************************************************************************************************/ +void DmPrivClearResList(void) +{ + dmPrivMsg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivMsg_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_CLEAR_RES_LIST; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI read peer resolvable address command. When complete the client's callback + * function is called with a DM_PRIV_READ_PEER_RES_ADDR_IND event. The client must + * wait to receive this event before executing this function again. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) +{ + HciLeReadPeerResolvableAddr(addrType, pIdentityAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Read local resolvable address command. When complete the client's callback + * function is called with a DM_PRIV_READ_LOCAL_RES_ADDR_IND event. The client must + * wait to receive this event before executing this function again. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) +{ + HciLeReadLocalResolvableAddr(addrType, pIdentityAddr); +} + +/*************************************************************************************************/ +/*! + * \brief Enable or disable address resolution in LL. When complete the client's callback + * function is called with a DM_PRIV_SET_ADDR_RES_ENABLE_IND event. The client must + * wait to receive this event before executing this function again. + * + * \param enable Set to TRUE to enable address resolution or FALSE to disable it. + * + * \return None. + * + * \Note This command can be used at any time except when: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + */ +/*************************************************************************************************/ +void DmPrivSetAddrResEnable(bool_t enable) +{ + dmPrivApiSetAddrResEnable_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivMsg_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_SET_ADDR_RES_ENABLE; + pMsg->hdr.param = 0; + pMsg->enable = enable; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set resolvable private address timeout command. + * + * \param rpaTimeout Timeout measured in seconds. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout) +{ + HciLeSetResolvablePrivateAddrTimeout(rpaTimeout); +} + +/*************************************************************************************************/ +/*! + * \brief Set privacy mode for a given entry in the resolving list. + * + * \param addrType Peer identity address type. + * \param pIdentityAddr Peer identity address. + * \param mode Privacy mode (by default, network privacy mode is used). + * + * \return None. + * + * \Note This command can be used at any time except when: + * - Advertising (other than periodic advertising) is enabled, + * - Scanning is enabled, or + * - (Extended) Create connection or Create Sync command is outstanding. + */ +/*************************************************************************************************/ +void DmPrivSetPrivacyMode(uint8_t addrType, const uint8_t *pIdentityAddr, uint8_t mode) +{ + dmPrivApiSetPrivacyMode_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivApiSetPrivacyMode_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_SET_PRIVACY_MODE; + pMsg->addrType = addrType; + BdaCpy(pMsg->peerAddr, pIdentityAddr); + pMsg->mode = mode; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Generate a Resolvable Private Address (RPA). + * + * \param pIrk The identity resolving key. + * \param param Client-defined parameter returned with callback event. + * + * \return None. + */ +/*************************************************************************************************/ +void DmPrivGenerateAddr(uint8_t *pIrk, uint16_t param) +{ + dmPrivApiGenAddr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmPrivApiGenAddr_t))) != NULL) + { + pMsg->hdr.event = DM_PRIV_MSG_API_GEN_ADDR; + pMsg->hdr.param = param; + Calc128Cpy(pMsg->irk, pIrk); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.h new file mode 100644 index 0000000000000000000000000000000000000000..ff247c9a538e968b120b4f389b361f32ffeb6243 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_priv.h @@ -0,0 +1,161 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM privacy module. + */ +/*************************************************************************************************/ +#ifndef DM_PRIV_H +#define DM_PRIV_H + +#include "util/bda.h" +#include "wsf_os.h" +#include "wsf_timer.h" +#include "sec_api.h" +#include "dm_main.h" +#include "smp_defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM priv event handler messages */ +enum +{ + DM_PRIV_MSG_API_RESOLVE_ADDR = DM_MSG_START(DM_ID_PRIV), + DM_PRIV_MSG_RESOLVE_AES_CMPL, + DM_PRIV_MSG_API_ADD_DEV_TO_RES_LIST, + DM_PRIV_MSG_API_REM_DEV_FROM_RES_LIST, + DM_PRIV_MSG_API_CLEAR_RES_LIST, + DM_PRIV_MSG_API_SET_ADDR_RES_ENABLE, + DM_PRIV_MSG_API_SET_PRIVACY_MODE, + DM_PRIV_MSG_API_GEN_ADDR, + DM_PRIV_MSG_GEN_ADDR_AES_CMPL +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data structure for DM_PRIV_MSG_API_RESOLVE_ADDR */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t irk[SMP_KEY_LEN]; + bdAddr_t addr; +} dmPrivApiResolveAddr_t; + +/* Data structure for DM_PRIV_MSG_API_GEN_ADDR */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t irk[SMP_KEY_LEN]; +} dmPrivApiGenAddr_t; + +/* Data structure for DM_PRIV_MSG_API_ADD_DEV_TO_RES_LIST */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t addrType; + bdAddr_t peerAddr; + uint8_t peerIrk[SMP_KEY_LEN]; + uint8_t localIrk[SMP_KEY_LEN]; + bool_t enableLlPriv; +} dmPrivApiAddDevToResList_t; + +/* Data structure for DM_PRIV_MSG_API_REM_DEV_FROM_RES_LIST */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t addrType; + bdAddr_t peerAddr; +} dmPrivApiRemDevFromResList_t; + +/* Data structure for DM_PRIV_MSG_API_SET_ADDR_RES_ENABLE */ +typedef struct +{ + wsfMsgHdr_t hdr; + bool_t enable; +} dmPrivApiSetAddrResEnable_t; + +/* Data structure for DM_PRIV_MSG_API_SET_PRIVACY_MODE */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t addrType; + bdAddr_t peerAddr; + uint8_t mode; +} dmPrivApiSetPrivacyMode_t; + +/* Union of all priv messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmPrivApiResolveAddr_t apiResolveAddr; + dmPrivApiAddDevToResList_t apiAddDevToResList; + dmPrivApiRemDevFromResList_t apiRemDevFromResList; + dmPrivApiSetAddrResEnable_t apiSetAddrResEnable; + dmPrivApiSetPrivacyMode_t apiSetPrivacyMode; + dmPrivApiGenAddr_t apiGenerateAddr; + dmPrivGenAddrIndEvt_t genAddrInd; + secAes_t aes; +} dmPrivMsg_t; + +/* Action function */ +typedef void (*dmPrivAct_t)(dmPrivMsg_t *pMsg); + +/* Control block for privacy module */ +typedef struct +{ + uint8_t hash[DM_PRIV_HASH_LEN]; /* Hash part of resolvable address */ + bool_t inProgress; /* Address resolution in progress */ + uint16_t addDevToResListParam; /* 'Add device to resolving list' callback param */ + uint16_t remDevFromResListParam; /* 'Remove device from resolving list' callback param */ + bool_t enableLlPriv; /* 'Add device to resolving list' input param */ + bool_t addrResEnable; /* 'Set address resolution enable' input param */ + uint8_t genAddrBuf[HCI_ENCRYPT_DATA_LEN]; /* Random value buffer for generating an RPA */ +} dmPrivCb_t; + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* component inteface */ +void dmPrivMsgHandler(wsfMsgHdr_t *pMsg); +void dmPrivHciHandler(hciEvt_t *pEvent); +void dmPrivReset(void); + +/* action functions */ +void dmPrivActResolveAddr(dmPrivMsg_t *pMsg); +void dmPrivActResAddrAesCmpl(dmPrivMsg_t *pMsg); +void dmPrivActAddDevToResList(dmPrivMsg_t *pMsg); +void dmPrivActRemDevFromResList(dmPrivMsg_t *pMsg); +void dmPrivActSetAddrResEnable(dmPrivMsg_t *pMsg); +void dmPrivActClearResList(dmPrivMsg_t *pMsg); +void dmPrivActSetPrivacyMode(dmPrivMsg_t *pMsg); +void dmPrivActGenAddr(dmPrivMsg_t *pMsg); +void dmPrivActGenAddrAesCmpl(dmPrivMsg_t *pMsg); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_PRIV_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.c new file mode 100644 index 0000000000000000000000000000000000000000..f022bd68c4db431213d76dd869bd83b0972cb37b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.c @@ -0,0 +1,191 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager scan module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "dm_api.h" +#include "dm_scan.h" +#include "dm_main.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Control block */ +dmScanCb_t dmScanCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize the scan module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanInit(void) +{ + uint8_t i; + + /* initialize control block */ + for (i = 0; i < DM_NUM_PHYS; i++) + { + dmScanCb.scanInterval[i] = DM_GAP_SCAN_FAST_INT_MIN; + dmScanCb.scanWindow[i] = DM_GAP_SCAN_FAST_WINDOW; + } + + dmCb.scanFiltPolicy = HCI_FILT_NONE; + dmScanCb.scanTimer.handlerId = dmCb.handlerId; + dmScanCb.scanState = DM_SCAN_STATE_IDLE; + dmCb.scanAddrType = DM_ADDR_PUBLIC; +} + +/*************************************************************************************************/ +/*! + * \brief Start scanning on the given PHYs. + * + * \param scanPhys Scanner PHYs. + * \param mode Discoverability mode. + * \param pScanType Scan type array. + * \param filterDup Filter duplicates. Set to TRUE to filter duplicate responses received + * from the same device. Set to FALSE to receive all responses. + * \param duration The scan duration, in milliseconds. If set to zero or both duration and + * period set to non-zero, scanning will continue until DmScanStop() is called. + * \param period The scan period, in 1.28 sec units (only applicable to AE). If set to zero, + * periodic scanning is disabled. + * + * \return None. + */ +/*************************************************************************************************/ +void DmScanStart(uint8_t scanPhys, uint8_t mode, const uint8_t *pScanType, bool_t filterDup, + uint16_t duration, uint16_t period) +{ + uint8_t i; /* scanPhy bit position */ + uint8_t idx; /* param array index */ + dmScanApiStart_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmScanApiStart_t))) != NULL) + { + pMsg->hdr.event = DM_SCAN_MSG_API_START; + pMsg->scanPhys = scanPhys; + + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (scanPhys & (1 << i)) + { + /* scan type for this PHY */ + pMsg->scanType[idx] = pScanType[idx]; + idx++; + } + } + + pMsg->mode = mode; + pMsg->duration = duration; + pMsg->period = period; + pMsg->filterDup = filterDup; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop scanning. + * + * \return None. + */ +/*************************************************************************************************/ +void DmScanStop(void) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->event = DM_SCAN_MSG_API_STOP; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the scan interval and window. + * + * \param phyIdx The scanning PHY. + * \param scanInterval The scan interval. + * \param scanWindow The scan window. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmScanSetInterval(uint8_t scanPhy, uint16_t scanInterval, uint16_t scanWindow) +{ + uint8_t phyIdx; + + WSF_ASSERT((scanPhy == HCI_INIT_PHY_LE_1M_BIT) || (scanPhy == HCI_INIT_PHY_LE_CODED_BIT)); + + WsfTaskLock(); + phyIdx = DmScanPhyToIdx(scanPhy); + dmScanCb.scanInterval[phyIdx] = scanInterval; + dmScanCb.scanWindow[phyIdx] = scanWindow; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Set the scan interval and window for the specified PHYs. + * + * \param scanPhys Scanning PHYs. + * \param pScanInterval Scan interval array. + * \param pScanWindow Scan window array. + * + * \return None. + */ +/*************************************************************************************************/ +void DmScanSetInterval(uint8_t scanPhys, uint16_t *pScanInterval, uint16_t *pScanWindow) +{ + uint8_t i; /* scanPhy bit position */ + uint8_t idx; /* param array index */ + + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (scanPhys & (1 << i)) + { + dmScanSetInterval((1 << i), pScanInterval[idx], pScanWindow[idx]); + idx++; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the local address type used while scanning. This function can be used to + * configure scanning to use a random address. + * + * \param addrType Address type. + * + * \return None. + */ +/*************************************************************************************************/ +void DmScanSetAddrType(uint8_t addrType) +{ + WsfTaskLock(); + dmCb.scanAddrType = addrType; + WsfTaskUnlock(); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.h new file mode 100644 index 0000000000000000000000000000000000000000..468372ee97f5e5ab5c0d4fe046ff614aa5df2bb5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan.h @@ -0,0 +1,237 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM scan module. + */ +/*************************************************************************************************/ +#ifndef DM_SCAN_H +#define DM_SCAN_H + +#include "wsf_os.h" +#include "wsf_timer.h" +#include "dm_main.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM scan event handler messages */ +enum +{ + DM_SCAN_MSG_API_START = DM_MSG_START(DM_ID_SCAN), + DM_SCAN_MSG_API_STOP, + DM_SCAN_MSG_TIMEOUT +}; + +/* DM scan states */ +enum +{ + DM_SCAN_STATE_IDLE, + DM_SCAN_STATE_STARTING, + DM_SCAN_STATE_SCANNING, + DM_SCAN_STATE_STOPPING +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data structure for DM_SCAN_MSG_API_START */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t scanPhys; + uint8_t scanType[DM_NUM_PHYS]; + uint8_t mode; + uint16_t duration; + uint16_t period; + bool_t filterDup; +} dmScanApiStart_t; + +/* Data structure for DM_SYNC_MSG_API_START */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advSid; + uint8_t advAddrType; + bdAddr_t advAddr; + uint16_t skip; + uint16_t syncTimeout; + uint8_t unused; +} dmSyncApiStart_t; + +/* Data structure for DM_SYNC_MSG_API_ADD_DEV_TO_PER_ADV_LIST */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advAddrType; + bdAddr_t advAddr; + uint8_t advSid; +} dmSyncApiAddDevToPerAdvList_t; + +/* Data structure for DM_SYNC_MSG_API_REM_DEV_FROM_PER_ADV_LIST */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t advAddrType; + bdAddr_t advAddr; + uint8_t advSid; +} dmSyncApiRemDevFromPerAdvList_t; + +/* Union of all scan messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmScanApiStart_t apiStart; +} dmScanMsg_t; + +/* Union of all DM Sync state machine messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmSyncApiStart_t apiSyncStart; + hciLePerAdvSyncEstEvt_t perAdvSyncEst; + hciLePerAdvSyncLostEvt_t perAdvSyncLost; + HciLePerAdvSyncTrsfRcvdEvt_t perAdvSyncTrsfEst; +} dmSyncMsg_t; + +/* Action function */ +typedef void (*dmScanAct_t)(dmScanMsg_t *pMsg); + +/* Control block for scan module */ +typedef struct +{ + wsfTimer_t scanTimer; + uint16_t scanInterval[DM_NUM_PHYS]; + uint16_t scanWindow[DM_NUM_PHYS]; + bool_t scanState; + uint16_t scanDuration; + bool_t filterNextScanRsp; + uint8_t discFilter; +} dmScanCb_t; + +/* Control block for periodic advertising sync module */ +typedef struct +{ + uint8_t advSid; /*!< advertising SID */ + bdAddr_t advAddr; /*!< advertiser address */ + uint8_t advAddrType; /*!< advertiser address type */ + uint16_t handle; /*!< sync handle */ + dmSyncId_t syncId; /*!< sync id */ + uint8_t state; /*!< sync state */ + uint8_t inUse; /*!< TRUE if entry in use */ +} dmSyncCb_t; + +/* Data structure for DM_PAST_MSG_API_SYNC_TRSF and DM_PAST_MSG_API_INFO_TRSF */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + uint16_t serviceData; /*!< Value provided by the Host */ + dmConnId_t connId; /*!< Connection id */ +} dmPastApiTrsf_t; + +/* Data structure for DM_PAST_MSG_API_CONFIG and DM_PAST_MSG_API_DEFAULT_CONFIG */ +typedef struct +{ + wsfMsgHdr_t hdr; /*!< Header */ + uint8_t mode; /*!< Mode */ + uint16_t skip; /*!< Skip */ + uint16_t syncTimeout; /*!< Sync timeout */ + uint8_t cteType; /*!< CTE type */ +} dmPastApiCfg_t; + +/* Union of all DM PAST API messages */ +typedef union +{ + wsfMsgHdr_t hdr; + dmPastApiTrsf_t apiPastTrsf; + dmPastApiCfg_t apiPastCfg; +} dmPastMsg_t; + +/*! Action function */ +typedef void (*dmPastAct_t)(dmPastMsg_t *pMsg); + +extern dmScanCb_t dmScanCb; + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* common scanning component inteface */ +void dmScanInit(void); + +/* legacy scanning component inteface */ +void dmScanReset(void); +void dmScanMsgHandler(wsfMsgHdr_t *pMsg); +void dmScanHciHandler(hciEvt_t *pEvent); + +/* legacy scanning action functions */ +void dmScanActStart(dmScanMsg_t *pMsg); +void dmScanActStop(dmScanMsg_t *pMsg); +void dmScanActTimeout(dmScanMsg_t *pMsg); + +/* extended scanning component inteface */ +void dmExtScanReset(void); +void dmExtScanMsgHandler(wsfMsgHdr_t *pMsg); +void dmExtScanHciHandler(hciEvt_t *pEvent); + +/* extended scanning action functions */ +void dmExtScanActStart(dmScanMsg_t *pMsg); +void dmExtScanActStop(dmScanMsg_t *pMsg); +void dmExtScanActTimeout(dmScanMsg_t *pMsg); + +/* sync and sync transfer action functions */ +void dmSyncSmActNone(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActStart(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActStop(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActCancelStart(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActSyncEst(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActSyncEstFailed(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActSyncLost(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActSyncTrsfEst(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); +void dmSyncSmActSyncTrsfEstFailed(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg); + +/* sync component inteface */ +void dmSyncInit(void); +void dmSyncReset(void); +void dmSyncMsgHandler(wsfMsgHdr_t *pMsg); +void dmSyncHciHandler(hciEvt_t *pEvent); + +/* past action functions */ +void dmPastActRptRcvEnable(dmPastMsg_t *pMsg); +void dmPastActSyncTsfr(dmPastMsg_t *pMsg); +void dmPastActSetInfoTrsf(dmPastMsg_t *pMsg); +void dmPastActConfig(dmPastMsg_t *pMsg); +void dmPastActDefaultConfig(dmPastMsg_t *pMsg); + +/* past component inteface */ +void dmPastMsgHandler(wsfMsgHdr_t *pMsg); +void dmPastHciHandler(hciEvt_t *pEvent); + +/* sync utility functions */ +dmSyncCb_t *dmSyncCbById(dmSyncId_t syncId); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_SCAN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..01dc5fc70747fc78d852906c5693b143a3f4a0d8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_ae.c @@ -0,0 +1,360 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager extended scan module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_scan.h" +#include "dm_conn.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* extended scan action function table */ +static const dmScanAct_t dmScanAct[] = +{ + dmExtScanActStart, + dmExtScanActStop, + dmExtScanActTimeout +}; + +/* extended scan component function interface */ +static const dmFcnIf_t dmScanFcnIf = +{ + dmExtScanReset, + dmExtScanHciHandler, + dmExtScanMsgHandler +}; + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* event being reported used for a legacy advertising PDU or a scan response */ +#define DM_ADV_RPT_SCAN_RSP(evtType) ((((evtType) == HCI_ADV_RPT_LEG_CONN_UNDIRECT_SCAN_RSP) || \ + ((evtType) == HCI_ADV_RPT_LEG_SCAN_UNDIRECT_SCAN_RSP)) || \ + ((((evtType) & HCI_ADV_RPT_LEG_ADV_BIT) == 0) && \ + ((evtType) & HCI_ADV_RPT_SCAN_RSP_BIT))) + +/* data status field of extended advertising report event type */ +#define DM_ADV_RPT_DATA_STATUS(evtType) (((evtType) & HCI_ADV_RPT_DATA_STATUS_BITS) >> 5) + +/*************************************************************************************************/ +/*! + * \brief Start extended scanning action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanActStart(dmScanMsg_t *pMsg) +{ + uint8_t i; + uint8_t idx; + uint8_t phyIdx; + hciExtScanParam_t scanParam[DM_NUM_PHYS]; + + if (dmScanCb.scanState == DM_SCAN_STATE_IDLE) + { + /* see advertising packets to be received on which PHY */ + for (i = 0, idx = 0; (i < 8) && (idx < DM_NUM_PHYS); i++) + { + if (pMsg->apiStart.scanPhys & (1 << i)) + { + phyIdx = DmScanPhyToIdx(1 << i); + + /* set extended scan parameters for this PHY */ + scanParam[idx].scanType = pMsg->apiStart.scanType[idx]; + scanParam[idx].scanInterval = dmScanCb.scanInterval[phyIdx]; + scanParam[idx].scanWindow = dmScanCb.scanWindow[phyIdx]; + idx++; + } + } + + /* set extended scan parameters to be used on primary advertising channel */ + HciLeSetExtScanParamCmd(DmLlAddrType(dmCb.scanAddrType), dmCb.scanFiltPolicy, + pMsg->apiStart.scanPhys, scanParam); + + /* initialize scan result filtering */ + if (pMsg->apiStart.mode == DM_DISC_MODE_LIMITED) + { + dmScanCb.discFilter = DM_FLAG_LE_LIMITED_DISC; + } + else if (pMsg->apiStart.mode == DM_DISC_MODE_GENERAL) + { + dmScanCb.discFilter = DM_FLAG_LE_LIMITED_DISC | DM_FLAG_LE_GENERAL_DISC; + } + else + { + dmScanCb.discFilter = 0; + } + + dmScanCb.filterNextScanRsp = FALSE; + + /* enable scan */ + dmScanCb.scanState = DM_SCAN_STATE_STARTING; + HciLeExtScanEnableCmd(TRUE, pMsg->apiStart.filterDup, (pMsg->apiStart.duration / 10), pMsg->apiStart.period); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop extended scanning action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanActStop(dmScanMsg_t *pMsg) +{ + if (dmScanCb.scanState == DM_SCAN_STATE_SCANNING) + { + /* disable scan */ + dmScanCb.scanState = DM_SCAN_STATE_STOPPING; + HciLeExtScanEnableCmd(FALSE, 0, 0, 0); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle an scan timeout. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanActTimeout(dmScanMsg_t *pMsg) +{ + /* empty */ +} + +/*************************************************************************************************/ +/*! + * \brief Handle an extended advertising report event from HCI. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmExtScanActHciReport(hciEvt_t *pEvent) +{ + uint8_t *p; + static bool_t filtered = FALSE; + static bool_t firstFrag = TRUE; + + /* ignore if not scanning */ + if (dmScanCb.scanState == DM_SCAN_STATE_SCANNING) + { + /* if filtering results for limited or general discovery, and first fragment */ + if ((dmScanCb.discFilter != 0) && firstFrag) + { + /* if this is a scan response */ + if (DM_ADV_RPT_SCAN_RSP(pEvent->leExtAdvReport.eventType)) + { + /* check if filtering next scan response */ + if (dmScanCb.filterNextScanRsp) + { + filtered = TRUE; + dmScanCb.filterNextScanRsp = FALSE; + } + } + /* else it's an advertising response */ + else + { + /* find flags in advertising data */ + p = DmFindAdType(DM_ADV_TYPE_FLAGS, pEvent->leExtAdvReport.len, pEvent->leExtAdvReport.pData); + if (p == NULL) + { + /* flags not found */ + filtered = TRUE; + dmScanCb.filterNextScanRsp = TRUE; + } + /* else flags found; check them */ + else if ((p[DM_AD_DATA_IDX] & dmScanCb.discFilter) == 0) + { + /* flags do not match discovery mode */ + filtered = TRUE; + dmScanCb.filterNextScanRsp = TRUE; + } + } + + firstFrag = FALSE; + } + + if (!filtered) + { + pEvent->hdr.event = DM_EXT_SCAN_REPORT_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + + /* if filtering results for limited or general discovery, and no more fragmented data to come */ + if ((dmScanCb.discFilter != 0) && + (DM_ADV_RPT_DATA_STATUS(pEvent->leExtAdvReport.eventType) != HCI_ADV_RPT_DATA_INCMPL_MORE)) + { + /* reset our flags */ + filtered = FALSE; + firstFrag = TRUE; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM extended scan reset function. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanReset(void) +{ + hciLeScanTimeoutEvt_t scanTimeout; + + /* if stopping scan or scanning */ + if ((dmScanCb.scanState == DM_SCAN_STATE_STOPPING) || + (dmScanCb.scanState == DM_SCAN_STATE_SCANNING)) + { + /* generate HCI scan timeout event */ + scanTimeout.hdr.event = HCI_LE_SCAN_TIMEOUT_CBACK_EVT; + scanTimeout.hdr.status = HCI_SUCCESS; + + /* handle the event */ + dmExtScanHciHandler((hciEvt_t *) &scanTimeout); + } + + /* reset scan module */ + dmScanInit(); +} + +/*************************************************************************************************/ +/*! + * \brief DM extended scan HCI event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanHciHandler(hciEvt_t *pEvent) +{ + DM_TRACE_INFO2("dmExtScanHciHandler: event: %d state: %d", pEvent->hdr.event, dmScanCb.scanState); + + if (pEvent->hdr.event == HCI_LE_EXT_ADV_REPORT_CBACK_EVT) + { + dmExtScanActHciReport(pEvent); + } + else if (pEvent->hdr.event == HCI_LE_SCAN_TIMEOUT_CBACK_EVT) + { + dmScanCb.scanState = DM_SCAN_STATE_IDLE; + + /* pass scanning stop event to dev priv */ + dmDevPassEvtToDevPriv(DM_DEV_PRIV_MSG_RPA_STOP, DM_EXT_SCAN_STOP_IND, 0, 0); + + /* call callback */ + pEvent->hdr.event = DM_EXT_SCAN_STOP_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + else if (pEvent->hdr.event == HCI_LE_EXT_SCAN_ENABLE_CMD_CMPL_CBACK_EVT) + { + switch (dmScanCb.scanState) + { + case DM_SCAN_STATE_STARTING: + pEvent->hdr.event = DM_EXT_SCAN_START_IND; + dmScanCb.scanState = pEvent->hdr.status == HCI_SUCCESS? DM_SCAN_STATE_SCANNING : DM_SCAN_STATE_IDLE; + break; + + case DM_SCAN_STATE_STOPPING: + pEvent->hdr.event = DM_EXT_SCAN_STOP_IND; + dmScanCb.scanState = pEvent->hdr.status == HCI_SUCCESS? DM_SCAN_STATE_IDLE : DM_SCAN_STATE_SCANNING; + break; + + default: + /* Should never happen */ + WSF_ASSERT(0); + break; + } + + /* pass scanning start/stop event to dev priv */ + dmDevPassEvtToDevPriv((pEvent->hdr.event == DM_EXT_SCAN_START_IND) ? \ + DM_DEV_PRIV_MSG_RPA_START : DM_DEV_PRIV_MSG_RPA_STOP, pEvent->hdr.event, + 0, 0); + + /* call callback */ + (*dmCb.cback)((dmEvt_t *)pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM scan event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmExtScanMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmScanAct[DM_MSG_MASK(pMsg->event)])((dmScanMsg_t *)pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM extended scanning. + * + * \return None. + */ +/*************************************************************************************************/ +void DmExtScanInit(void) +{ + WsfTaskLock(); + + /* set function interface table */ + dmFcnIfTbl[DM_ID_SCAN] = (dmFcnIf_t *) &dmScanFcnIf; + + /* initialize scan/sync modules */ + dmScanInit(); + dmSyncInit(); + + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Whether DM scanning is in extended mode. + * + * \return TRUE if DM scanning is in extended mode. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t DmScanModeExt(void) +{ + return (dmFcnIfTbl[DM_ID_SCAN] == (dmFcnIf_t *) &dmScanFcnIf) ? TRUE : FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_leg.c new file mode 100644 index 0000000000000000000000000000000000000000..7f67ae91dba74173082f82e2c734aa6b47a2238a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_scan_leg.c @@ -0,0 +1,334 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager scan module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "dm_api.h" +#include "dm_scan.h" +#include "dm_conn.h" +#include "dm_dev.h" +#include "dm_main.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* action function table */ +static const dmScanAct_t dmScanAct[] = +{ + dmScanActStart, + dmScanActStop, + dmScanActTimeout +}; + +/* Component function interface */ +static const dmFcnIf_t dmScanFcnIf = +{ + dmScanReset, + dmScanHciHandler, + dmScanMsgHandler +}; + +/*************************************************************************************************/ +/*! + * \brief Start scanning action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanActStart(dmScanMsg_t *pMsg) +{ + uint8_t phyIdx = DmScanPhyToIdx(HCI_SCAN_PHY_LE_1M_BIT); + + if (dmScanCb.scanState == DM_SCAN_STATE_IDLE) + { + /* set scan parameters */ + HciLeSetScanParamCmd(pMsg->apiStart.scanType[phyIdx], dmScanCb.scanInterval[phyIdx], + dmScanCb.scanWindow[phyIdx], DmLlAddrType(dmCb.scanAddrType), + dmCb.scanFiltPolicy); + + /* initialize scan result filtering */ + if (pMsg->apiStart.mode == DM_DISC_MODE_LIMITED) + { + dmScanCb.discFilter = DM_FLAG_LE_LIMITED_DISC; + } + else if (pMsg->apiStart.mode == DM_DISC_MODE_GENERAL) + { + dmScanCb.discFilter = DM_FLAG_LE_LIMITED_DISC | DM_FLAG_LE_GENERAL_DISC; + } + else + { + dmScanCb.discFilter = 0; + } + dmScanCb.filterNextScanRsp = FALSE; + + /* enable scan */ + dmScanCb.scanDuration = pMsg->apiStart.duration; + dmScanCb.scanState = DM_SCAN_STATE_STARTING; + HciLeSetScanEnableCmd(TRUE, pMsg->apiStart.filterDup); + } +} + +/*************************************************************************************************/ +/*! + * \brief Stop scanning action function. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanActStop(dmScanMsg_t *pMsg) +{ + if (dmScanCb.scanState == DM_SCAN_STATE_SCANNING) + { + /* disable scan */ + dmScanCb.scanState = DM_SCAN_STATE_STOPPING; + HciLeSetScanEnableCmd(FALSE, 0); + } +} + +/*************************************************************************************************/ +/*! + * \brief Handle an scan timeout. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanActTimeout(dmScanMsg_t *pMsg) +{ + dmScanActStop(pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle an advertising report event from HCI. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void dmScanActHciReport(hciEvt_t *pEvent) +{ + uint8_t *p; + bool_t filtered = FALSE; + + /* ignore if not scanning */ + if (dmScanCb.scanState == DM_SCAN_STATE_SCANNING) + { + /* if filtering results for limited or general discovery */ + if (dmScanCb.discFilter != 0) + { + /* if this is a scan response */ + if (pEvent->leAdvReport.eventType == DM_RPT_SCAN_RESPONSE) + { + /* check if filtering next scan response */ + if (dmScanCb.filterNextScanRsp) + { + filtered = TRUE; + dmScanCb.filterNextScanRsp = FALSE; + } + } + /* else it's an advertising response */ + else + { + /* find flags in advertising data */ + p = DmFindAdType(DM_ADV_TYPE_FLAGS, pEvent->leAdvReport.len, pEvent->leAdvReport.pData); + if (p == NULL) + { + /* flags not found */ + filtered = TRUE; + dmScanCb.filterNextScanRsp = TRUE; + } + /* else flags found; check them */ + else if ((p[DM_AD_DATA_IDX] & dmScanCb.discFilter) == 0) + { + /* flags do not match discovery mode */ + filtered = TRUE; + dmScanCb.filterNextScanRsp = TRUE; + } + } + } + + if (!filtered) + { + pEvent->hdr.event = DM_SCAN_REPORT_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Reset the scan module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanReset(void) +{ + wsfMsgHdr_t scanStop; + + /* if stopping scan or scanning */ + if ((dmScanCb.scanState == DM_SCAN_STATE_STOPPING) || + (dmScanCb.scanState == DM_SCAN_STATE_SCANNING)) + { + /* stop scan timer */ + WsfTimerStop(&dmScanCb.scanTimer); + + /* generate scan stop event */ + scanStop.event = DM_SCAN_STOP_IND; + scanStop.status = HCI_SUCCESS; + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) &scanStop); + + dmScanCb.scanState = DM_SCAN_STATE_IDLE; + } + + /* reset scan module */ + dmScanInit(); +} + +/*************************************************************************************************/ +/*! + * \brief DM scan HCI event handler. + * + * \param pEvent WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanHciHandler(hciEvt_t *pEvent) +{ + if (pEvent->hdr.event == HCI_LE_ADV_REPORT_CBACK_EVT) + { + dmScanActHciReport(pEvent); + } + else if (pEvent->hdr.event == HCI_LE_SCAN_ENABLE_CMD_CMPL_CBACK_EVT) + { + switch (dmScanCb.scanState) + { + case DM_SCAN_STATE_STARTING: + if (pEvent->hdr.status == HCI_SUCCESS) + { + /* start scan timer if applicable */ + if (dmScanCb.scanDuration > 0) + { + dmScanCb.scanTimer.msg.event = DM_SCAN_MSG_TIMEOUT; + WsfTimerStartMs(&dmScanCb.scanTimer, dmScanCb.scanDuration); + } + + dmScanCb.scanState = DM_SCAN_STATE_SCANNING; + } + else + { + dmScanCb.scanState = DM_SCAN_STATE_IDLE; + } + + pEvent->hdr.event = DM_SCAN_START_IND; + break; + + case DM_SCAN_STATE_STOPPING: + if (pEvent->hdr.status == HCI_SUCCESS) + { + /* stop scan timer */ + WsfTimerStop(&dmScanCb.scanTimer); + dmScanCb.scanState = DM_SCAN_STATE_IDLE; + } + else + { + dmScanCb.scanState = DM_SCAN_STATE_SCANNING; + } + + pEvent->hdr.event = DM_SCAN_STOP_IND; + break; + + default: + + /* Should never happen */ + WSF_ASSERT(0); + break; + } + + /* pass scanning start/stop event to dev priv */ + dmDevPassEvtToDevPriv((pEvent->hdr.event == DM_SCAN_START_IND) ? \ + DM_DEV_PRIV_MSG_RPA_START : DM_DEV_PRIV_MSG_RPA_STOP, pEvent->hdr.event, + 0, 0); + + /* call callback */ + (*dmCb.cback)((dmEvt_t *) pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM scan event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmScanMsgHandler(wsfMsgHdr_t *pMsg) +{ + /* execute action function */ + (*dmScanAct[DM_MSG_MASK(pMsg->event)])((dmScanMsg_t *)pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM legacy scanning. + * + * \return None. + */ +/*************************************************************************************************/ +void DmScanInit(void) +{ + WsfTaskLock(); + + /* set function interface table */ + dmFcnIfTbl[DM_ID_SCAN] = (dmFcnIf_t *) &dmScanFcnIf; + + /* initialize scan module */ + dmScanInit(); + + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Whether DM scanning is in legacy mode. + * + * \return TRUE if DM scanning is in legacy mode. FALSE, otherwise. + */ +/*************************************************************************************************/ +bool_t DmScanModeLeg(void) +{ + return (dmFcnIfTbl[DM_ID_SCAN] == (dmFcnIf_t *) &dmScanFcnIf) ? TRUE : FALSE; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.c new file mode 100644 index 0000000000000000000000000000000000000000..71879c156c387900f5a6fbfb4474bfd3d275d8dd --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.c @@ -0,0 +1,393 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM security module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "wsf_buf.h" +#include "wsf_trace.h" +#include "util/calc128.h" +#include "smp_api.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_sec.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +dmSecCb_t dmSecCb; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Component function interface */ +static const dmFcnIf_t dmSecFcnIf = +{ + dmSecReset, + dmSecHciHandler, + (dmMsgHandler_t) dmSecMsgHandler +}; + +/*************************************************************************************************/ +/*! + * \brief Utility function for API encrypt request or ltk response. + * + * \param connId DM connection ID. + * \param status HCI_SUCCESS if LTK available. + * \param *pLTK Pointer to LTK parameter structure. + * \param event DM handler event. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSecApiLtkMsg(dmConnId_t connId, uint8_t status, dmSecLtk_t *pLtk, uint8_t event) +{ + dmSecApiEncryptReq_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmSecApiEncryptReq_t))) != NULL) + { + pMsg->hdr.event = event; + pMsg->hdr.param = connId; + pMsg->hdr.status = status; + memcpy(&pMsg->ltk, pLtk, sizeof(dmSecLtk_t)); + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM dev HCI event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSecHciHandler(hciEvt_t *pEvent) +{ + dmConnCcb_t *pCcb; + uint8_t *pKey; + dmSecEncryptIndEvt_t encryptInd; + uint8_t secLevel; + + if ((pCcb = dmConnCcbByHandle(pEvent->hdr.param)) != NULL) + { + if (pEvent->hdr.event == HCI_LE_LTK_REQ_CBACK_EVT) + { + /* if ediv and rand are zero then check if STK is available from SMP */ + if ((pEvent->leLtkReq.encDiversifier == 0) && + (memcmp(pEvent->leLtkReq.randNum, calc128Zeros, HCI_RAND_LEN) == 0)) + { + if ((pKey = SmpDmGetStk(pCcb->connId, &secLevel)) != NULL) + { + /* store security level */ + pCcb->tmpSecLevel = secLevel; + + /* not using LTK */ + pCcb->usingLtk = FALSE; + + /* provide key to HCI */ + HciLeLtkReqReplCmd(pEvent->hdr.param, pKey); + return; + } + } + + /* call callback to get key from app */ + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_DM_ENC, DM_CONN_BUSY); + + /* using LTK */ + pCcb->usingLtk = TRUE; + + /* use the header from the encryptInd struct for efficiency */ + pEvent->hdr.param = pCcb->connId; + pEvent->hdr.event = DM_SEC_LTK_REQ_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + } + else if (pEvent->hdr.event == HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT || + pEvent->hdr.event == HCI_ENC_CHANGE_CBACK_EVT) + { + /* set connection idle */ + DmConnSetIdle(pCcb->connId, DM_IDLE_DM_ENC, DM_CONN_IDLE); + + encryptInd.hdr.param = pCcb->connId; + encryptInd.hdr.status = pEvent->hdr.status; + if (encryptInd.hdr.status == HCI_SUCCESS) + { + encryptInd.hdr.event = DM_SEC_ENCRYPT_IND; + + /* update security level of connection */ + pCcb->secLevel = pCcb->tmpSecLevel; + + /* set LTK flag */ + encryptInd.usingLtk = pCcb->usingLtk; + } + else + { + encryptInd.hdr.event = DM_SEC_ENCRYPT_FAIL_IND; + } + + /* call callback before passing to SMP */ + DmSmpCbackExec((dmEvt_t *) &encryptInd); + + /* pass to SMP */ + encryptInd.hdr.param = pCcb->connId; + encryptInd.hdr.status = pEvent->hdr.status; + SmpDmEncryptInd((wsfMsgHdr_t *) &encryptInd); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM dev event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSecMsgHandler(dmSecMsg_t *pMsg) +{ + dmConnCcb_t *pCcb; + + /* look up ccb */ + if ((pCcb = dmConnCcbById((dmConnId_t) pMsg->hdr.param)) != NULL) + { + /* process API encrypt req */ + switch (pMsg->hdr.event) + { + case DM_SEC_MSG_API_ENCRYPT_REQ: + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_DM_ENC, DM_CONN_BUSY); + + /* store security level */ + pCcb->tmpSecLevel = pMsg->encryptReq.secLevel; + + /* using LTK */ + pCcb->usingLtk = TRUE; + + /* start encryption */ + HciLeStartEncryptionCmd(pCcb->handle, pMsg->encryptReq.ltk.rand, + pMsg->encryptReq.ltk.ediv, pMsg->encryptReq.ltk.key); + + break; + + case DM_SEC_MSG_API_LTK_RSP: + /* if key found */ + if (pMsg->ltkRsp.keyFound) + { + /* store security level */ + pCcb->tmpSecLevel = pMsg->ltkRsp.secLevel; + + /* provide key to HCI */ + HciLeLtkReqReplCmd(pCcb->handle, pMsg->ltkRsp.key); + } + else + { + /* key not found; set connection idle */ + DmConnSetIdle(pCcb->connId, DM_IDLE_DM_ENC, DM_CONN_IDLE); + + HciLeLtkReqNegReplCmd(pCcb->handle); + } + break; + + default: + break; + } + } +} + +/*************************************************************************************************/ +/*! + * \brief For internal use only. Execute DM callback from SMP procedures. + * + * \param pDmEvt Pointer to callback event data. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSmpCbackExec(dmEvt_t *pDmEvt) +{ + /* certain messages need to get to ATT */ + if (pDmEvt->hdr.event == DM_SEC_PAIR_CMPL_IND || + pDmEvt->hdr.event == DM_SEC_ENCRYPT_IND) + { + if (dmConnCb.connCback[DM_CLIENT_ID_ATT] != NULL) + { + (*dmConnCb.connCback[DM_CLIENT_ID_ATT])(pDmEvt); + } + } + + /* execute DM client callback */ + (*dmCb.cback)(pDmEvt); +} + +/*************************************************************************************************/ +/*! + * \brief This function is called to cancel the pairing process. + * + * \param connId DM connection ID. + * \param reason Failure reason. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecCancelReq(dmConnId_t connId, uint8_t reason) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->event = SMP_MSG_API_CANCEL_REQ; + pMsg->param = connId; + pMsg->status = reason; + + /* note we're sending this to SMP */ + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called in response to a DM_SEC_AUTH_REQ_IND event to provide + * PIN or OOB data during pairing. + * + * \param connId DM connection ID. + * \param authDataLen Length of PIN or OOB data. + * \param pAuthData pointer to PIN or OOB data. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecAuthRsp(dmConnId_t connId, uint8_t authDataLen, uint8_t *pAuthData) +{ + smpDmAuthRsp_t *pMsg; + + WSF_ASSERT(authDataLen <= SMP_OOB_LEN); + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmAuthRsp_t))) != NULL) + { + pMsg->hdr.event = SMP_MSG_API_AUTH_RSP; + pMsg->hdr.param = connId; + pMsg->authDataLen = authDataLen; + + if (pAuthData != NULL) + { + memcpy(pMsg->authData, pAuthData, authDataLen); + } + + /* note we're sending this to SMP */ + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM security. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecInit(void) +{ + dmFcnIfTbl[DM_ID_SEC] = (dmFcnIf_t *) &dmSecFcnIf; + + dmSecCb.pCsrk = dmSecCb.pIrk = (uint8_t *) calc128Zeros; +} + +/*************************************************************************************************/ +/*! + * \brief This function sets the local CSRK used by the device. + * + * \param pCsrk Pointer to CSRK. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecSetLocalCsrk(uint8_t *pCsrk) +{ + WsfTaskLock(); + dmSecCb.pCsrk = pCsrk; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief This function sets the local IRK used by the device. + * + * \param pCsrk Pointer to IRK. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecSetLocalIrk(uint8_t *pIrk) +{ + WsfTaskLock(); + dmSecCb.pIrk = pIrk; + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief This function gets the local CSRK used by the device. + * + * \return Pointer to CSRK. + */ +/*************************************************************************************************/ +uint8_t *DmSecGetLocalCsrk(void) +{ + return dmSecCb.pCsrk; +} + +/*************************************************************************************************/ +/*! + * \brief This function gets the local IRK used by the device. + * + * \return Pointer to IRK. + */ +/*************************************************************************************************/ +uint8_t *DmSecGetLocalIrk(void) +{ + return dmSecCb.pIrk; +} + +/*************************************************************************************************/ +/*! + * \brief Reset the sec module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSecReset(void) +{ + /* initialize smp database */ + SmpDbInit(); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.h new file mode 100644 index 0000000000000000000000000000000000000000..5339347af88df6230bc1cfe411ffe5657aaff4a7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec.h @@ -0,0 +1,109 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM security module. + */ +/*************************************************************************************************/ +#ifndef DM_SEC_H +#define DM_SEC_H + +#include "wsf_os.h" +#include "smp_api.h" +#include "dm_main.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* DM sec event handler messages */ +enum +{ + DM_SEC_MSG_API_ENCRYPT_REQ = DM_MSG_START(DM_ID_SEC), + DM_SEC_MSG_API_LTK_RSP +}; + +/* DM lesc sec event handler messages */ +enum +{ + DM_SEC_MSG_CALC_OOB_CNF = DM_MSG_START(DM_ID_LESC), + DM_SEC_MSG_ECC_KEY_CNF +}; + +/************************************************************************************************** + Data types +**************************************************************************************************/ + +/* Data type for DM_SEC_MSG_API_ENCRYPT_REQ */ +typedef struct +{ + wsfMsgHdr_t hdr; + dmSecLtk_t ltk; + uint8_t secLevel; +} dmSecApiEncryptReq_t; + +/* Data type for DM_SEC_MSG_API_LTK_RSP */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t key[SMP_KEY_LEN]; + bool_t keyFound; + uint8_t secLevel; +} dmSecApiLtkRsp_t; + +typedef union +{ + wsfMsgHdr_t hdr; + dmSecApiEncryptReq_t encryptReq; + dmSecApiLtkRsp_t ltkRsp; +} dmSecMsg_t; + +/* Security control block type */ +typedef struct +{ + uint8_t *pIrk; + uint8_t *pCsrk; +} dmSecCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +extern dmSecCb_t dmSecCb; + +/************************************************************************************************** + Function declarations +**************************************************************************************************/ + +/* component interface */ +void dmSecHciHandler(hciEvt_t *pEvent); +void dmSecMsgHandler(dmSecMsg_t *pMsg); +void dmSecReset(void); + +/* component interface */ +void dmSecLescMsgHandler(dmSecMsg_t *pMsg); + +#ifdef __cplusplus +}; +#endif + +#endif /* DM_SEC_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_lesc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_lesc.c new file mode 100644 index 0000000000000000000000000000000000000000..5176f1ccbd372a314b76c1a62163d354426441b1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_lesc.c @@ -0,0 +1,326 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM security module for LE Secure Connections. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "wsf_buf.h" +#include "wsf_trace.h" +#include "util/calc128.h" +#include "smp_api.h" +#include "smp_sc_main.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "dm_sec.h" + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Component function interface */ +static const dmFcnIf_t dmSecLescFcnIf = +{ + dmEmptyReset, + (dmHciHandler_t) dmEmptyHandler, + (dmMsgHandler_t) dmSecLescMsgHandler +}; + +/* OOB random value */ +static uint8_t *dmSecOobRand; + +/* Local device's ECC Key */ +static secEccKey_t localEccKey; + +/*************************************************************************************************/ +/*! + * \brief DM dev event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSecLescMsgHandler(dmSecMsg_t *pMsg) +{ + if (pMsg->hdr.event == DM_SEC_MSG_ECC_KEY_CNF) + { + pMsg->hdr.event = DM_SEC_ECC_KEY_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); + } + else if (pMsg->hdr.event == DM_SEC_MSG_CALC_OOB_CNF) + { + dmSecOobCalcIndEvt_t oobEvt; + secCmacMsg_t *pCmacMsg = (secCmacMsg_t *) pMsg; + + WsfBufFree(pCmacMsg->pPlainText); + + /* Notify the application of the local confirm and random values */ + oobEvt.hdr.event = DM_SEC_CALC_OOB_IND; + oobEvt.hdr.status = HCI_SUCCESS; + + Calc128Cpy(oobEvt.confirm, ((secAes_t *) pMsg)->pCiphertext); + Calc128Cpy(oobEvt.random, dmSecOobRand); + + WsfBufFree(dmSecOobRand); + + (*dmCb.cback)((dmEvt_t *) &oobEvt); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function sends keypress cmd messages to the peer. + * + * \return none. + */ +/*************************************************************************************************/ +void DmSecKeypressReq(dmConnId_t connId, uint8_t keypressType) +{ + smpDmKeypress_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmKeypress_t))) != NULL) + { + /* Execution an an SMP state machine event to send the keypress to the peer device */ + pMsg->keypress = keypressType; + pMsg->hdr.param = connId; + + pMsg->hdr.event = SMP_MSG_API_USER_KEYPRESS; + + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function records the peer random value and peer confirm value exchanged via + * out-of-band (OOB) methods. + * + * \param connId ID of the connection + * \param pCfg OOB Configuration + * + * \return Pointer to IRK. + */ +/*************************************************************************************************/ +void DmSecSetOob(dmConnId_t connId, dmSecLescOobCfg_t *pCfg) +{ + /* Update the Security Manager control structure with random and confirm values from the peer */ + SmpScSetOobCfg(connId, pCfg); +} + +/*************************************************************************************************/ +/*! + * \brief This function calcualtes the local random and confirm values used in LESC OOB pairing. + * The operation's result is posted as a DM_SEC_CALC_OOB_IND event to the application's DM + * callback handler. The local rand and confirm values are exchanged with the peer via + * out-of-band (OOB) methods and passed into the DmSecSetOob after DM_CONN_OPEN_IND. + * + * \param pRand Random value used in calculation. + * \param pPubKeyX X component of the local public key. + * + * \return none. + */ +/*************************************************************************************************/ +void DmSecCalcOobReq(uint8_t *pRand, uint8_t *pPubKeyX) +{ + uint8_t *pCmacText; + dmSecOobCalcIndEvt_t pEvt; + + SMP_TRACE_256("DmSecCalcOobReq Key", pPubKeyX); + SMP_TRACE_128("DmSecCalcOobReq Rand", pRand); + + if ((dmSecOobRand = WsfBufAlloc(SMP_RAND_LEN)) != NULL) + { + /* Store the random value */ + Calc128Cpy(dmSecOobRand, pRand); + + /* Cnf = f4(PKx, PKx, rand, 0x00) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + if ((pCmacText = (uint8_t*) WsfBufAlloc(SMP_F4_TEXT_LEN)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* Concatinate PKx, PKx, 0x00 */ + pCatBuf = SmpScCat(pCatBuf, pPubKeyX, SMP_PUB_KEY_LEN); + pCatBuf = SmpScCat(pCatBuf, pPubKeyX, SMP_PUB_KEY_LEN); + *pCatBuf = 0; + + /* Execute CMAC with rand as the key */ + if (SecCmac(dmSecOobRand, pCmacText, SMP_F4_TEXT_LEN, dmCb.handlerId, 0, DM_SEC_MSG_CALC_OOB_CNF)) + { + return; + } + + WsfBufFree(pCmacText); + } + + WsfBufFree(dmSecOobRand); + } + + /* Notify the application of a failure */ + memset(&pEvt, 0, sizeof(dmSecOobCalcIndEvt_t)); + + pEvt.hdr.event = DM_SEC_CALC_OOB_IND; + pEvt.hdr.status = HCI_ERR_MEMORY_EXCEEDED; + + (*dmCb.cback)((dmEvt_t *) &pEvt); +} + +/*************************************************************************************************/ +/*! + * \brief This function generates an ECC key for use with LESC security. When the calculation + * completes, the result is posted as a DM_SEC_ECC_KEY_IND event to the application's + * DM callback handler. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecGenerateEccKeyReq(void) +{ + SecEccGenKey(dmCb.handlerId, 0, DM_SEC_MSG_ECC_KEY_CNF); +} + +/*************************************************************************************************/ +/*! + * \brief This function sets the ECC key for use with LESC security to standard debug keys values. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecSetDebugEccKey(void) +{ + const uint8_t privateKey[] = {0x3f, 0x49, 0xf6, 0xd4, 0xa3, 0xc5, 0x5f, 0x38, + 0x74, 0xc9, 0xb3, 0xe3, 0xd2, 0x10, 0x3f, 0x50, + 0x4a, 0xff, 0x60, 0x7b, 0xeb, 0x40, 0xb7, 0x99, + 0x58, 0x99, 0xb8, 0xa6, 0xcd, 0x3c, 0x1a, 0xbd}; + + const uint8_t publicKeyX[] = {0x20, 0xb0, 0x03, 0xd2, 0xf2, 0x97, 0xbe, 0x2c, + 0x5e, 0x2c, 0x83, 0xa7, 0xe9, 0xf9, 0xa5, 0xb9, + 0xef, 0xf4, 0x91, 0x11, 0xac, 0xf4, 0xfd, 0xdb, + 0xcc, 0x03, 0x01, 0x48, 0x0e, 0x35, 0x9d, 0xe6}; + + const uint8_t publicKeyY[] = {0xdc, 0x80, 0x9c, 0x49, 0x65, 0x2a, 0xeb, 0x6d, + 0x63, 0x32, 0x9a, 0xbf, 0x5a, 0x52, 0x15, 0x5c, + 0x76, 0x63, 0x45, 0xc2, 0x8f, 0xed, 0x30, 0x24, + 0x74, 0x1c, 0x8e, 0xd0, 0x15, 0x89, 0xd2, 0x8b}; + + SMP_TRACE_INFO0("Debug LESC Keys Enabled"); + + memcpy(localEccKey.privKey, privateKey, SEC_ECC_KEY_LEN); + memcpy(localEccKey.pubKey_x, publicKeyX, SEC_ECC_KEY_LEN); + memcpy(localEccKey.pubKey_y, publicKeyY, SEC_ECC_KEY_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief This function sets the local ECC key for use with LESC security. The key can be + * generated using DmSecGenerateEccKeyReq or the key could originate from an application + * specific source (e.g. prestored in non-volatile memory, generated with specialized + * hardware, etc). + * + * \param pKey Pointer to local ECC key + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecSetEccKey(secEccKey_t *pKey) +{ + memcpy(&localEccKey, pKey, sizeof(secEccKey_t)); +} + +/*************************************************************************************************/ +/*! + * \brief This function gets the local ECC key for use with LESC security. + * + * \return Pointer to local ECC key. + */ +/*************************************************************************************************/ +secEccKey_t *DmSecGetEccKey(void) +{ + return &localEccKey; +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by the application in response to a DM_SEC_COMPARE_IND event. + * The valid parameter indicates if the compare value of the DM_SEC_COMPARE_IND was valid. + * + * \param connId ID of the connection + * \param valid TRUE if compare value was valid + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecCompareRsp(dmConnId_t connId, bool_t valid) +{ + smpDmMsg_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmMsg_t))) != NULL) + { + /* Execution an an SMP state machine event to send the compare response */ + pMsg->hdr.param = connId; + + if (valid) + { + pMsg->hdr.event = SMP_MSG_API_USER_CONFIRM; + } + else + { + SmpScGetCancelMsgWithReattempt(connId, (wsfMsgHdr_t *) pMsg, SMP_ERR_NUMERIC_COMPARISON); + } + + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function returns the 6-digit compare value for the specified 128-bit confirm value. + * + * \param pConfirm Pointer to 128-bit comfirm value. + * + * \return Six-digit compare value. + */ +/*************************************************************************************************/ +uint32_t DmSecGetCompareValue(uint8_t *pConfirm) +{ + uint32_t compare = ((uint32_t) pConfirm[15] + + ((uint32_t) pConfirm[14] << 8) + + ((uint32_t) pConfirm[13] << 16) + + ((uint32_t) pConfirm[12] << 24)); + + /* return the least significant six digits */ + return compare % 1000000; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize DM LE Secure Connections security. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecLescInit(void) +{ + dmFcnIfTbl[DM_ID_LESC] = (dmFcnIf_t *) &dmSecLescFcnIf; +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_master.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_master.c new file mode 100644 index 0000000000000000000000000000000000000000..be8cef81f537bb4571bf157a28a58c1c41e75e32 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_master.c @@ -0,0 +1,119 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM security module for master. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/calc128.h" +#include "smp_api.h" +#include "dm_api.h" +#include "dm_sec.h" +#include "dm_conn.h" +#include "dm_main.h" + +/*************************************************************************************************/ +/*! + * \brief For internal use only. This function is called by SMP to request encryption. + * + * \param connId DM connection ID. + * \param secLevel Security level of pairing when key was exchanged. + * \param pKey Pointer to key. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSmpEncryptReq(dmConnId_t connId, uint8_t secLevel, uint8_t *pKey) +{ + dmConnCcb_t *pCcb; + + if ((pCcb = dmConnCcbById(connId)) != NULL) + { + /* store security level */ + pCcb->tmpSecLevel = secLevel; + + /* not using LTK */ + pCcb->usingLtk = FALSE; + + /* start encryption; note EDIV and RAND are zero */ + HciLeStartEncryptionCmd(pCcb->handle, (uint8_t *) calc128Zeros, 0, pKey); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by a master device to initiate pairing. + * + * \param connId DM connection ID. + * \param oob Out-of-band pairing data present or not present. + * \param auth Authentication and bonding flags. + * \param iKeyDist Initiator key distribution flags. + * \param rKeyDist Responder key distribution flags. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecPairReq(dmConnId_t connId, uint8_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist) +{ + smpDmPair_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmPair_t))) != NULL) + { + pMsg->hdr.event = SMP_MSG_API_PAIR_REQ; + pMsg->hdr.param = connId; + pMsg->oob = oob; + pMsg->auth = auth; + + /* clear any erroneous key dist bits set by app */ + pMsg->iKeyDist = iKeyDist & SMP_KEY_DIST_MASK; + pMsg->rKeyDist = rKeyDist & SMP_KEY_DIST_MASK; + + /* note we're sending this to SMP */ + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by a master device to initiate link encryption. + * + * \param connId DM connection ID. + * \param secLevel Security level of pairing when key was exchanged. + * \param pLtk Pointer to LTK parameter structure. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecEncryptReq(dmConnId_t connId, uint8_t secLevel, dmSecLtk_t *pLtk) +{ + dmSecApiEncryptReq_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmSecApiEncryptReq_t))) != NULL) + { + pMsg->hdr.event = DM_SEC_MSG_API_ENCRYPT_REQ; + pMsg->hdr.param = connId; + memcpy(&pMsg->ltk, pLtk, sizeof(dmSecLtk_t)); + pMsg->secLevel = secLevel; + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_slave.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..ab506593751700b4c9db9c8b0c37223ba0483261 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sec_slave.c @@ -0,0 +1,120 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief DM security module for slave. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/calc128.h" +#include "dm_api.h" +#include "dm_sec.h" +#include "dm_main.h" + +/*************************************************************************************************/ +/*! + * \brief This function is called by a slave device to proceed with pairing after a + * DM_SEC_PAIR_IND event is received. + * + * \param connId DM connection ID. + * \param oob Out-of-band pairing data present or not present. + * \param auth Authentication and bonding flags. + * \param iKeyDist Initiator key distribution flags. + * \param rKeyDist Responder key distribution flags. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecPairRsp(dmConnId_t connId, uint8_t oob, uint8_t auth, uint8_t iKeyDist, uint8_t rKeyDist) +{ + smpDmPair_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmPair_t))) != NULL) + { + pMsg->hdr.event = SMP_MSG_API_PAIR_RSP; + pMsg->hdr.param = connId; + pMsg->oob = oob; + pMsg->auth = auth; + + /* clear any erroneous key dist bits set by app */ + pMsg->iKeyDist = iKeyDist & SMP_KEY_DIST_MASK; + pMsg->rKeyDist = rKeyDist & SMP_KEY_DIST_MASK; + + /* note we're sending this to SMP */ + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by a slave device to request that the master initiates + * pairing or link encryption. + * + * \param connId DM connection ID. + * \param auth Authentication flags. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecSlaveReq(dmConnId_t connId, uint8_t auth) +{ + smpDmSecurityReq_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(smpDmSecurityReq_t))) != NULL) + { + pMsg->hdr.event = SMP_MSG_API_SECURITY_REQ; + pMsg->hdr.param = connId; + pMsg->auth = auth; + + /* note we're sending this to SMP */ + SmpDmMsgSend((smpDmMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by a slave in response to a DM_SEC_LTK_REQ_IND event + * to provide the key used for encryption. + * + * \param connId DM connection ID. + * \param keyFound TRUE if key found. + * \param secLevel Security level of pairing when key was exchanged. + * \param *pKey Pointer to the key, if found. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSecLtkRsp(dmConnId_t connId, bool_t keyFound, uint8_t secLevel, uint8_t *pKey) +{ + dmSecApiLtkRsp_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(dmSecApiLtkRsp_t))) != NULL) + { + pMsg->hdr.event = DM_SEC_MSG_API_LTK_RSP; + pMsg->hdr.param = connId; + pMsg->keyFound = keyFound; + pMsg->secLevel = secLevel; + if (keyFound) + { + Calc128Cpy(pMsg->key, pKey); + } + + WsfMsgSend(dmCb.handlerId, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sync_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sync_ae.c new file mode 100644 index 0000000000000000000000000000000000000000..9548a648abc85093b2474d74bf7bb754cfa2229c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/dm/dm_sync_ae.c @@ -0,0 +1,832 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Device manager periodic advertising synchronization management and state machine + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_scan.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! DM sync event handler messages for state machine */ +enum +{ + /* messages from API */ + DM_SYNC_MSG_API_START = DM_MSG_START(DM_ID_SYNC), /*!< Start Sync */ + DM_SYNC_MSG_API_STOP, /*!< Stop Sync */ + + /* messages from HCI */ + DM_SYNC_MSG_HCI_LE_SYNC_EST_FAIL, /*!< HCI LE Sync Establishment Failed */ + DM_SYNC_MSG_HCI_LE_SYNC_EST, /*!< HCI LE Sync Established */ + DM_SYNC_MSG_HCI_LE_SYNC_LOST, /*!< HCI LE Sync Lost */ + DM_SYNC_MSG_HCI_LE_SYNC_TRSF_EST_FAIL, /*!< HCI LE Sync Transfer Establishment Failed */ + DM_SYNC_MSG_HCI_LE_SYNC_TRSF_EST /*!< HCI LE Sync Transfer Established */ +}; + +/*! State machine states */ +enum +{ + DM_SYNC_SM_ST_IDLE, /*!< Idle State */ + DM_SYNC_SM_ST_SYNCING, /*!< Synchronizing State */ + DM_SYNC_SM_ST_SYNCED, /*!< Synced State */ + DM_SYNC_SM_ST_DESYNCING, /*!< Desynchronizing State */ + + DM_SYNC_SM_NUM_STATES +}; + +/*! State machine actions */ +enum +{ + DM_SYNC_SM_ACT_NONE, /*!< No Action */ + DM_SYNC_SM_ACT_START, /*!< Process Start Sync */ + DM_SYNC_SM_ACT_STOP, /*!< Process Stop Sync */ + DM_SYNC_SM_ACT_CANCEL_START, /*!< Process Cancel Start Sync */ + DM_SYNC_SM_ACT_SYNC_EST, /*!< Process Sync Established */ + DM_SYNC_SM_ACT_SYNC_EST_FAILED, /*!< Process Sync Establishment Failed */ + DM_SYNC_SM_ACT_SYNC_LOST, /*!< Process Sync Lost */ + DM_SYNC_SM_ACT_SYNC_TRSF_EST, /*!< Process Sync Transfer Established */ + DM_SYNC_SM_ACT_SYNC_TRSF_EST_FAILED /*!< Process Sync Transfer Establishment Failed */ +}; + +/*! Column position of next state */ +#define DM_SYNC_NEXT_STATE 0 + +/*! Column position of action */ +#define DM_SYNC_ACTION 1 + +/*! Number of columns in the state machine state tables */ +#define DM_SYNC_NUM_COLS 2 + +/*! Number of messages */ +#define DM_SYNC_NUM_MSGS (DM_SYNC_MSG_HCI_LE_SYNC_TRSF_EST - DM_SYNC_MSG_API_START + 1) + +/*! Translate HCI event to state machine message */ +#define DM_SYNC_HCI_EVT_2_MSG(evt) (DM_SYNC_MSG_HCI_LE_SYNC_LOST - HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT + (evt)) + +/*! Uninitialized HCI sync handle */ +#define DM_SYNC_HCI_HANDLE_NONE 0xFFFF + +/*! Action function */ +typedef void (*dmSyncAct_t)(dmSyncCb_t *pCcb, dmSyncMsg_t *pMsg); + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/*! DM Sync state machine state tables */ +static const uint8_t dmSyncStateTbl[DM_SYNC_SM_NUM_STATES][DM_SYNC_NUM_MSGS][DM_SYNC_NUM_COLS] = +{ + /* Idle state */ + { + /* Event Next state Action */ + /* API_START */ {DM_SYNC_SM_ST_SYNCING, DM_SYNC_SM_ACT_START}, + /* API_STOP */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_EST */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_LOST */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_TRSF_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_TRSF_EST_FAILED}, + /* HCI_LE_SYNC_TRSF_EST */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_SYNC_TRSF_EST} + }, + /* Syncing state */ + { + /* Event Next state Action */ + /* API_START */ {DM_SYNC_SM_ST_SYNCING, DM_SYNC_SM_ACT_NONE}, + /* API_STOP */ {DM_SYNC_SM_ST_DESYNCING, DM_SYNC_SM_ACT_CANCEL_START}, + /* HCI_LE_SYNC_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_EST_FAILED}, + /* HCI_LE_SYNC_EST */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_SYNC_EST}, + /* HCI_LE_SYNC_LOST */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_EST_FAILED}, + /* HCI_LE_SYNC_TRSF_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_TRSF_EST_FAILED}, + /* HCI_LE_SYNC_TRSF_EST */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_SYNC_TRSF_EST}, + }, + /* Synced state */ + { + /* Event Next state Action */ + /* API_START */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_NONE}, + /* API_STOP */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_STOP}, + /* HCI_LE_SYNC_EST_FAIL */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_EST */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_LOST */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_LOST}, + /* HCI_LE_SYNC_TRSF_EST_FAIL */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_TRSF_EST */ {DM_SYNC_SM_ST_SYNCED, DM_SYNC_SM_ACT_NONE}, + }, + /* Desyncing state */ + { + /* Event Next state Action */ + /* API_START */ {DM_SYNC_SM_ST_DESYNCING, DM_SYNC_SM_ACT_NONE}, + /* API_STOP */ {DM_SYNC_SM_ST_DESYNCING, DM_SYNC_SM_ACT_NONE}, + /* HCI_LE_SYNC_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_EST_FAILED}, + /* HCI_LE_SYNC_EST */ {DM_SYNC_SM_ST_DESYNCING, DM_SYNC_SM_ACT_STOP}, + /* HCI_LE_SYNC_LOST */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_LOST}, + /* HCI_LE_SYNC_TRSF_EST_FAIL */ {DM_SYNC_SM_ST_IDLE, DM_SYNC_SM_ACT_SYNC_TRSF_EST_FAILED}, + /* HCI_LE_SYNC_TRSF_EST */ {DM_SYNC_SM_ST_DESYNCING, DM_SYNC_SM_ACT_STOP}, + } +}; + +/*! DM Sync action function table */ +static const dmSyncAct_t dmSyncAct[] = +{ + dmSyncSmActNone, + dmSyncSmActStart, + dmSyncSmActStop, + dmSyncSmActCancelStart, + dmSyncSmActSyncEst, + dmSyncSmActSyncEstFailed, + dmSyncSmActSyncLost, + dmSyncSmActSyncTrsfEst, + dmSyncSmActSyncTrsfEstFailed +}; + +/*! DM Sync component function interface */ +static const dmFcnIf_t dmSyncFcnIf = +{ + dmSyncReset, + dmSyncHciHandler, + dmSyncMsgHandler +}; + +/*! DM Periodic advertising sync control block */ +static dmSyncCb_t dmSyncCb[DM_SYNC_MAX]; + +/*************************************************************************************************/ +/*! + * \brief Return the SCB with particular state conditions. + * + * \return Pointer to SCB or NULL if failure. + */ +/*************************************************************************************************/ +static dmSyncCb_t *dmSyncCmplState(void) +{ + dmSyncCb_t *pScb = dmSyncCb; + uint8_t i; + + /* if there's a scb in accepting state */ + for (i = DM_SYNC_MAX; i > 0; i--, pScb++) + { + /* look for sync in desyncing state, cancelled sync */ + if (pScb->inUse && + (pScb->state == DM_SYNC_SM_ST_DESYNCING) && + (pScb->handle == DM_SYNC_HCI_HANDLE_NONE)) + { + DM_TRACE_INFO1("dmSyncCmplState %d", pScb->syncId); + return pScb; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! +* \brief Allocate a DM sync control block. +* +* \param sid Advertising Sid. +* \param pAddr Advertiser BD address. +* +* \return Pointer to sync CB or NULL if failure. +*/ +/*************************************************************************************************/ +static dmSyncCb_t *dmSyncCbAlloc(uint8_t sid, const uint8_t *pAddr) +{ + dmSyncCb_t *pScb = dmSyncCb; + uint8_t i; + + for (i = 0; i < DM_SYNC_MAX; i++, pScb++) + { + if (pScb->inUse == FALSE) + { + memset(pScb, 0, sizeof(dmSyncCb_t)); + + pScb->advSid = sid; + BdaCpy(pScb->advAddr, pAddr); + pScb->handle = DM_SYNC_HCI_HANDLE_NONE; + pScb->syncId = i + 1; + pScb->inUse = TRUE; + + DM_TRACE_ALLOC1("dmSyncCbAlloc %d", pScb->syncId); + + return pScb; + } + } + + DM_TRACE_ERR0("dmSyncCbAlloc failed"); + + return NULL; +} + +/*************************************************************************************************/ +/*! +* \brief Deallocate a DM sync control block. +* +* \param pCb Sync control block. +* +* \return None. +*/ +/*************************************************************************************************/ +static void dmSyncCbDealloc(dmSyncCb_t *pCb) +{ + DM_TRACE_FREE1("dmSyncCbDealloc %d", pCb->syncId); + + pCb->inUse = FALSE; +} + +/*************************************************************************************************/ +/*! +* \brief Find a sync control block with matching handle. +* +* \param handle Handle to find. +* +* \return Pointer to sync CB or NULL if failure. +*/ +/*************************************************************************************************/ +static dmSyncCb_t *dmSyncCbByHandle(uint16_t handle) +{ + dmSyncCb_t *pScb = dmSyncCb; + uint8_t i; + + for (i = DM_SYNC_MAX; i > 0; i--, pScb++) + { + if (pScb->inUse && (pScb->handle == handle)) + { + return pScb; + } + } + + DM_TRACE_WARN1("dmSyncCbByHandle not found 0x%04x", handle); + + return NULL; +} + +/*************************************************************************************************/ +/*! +* \brief Find a sync control block with advertising SID and advertiser BD address. +* +* \param sid Sid to find. +* \param pAddr BD address to find. +* +* \return Pointer to CB or NULL if failure. +*/ +/*************************************************************************************************/ +dmSyncCb_t *dmSyncCbBySidBdAddr(uint8_t sid, const uint8_t *pAddr) +{ + dmSyncCb_t *pScb = dmSyncCb; + uint8_t i; + + for (i = DM_SYNC_MAX; i > 0; i--, pScb++) + { + if (pScb->inUse && (pScb->advSid == sid) && BdaCmp(pScb->advAddr, pAddr)) + { + return pScb; + } + } + + DM_TRACE_INFO0("dmSyncCbBySidBdAddr not found"); + + return NULL; +} + +/*************************************************************************************************/ +/*! +* \brief Return the sync control block for the given sync ID. +* +* \param syncId Sync ID. +* +* \return Pointer to CB or NULL if failure. +*/ +/*************************************************************************************************/ +dmSyncCb_t *dmSyncCbById(dmSyncId_t syncId) +{ + WSF_ASSERT((syncId > 0) && (syncId <= DM_SYNC_MAX)); + + syncId--; + if (dmSyncCb[syncId].inUse) + { + return &dmSyncCb[syncId]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Empty action. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActNone(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Synchronize with periodic advertising from the given advertiser. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActStart(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + HciLePerAdvCreateSyncCmd(dmCb.syncOptions, pMsg->apiSyncStart.advSid, + pMsg->apiSyncStart.advAddrType, pMsg->apiSyncStart.advAddr, + pMsg->apiSyncStart.skip, pMsg->apiSyncStart.syncTimeout, + pMsg->apiSyncStart.unused); +} + +/*************************************************************************************************/ +/*! + * \brief Stop reception of the periodic advertising identified by the given sync handle. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActStop(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + HciLePerAdvTerminateSyncCmd(pScb->handle); + + dmSyncSmActSyncLost(pScb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Cancel creation of a sync while it's pending. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActCancelStart(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + HciLePerAdvCreateSyncCancelCmd(); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a sync established event from HCI. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActSyncEst(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + /* store adv sid, adv address and sync handle */ + pScb->advSid = pMsg->perAdvSyncEst.advSid; + BdaCpy(pScb->advAddr, pMsg->perAdvSyncEst.advAddr); + pScb->advAddrType = DmHostAddrType(pMsg->perAdvSyncEst.advAddrType); + pScb->handle = pMsg->perAdvSyncEst.syncHandle; + + pMsg->hdr.event = DM_PER_ADV_SYNC_EST_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a sync established failure event from HCI. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActSyncEstFailed(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + /* deallocate scb */ + dmSyncCbDealloc(pScb); + + pMsg->hdr.event = DM_PER_ADV_SYNC_EST_FAIL_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a sync lost event from HCI. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActSyncLost(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + /* deallocate scb */ + dmSyncCbDealloc(pScb); + + pMsg->hdr.event = DM_PER_ADV_SYNC_LOST_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a sync transfer established event from HCI. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActSyncTrsfEst(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + /* store adv sid, adv address and sync handle */ + pScb->advSid = pMsg->perAdvSyncTrsfEst.advSid; + BdaCpy(pScb->advAddr, pMsg->perAdvSyncTrsfEst.advAddr); + pScb->advAddrType = DmHostAddrType(pMsg->perAdvSyncTrsfEst.advAddrType); + pScb->handle = pMsg->perAdvSyncTrsfEst.syncHandle; + + pMsg->hdr.event = DM_PER_ADV_SYNC_TRSF_EST_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Handle a sync transfer established failure event from HCI. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmActSyncTrsfEstFailed(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + /* deallocate scb */ + dmSyncCbDealloc(pScb); + + pMsg->hdr.event = DM_PER_ADV_SYNC_TRSF_EST_FAIL_IND; + (*dmCb.cback)((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Execute the DM sync state machine. + * + * \param pScb Sync control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncSmExecute(dmSyncCb_t *pScb, dmSyncMsg_t *pMsg) +{ + uint8_t action; + uint8_t event; + + DM_TRACE_INFO2("dmSyncSmExecute event=%d state=%d", pMsg->hdr.event, pScb->state); + + /* get the event */ + event = DM_MSG_MASK(pMsg->hdr.event); + + /* get action */ + action = dmSyncStateTbl[pScb->state][event][DM_SYNC_ACTION]; + + /* set next state */ + pScb->state = dmSyncStateTbl[pScb->state][event][DM_SYNC_NEXT_STATE]; + + /* execute action function */ + (*dmSyncAct[action])(pScb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the sync module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncInit(void) +{ + dmFcnIfTbl[DM_ID_SYNC] = (dmFcnIf_t *) &dmSyncFcnIf; +} + +/*************************************************************************************************/ +/*! + * \brief Reset the sync module. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncReset(void) +{ + dmSyncCb_t *pScb = dmSyncCb; + hciLePerAdvSyncLostEvt_t syncLost; + uint8_t i; + + /* generate HCI sync lost event */ + syncLost.hdr.event = HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT; + syncLost.hdr.status = HCI_SUCCESS; + + for (i = DM_SYNC_MAX; i > 0; i--, pScb++) + { + if (pScb->inUse) + { + /* set sync handle */ + syncLost.hdr.param = syncLost.syncHandle = pScb->handle; + + /* handle the event */ + dmSyncHciHandler((hciEvt_t *) &syncLost); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief DM sync HCI event handler. + * + * \param pEvent Pointer to HCI callback event structure. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncHciHandler(hciEvt_t *pEvent) +{ + dmSyncCb_t *pScb; + + /* handle special case for periodic advertising report event */ + if (pEvent->hdr.event == HCI_LE_PER_ADV_REPORT_CBACK_EVT) + { + pEvent->hdr.event = DM_PER_ADV_REPORT_IND; + (*dmCb.cback)((dmEvt_t *) pEvent); + return; + } + + /* handle special cases for sync established event */ + if (pEvent->hdr.event == HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT) + { + /* first check if scb exists for this sid and bd addr */ + pScb = dmSyncCbBySidBdAddr(pEvent->lePerAdvSyncEst.advSid, pEvent->lePerAdvSyncEst.advAddr); + + /* if scb not found */ + if (pScb == NULL) + { + /* check for special case state */ + pScb = dmSyncCmplState(); + } + + /* translate HCI event to state machine event */ + if (pEvent->hdr.status == HCI_SUCCESS) + { + pEvent->hdr.event = DM_SYNC_MSG_HCI_LE_SYNC_EST; + } + else + { + pEvent->hdr.event = DM_SYNC_MSG_HCI_LE_SYNC_EST_FAIL; + } + } + /* handle special cases for past received event */ + else if (pEvent->hdr.event == HCI_LE_PER_SYNC_TRSF_RCVD_CBACK_EVT) + { + /* first check if scb exists for this sid and bd addr */ + pScb = dmSyncCbBySidBdAddr(pEvent->lePerAdvSyncTrsfRcvd.advSid, pEvent->lePerAdvSyncTrsfRcvd.advAddr); + + /* if scb not found */ + if (pScb == NULL) + { + /* allocate scb */ + pScb = dmSyncCbAlloc(pEvent->lePerAdvSyncTrsfRcvd.advSid, pEvent->lePerAdvSyncTrsfRcvd.advAddr); + } + + /* translate HCI event to state machine event */ + if (pEvent->hdr.status == HCI_SUCCESS) + { + pEvent->hdr.event = DM_SYNC_MSG_HCI_LE_SYNC_TRSF_EST; + } + else + { + pEvent->hdr.event = DM_SYNC_MSG_HCI_LE_SYNC_TRSF_EST_FAIL; + } + } + else + { + pScb = dmSyncCbByHandle(pEvent->hdr.param); + + /* translate HCI event to state machine message */ + pEvent->hdr.event = DM_SYNC_HCI_EVT_2_MSG(pEvent->hdr.event); + } + + /* if scb found */ + if (pScb != NULL) + { + /* set sync id */ + pEvent->hdr.param = pScb->syncId; + + /* execute state machine */ + dmSyncSmExecute(pScb, (dmSyncMsg_t *) pEvent); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM sync event handler. + * + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void dmSyncMsgHandler(wsfMsgHdr_t *pMsg) +{ + dmSyncCb_t *pScb; + + /* look up scb from sync id */ + if ((pScb = dmSyncCbById((dmSyncId_t) pMsg->param)) != NULL) + { + /* execute state machine */ + dmSyncSmExecute(pScb, (dmSyncMsg_t *) pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Synchronize with periodic advertising from the given advertiser, and start receiving + * periodic advertising packets. + * + * Note: The synchronization filter policy is used to determine whether the periodic + * advertiser list is used. If the periodic advertiser list is not used, the + * advertising SID, advertiser address type, and advertiser address parameters + * specify the periodic advertising device to listen to; otherwise these parameters + * are ignored. + * + * \param advSid Advertising SID. + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param skip Number of periodic advertising packets that can be skipped after + * successful receive. + * \param syncTimeout Synchronization timeout. + * + * \return Sync identifier. + */ +/*************************************************************************************************/ +dmSyncId_t DmSyncStart(uint8_t advSid, uint8_t advAddrType, const uint8_t *pAdvAddr, uint16_t skip, + uint16_t syncTimeout) +{ + dmSyncCb_t *pScb = NULL; + dmSyncApiStart_t *pMsg; + + /* make sure scb not already allocated */ + WsfTaskLock(); + if ((pScb = dmSyncCbBySidBdAddr(advSid, pAdvAddr)) == NULL) + { + /* allocate scb */ + pScb = dmSyncCbAlloc(advSid, pAdvAddr); + } + WsfTaskUnlock(); + + if (pScb != NULL) + { + if ((pMsg = WsfMsgAlloc(sizeof(dmSyncApiStart_t))) != NULL) + { + pMsg->hdr.param = pScb->syncId; + pMsg->hdr.event = DM_SYNC_MSG_API_START; + pMsg->advSid = advSid; + pMsg->advAddrType = advAddrType; + BdaCpy(pMsg->advAddr, pAdvAddr); + pMsg->skip = skip; + pMsg->syncTimeout = syncTimeout; + pMsg->unused = 0; + WsfMsgSend(dmCb.handlerId, pMsg); + + /* return sync id */ + return pScb->syncId; + } + else + { + WsfTaskLock(); + dmSyncCbDealloc(pScb); + WsfTaskUnlock(); + } + } + + /* open failed */ + return DM_SYNC_ID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Stop reception of the periodic advertising identified by the given sync identifier. + * + * \param syncId Sync identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSyncStop(dmSyncId_t syncId) +{ + wsfMsgHdr_t *pMsg; + + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pMsg->param = syncId; + pMsg->event = DM_SYNC_MSG_API_STOP; + WsfMsgSend(dmCb.handlerId, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Add device to periodic advertiser list. + * + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param advSid Advertising SID. + * + * \return None. + */ +/*************************************************************************************************/ +void DmAddDeviceToPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) +{ + HciLeAddDeviceToPerAdvListCmd(advAddrType, pAdvAddr, advSid); +} + +/*************************************************************************************************/ +/*! + * \brief DM remove device from periodic advertiser list. + * + * \param advAddrType Advertiser address type. + * \param pAdvAddr Advertiser address. + * \param advSid Advertising SID. + * + * \return None. + */ +/*************************************************************************************************/ +void DmRemoveDeviceFromPerAdvList(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) +{ + HciLeRemoveDeviceFromPerAdvListCmd(advAddrType, pAdvAddr, advSid); +} + +/*************************************************************************************************/ +/*! + * \brief DM clear periodic advertiser list. + * + * \return None. + */ +/*************************************************************************************************/ +void DmClearPerAdvList(void) +{ + HciLeClearPerAdvListCmd(); +} + +/*************************************************************************************************/ +/*! + * \brief DM enable or disable initial periodic advertising reports once synchronized. + * + * \param enable TRUE to enable initial reporting, FALSE to disable initial reporting. + * + * \return None. + */ +/*************************************************************************************************/ +void DmSyncInitialRptEnable(bool_t enable) +{ + WsfTaskLock(); + if (enable) + { + /* Enable initial periodic advertisement reporting */ + dmCb.syncOptions &= ~HCI_OPTIONS_INIT_RPT_ENABLE_BIT; + } + else + { + /* Disable initial periodic advertisement reporting */ + dmCb.syncOptions |= HCI_OPTIONS_INIT_RPT_ENABLE_BIT; + } + WsfTaskUnlock(); +} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.c similarity index 80% rename from lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.c index 16b7d2e207fbb05fcbc1d52a629f071d035ce7eb..61dd0d3646ccdd2beb88a1950c1c8d2e736dc7b2 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI main module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI main module. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.h similarity index 74% rename from lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.h index 12c44a7eed1fdbe7d947e858f9d7a86c4c103efa..936c42d8492e355e1dce706c872a0159ba339fa3 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/stack/hci/hci_main.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/hci/hci_main.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief HCI main module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI main module. */ /*************************************************************************************************/ #ifndef HCI_MAIN_H diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_coc.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_coc.c new file mode 100644 index 0000000000000000000000000000000000000000..7af97f720d802aa408dc10896ecb3c80eb5e3280 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_coc.c @@ -0,0 +1,1874 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP connection oriented channel module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_timer.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include "l2c_api.h" +#include "l2c_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Channel states */ +enum +{ + L2C_CHAN_STATE_UNUSED, + L2C_CHAN_STATE_CONNECTING, + L2C_CHAN_STATE_CONNECTED, + L2C_CHAN_STATE_DISCONNECTING +}; + +/* Event handler messages */ +enum +{ + /* messages from API */ + L2C_MSG_API_DATA_REQ, + L2C_MSG_API_CONNECT_REQ, + L2C_MSG_API_DISCONNECT_REQ, + + /* messages from timers */ + L2C_MSG_COC_REQ_TIMEOUT +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data type for L2C_MSG_API_DATA_REQ */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint8_t *pPacket; + uint16_t localCid; + uint16_t sduLen; +} l2cApiDataReq_t; + + +/* Data type for L2C_MSG_API_CONNECT_REQ */ +typedef struct +{ + wsfMsgHdr_t hdr; + uint16_t localCid; + uint16_t remotePsm; +} l2cApiConnectReq_t; + +/* Data type for event handler messages */ +typedef union +{ + wsfMsgHdr_t hdr; + l2cApiDataReq_t dataReq; + l2cApiConnectReq_t connectReq; +} l2cCocMsg_t; + +/* Registration control block */ +typedef struct +{ + l2cCocReg_t reg; /* Registration data structure */ + l2cCocCback_t cback; /* Client callback */ + l2cCocRegId_t regId; /* Registration instance ID */ + bool_t inUse; /* TRUE if in use */ +} l2cRegCb_t; + +/* connection control block */ +typedef struct +{ + uint16_t handle; + dmConnId_t connId; + bool_t flowDisabled; +} l2cConnCb_t; + +/* channel control block */ +typedef struct +{ + l2cRegCb_t *pRegCb; /* Pointer to associated registration control block */ + l2cConnCb_t *pConnCb; /* Pointer to associated connection control block */ + wsfTimer_t reqTimer; /* Signaling request timeout timer */ + uint8_t *pTxPkt; /* Pointer to tx packet in progress */ + uint8_t *pRxPkt; /* Pointer to rx packet in progress */ + uint16_t txTotalLen; /* Total length of tx data */ + uint16_t txCurrLen; /* Current length of tx data */ + uint16_t rxTotalLen; /* Total length of rx data */ + uint16_t rxCurrLen; /* Current length of rx data */ + uint16_t psm; + uint16_t peerMps; + uint16_t peerMtu; + uint16_t peerCredits; + uint16_t peerCid; + uint16_t localCredits; + uint16_t localCid; + uint8_t state; + uint8_t role; + uint8_t identifier; +} l2cChanCb_t; + +/* main control block */ +typedef struct +{ + l2cRegCb_t regCb[L2C_COC_REG_MAX]; /* Registration control blocks */ + l2cConnCb_t connCb[DM_CONN_MAX]; /* Connection control blocks */ + l2cChanCb_t chanCb[L2C_COC_CHAN_MAX]; /* Channel control blocks */ + l2cCocAuthorCback_t authorCback; /* Authorization callback */ + wsfHandlerId_t handlerId; /* WSF handler ID */ + uint16_t errTest; /* Status code for error testing */ +} l2cCocCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +l2cCocCb_t l2cCocCb; + +/*************************************************************************************************/ +/*! + * \brief Allocate a registration control block. + * + * \param cback Client callback function. + * \param pReg Registration data. + * + * \return Pointer to control block or NULL if failure. + */ +/*************************************************************************************************/ +l2cRegCb_t *l2cRegCbAlloc(l2cCocCback_t cback, l2cCocReg_t *pReg) +{ + l2cRegCb_t *pCb = l2cCocCb.regCb; + uint8_t i; + + for (i = 0; i < L2C_COC_REG_MAX; i++, pCb++) + { + if (pCb->inUse == FALSE) + { + memcpy(&pCb->reg, pReg, sizeof(l2cCocReg_t)); + pCb->cback = cback; + pCb->regId = i + 1; + pCb->inUse = TRUE; + + /* if MPS is larger than maximum RX PDU length */ + if (pReg->mps > (HciGetMaxRxAclLen() - L2C_HDR_LEN)) + { + l2cCocEvt_t evt; + + evt.hdr.param = 0; + evt.hdr.event = DM_ERROR_IND; + evt.hdr.status = DM_ERR_L2C_RX_PDU_LEN_EXCEEDED; + + (*pCb->cback)(&evt); + } + + L2C_TRACE_INFO1("l2cRegCbAlloc %d", i+1); + + return pCb; + } + } + + DM_TRACE_ERR0("l2cRegCbAlloc failed"); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Find a registration control block accepting the given PSM. + * + * \param psm The PSM. + * + * \return Pointer to control block or NULL if not found. + */ +/*************************************************************************************************/ +l2cRegCb_t *l2cRegCbAccept(dmConnId_t connId, uint16_t psm) +{ + l2cRegCb_t *pRegCb = l2cCocCb.regCb; + uint8_t i; + + /* find acceptor control block with matching psm */ + for (i = 0; i < L2C_COC_REG_MAX; i++, pRegCb++) + { + if (pRegCb->inUse && (pRegCb->reg.role & L2C_COC_ROLE_ACCEPTOR) && (pRegCb->reg.psm == psm)) + { + /* psm found */ + return pRegCb; + } + } + + /* psm not found */ + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Check if peer CID is already allocated to the same psm. + * + * \param connId Connection ID. + * \param peerCid Peer CID. + * \param pRegCb Registration control block. + * + * \return TRUE if peer CID already allocated, otherwise FALSE. + */ +/*************************************************************************************************/ +bool_t l2cCheckPeerCid(dmConnId_t connId, uint16_t peerCid, l2cRegCb_t *pRegCb) +{ + l2cChanCb_t *pChanCb; + uint8_t i; + + /* make sure CID is not already allocated to same psm */ + for (i = 0, pChanCb = l2cCocCb.chanCb; i < L2C_COC_CHAN_MAX; i++, pChanCb++) + { + if ((pChanCb->state != L2C_CHAN_STATE_UNUSED) && (pChanCb->pRegCb == pRegCb) && + (pChanCb->pConnCb->connId == connId) && (pChanCb->role == L2C_COC_ROLE_ACCEPTOR) && + (pChanCb->peerCid == peerCid)) + { + /* peer CID found */ + L2C_TRACE_WARN3("Peer CID in use psm:0x%04x connId:%d peerCid", pRegCb->reg.psm, connId, peerCid); + return TRUE; + } + } + + /* peer CID not found */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Look up a connection control block by connection ID. + * + * \param connId DM Connection ID. + * + * \return Pointer to connection control block. + */ +/*************************************************************************************************/ +l2cConnCb_t *l2cConnCbById(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return &l2cCocCb.connCb[connId-1]; +} + +/*************************************************************************************************/ +/*! + * \brief Get a registration control block by ID. + * + * \param regId Registration ID. + * + * \return Pointer to control block. + */ +/*************************************************************************************************/ +l2cRegCb_t *l2cRegCbById(l2cCocRegId_t regId) +{ + WSF_ASSERT((regId > 0) && (regId <= L2C_COC_REG_MAX)); + + regId--; + return &l2cCocCb.regCb[regId]; +} + +/*************************************************************************************************/ +/*! + * \brief Deallocate a registration control block. + * + * \param regId Registration ID. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cRegCbDealloc(l2cCocRegId_t regId) +{ + WSF_ASSERT((regId > 0) && (regId <= L2C_COC_REG_MAX)); + + regId--; + l2cCocCb.regCb[regId].inUse = FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a registration control block. + * + * \param state Initial channel state, either L2C_CHAN_STATE_CONNECTING or + * L2C_CHAN_STATE_CONNECTED. + * + * \return Pointer to control block or NULL if failure. + */ +/*************************************************************************************************/ +l2cChanCb_t *l2cChanCbAlloc(uint8_t state) +{ + l2cChanCb_t *pCb = l2cCocCb.chanCb; + uint8_t i; + + for (i = 0; i < L2C_COC_CHAN_MAX; i++, pCb++) + { + if (pCb->state == L2C_CHAN_STATE_UNUSED) + { + pCb->state = state; + pCb->reqTimer.msg.param = pCb->localCid = i + L2C_CID_DYN_MIN; + pCb->reqTimer.msg.event = L2C_MSG_COC_REQ_TIMEOUT; + L2C_TRACE_INFO1("l2cChanCbAlloc cid=0x%04x", pCb->localCid); + + return pCb; + } + } + + L2C_TRACE_ERR0("l2cChanCbAlloc failed"); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Get a channel control block by ID. + * + * \param cid Local channel ID. + * + * \return Pointer to control block. + */ +/*************************************************************************************************/ +l2cChanCb_t *l2cChanCbByCid(uint16_t cid) +{ + WSF_ASSERT(cid >= L2C_CID_DYN_MIN && cid < (L2C_CID_DYN_MIN + L2C_COC_CHAN_MAX)); + + return &l2cCocCb.chanCb[cid - L2C_CID_DYN_MIN]; +} + +/*************************************************************************************************/ +/*! + * \brief Get a channel control block with matching CID, checking CID range. + * + * \param cid Local channel ID. + * + * \return Pointer to control block or NULL if not found. + */ +/*************************************************************************************************/ +l2cChanCb_t *l2cChanCbByCidCheck(uint16_t cid) +{ + if (cid >= L2C_CID_DYN_MIN && cid < (L2C_CID_DYN_MIN + L2C_COC_CHAN_MAX)) + { + return &l2cCocCb.chanCb[cid - L2C_CID_DYN_MIN]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Get a channel control block with matching CID and state. + * + * \param cid Local channel ID. + * \param state Channel state; + * + * \return Pointer to control block or NULL if not found. + */ +/*************************************************************************************************/ +l2cChanCb_t *l2cChanCbByCidState(uint16_t cid, uint8_t state) +{ + l2cChanCb_t *pCb; + + if ((pCb = l2cChanCbByCidCheck(cid)) != NULL) + { + if (pCb->state == state) + { + return pCb; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Find a matching channel control block in connecting state. + * + * \param connId Connection ID. + * \param identifier Identifier value in sent connect request. + * + * \return Pointer to control block or NULL if not found. + */ +/*************************************************************************************************/ +l2cChanCb_t *l2cChanCbConnecting(dmConnId_t connId, uint8_t identifier) +{ + l2cChanCb_t *pCb = l2cCocCb.chanCb; + uint8_t i; + + for (i = 0; i < L2C_COC_CHAN_MAX; i++, pCb++) + { + if (pCb->state == L2C_CHAN_STATE_CONNECTING && + pCb->identifier == identifier && + pCb->pConnCb->connId == connId) + { + return pCb; + } + } + + L2C_TRACE_INFO2("l2cChanCbConnecting not found connId=%d identifier=%d", connId, identifier); + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Deallocate a channel control block. + * + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cChanCbDealloc(l2cChanCb_t *pCb) +{ + L2C_TRACE_INFO1("l2cChanCbDealloc cid=0x%04x", pCb->localCid); + + pCb->state = L2C_CHAN_STATE_UNUSED; + WsfTimerStop(&pCb->reqTimer); + if (pCb->pRxPkt != NULL) + { + WsfMsgFree(pCb->pRxPkt); + pCb->pRxPkt = NULL; + } + if (pCb->pTxPkt != NULL) + { + WsfMsgFree(pCb->pTxPkt); + pCb->pTxPkt = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Check security requirements. + * + * \param connId Connection ID. + * \param pRegCb Registration control block. + * + * \return L2C_CONN_SUCCESS if security ok otherwise failure. + */ +/*************************************************************************************************/ +uint16_t l2cCheckSecurity(dmConnId_t connId, l2cRegCb_t *pRegCb) +{ + uint16_t result; + + if (DmConnSecLevel(connId) >= pRegCb->reg.secLevel) + { + if (pRegCb->reg.authoriz) + { + if (l2cCocCb.authorCback != NULL) + { + result = (*l2cCocCb.authorCback)(connId, pRegCb->regId, pRegCb->reg.psm); + } + else + { + result = L2C_CONN_FAIL_AUTHORIZ; + } + } + else + { + result = L2C_CONN_SUCCESS; + } + } + else + { + result = L2C_CONN_FAIL_AUTH; + } + return result; +} + +/*************************************************************************************************/ +/*! + * \brief Execute client callback with connect indication. + * + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cConnectInd(l2cChanCb_t *pChanCb) +{ + l2cCocConnectInd_t connectInd; + + connectInd.hdr.event = L2C_COC_CONNECT_IND; + connectInd.hdr.param = pChanCb->pConnCb->connId; + connectInd.cid = pChanCb->localCid; + connectInd.peerMtu = pChanCb->peerMtu; + connectInd.psm = pChanCb->psm; + (*pChanCb->pRegCb->cback)((l2cCocEvt_t *) &connectInd); +} + +/*************************************************************************************************/ +/*! + * \brief Execute client callback with disconnect indication and deallocate the channel. + * + * \param pChanCb Channel control block. + * \param result Connection result code. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDisconnectIndAndDealloc(l2cChanCb_t *pChanCb, uint16_t result) +{ + l2cCocDisconnectInd_t disconnectInd; + l2cCocCback_t cback = pChanCb->pRegCb->cback; + + disconnectInd.hdr.event = L2C_COC_DISCONNECT_IND; + disconnectInd.hdr.param = pChanCb->pConnCb->connId; + disconnectInd.cid = pChanCb->localCid; + disconnectInd.result = result; + + l2cChanCbDealloc(pChanCb); + + (*cback)((l2cCocEvt_t *) &disconnectInd); +} + +/*************************************************************************************************/ +/*! + * \brief Execute client callback with data confirm. + * + * \param pChanCb Channel control block. + * \param status Data confirm status. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDataCnf(l2cChanCb_t *pChanCb, uint8_t status) +{ + l2cCocDataCnf_t dataCnf; + + dataCnf.hdr.event = L2C_COC_DATA_CNF; + dataCnf.hdr.status = status; + dataCnf.hdr.param = pChanCb->pConnCb->connId; + dataCnf.cid = pChanCb->localCid; + (*pChanCb->pRegCb->cback)((l2cCocEvt_t *) &dataCnf); +} + +/*************************************************************************************************/ +/*! + * \brief Deallocate all channel control block on the given connection. + * + * \param connId DM connection ID. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cChanCbDeallocAll(dmConnId_t connId) +{ + l2cChanCb_t *pCb = l2cCocCb.chanCb; + uint8_t i; + + for (i = 0; i < L2C_COC_CHAN_MAX; i++, pCb++) + { + if (pCb->state != L2C_CHAN_STATE_UNUSED && pCb->pConnCb->connId == connId) + { + l2cDisconnectIndAndDealloc(pCb, L2C_CONN_NONE); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a flow control credit. + * + * \param handle The connection handle. + * \param cid Local CID. + * \param credits Credits. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cSendFlowControlCredit(uint16_t handle, uint16_t cid, uint16_t credits) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_FLOW_CTRL_CREDIT_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_FLOW_CTRL_CREDIT); /* command code */ + UINT8_TO_BSTREAM(p, l2cCb.identifier); /* identifier */ + l2cCb.identifier = L2C_NEXT_ID(l2cCb.identifier); + UINT16_TO_BSTREAM(p, L2C_SIG_FLOW_CTRL_CREDIT_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, cid); /* cid */ + UINT16_TO_BSTREAM(p, credits); /* credit */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_FLOW_CTRL_CREDIT_LEN), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send an LE connection request. + * + * \param handle The connection handle. + * \param psm Remote PSM. + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cSendConnectReq(uint16_t handle, uint16_t psm, l2cChanCb_t *pChanCb) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_LE_CONN_REQ_LEN)) != NULL) + { + uint16_t mps = WSF_MIN(pChanCb->pRegCb->reg.mps, (HciGetMaxRxAclLen() - L2C_HDR_LEN)); + + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_LE_CONNECT_REQ); /* command code */ + UINT8_TO_BSTREAM(p, l2cCb.identifier); /* identifier */ + pChanCb->identifier = l2cCb.identifier; + l2cCb.identifier = L2C_NEXT_ID(l2cCb.identifier); + UINT16_TO_BSTREAM(p, L2C_SIG_LE_CONN_REQ_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, psm); /* psm */ + UINT16_TO_BSTREAM(p, pChanCb->localCid); /* source cid */ + UINT16_TO_BSTREAM(p, pChanCb->pRegCb->reg.mtu); /* mtu */ + UINT16_TO_BSTREAM(p, mps); /* mps */ + UINT16_TO_BSTREAM(p, pChanCb->pRegCb->reg.credits); /* initial credits */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_LE_CONN_REQ_LEN), pPacket); + + /* start timer */ + WsfTimerStartSec(&pChanCb->reqTimer, pL2cCfg->reqTimeout); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send an LE connection response. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param result Connection status result. + * \param pChanCb Channel control block (note: may be NULL). + * + * \return None. + */ +/*************************************************************************************************/ +void l2cSendConnectRsp(uint16_t handle, uint8_t identifier, uint16_t result, l2cChanCb_t *pChanCb) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_LE_CONN_RSP_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_LE_CONNECT_RSP); /* command code */ + UINT8_TO_BSTREAM(p, identifier); /* identifier */ + UINT16_TO_BSTREAM(p, L2C_SIG_LE_CONN_RSP_LEN); /* parameter length */ + if (pChanCb != NULL) + { + uint16_t mps = WSF_MIN(pChanCb->pRegCb->reg.mps, (HciGetMaxRxAclLen() - L2C_HDR_LEN)); + + UINT16_TO_BSTREAM(p, pChanCb->localCid); /* destination cid */ + UINT16_TO_BSTREAM(p, pChanCb->pRegCb->reg.mtu); /* mtu */ + UINT16_TO_BSTREAM(p, mps); /* mps */ + UINT16_TO_BSTREAM(p, pChanCb->pRegCb->reg.credits); /* initial credits */ + } + else + { + UINT16_TO_BSTREAM(p, 0); + UINT16_TO_BSTREAM(p, 0); + UINT16_TO_BSTREAM(p, 0); + UINT16_TO_BSTREAM(p, 0); + } + UINT16_TO_BSTREAM(p, result); /* result */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_LE_CONN_RSP_LEN), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a Disconnect request. + * + * \param handle The connection handle. + * \param destCid Destination (remote) CID. + * \param sourceCid Source (local) CID. + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cSendDisconnectReq(uint16_t handle, uint16_t destCid, uint16_t sourceCid, l2cChanCb_t *pChanCb) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_DISCONN_REQ_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_DISCONNECT_REQ); /* command code */ + UINT8_TO_BSTREAM(p, l2cCb.identifier); /* identifier */ + l2cCb.identifier = L2C_NEXT_ID(l2cCb.identifier); + UINT16_TO_BSTREAM(p, L2C_SIG_DISCONN_REQ_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, destCid); /* destination cid */ + UINT16_TO_BSTREAM(p, sourceCid); /* source cid */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_DISCONN_REQ_LEN), pPacket); + + /* start timer */ + WsfTimerStartSec(&pChanCb->reqTimer, pL2cCfg->reqTimeout); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a Disconnect response. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param destCid Destination (local) CID. + * \param sourceCid Source (remote) CID. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cSendDisconnectRsp(uint16_t handle, uint16_t identifier, uint16_t destCid, + uint16_t sourceCid) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_DISCONN_RSP_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_DISCONNECT_RSP); /* command code */ + UINT8_TO_BSTREAM(p, identifier); /* identifier */ + UINT16_TO_BSTREAM(p, L2C_SIG_DISCONN_RSP_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, destCid); /* destination cid */ + UINT16_TO_BSTREAM(p, sourceCid); /* source cid */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_DISCONN_RSP_LEN), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Disconnect a channel. + * + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDisconnectChannel(l2cChanCb_t *pChanCb) +{ + pChanCb->state = L2C_CHAN_STATE_DISCONNECTING; + + /* send disconnect req */ + l2cSendDisconnectReq(pChanCb->pConnCb->handle, pChanCb->peerCid, pChanCb->localCid, pChanCb); +} + + +/*************************************************************************************************/ +/*! + * \brief L2CAP data reassembly function. + * + * \param pChanCb Channel control block. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet payload. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2CocDataReassemble(l2cChanCb_t *pChanCb, uint16_t len, uint8_t *pPacket) +{ + l2cCocDataInd_t dataInd; + uint16_t sduLen; + + /* sanity check payload length */ + if (len == 0) + { + return; + } + + /* set pointer to start of payload */ + pPacket += L2C_PAYLOAD_START; + + /* reassembly not already in progress? */ + if (pChanCb->pRxPkt == NULL) + { + /* get sdu len */ + BSTREAM_TO_UINT16(sduLen, pPacket); + + /* verify sdu len not greater than our mtu */ + if (sduLen > pChanCb->pRegCb->reg.mtu) + { + /* invalid sdu len; disconnect */ + l2cDisconnectChannel(pChanCb); + + L2C_TRACE_WARN2("sduLen:%d > local mtu:%d", sduLen, pChanCb->pRegCb->reg.mtu); + } + /* check sdu len vs. packet payload len */ + else if ((sduLen + L2C_LE_SDU_HDR_LEN) == len) + { + /* no reassembly required; send directly up to application */ + dataInd.hdr.event = L2C_COC_DATA_IND; + dataInd.hdr.param = pChanCb->pConnCb->connId; + dataInd.cid = pChanCb->localCid; + dataInd.pData = pPacket; + dataInd.dataLen = sduLen; + (*pChanCb->pRegCb->cback)((l2cCocEvt_t *) &dataInd); + } + else if ((sduLen + L2C_LE_SDU_HDR_LEN) > len) + { + /* reassembly required; allocate reassembly buffer */ + if ((pChanCb->pRxPkt = WsfMsgDataAlloc(sduLen, 0)) != NULL) + { + memcpy(pChanCb->pRxPkt, pPacket, (len - L2C_LE_SDU_HDR_LEN)); + pChanCb->rxCurrLen = (len - L2C_LE_SDU_HDR_LEN); + pChanCb->rxTotalLen = sduLen; + + L2C_TRACE_INFO2("reassembling sduLen:%d currLen:%d", sduLen, pChanCb->rxCurrLen); + } + } + else + { + /* invalid sdu len */ + l2cDisconnectChannel(pChanCb); + + L2C_TRACE_WARN2("rx invalid sduLen:%d payload len:%d", sduLen, len); + } + } + /* else reassembly already in progress */ + else + { + /* verify length */ + if ((pChanCb->rxCurrLen + len) <= pChanCb->rxTotalLen) + { + memcpy((pChanCb->pRxPkt + pChanCb->rxCurrLen), pPacket, len); + pChanCb->rxCurrLen += len; + + /* if reassembly complete */ + if (pChanCb->rxCurrLen == pChanCb->rxTotalLen) + { + /* call callback */ + dataInd.hdr.event = L2C_COC_DATA_IND; + dataInd.hdr.param = pChanCb->pConnCb->connId; + dataInd.cid = pChanCb->localCid; + dataInd.pData = pChanCb->pRxPkt; + dataInd.dataLen = pChanCb->rxTotalLen; + (*pChanCb->pRegCb->cback)((l2cCocEvt_t *) &dataInd); + + /* free reassembly buffer */ + WsfMsgFree(pChanCb->pRxPkt); + pChanCb->pRxPkt = NULL; + } + } + /* else too much data sent for this sdu */ + else + { + l2cDisconnectChannel(pChanCb); + + L2C_TRACE_WARN2("too much data currLen:%d payload len:%d", pChanCb->rxCurrLen, len); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Send data and perform segmentation. + * + * \param pChanCb Channel control block. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocSendData(l2cChanCb_t *pChanCb) +{ + uint16_t len; + uint8_t *pBuf; + + L2C_TRACE_INFO3("l2cCocSendData pTxPkt:%x peerCredits:%d flowDisabled:%d", (uint32_t)pChanCb->pTxPkt, pChanCb->peerCredits, pChanCb->pConnCb->flowDisabled); + + /* while we have data and peer credits and flow is not disabled */ + while (pChanCb->pTxPkt != NULL && pChanCb->peerCredits > 0 && !pChanCb->pConnCb->flowDisabled) + { + /* determine next packet length */ + len = (pChanCb->peerMps < (pChanCb->txTotalLen - pChanCb->txCurrLen)) ? + pChanCb->peerMps : (pChanCb->txTotalLen - pChanCb->txCurrLen); + + /* allocate a buffer */ + if ((pBuf = l2cMsgAlloc(len + L2C_PAYLOAD_START)) != NULL) + { + /* copy next segment of data to buffer */ + memcpy((pBuf + L2C_PAYLOAD_START), + (pChanCb->pTxPkt + L2C_PAYLOAD_START + pChanCb->txCurrLen), len); + pChanCb->txCurrLen += len; + + /* decrement credits */ + pChanCb->peerCredits--; + + /* send packet */ + L2cDataReq(pChanCb->peerCid, pChanCb->pConnCb->handle, len, pBuf); + + /* if this was the last segment free stored tx buffer and call callback */ + if (pChanCb->txCurrLen == pChanCb->txTotalLen) + { + WsfMsgFree(pChanCb->pTxPkt); + pChanCb->pTxPkt = NULL; + l2cDataCnf(pChanCb, L2C_COC_DATA_SUCCESS); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a flow control credit message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cProcFlowControlCredit(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + uint16_t cid; + uint16_t credits; + + /* parse parameters */ + BSTREAM_TO_UINT16(cid, pPacket); + BSTREAM_TO_UINT16(credits, pPacket); + + if ((pChanCb = l2cChanCbByCidState(cid, L2C_CHAN_STATE_CONNECTED)) != NULL) + { + if (credits != 0) + { + /* check credits for overflow */ + if (((uint32_t)(credits) + (uint32_t) pChanCb->peerCredits) <= L2C_CREDITS_MAX) + { + pChanCb->peerCredits += credits; + + /* send any pending data */ + l2cCocSendData(pChanCb); + } + /* else disconnect if credit overflow */ + else + { + l2cDisconnectChannel(pChanCb); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a connect request message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cProcLeConnectReq(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cRegCb_t *pRegCb; + l2cChanCb_t *pChanCb = NULL; + uint16_t cid; + uint16_t psm; + uint16_t mps; + uint16_t mtu; + uint16_t credits; + uint16_t result; + dmConnId_t connId; + + /* parse parameters */ + BSTREAM_TO_UINT16(psm, pPacket); + BSTREAM_TO_UINT16(cid, pPacket); + BSTREAM_TO_UINT16(mtu, pPacket); + BSTREAM_TO_UINT16(mps, pPacket); + BSTREAM_TO_UINT16(credits, pPacket); + + /* get conn ID for handle */ + if ((connId = DmConnIdByHandle(handle)) == DM_CONN_ID_NONE) + { + return; + } + + /* verify parameters */ + //TBD + //if fail send command reject, return + + /* check for error test mode */ + if (l2cCocCb.errTest != L2C_CONN_SUCCESS) + { + result = l2cCocCb.errTest; + } + /* registered to accept connections on this psm? */ + else if ((pRegCb = l2cRegCbAccept(connId, psm)) != NULL) + { + /* check if peer CID already allocated to this psm */ + if (!l2cCheckPeerCid(connId, cid, pRegCb)) + { + /* check security level */ + if ((result = l2cCheckSecurity(connId, pRegCb)) == L2C_CONN_SUCCESS) + { + /* allocate channel */ + if ((pChanCb = l2cChanCbAlloc(L2C_CHAN_STATE_CONNECTED)) != NULL) + { + /* initialize control block */ + pChanCb->pRegCb = pRegCb; + pChanCb->pConnCb = l2cConnCbById(connId); + pChanCb->psm = psm; + pChanCb->peerMps = mps; + pChanCb->peerMtu = mtu; + pChanCb->peerCredits = credits; + pChanCb->peerCid = cid; + pChanCb->localCredits = pChanCb->pRegCb->reg.credits; + pChanCb->role = L2C_COC_ROLE_ACCEPTOR; + result = L2C_CONN_SUCCESS; + } + else + { + /* channel allocation failed */ + result = L2C_CONN_FAIL_RES; + } + } + } + else + { + /* peer CID already allocated to this psm */ + result = L2C_CONN_FAIL_ALLOCATED_SCID; + } + } + else + { + /* not registered on this psm */ + result = L2C_CONN_FAIL_PSM; + } + + /* send connection response */ + l2cSendConnectRsp(handle, identifier, result, pChanCb); + + /* if successful call client callback */ + if (result == L2C_CONN_SUCCESS) + { + l2cConnectInd(pChanCb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a connect response message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cProcLeConnectRsp(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + uint16_t cid; + uint16_t mps; + uint16_t mtu; + uint16_t credits; + uint16_t result; + dmConnId_t connId; + + /* parse parameters */ + BSTREAM_TO_UINT16(cid, pPacket); + BSTREAM_TO_UINT16(mtu, pPacket); + BSTREAM_TO_UINT16(mps, pPacket); + BSTREAM_TO_UINT16(credits, pPacket); + BSTREAM_TO_UINT16(result, pPacket); + + /* get conn ID for handle */ + if ((connId = DmConnIdByHandle(handle)) == DM_CONN_ID_NONE) + { + return; + } + + /* verify parameters */ + // TBD + // If fail ignore + + /* any channels waiting for connection response on this handle? */ + if ((pChanCb = l2cChanCbConnecting(connId, identifier)) != NULL) + { + if (result == L2C_CONN_SUCCESS) + { + /* yes; we are connected */ + pChanCb->state = L2C_CHAN_STATE_CONNECTED; + + /* stop timer */ + WsfTimerStop(&pChanCb->reqTimer); + + /* store parameters */ + pChanCb->peerMps = (mps < pChanCb->pRegCb->reg.mps) ? mps : pChanCb->pRegCb->reg.mps; + pChanCb->peerMtu = mtu; + pChanCb->peerCredits = credits; + pChanCb->localCredits = pChanCb->pRegCb->reg.credits; + pChanCb->peerCid = cid; + + /* call client callback */ + l2cConnectInd(pChanCb); + } + else + { + /* connection failed, call client callback with disconnect */ + l2cDisconnectIndAndDealloc(pChanCb, result); + } + } + else + { + L2C_TRACE_INFO2("LeConnectRsp for unknown peerCid=0x%04x connId=%d", cid, connId); + } + + // tbd consider case of api disconnect req before receive connect rsp +} + +/*************************************************************************************************/ +/*! + * \brief Process a disconnect request message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cProcDisconnectReq(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + uint16_t destCid; + uint16_t sourceCid; + + /* parse parameters */ + BSTREAM_TO_UINT16(destCid, pPacket); + BSTREAM_TO_UINT16(sourceCid, pPacket); + + if ((pChanCb = l2cChanCbByCidCheck(destCid)) != NULL) + { + if ((pChanCb->peerCid == sourceCid) && + ((pChanCb->state == L2C_CHAN_STATE_CONNECTED) || + (pChanCb->state == L2C_CHAN_STATE_DISCONNECTING))) + { + /* send disconnect response */ + l2cSendDisconnectRsp(handle, identifier, destCid, sourceCid); + + /* execute client callback */ + l2cDisconnectIndAndDealloc(pChanCb, L2C_CONN_NONE); + } + } + else + { + /* no matching local cid found; send command reject */ + //tbd add CID parameters + l2cSendCmdReject(handle, identifier, L2C_REJ_INVALID_CID); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a disconnect response message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cProcDisconnectRsp(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + uint16_t sourceCid; + + /* parse parameters */ + pPacket += 2; + BSTREAM_TO_UINT16(sourceCid, pPacket); + + if ((pChanCb = l2cChanCbByCidState(sourceCid, L2C_CHAN_STATE_DISCONNECTING)) != NULL) + { + /* stop timer */ + WsfTimerStop(&pChanCb->reqTimer); + + /* execute client callback */ + l2cDisconnectIndAndDealloc(pChanCb, L2C_CONN_NONE); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a command reject message from peer. + * + * \param handle The connection handle. + * \param identifier Identifier value in received request. + * \param pPacket Packet data. + * + * \return TRUE if command reject processed, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t l2cProcCommandRej(uint16_t handle, uint8_t identifier, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + dmConnId_t connId; + + /* get conn ID for handle */ + if ((connId = DmConnIdByHandle(handle)) != DM_CONN_ID_NONE) + { + /* any channels waiting for connection response on this handle? */ + if ((pChanCb = l2cChanCbConnecting(connId, identifier)) != NULL) + { + /* connection failed, call client callback with disconnect */ + l2cDisconnectIndAndDealloc(pChanCb, L2C_CONN_NONE); + return TRUE; + } + } + + /* otherwise command reject not processed here */ + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Manage local credits. + * + * \param pChanCb Channel control block. + * + * \return TRUE if successful, FALSE if received packet cannot be processed. + */ +/*************************************************************************************************/ +static bool_t l2CocManageLocalCredits(l2cChanCb_t *pChanCb) +{ + /* if we have credits */ + if (pChanCb->localCredits > 0) + { + /* decrement credit count */ + pChanCb->localCredits--; + + /* if below threshold send a credit update */ + if (pChanCb->localCredits == 0 && pChanCb->pRegCb->reg.credits > 0) + { + pChanCb->localCredits = pChanCb->pRegCb->reg.credits; + + l2cSendFlowControlCredit(pChanCb->pConnCb->handle, pChanCb->localCid, pChanCb->localCredits); + } + return TRUE; + } + /* else we received a packet at zero credits; disconnect */ + else + { + l2cDisconnectChannel(pChanCb); + return FALSE; + } +} + +/*************************************************************************************************/ +/*! + * \brief L2CAP data callback function. + * + * \param handle The connection handle. + * \param cid The L2CAP connection ID. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet payload. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocDataCidCback(uint16_t handle, uint16_t cid, uint16_t len, uint8_t *pPacket) +{ + l2cChanCb_t *pChanCb; + + /* look for matching CID in connected state */ + if ((pChanCb = l2cChanCbByCidState(cid, L2C_CHAN_STATE_CONNECTED)) != NULL) + { + /* manage credits */ + if (l2CocManageLocalCredits(pChanCb)) + { + /* reassemble */ + l2CocDataReassemble(pChanCb, len, pPacket); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief L2CAP signaling packet callback. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cCocSignalingCback(uint16_t handle, uint16_t l2cLen, uint8_t *pPacket) +{ + uint8_t code; + uint8_t id; + uint16_t len; + uint8_t *p = pPacket; + + /* parse code, len, and identifier */ + p += L2C_PAYLOAD_START; + BSTREAM_TO_UINT8(code, p); + BSTREAM_TO_UINT8(id, p); + BSTREAM_TO_UINT16(len, p); + + /* verify signaling length vs. l2c length */ + if (l2cLen != (len + L2C_SIG_HDR_LEN)) + { + L2C_TRACE_WARN3("invalid msg code:%d len:%d l2cLen:%d", code, len, l2cLen); + + /* reject command */ + l2cSendCmdReject(handle, id, L2C_REJ_NOT_UNDERSTOOD); + return; + } + + + /* if flow control credit */ + if ((code == L2C_SIG_FLOW_CTRL_CREDIT) && (len == L2C_SIG_FLOW_CTRL_CREDIT_LEN)) + { + l2cProcFlowControlCredit(handle, id, p); + } + /* if connection request */ + else if ((code == L2C_SIG_LE_CONNECT_REQ) && (len == L2C_SIG_LE_CONN_REQ_LEN)) + { + l2cProcLeConnectReq(handle, id, p); + } + /* if connection response */ + else if ((code == L2C_SIG_LE_CONNECT_RSP) && (len == L2C_SIG_LE_CONN_RSP_LEN)) + { + l2cProcLeConnectRsp(handle, id, p); + } + /* if disconnection request */ + else if ((code == L2C_SIG_DISCONNECT_REQ) && (len == L2C_SIG_DISCONN_REQ_LEN)) + { + l2cProcDisconnectReq(handle, id, p); + } + /* if disconnection response */ + else if ((code == L2C_SIG_DISCONNECT_RSP) && (len == L2C_SIG_DISCONN_RSP_LEN)) + { + l2cProcDisconnectRsp(handle, id, p); + } + /* if command reject */ + else if ((code == L2C_SIG_CMD_REJ) && (len >= L2C_SIG_CMD_REJ_LEN)) + { + if (!l2cProcCommandRej(handle, id, p)) + { + /* pass to main signaling packet processing function if reject not handled */ + l2cRxSignalingPkt(handle, l2cLen, pPacket); + } + } + /* else pass to main signaling packet processing function */ + else + { + l2cRxSignalingPkt(handle, l2cLen, pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Default L2CAP control callback. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocCtrlCback(wsfMsgHdr_t *pMsg) +{ + l2cConnCb_t *pConnCb = l2cConnCbById((dmConnId_t) pMsg->param); + + /* store flow control state */ + pConnCb->flowDisabled = (pMsg->event == L2C_CTRL_FLOW_DISABLE_IND); + + /* if flow enabled */ + if (!pConnCb->flowDisabled) + { + /* check for pending data to be sent on this connection */ + //tbd + } +} + +/*************************************************************************************************/ +/*! + * \brief DM connection callback for L2CAP. + * + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocDmConnCback(dmEvt_t *pDmEvt) +{ + l2cConnCb_t *pConnCb = l2cConnCbById((dmConnId_t) pDmEvt->hdr.param); + + /* if new connection created */ + if (pDmEvt->hdr.event == DM_CONN_OPEN_IND) + { + /* initialize connection control block */ + pConnCb->connId = (dmConnId_t) pDmEvt->hdr.param; + pConnCb->handle = pDmEvt->connOpen.handle; + pConnCb->flowDisabled = FALSE; + } + /* else if connection closed */ + else if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* disconnect all channels on this connection */ + l2cChanCbDeallocAll(pConnCb->connId); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a data request message from API. + * + * \param pMsg Message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocApiDataReq(l2cCocMsg_t *pMsg) +{ + l2cChanCb_t *pChanCb = l2cChanCbByCid(pMsg->dataReq.localCid); + + L2C_TRACE_INFO2("l2cCocApiDataReq sduLen:%d peerMps:%d", pMsg->dataReq.sduLen, pChanCb->peerMps); + + /* if channel connected */ + if (pChanCb->state == L2C_CHAN_STATE_CONNECTED) + { + //tbd verify application didn't exceed peer mtu + + /* if no packet already on deck */ + if (pChanCb->pTxPkt == NULL) + { + /* if length does not exceed MPS and we have peer credits */ + if (((pMsg->dataReq.sduLen + L2C_LE_SDU_HDR_LEN) <= pChanCb->peerMps) && + (pChanCb->peerCredits > 0) && !pChanCb->pConnCb->flowDisabled) + { + /* decrement credits */ + pChanCb->peerCredits--; + + /* send packet now */ + L2cDataReq(pChanCb->peerCid, pChanCb->pConnCb->handle, + pMsg->dataReq.sduLen + L2C_LE_SDU_HDR_LEN, pMsg->dataReq.pPacket); + + /* call callback */ + l2cDataCnf(pChanCb, L2C_COC_DATA_SUCCESS); + } + else + { + /* set up packet to be sent */ + pChanCb->pTxPkt = pMsg->dataReq.pPacket; + pChanCb->txTotalLen = pMsg->dataReq.sduLen + L2C_LE_SDU_HDR_LEN; + pChanCb->txCurrLen = 0; + l2cCocSendData(pChanCb); + } + } + else + { + /* else transaction overflow; discard packet */ + WsfMsgFree(pMsg->dataReq.pPacket); + + /* call callback with failure status */ + l2cDataCnf(pChanCb, L2C_COC_DATA_ERR_OVERFLOW); + } + } + else + { + /* channel closed; discard packet */ + WsfMsgFree(pMsg->dataReq.pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a Connect request message from API. + * + * \param pMsg Message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocApiConnectReq(l2cCocMsg_t *pMsg) +{ + l2cChanCb_t *pChanCb = l2cChanCbByCid(pMsg->connectReq.localCid); + + /* verify still in connecting state (link could have been disconnected) */ + if (pChanCb->state == L2C_CHAN_STATE_CONNECTING) + { + pChanCb->role = L2C_COC_ROLE_INITIATOR; + pChanCb->psm = pMsg->connectReq.remotePsm; + + /* send connect req */ + l2cSendConnectReq(pChanCb->pConnCb->handle, pChanCb->psm, pChanCb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a Connect request message from API. + * + * \param pMsg Message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocApiDisconnectReq(l2cCocMsg_t *pMsg) +{ + l2cChanCb_t *pChanCb = l2cChanCbByCid(pMsg->hdr.param); + + /* if in connected state */ + if (pChanCb->state == L2C_CHAN_STATE_CONNECTED) + { + l2cDisconnectChannel(pChanCb); + } + /* else if in connecting state */ + else if (pChanCb->state == L2C_CHAN_STATE_CONNECTING) + { + // tbd consider api disconnect req in this state + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a request timeout. + * + * \param pMsg Message buffer. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cCocReqTimeout(wsfMsgHdr_t *pMsg) +{ + l2cChanCb_t *pChanCb = l2cChanCbByCid(pMsg->param); + + /* if still connecting or disconnecting */ + if (pChanCb->state == L2C_CHAN_STATE_CONNECTING || + pChanCb->state == L2C_CHAN_STATE_DISCONNECTING) + { + /* deallocate channel and call client callback */ + l2cDisconnectIndAndDealloc(pChanCb, L2C_CONN_FAIL_TIMEOUT); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize L2C connection oriented channel subsystem. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocInit(void) +{ + l2cCb.l2cSignalingCback = l2cCocSignalingCback; + l2cCb.l2cCocCtrlCback = l2cCocCtrlCback; + l2cCb.l2cDataCidCback = l2cCocDataCidCback; + + /* Register with DM */ + DmConnRegister(DM_CLIENT_ID_L2C, l2cCocDmConnCback); +} + +/*************************************************************************************************/ +/*! + * \brief Event handler initialization function for L2C with connection oriented channels. + * + * \param handlerId ID for this event handler. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocHandlerInit(wsfHandlerId_t handlerId) +{ + l2cCocCb.handlerId = handlerId; +} + +/*************************************************************************************************/ +/*! + * \brief The WSF event handler for L2C with connection oriented channels. + * + * \param event Event mask. + * \param pMsg Pointer to message. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + /* Handle message */ + if (pMsg != NULL) + { + switch(pMsg->event) + { + case L2C_MSG_API_DATA_REQ: + l2cCocApiDataReq((l2cCocMsg_t *) pMsg); + break; + + case L2C_MSG_API_CONNECT_REQ: + l2cCocApiConnectReq((l2cCocMsg_t *) pMsg); + break; + + case L2C_MSG_API_DISCONNECT_REQ: + l2cCocApiDisconnectReq((l2cCocMsg_t *) pMsg); + break; + + case L2C_MSG_COC_REQ_TIMEOUT: + l2cCocReqTimeout(pMsg); + break; + + default: + break; + } + } + /* Handle events */ + else if (event) + { + + } +} + +/*************************************************************************************************/ +/*! + * \brief Register to use a connection oriented channel, as either a channel acceptor, + * initiator, or both. If registering as channel acceptor then the PSM is specified. + * After registering, a connection can be established by the client using this + * registration instance. + * + * \param cback Client callback function. + * \param pReg Registration parameter structure. + * + * \return Registration instance ID or L2C_COC_REG_ID_NONE if registration failed. + */ +/*************************************************************************************************/ +l2cCocRegId_t L2cCocRegister(l2cCocCback_t cback, l2cCocReg_t *pReg) +{ + l2cRegCb_t *pRegCb; + + WSF_ASSERT(cback != NULL); + + WsfTaskLock(); + pRegCb = l2cRegCbAlloc(cback, pReg); + WsfTaskUnlock(); + + if (pRegCb != NULL) + { + return pRegCb->regId; + } + + return L2C_COC_REG_ID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Deregister and deallocate a connection oriented channel registration instance. + * This function should only be called if there are no active channels using this + * registration instance. + * + * \param regId Registration instance ID. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocDeregister(l2cCocRegId_t regId) +{ + //check for active channels? + //tbd + + WsfTaskLock(); + l2cRegCbDealloc(regId); + WsfTaskUnlock(); +} + +/*************************************************************************************************/ +/*! + * \brief Initiate a connection to the given peer PSM. + * + * \param connId DM connection ID. + * \param regId The associated registration instance. + * \param psm Peer PSM. + * + * \return Local CID or L2C_COC_CID_NONE none if failure. + */ +/*************************************************************************************************/ +uint16_t L2cCocConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm) +{ + l2cChanCb_t *pChanCb = NULL; + l2cRegCb_t *pRegCb; + l2cApiConnectReq_t *pMsg; + + /* verify registration instance and allocate channel */ + WsfTaskLock(); + pRegCb = l2cRegCbById(regId); + if (pRegCb->inUse && (pRegCb->reg.role & L2C_COC_ROLE_INITIATOR) && connId != DM_CONN_ID_NONE) + { + if ((pChanCb = l2cChanCbAlloc(L2C_CHAN_STATE_CONNECTING)) != NULL) + { + pChanCb->pRegCb = pRegCb; + pChanCb->pConnCb = l2cConnCbById(connId); + } + } + WsfTaskUnlock(); + + if (pChanCb != NULL) + { + if ((pMsg = WsfMsgAlloc(sizeof(l2cApiConnectReq_t))) != NULL) + { + pMsg->hdr.param = connId; + pMsg->hdr.event = L2C_MSG_API_CONNECT_REQ; + pMsg->localCid = pChanCb->localCid; + pMsg->remotePsm = psm; + WsfMsgSend(l2cCocCb.handlerId, pMsg); + + return pChanCb->localCid; + } + else + { + WsfTaskLock(); + l2cChanCbDealloc(pChanCb); + WsfTaskUnlock(); + } + } + + return L2C_COC_CID_NONE; +} + +/*************************************************************************************************/ +/*! + * \brief Disconnect the channel for the given CID. + * + * \param cid Channel ID. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocDisconnectReq(uint16_t cid) +{ + wsfMsgHdr_t *pMsg; + + /* allocate message buffer */ + if ((pMsg = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + /* send message */ + pMsg->event = L2C_MSG_API_DISCONNECT_REQ; + pMsg->param = cid; + WsfMsgSend(l2cCocCb.handlerId, pMsg); + } +} + + +/*************************************************************************************************/ +/*! + * \brief Send an L2CAP data packet on the given connection oriented CID. + * + * \param cid The local channel identifier. + * \param len The length of the payload data in pPacket. + * \param pPacket Packet payload data. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocDataReq(uint16_t cid, uint16_t len, uint8_t *pPayload) +{ + l2cApiDataReq_t *pMsg; + uint8_t *pPkt; + uint8_t *p; + + /* allocate packet buffer */ + if ((pPkt = l2cMsgAlloc(L2C_LE_SDU_PKT_BASE_LEN + len)) != NULL) + { + /* allocate message buffer */ + if ((pMsg = WsfMsgAlloc(sizeof(l2cApiDataReq_t))) != NULL) + { + /* copy length and packet data to packet buffer */ + p = (uint8_t *) pPkt + L2C_PAYLOAD_START; + UINT16_TO_BSTREAM(p, len); + memcpy(p, pPayload, len); + + /* copy message parameters */ + pMsg->pPacket = pPkt; + pMsg->localCid = cid; + pMsg->sduLen = len; + + /* send message */ + pMsg->hdr.event = L2C_MSG_API_DATA_REQ; + WsfMsgSend(l2cCocCb.handlerId, pMsg); + } + else + { + /* allocation failed; free packet buffer */ + WsfMsgFree(pPkt); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief For testing purposes only. + * + * \param result Result code + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocErrorTest(uint16_t result) +{ + l2cCocCb.errTest = result; +} + +/*************************************************************************************************/ +/*! + * \brief For testing purposes only. + * + * \param cid The local channel identifier. + * \param credits Credits to send. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cCocCreditSendTest(uint16_t cid, uint16_t credits) +{ + l2cChanCb_t *pChanCb; + + WsfTaskLock(); + pChanCb = l2cChanCbByCid(cid); + pChanCb->localCredits += credits; + l2cSendFlowControlCredit(pChanCb->pConnCb->handle, cid, credits); + WsfTaskUnlock(); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.c new file mode 100644 index 0000000000000000000000000000000000000000..ccc00083fc99117d4d062919520743c02a8b6ee5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.c @@ -0,0 +1,349 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP main module. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "l2c_api.h" +#include "l2c_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* Control block */ +l2cCb_t l2cCb; + +/*************************************************************************************************/ +/*! + * \brief Default callback function for unregistered CID. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDefaultDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + L2C_TRACE_WARN0("rcvd data on uregistered cid"); +} + +/*************************************************************************************************/ +/*! + * \brief Default callback function for unregistered CID. + * + * \param handle The connection handle. + * \param cid The L2CAP connection ID. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDefaultDataCidCback(uint16_t handle, uint16_t cid, uint16_t len, uint8_t *pPacket) +{ + L2C_TRACE_WARN1("unknown cid=0x%04x", cid); +} + +/*************************************************************************************************/ +/*! + * \brief Default L2CAP control callback function. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cDefaultCtrlCback(wsfMsgHdr_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Process received L2CAP signaling packets. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cRxSignalingPkt(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t role; + dmConnId_t connId; + + if ((connId = DmConnIdByHandle(handle)) == DM_CONN_ID_NONE) + { + return; + } + + role = DmConnRole(connId); + + if ((role == DM_ROLE_MASTER) && (l2cCb.masterRxSignalingPkt != NULL)) + { + (*l2cCb.masterRxSignalingPkt)(handle, len, pPacket); + } + else if ((role == DM_ROLE_SLAVE) && (l2cCb.slaveRxSignalingPkt != NULL)) + { + (*l2cCb.slaveRxSignalingPkt)(handle, len, pPacket); + } + else + { + L2C_TRACE_ERR1("Invalid role configuration: role=%d", role); + } +} + +/*************************************************************************************************/ +/*! + * \brief HCI ACL data callback function. + * + * \param pPacket A buffer containing an ACL packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cHciAclCback(uint8_t *pPacket) +{ + uint16_t handle; + uint16_t hciLen; + uint16_t cid; + uint16_t l2cLen; + uint8_t *p = pPacket; + + /* parse HCI handle and length */ + BSTREAM_TO_UINT16(handle, p); + handle &= HCI_HANDLE_MASK; + BSTREAM_TO_UINT16(hciLen, p); + + /* parse L2CAP length */ + if (hciLen >= L2C_HDR_LEN) + { + BSTREAM_TO_UINT16(l2cLen, p); + } + else + { + l2cLen = 0; + } + + /* verify L2CAP length vs HCI length */ + if (hciLen == (l2cLen + L2C_HDR_LEN)) + { + /* parse CID */ + BSTREAM_TO_UINT16(cid, p); + + switch (cid) + { + case L2C_CID_LE_SIGNALING: + (*l2cCb.l2cSignalingCback)(handle, l2cLen, pPacket); + break; + + case L2C_CID_ATT: + (*l2cCb.attDataCback)(handle, l2cLen, pPacket); + break; + + case L2C_CID_SMP: + (*l2cCb.smpDataCback)(handle, l2cLen, pPacket); + break; + + default: + (*l2cCb.l2cDataCidCback)(handle, cid, l2cLen, pPacket); + break; + } + } + /* else length mismatch */ + else + { + L2C_TRACE_WARN2("length mismatch: l2c=%u hci=%u", l2cLen, hciLen); + } + + /* deallocate buffer */ + WsfMsgFree(pPacket); +} + +/*************************************************************************************************/ +/*! + * \brief HCI flow control callback function. + * + * \param handle The connection handle. + * \param flowDisabled TRUE if data flow is disabled. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cHciFlowCback(uint16_t handle, bool_t flowDisabled) +{ + wsfMsgHdr_t hdr; + + L2C_TRACE_INFO2("flowDisabled=%u handle=%u", flowDisabled, handle); + + /* get conn ID for handle */ + if ((hdr.param = DmConnIdByHandle(handle)) != DM_CONN_ID_NONE) + { + /* execute higher layer flow control callbacks */ + hdr.event = flowDisabled; + (*l2cCb.attCtrlCback)(&hdr); + hdr.event = flowDisabled; + (*l2cCb.smpCtrlCback)(&hdr); + + /* execute connection oriented channel flow control callback */ + hdr.event = flowDisabled; + (*l2cCb.l2cCocCtrlCback)(&hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a command reject message with reason "not understood". + * + * \param handle The connection handle. + * \param identifier Identifier value in received message being rejected. + * \param reason Why request was rejected. + * + * \return None. + */ +/*************************************************************************************************/ +void l2cSendCmdReject(uint16_t handle, uint8_t identifier, uint16_t reason) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_CMD_REJ_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_CMD_REJ); /* command code */ + UINT8_TO_BSTREAM(p, identifier); /* identifier */ + UINT16_TO_BSTREAM(p, L2C_SIG_CMD_REJ_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, reason); /* reason */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_CMD_REJ_LEN), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an L2CAP data message buffer to be used for the L2CAP protocol messages. + * + * \param len Message length in bytes. + * + * \return Pointer to data message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *l2cMsgAlloc(uint16_t len) +{ + return WsfMsgDataAlloc(len, HCI_TX_DATA_TAILROOM); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize L2C subsystem. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cInit(void) +{ + /* Initialize control block */ + l2cCb.attDataCback = l2cDefaultDataCback; + l2cCb.smpDataCback = l2cDefaultDataCback; + l2cCb.l2cSignalingCback = l2cRxSignalingPkt; + l2cCb.attCtrlCback = l2cDefaultCtrlCback; + l2cCb.smpCtrlCback = l2cDefaultCtrlCback; + l2cCb.l2cCocCtrlCback = l2cDefaultCtrlCback; + l2cCb.l2cDataCidCback = l2cDefaultDataCidCback; + l2cCb.identifier = 1; + + /* Register with HCI */ + HciAclRegister(l2cHciAclCback, l2cHciFlowCback); +} + +/*************************************************************************************************/ +/*! + * \brief called by the L2C client, such as ATT or SMP, to register for the given CID. + * + * \param cid channel identifier. + * \param dataCback Callback function for L2CAP data received for this CID. + * \param ctrlCback Callback function for control events for this CID. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cRegister(uint16_t cid, l2cDataCback_t dataCback, l2cCtrlCback_t ctrlCback) +{ + WSF_ASSERT((cid == L2C_CID_ATT) || (cid == L2C_CID_SMP)); + + /* store the callbacks */ + if (cid == L2C_CID_ATT) + { + /* registering for attribute protocol */ + l2cCb.attDataCback = dataCback; + l2cCb.attCtrlCback = ctrlCback; + } + else + { + /* registering for security manager protocol */ + l2cCb.smpDataCback = dataCback; + l2cCb.smpCtrlCback = ctrlCback; + } +} + +/*************************************************************************************************/ +/*! + * \brief Send an L2CAP data packet on the given CID. + * + * \param cid The channel identifier. + * \param handle The connection handle. The client receives this handle from DM. + * \param len The length of the payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t *p = pPacket; + + /* Set HCI header */ + UINT16_TO_BSTREAM(p, handle); + UINT16_TO_BSTREAM(p, (len + L2C_HDR_LEN)); + + /* Set L2CAP header */ + UINT16_TO_BSTREAM(p, len); + UINT16_TO_BSTREAM(p, cid); + + /* Send to HCI */ + HciSendAclData(pPacket); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.h new file mode 100644 index 0000000000000000000000000000000000000000..b36baf00aebeb1c36001b132d2f6c75c0cabca39 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_main.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP main module. + */ +/*************************************************************************************************/ +#ifndef L2C_MAIN_H +#define L2C_MAIN_H + +#include "l2c_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Return the next L2CAP signaling req identifier. Cannot be zero. */ +#define L2C_NEXT_ID(id) (((id) == 255) ? (1) : ((id) + 1)) + +/* L2C event handler message types */ +#define L2C_MSG_REQ_TIMEOUT 1 /* L2CAP slave signaling request timeout */ +#define L2C_MSG_TYPE_MAX 1 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data callback with CID */ +typedef void (*l2cDataCidCback_t)(uint16_t handle, uint16_t cid, uint16_t len, uint8_t *pPacket); + +/* Main control block of the L2C subsystem */ +typedef struct +{ + l2cDataCback_t attDataCback; /* Data callback for ATT */ + l2cDataCback_t smpDataCback; /* Data callback for SMP */ + l2cDataCback_t l2cSignalingCback; /* Data callback for L2CAP signaling */ + l2cCtrlCback_t attCtrlCback; /* Control callback for ATT */ + l2cCtrlCback_t smpCtrlCback; /* Control callback for SMP */ + l2cCtrlCback_t l2cCocCtrlCback; /* Control callback for L2CAP connection oriented channels */ + l2cDataCback_t masterRxSignalingPkt; /* Master signaling packet processing function */ + l2cDataCback_t slaveRxSignalingPkt; /* Slave signaling packet processing function */ + l2cDataCidCback_t l2cDataCidCback; /* Data callback for L2CAP on other CIDs */ + uint8_t identifier; /* Signaling request identifier */ +} l2cCb_t; + +/************************************************************************************************** + Function Prototypes +**************************************************************************************************/ + +void l2cSendCmdReject(uint16_t handle, uint8_t identifier, uint16_t reason); +void l2cRxSignalingPkt(uint16_t handle, uint16_t len, uint8_t *pPacket); +void *l2cMsgAlloc(uint16_t len); + +/* Control block */ +extern l2cCb_t l2cCb; + +#ifdef __cplusplus +}; +#endif + +#endif /* L2C_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_master.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_master.c new file mode 100644 index 0000000000000000000000000000000000000000..8b8a9fb707c109b55bc4b16287ea4024ac996fdf --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_master.c @@ -0,0 +1,145 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP module for master operations. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "l2c_api.h" +#include "l2c_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Master processing of received L2CAP signaling packets. + * + * \param handle The connection handle. + * \param l2cLen The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cMasterRxSignalingPkt(uint16_t handle, uint16_t l2cLen, uint8_t *pPacket) +{ + uint8_t code; + uint8_t id; + uint16_t len; + hciConnSpec_t connSpec; + + /* parse code, len, and identifier */ + pPacket += L2C_PAYLOAD_START; + BSTREAM_TO_UINT8(code, pPacket); + BSTREAM_TO_UINT8(id, pPacket); + BSTREAM_TO_UINT16(len, pPacket); + + /* verify signaling length vs. l2c length + * verify this is a conn param update rsp + * verify parameter length + */ + if ((l2cLen != (len + L2C_SIG_HDR_LEN)) || + (code != L2C_SIG_CONN_UPDATE_REQ) || + (len != L2C_SIG_CONN_UPDATE_REQ_LEN)) + { + L2C_TRACE_WARN3("invalid msg code:%d len:%d l2cLen:%d", code, len, l2cLen); + + /* reject all unknown or invalid commands except command reject. */ + if (code != L2C_SIG_CMD_REJ) + { + l2cSendCmdReject(handle, id, L2C_REJ_NOT_UNDERSTOOD); + } + + return; + } + + /* parse parameters */ + BSTREAM_TO_UINT16(connSpec.connIntervalMin, pPacket); + BSTREAM_TO_UINT16(connSpec.connIntervalMax, pPacket); + BSTREAM_TO_UINT16(connSpec.connLatency, pPacket); + BSTREAM_TO_UINT16(connSpec.supTimeout, pPacket); + connSpec.minCeLen = 0; + connSpec.maxCeLen = 0; + + /* check parameter range */ + if ((connSpec.connIntervalMin < HCI_CONN_INTERVAL_MIN) || + (connSpec.connIntervalMin > HCI_CONN_INTERVAL_MAX) || + (connSpec.connIntervalMin > connSpec.connIntervalMax) || + (connSpec.connIntervalMax < HCI_CONN_INTERVAL_MIN) || + (connSpec.connIntervalMax > HCI_CONN_INTERVAL_MAX) || + (connSpec.connLatency > HCI_CONN_LATENCY_MAX) || + (connSpec.supTimeout < HCI_SUP_TIMEOUT_MIN) || + (connSpec.supTimeout > HCI_SUP_TIMEOUT_MAX)) + { + L2cDmConnUpdateRsp(id, handle, L2C_CONN_PARAM_REJECTED); + return; + } + + DmL2cConnUpdateInd(id, handle, &connSpec); +} + +/*************************************************************************************************/ +/*! + * \brief Initialize L2C for operation as a Bluetooth LE master. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cMasterInit(void) +{ + l2cCb.masterRxSignalingPkt = l2cMasterRxSignalingPkt; +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by DM to send an L2CAP connection update response. + * + * \param identifier Identifier value previously passed from L2C to DM. + * \param handle The connection handle. + * \param result Connection update response result. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cDmConnUpdateRsp(uint8_t identifier, uint16_t handle, uint16_t result) +{ + uint8_t *pPacket; + uint8_t *p; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_CONN_UPDATE_RSP_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_CONN_UPDATE_RSP); /* command code */ + UINT8_TO_BSTREAM(p, identifier); /* identifier */ + UINT16_TO_BSTREAM(p, L2C_SIG_CONN_UPDATE_RSP_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, result); /* result */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_CONN_UPDATE_RSP_LEN), pPacket); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_slave.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_slave.c new file mode 100644 index 0000000000000000000000000000000000000000..4c0e622f4b1760d41206fe44eaed34e0d0155608 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/l2c/l2c_slave.c @@ -0,0 +1,310 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief L2CAP module for slave operations. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "wsf_timer.h" +#include "wsf_msg.h" +#include "wsf_os.h" +#include "util/bstream.h" +#include "l2c_api.h" +#include "l2c_main.h" +#include "dm_api.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Signaling request timeout in seconds */ +#define L2C_SIG_REQ_TIMEOUT 30 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Slave control block */ +typedef struct +{ + wsfTimer_t reqTimer; /* Signaling request timeout timer */ + wsfHandlerId_t handlerId; /* ID for this event handler */ + uint8_t lastCode[DM_CONN_MAX]; /* last code sent on each handle */ + uint8_t signId[DM_CONN_MAX]; /* expected signaling identifier */ +} l2cSlaveCb_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +static l2cSlaveCb_t l2cSlaveCb; + +/*************************************************************************************************/ +/*! + * \brief Handle slave signaling request timeout. + * + * \param pMsg Pointer to message. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cSlaveReqTimeout(wsfMsgHdr_t *pMsg) +{ + L2C_TRACE_WARN0("conn update req timeout"); + + /* Notify DM that connection update has failed (handle is stored in param) */ + DmL2cConnUpdateCnf(pMsg->param, L2C_CONN_PARAM_REJECTED); +} + +/*************************************************************************************************/ +/*! + * \brief Slave processing of received L2CAP signaling packets. + * + * \param handle The connection handle. + * \param l2cLen The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void l2cSlaveRxSignalingPkt(uint16_t handle, uint16_t l2cLen, uint8_t *pPacket) +{ + uint8_t code; + uint8_t id; + uint16_t len; + uint16_t result; + + /* parse code, len, and identifier */ + pPacket += L2C_PAYLOAD_START; + BSTREAM_TO_UINT8(code, pPacket); + BSTREAM_TO_UINT8(id, pPacket); + BSTREAM_TO_UINT16(len, pPacket); + + /* verify signal identifier is valid */ + if (id == L2C_SIGNAL_ID_INVALID) + { + /* not expected, ignore */ + return; + } + + /* verify signal identifier is expected + * verify signaling length vs. l2c length + * verify this is a conn param update rsp or command reject + * verify parameter length + */ + if ((id == l2cSlaveCb.signId[handle]) && + (l2cLen == (len + L2C_SIG_HDR_LEN)) && + (((code == L2C_SIG_CONN_UPDATE_RSP) && (len == L2C_SIG_CONN_UPDATE_RSP_LEN)) || + (code == L2C_SIG_CMD_REJ))) + { + /* get last sent code */ + uint8_t lastCode = l2cSlaveCb.lastCode[handle]; + + /* clear pending signal id */ + l2cSlaveCb.signId[handle] = L2C_SIGNAL_ID_INVALID; + + /* parse result parameter */ + BSTREAM_TO_UINT16(result, pPacket); + + /* stop req timer */ + WsfTimerStop(&l2cSlaveCb.reqTimer); + + if (lastCode == L2C_SIG_CONN_UPDATE_REQ) + { + if (code == L2C_SIG_CMD_REJ) + { + /* got command reject */ + result = L2C_CONN_PARAM_REJECTED; + } + + /* send to DM */ + DmL2cConnUpdateCnf(handle, result); + } + else + { + /* send to DM */ + DmL2cCmdRejInd(handle, result); + } + } + else + { + L2C_TRACE_WARN3("invalid msg code:%d len:%d l2cLen:%d", code, len, l2cLen); + + /* reject all unknown, invalid or unidentified commands except command reject. */ + if (code != L2C_SIG_CMD_REJ) + { + l2cSendCmdReject(handle, id, L2C_REJ_NOT_UNDERSTOOD); + } + + return; + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize L2C for operation as a Bluetooth LE slave. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cSlaveInit(void) +{ + uint8_t i; + l2cCb.slaveRxSignalingPkt = l2cSlaveRxSignalingPkt; + + for (i = 0; i < DM_CONN_MAX; i++) + { + l2cSlaveCb.signId[i] = L2C_SIGNAL_ID_INVALID; + } +} + +/*************************************************************************************************/ +/*! + * \brief Build and send a signaling packet. + * + * \param handle The connection handle. + * \param code Type of command. + * \param len Length of \ref pParam. + * \param pParam parameters of command to send. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam) +{ + uint8_t *pPacket; + uint8_t *p; + + WSF_ASSERT(handle < DM_CONN_MAX); + + /* record code */ + l2cSlaveCb.lastCode[handle] = code; + + /* Start signaling request timer and store handle */ + WsfTimerStartSec(&l2cSlaveCb.reqTimer, L2C_SIG_REQ_TIMEOUT); + l2cSlaveCb.reqTimer.msg.param = handle; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + len)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, code); /* command code */ + l2cSlaveCb.signId[handle] = l2cCb.identifier; + UINT8_TO_BSTREAM(p, l2cCb.identifier); /* identifier */ + l2cCb.identifier = L2C_NEXT_ID(l2cCb.identifier); + UINT16_TO_BSTREAM(p, len); /* parameter length */ + memcpy(p, pParam, len); /* parameters */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + len), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by DM to send an L2CAP connection update request. + * + * \param handle The connection handle. + * \param pConnSpec Pointer to the connection specification structure. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cDmConnUpdateReq(uint16_t handle, hciConnSpec_t *pConnSpec) +{ + uint8_t *pPacket; + uint8_t *p; + + /* record code */ + l2cSlaveCb.lastCode[handle] = L2C_SIG_CONN_UPDATE_REQ; + + /* Start signaling request timer and store handle */ + WsfTimerStartSec(&l2cSlaveCb.reqTimer, L2C_SIG_REQ_TIMEOUT); + l2cSlaveCb.reqTimer.msg.param = handle; + + /* allocate msg buffer */ + if ((pPacket = l2cMsgAlloc(L2C_SIG_PKT_BASE_LEN + L2C_SIG_CONN_UPDATE_REQ_LEN)) != NULL) + { + /* build message */ + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, L2C_SIG_CONN_UPDATE_REQ); /* command code */ + UINT8_TO_BSTREAM(p, l2cCb.identifier); /* identifier */ + l2cSlaveCb.signId[handle] = l2cCb.identifier; + l2cCb.identifier = L2C_NEXT_ID(l2cCb.identifier); + UINT16_TO_BSTREAM(p, L2C_SIG_CONN_UPDATE_REQ_LEN); /* parameter length */ + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMin); /* interval min */ + UINT16_TO_BSTREAM(p, pConnSpec->connIntervalMax); /* interval max */ + UINT16_TO_BSTREAM(p, pConnSpec->connLatency); /* slave latency */ + UINT16_TO_BSTREAM(p, pConnSpec->supTimeout); /* timeout multiplier */ + + /* send packet */ + L2cDataReq(L2C_CID_LE_SIGNALING, handle, (L2C_SIG_HDR_LEN + L2C_SIG_CONN_UPDATE_REQ_LEN), pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Event handler initialization function for L2C when operating as a slave. + * + * \param handlerId ID for this event handler. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cSlaveHandlerInit(wsfHandlerId_t handlerId) +{ + l2cSlaveCb.reqTimer.msg.event = L2C_MSG_REQ_TIMEOUT; + l2cSlaveCb.reqTimer.handlerId = handlerId; + l2cSlaveCb.handlerId = handlerId; +} + +/*************************************************************************************************/ +/*! + * \brief The WSF event handler for L2C when operating as a slave. + * + * \param event Event mask. + * \param pMsg Pointer to message. + * + * \return None. + */ +/*************************************************************************************************/ +void L2cSlaveHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + /* Handle message */ + if (pMsg != NULL) + { + WSF_ASSERT(pMsg->event > 0 && pMsg->event <= L2C_MSG_TYPE_MAX); + + /* handle slave signaling request timeout */ + if (pMsg->event == L2C_MSG_REQ_TIMEOUT) + { + l2cSlaveReqTimeout(pMsg); + } + } + /* Handle events */ + else if (event) + { + + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_act.c new file mode 100644 index 0000000000000000000000000000000000000000..9fe67eb1b6ad4dea7bd2427c323e8be2e119a812 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_act.c @@ -0,0 +1,872 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP common utility functions and action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "dm_api.h" +#include "smp_api.h" +#include "smp_main.h" + +#ifndef SMP_EXTRA_TRACE +#define SMP_EXTRA_TRACE FALSE +#endif + +/*************************************************************************************************/ +/*! + * \brief Start SMP response timer. + * + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void smpStartRspTimer(smpCcb_t *pCcb) +{ + /* start smp response timer */ + pCcb->rspTimer.msg.event = SMP_MSG_INT_RSP_TIMEOUT; + pCcb->rspTimer.msg.status = SMP_ERR_TIMEOUT; + WsfTimerStartSec(&pCcb->rspTimer, SMP_TIMEOUT); +} + +/*************************************************************************************************/ +/*! + * \brief No action. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActNone(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup CCB. + * + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +void smpCleanup(smpCcb_t *pCcb) +{ + /* free scratch buffer */ + if (pCcb->pScr != NULL) + { + WsfBufFree(pCcb->pScr); + pCcb->pScr = NULL; + } + + /* stop response timer */ + WsfTimerStop(&pCcb->rspTimer); + + /* stop wait interval timer */ + WsfTimerStop(&pCcb->waitTimer); + + pCcb->secReq = FALSE; + pCcb->nextCmdCode = (pCcb->initiator) ? SMP_CMD_SECURITY_REQ : SMP_CMD_PAIR_REQ; + pCcb->lastSentKey = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup CCB. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActCleanup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smpCleanup(pCcb); +} + +/*************************************************************************************************/ +/*! + * \brief Send a pairing failed packet. + * + * \param pCcb Connection control block. + * \param reason Failure reason. + * + * \return None. + */ +/*************************************************************************************************/ +void smpSendPairingFailed(smpCcb_t *pCcb, uint8_t reason) +{ + uint8_t *pPacket; + uint8_t *p; + + if ((pPacket = smpMsgAlloc(L2C_PAYLOAD_START + SMP_PAIR_FAIL_LEN)) != NULL) + { + p = pPacket + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_FAIL); + UINT8_TO_BSTREAM(p, reason); + + smpSendPkt(pCcb, pPacket); + } +} + +/*************************************************************************************************/ +/*! + * \brief Pairing failed. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairingFailed(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* clean up */ + smpCleanup(pCcb); + + /* set connection idle */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_IDLE); + + /* notify DM of pairing failure */ + pMsg->hdr.event = DM_SEC_PAIR_FAIL_IND; + DmSmpCbackExec((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Pairing cancelled by user. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairingCancel(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* send pairing failed packet */ + smpSendPairingFailed(pCcb, pMsg->hdr.status); + + smpActPairingFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Store the authentication data. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActStorePin(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* copy authentication data to scratchpad */ + memcpy(pCcb->pScr->buf.b1, pMsg->dm.authRsp.authData, pMsg->dm.authRsp.authDataLen); + + /* zero out unused pin data */ + if (pMsg->dm.authRsp.authDataLen == SMP_PIN_LEN) + { + memset(&pCcb->pScr->buf.b1[SMP_PIN_LEN], 0, SMP_OOB_LEN - SMP_PIN_LEN); + } +} + + +/*************************************************************************************************/ +/*! + * \brief Process a pairing request and response data. + * + * \param pCcb Connection control block. + * \param pOob Return parameter, TRUE if out-of-band data requested. + * \param pDisplay Return parameter, TRUE if pin is to be displayed. + * + * \return TRUE on success, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t smpProcPairing(smpCcb_t *pCcb, uint8_t *pOob, uint8_t *pDisplay) +{ + bool_t justWorks = TRUE; + uint8_t localAuth; + wsfMsgHdr_t hdr; + + *pDisplay = FALSE; + *pOob = FALSE; + + /* if OOB available use that */ + if (pCcb->pairReq[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT && + pCcb->pairRsp[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) + { + *pOob = SMP_OOB_DATA_PRESENT; + justWorks = FALSE; + } + /* if either device set mitm flag */ + else if ((pCcb->pairReq[SMP_AUTHREQ_POS] & SMP_AUTH_MITM_FLAG) || + (pCcb->pairRsp[SMP_AUTHREQ_POS] & SMP_AUTH_MITM_FLAG)) + { + /* check for compatible I/O settings */ + if ((pCcb->pairReq[SMP_IO_POS] != SMP_IO_NO_IN_NO_OUT) && /* initiator has i/o and */ + (pCcb->pairRsp[SMP_IO_POS] != SMP_IO_NO_IN_NO_OUT) && /* responder has i/o and */ + !(((pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_ONLY) || /* both don't have display only */ + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO)) && + ((pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_ONLY) || + (pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_YES_NO)))) + { + /* use pin */ + justWorks = FALSE; + + /* check if pin should be displayed (as initiator) */ + *pDisplay = + ((pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_ONLY) || /* initiator is display only or */ + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO) || /* initiator is display y/n or */ + ((pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_DISP) && /* initiator is key/display and */ + (pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_ONLY || /* responder is key only or key/display */ + pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_DISP))); + + /* invert display setting if we are not initiator and both are not key only */ + if (!(pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_ONLY && + pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_ONLY)) + { + *pDisplay ^= !pCcb->initiator; + } + } + } + + if (!justWorks) + { + /* set auth flags with mitm bit set */ + pCcb->auth = (pCcb->pairReq[SMP_AUTHREQ_POS] & pCcb->pairRsp[SMP_AUTHREQ_POS]) | SMP_AUTH_MITM_FLAG; + } + else + { + /* set auth flags with mitm bit cleared */ + pCcb->auth = pCcb->pairReq[SMP_AUTHREQ_POS] & pCcb->pairRsp[SMP_AUTHREQ_POS] & ~SMP_AUTH_MITM_FLAG; + } + + /* if we ended up with 'just works' but the device configuration requires authentication */ + localAuth = (pCcb->initiator) ? pCcb->pairReq[SMP_AUTHREQ_POS] : pCcb->pairRsp[SMP_AUTHREQ_POS]; + if (justWorks && (pSmpCfg->auth & localAuth & SMP_AUTH_MITM_FLAG)) + { + /* cancel pairing */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_AUTH_REQ; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + + /* if max encryption key is less than our minimum */ + if (pCcb->pairReq[SMP_MAXKEY_POS] < pSmpCfg->minKeyLen || + pCcb->pairRsp[SMP_MAXKEY_POS] < pSmpCfg->minKeyLen) + { + /* cancel pairing */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_ENC_KEY_SIZE; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Request authentication data or send ourselves an authentication response. + * + * \param pCcb Connection control block. + * \param oob Out-of-band data requested. + * \param display TRUE if pin is to be displayed. + * + * \return None. + */ +/*************************************************************************************************/ +void smpAuthReq(smpCcb_t *pCcb, uint8_t oob, uint8_t display) +{ + /* use a union to save a bit of memory on the stack */ + union + { + smpDmAuthRsp_t authRsp; + dmSecAuthReqIndEvt_t authReq; + } buf; + + /* if authenticated pairing */ + if (pCcb->auth & SMP_AUTH_MITM_FLAG) + { + /* request pin or oob from user */ + buf.authReq.hdr.param = pCcb->connId; + buf.authReq.hdr.event = DM_SEC_AUTH_REQ_IND; + buf.authReq.oob = oob; + buf.authReq.display = display; + DmSmpCbackExec((dmEvt_t *) &buf.authReq); + } + else + { + /* else use just works; send ourselves a auth rsp with all zero pin */ + buf.authRsp.hdr.param = pCcb->connId; + buf.authRsp.hdr.event = SMP_MSG_API_AUTH_RSP; + buf.authRsp.authData[0] = 0; + buf.authRsp.authData[1] = 0; + buf.authRsp.authData[2] = 0; + buf.authRsp.authDataLen = SMP_PIN_LEN; + smpSmExecute(pCcb, (smpMsg_t *) &buf.authRsp); + } +} + +/*************************************************************************************************/ +/*! + * \brief Perform first part of pairing confirm calculation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairCnfCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* store authentication data */ + smpActStorePin(pCcb, pMsg); + + /* get random number to scratchpad */ + SecRand(pCcb->pScr->buf.b4, SMP_RAND_LEN); + + /* execute calculation */ + smpCalcC1Part1(pCcb, pCcb->pScr->buf.b1, pCcb->pScr->buf.b4); +} + +/*************************************************************************************************/ +/*! + * \brief Perform second part of pairing confirm calculation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairCnfCalc2(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smpCalcC1Part2(pCcb, pCcb->pScr->buf.b1, pMsg->aes.pCiphertext); +} + +/*************************************************************************************************/ +/*! + * \brief Send a pairing confirm packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActSendPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + + /* set next expected packet */ + pCcb->nextCmdCode = (pCcb->initiator) ? SMP_CMD_PAIR_CNF : SMP_CMD_PAIR_RAND; + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_CNF_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_CNF); + memcpy(p, pMsg->aes.pCiphertext, SMP_CONFIRM_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Perform first part of the pairing confirm verification calculation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairCnfVerCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *p; + + /* go to start of received pairing random packet */ + p = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* store random value */ + memcpy(pCcb->pScr->buf.b2, p, SMP_RAND_LEN); + + /* execute calculation */ + smpCalcC1Part1(pCcb, pCcb->pScr->buf.b1, p); +} + +/*************************************************************************************************/ +/*! + * \brief Perform first part of the pairing confirm verification calculation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairCnfVerCalc2(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smpCalcC1Part2(pCcb, pCcb->pScr->buf.b1, pMsg->aes.pCiphertext); +} + +/*************************************************************************************************/ +/*! + * \brief Send a key. + * + * \param pCcb Connection control block. + * \param keyDist Key distribution mask. + * + * \return TRUE if done sending keys, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t smpSendKey(smpCcb_t *pCcb, uint8_t keyDist) +{ + uint8_t *pPkt; + uint8_t *p; + wsfMsgHdr_t *pHdr; + + if (smpCb.lescSupported && pCcb->pScCcb->lescEnabled && pCcb->lastSentKey == 0) + { + dmSecKeyIndEvt_t keyInd; + + /* pass LTK to app via DM */ + if (DmConnRole(pCcb->connId) == DM_ROLE_MASTER) + { + keyInd.type = DM_KEY_PEER_LTK; + } + else + { + keyInd.type = DM_KEY_LOCAL_LTK; + } + + keyInd.hdr.event = DM_SEC_KEY_IND; + keyInd.hdr.param = pCcb->connId; + keyInd.secLevel = smpGetScSecLevel(pCcb); + keyInd.keyData.ltk.ediv = 0; + memset(keyInd.keyData.ltk.rand, 0, SMP_RAND8_LEN); + Calc128Cpy(keyInd.keyData.ltk.key, pCcb->pScCcb->pLtk->ltk_t); + DmSmpCbackExec((dmEvt_t *)&keyInd); + + pCcb->lastSentKey = SMP_CMD_MASTER_ID; + } + + /* check if we're done sending keys */ + if ((keyDist == 0) || + (keyDist == SMP_KEY_DIST_ENC && pCcb->lastSentKey == SMP_CMD_MASTER_ID) || + (keyDist <= (SMP_KEY_DIST_ENC | SMP_KEY_DIST_ID) && pCcb->lastSentKey == SMP_CMD_ID_ADDR_INFO) || + (pCcb->lastSentKey == SMP_CMD_SIGN_INFO)) + { + return TRUE; + } + + /* if flow disabled return */ + if (pCcb->flowDisabled) + { + return FALSE; + } + + /* allocate packet buffer for largest packet size */ + if ((pPkt = smpMsgAlloc(SMP_ENC_INFO_LEN + L2C_PAYLOAD_START)) != NULL) + { + p = pPkt + L2C_PAYLOAD_START; + + /* determine next key to send */ + if (pCcb->lastSentKey == 0 && (keyDist & SMP_KEY_DIST_ENC)) + { + /* generate LTK, EDIV, and RAND */ + smpGenerateLtk(pCcb); + + /* send first part of LTK */ + UINT8_TO_BSTREAM(p, SMP_CMD_ENC_INFO); + Calc128Cpy(p, pCcb->pScr->keyInd.keyData.ltk.key); + } + else if (pCcb->lastSentKey == SMP_CMD_ENC_INFO) + { + /* send second part of LTK */ + UINT8_TO_BSTREAM(p, SMP_CMD_MASTER_ID); + UINT16_TO_BSTREAM(p, pCcb->pScr->keyInd.keyData.ltk.ediv); + memcpy(p, pCcb->pScr->keyInd.keyData.ltk.rand, SMP_RAND8_LEN); + } + else if ((keyDist & SMP_KEY_DIST_ID) && + (pCcb->lastSentKey == 0 || pCcb->lastSentKey == SMP_CMD_MASTER_ID)) + { + /* send first part of IRK */ + UINT8_TO_BSTREAM(p, SMP_CMD_ID_INFO); + Calc128Cpy(p, DmSecGetLocalIrk()); + } + else if (pCcb->lastSentKey == SMP_CMD_ID_INFO) + { + /* send second part of IRK */ + UINT8_TO_BSTREAM(p, SMP_CMD_ID_ADDR_INFO); + UINT8_TO_BSTREAM(p, DM_ADDR_PUBLIC); + BDA_TO_BSTREAM(p, HciGetBdAddr()); + + } + else if ((keyDist & SMP_KEY_DIST_SIGN) && + (pCcb->lastSentKey == 0 || pCcb->lastSentKey == SMP_CMD_ID_ADDR_INFO || + pCcb->lastSentKey == SMP_CMD_MASTER_ID)) + { + /* send SRK */ + UINT8_TO_BSTREAM(p, SMP_CMD_SIGN_INFO); + Calc128Cpy(p, DmSecGetLocalCsrk()); + } + else + { + /* should never get here */ + WsfMsgFree(pPkt); + SMP_TRACE_WARN2("smpSendKey unexpected state keyDist:%d lastSentKey:%d", keyDist, pCcb->lastSentKey); + return TRUE; + } + + /* set last sent key to command code */ + pCcb->lastSentKey = pPkt[L2C_PAYLOAD_START]; + + /* send command packet */ + smpSendPkt(pCcb, pPkt); + + /* if flow not disabled set up to send next key */ + if (!pCcb->flowDisabled) + { + if ((pHdr = WsfMsgAlloc(sizeof(wsfMsgHdr_t))) != NULL) + { + pHdr->event = SMP_MSG_INT_SEND_NEXT_KEY; + pHdr->param = pCcb->connId; + WsfMsgSend(smpCb.handlerId, pHdr); + } + } + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Process received key packet and pass it to DM if complete. + * + * \param pCcb Connection control block. + * \param pKeyInd Key data structure allocated by caller. + * \param pBuf Buffer containing packet. + * \param keyDist Key distribution mask. + * + * \return TRUE if done receiving keys, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t smpProcRcvKey(smpCcb_t *pCcb, dmSecKeyIndEvt_t *pKeyInd, uint8_t *pBuf, uint8_t keyDist) +{ + bool_t keyIndReady = FALSE; + bool_t done = FALSE; + uint8_t cmdCode; + + /* go to start of packet */ + pBuf += L2C_PAYLOAD_START; + cmdCode = *pBuf++; + + if (cmdCode == SMP_CMD_ENC_INFO) + { + /* parse encryption information packet */ + Calc128Cpy(pKeyInd->keyData.ltk.key, pBuf); + } + else if (cmdCode == SMP_CMD_MASTER_ID) + { + /* parse master identification packet */ + BSTREAM_TO_UINT16(pKeyInd->keyData.ltk.ediv, pBuf); + memcpy(pKeyInd->keyData.ltk.rand, pBuf, SMP_RAND8_LEN); + pKeyInd->secLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + pKeyInd->type = DM_KEY_PEER_LTK; + keyIndReady = TRUE; + } + else if (cmdCode == SMP_CMD_ID_INFO) + { + /* parse identity information packet */ + Calc128Cpy(pKeyInd->keyData.irk.key, pBuf); + } + else if (cmdCode == SMP_CMD_ID_ADDR_INFO) + { + /* parse identity address information packet */ + BSTREAM_TO_UINT8(pKeyInd->keyData.irk.addrType, pBuf); + BSTREAM_TO_BDA(pKeyInd->keyData.irk.bdAddr, pBuf); + pKeyInd->type = DM_KEY_IRK; + keyIndReady = TRUE; + } + else if (cmdCode == SMP_CMD_SIGN_INFO) + { + /* parse signing information packet */ + Calc128Cpy(pKeyInd->keyData.csrk.key, pBuf); + pKeyInd->type = DM_KEY_CSRK; + keyIndReady = TRUE; + } + + /* set up to receive next key */ + + /* if just got first part of LTK or IRK */ + if (pCcb->nextCmdCode == SMP_CMD_ENC_INFO || pCcb->nextCmdCode == SMP_CMD_ID_INFO) + { + /* wait for second part of LTK or IRK info */ + pCcb->nextCmdCode++; + } + /* else if got LTK and need IRK */ + else if ((keyDist & SMP_KEY_DIST_ID) && (pCcb->nextCmdCode == SMP_CMD_MASTER_ID)) + { + /* wait for first part of IRK */ + pCcb->nextCmdCode = SMP_CMD_ID_INFO; + } + /* else if got LTK or IRK and need SRK */ + else if ((keyDist & SMP_KEY_DIST_SIGN) && + (pCcb->nextCmdCode == SMP_CMD_MASTER_ID || pCcb->nextCmdCode == SMP_CMD_ID_ADDR_INFO)) + { + /* wait for SRK */ + pCcb->nextCmdCode = SMP_CMD_SIGN_INFO; + } + else + { + /* done receiving keys */ + done = TRUE; + } + + /* call callback if key ready */ + if (keyIndReady) + { + pKeyInd->hdr.event = DM_SEC_KEY_IND; + DmSmpCbackExec((dmEvt_t *) pKeyInd); + } + + return done; +} + +/*************************************************************************************************/ +/*! + * \brief Maximum unsuccessful pairing attempts reached. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActMaxAttempts(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint32_t timeout; + + /* send paring failed packet; note this stops the timer so call this first */ + smpActPairingCancel(pCcb, pMsg); + + /* Check SMP device DB to determine time to wait before pairing can happen again */ + timeout = SmpDbMaxAttemptReached(pCcb->connId); + + /* start wait interval timer */ + pCcb->waitTimer.msg.event = SMP_MSG_INT_WI_TIMEOUT; + WsfTimerStartMs(&pCcb->waitTimer, timeout); + + /* clear attempts count */ + pCcb->attempts = 0; +} + +/*************************************************************************************************/ +/*! + * \brief A pairing attempt was received while in 'repeated attempts' state. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActAttemptRcvd(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* set that attempt was received */ + pCcb->attempts = 1; +} + +/*************************************************************************************************/ +/*! + * \brief Notify DM of a pairing failure due to max attempt failures. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActNotifyDmAttemptsFailure(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* notify DM of pairing failure */ + pMsg->hdr.status = SMP_ERR_ATTEMPTS; + pMsg->hdr.event = DM_SEC_PAIR_FAIL_IND; + DmSmpCbackExec((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Notify DM of a pairing failure due to response timeout. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActNotifyDmRspToFailure(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* notify DM of pairing failure */ + pMsg->hdr.status = SMP_ERR_TIMEOUT; + pMsg->hdr.event = DM_SEC_PAIR_FAIL_IND; + DmSmpCbackExec((dmEvt_t *) pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Check if any pairing attempts received when leaving 'repeated attempts' state. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActCheckAttempts(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* check if attempt was received */ + if (pCcb->attempts) + { + pCcb->attempts = 0; + smpSendPairingFailed(pCcb, SMP_ERR_ATTEMPTS); + + /* notify DM of pairing failure */ + smpActNotifyDmAttemptsFailure(pCcb, pMsg); + + smpCleanup(pCcb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Pairing completed successfully. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpActPairingCmpl(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + dmSecPairCmplIndEvt_t pairCmpl; + + smpCleanup(pCcb); + + /* set connection idle */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_IDLE); + + pairCmpl.auth = pCcb->auth; + pairCmpl.hdr.param = pCcb->connId; + pairCmpl.hdr.event = DM_SEC_PAIR_CMPL_IND; + DmSmpCbackExec((dmEvt_t *) &pairCmpl); +} + +/*************************************************************************************************/ +/*! + * \brief Execute the SMP state machine. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpSmExecute(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smpTblEntry_t const *pTblEntry; + smpSmIf_t const *pSmIf; + +#if SMP_EXTRA_TRACE == TRUE + if (smpCb.lescSupported) + SMP_TRACE_INFO2("SMP Exe: evt=%s st=%s", smpEventStr(pMsg->hdr.event), smpStateStr(pCcb->state)); + else +#endif + SMP_TRACE_INFO2("smpSmExecute event=%d state=%d", pMsg->hdr.event, pCcb->state); + + /* look up state table for state */ + pSmIf = DmConnRole(pCcb->connId) == DM_ROLE_SLAVE? smpCb.pSlave : smpCb.pMaster; + pTblEntry = pSmIf->pStateTbl[pCcb->state]; + + /* run through state machine twice; once with state table for current state + * and once with the state table for common events + */ + for(;;) + { + /* look for event match and execute action */ + do + { + /* if match */ + if ((*pTblEntry)[SMP_SM_POS_EVENT] == pMsg->hdr.event) + { + /* set next state */ + pCcb->state = (*pTblEntry)[SMP_SM_POS_NEXT_STATE]; + + /* execute action */ + (*pSmIf->pActionTbl[(*pTblEntry)[SMP_SM_POS_ACTION]])(pCcb, pMsg); + + return; + } + + /* next entry */ + pTblEntry++; + + /* while not at end */ + } while ((*pTblEntry)[SMP_SM_POS_EVENT] != 0); + + /* if we've reached end of the common state table */ + if (pTblEntry == (pSmIf->pCommonTbl + SMP_STATE_TBL_COMMON_MAX - 1)) + { + /* we're done */ + break; + } + /* else we haven't run through common state table yet */ + else + { + /* set it up */ + pTblEntry = pSmIf->pCommonTbl; + } + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_db.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_db.c new file mode 100644 index 0000000000000000000000000000000000000000..3799c3276484f062a09cace954e63173686c19a5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_db.c @@ -0,0 +1,431 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP device database. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "wsf_timer.h" +#include "smp_api.h" +#include "smp_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* Period in ms to service the database. */ +#define SMP_DB_SRV_MS 1000 + +/* Decrement a timer. */ +#define SMP_DB_DEC_TIMER(a) do { a = a > SMP_DB_SRV_MS ? a - SMP_DB_SRV_MS : 0;} while (0) + +/* Device database indicies. */ +#define SMP_DB_COMMON_REC 0 /*! Common record used when database is full. */ +#define SMP_DB_FIRST_REC 1 /*! Index of first device specific record in database. */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +typedef struct +{ + bdAddr_t peerAddr; /*! Peer address. */ + uint8_t addrType; /*! Peer address type. */ + uint8_t failCount; /*! Prior attempt failure count. */ + uint16_t attemptMult; /*! Attempts timeout multiplier (0 - record not used). */ + uint32_t lockMs; /*! Time remaining until device can attempt pairing. */ + uint32_t expDecrementMs; /*! Time remaining until attempt attemptMult decreases. */ + uint32_t failCountToMs; /*! Time remaining until failCount is cleared. */ +} smpDbDevice_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/* Control block. */ +static struct +{ + smpDbDevice_t db[SMP_DB_MAX_DEVICES]; /*! Device database. */ + wsfTimer_t serviceTimer; /*! Timer to service database. */ +} smpDbCb; + +/*************************************************************************************************/ +/*! + * \brief Ensure the SMP DB service timer is running. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpDbStartServiceTimer(void) +{ + if (smpDbCb.serviceTimer.isStarted == FALSE) + { + WsfTimerStartMs(&smpDbCb.serviceTimer, SMP_DB_SRV_MS); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if a database record is in use. + * + * \param pRec Pointer to the record. + * + * \return TRUE if record in use, else FALSE. + */ +/*************************************************************************************************/ +static bool_t smpDbRecordInUse(smpDbDevice_t *pRec) +{ + /* When failCount, lockMs, and attemptMult are zero, the record can be used for another device. */ + if (pRec->failCount > 0) + { + return TRUE; + } + + if (pRec->lockMs > 0) + { + return TRUE; + } + + if (pRec->attemptMult > 0) + { + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Add a device to the database. + * + * \param pAddr Peer BD address. + * \param addrType Peer BD address type. + * + * \return Pointer to DB record or NULL if database full. + */ +/*************************************************************************************************/ +static smpDbDevice_t *smpDbAddDevice(uint8_t *pAddr, uint8_t addrType) +{ + smpDbDevice_t *pRec = &smpDbCb.db[SMP_DB_FIRST_REC]; + uint8_t i; + + SMP_TRACE_INFO0("smpDbAddDevice"); + + for (i = SMP_DB_FIRST_REC; i < SMP_DB_MAX_DEVICES; i++, pRec++) + { + if (smpDbRecordInUse(pRec) == FALSE) + { + /* Reset record. */ + memset(pRec, 0, sizeof(smpDbDevice_t)); + + pRec->addrType = addrType; + BdaCpy(pRec->peerAddr, pAddr); + return pRec; + } + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Get a record in the database. + * + * \param connId Connection identifier. + * + * \return Pointer to the record associated with the connection or the common record. + */ +/*************************************************************************************************/ +static smpDbDevice_t *smpDbGetRecord(dmConnId_t connId) +{ + smpDbDevice_t *pRec = &smpDbCb.db[SMP_DB_FIRST_REC]; + uint8_t addrType = DmHostAddrType(DmConnPeerAddrType(connId)); + uint8_t *pAddr = DmConnPeerAddr(connId); + uint8_t i; + + SMP_TRACE_INFO2("smpDbGetRecord: connId: %d type: %d", connId, addrType); + + for (i = SMP_DB_FIRST_REC; i < SMP_DB_MAX_DEVICES; i++, pRec++) + { + if (smpDbRecordInUse(pRec) && (pRec->addrType == addrType) && BdaCmp(pRec->peerAddr, pAddr)) + { + return pRec; + } + } + + /* Device is not in the database, add the device. */ + pRec = smpDbAddDevice(pAddr, addrType); + + if (pRec == NULL) + { + SMP_TRACE_INFO0("smpDbGetRecord: common record"); + + /* Database is full, use the common record. */ + pRec = &smpDbCb.db[SMP_DB_COMMON_REC]; + } + + return pRec; +} + +/*************************************************************************************************/ +/*! + * \brief Initialize the SMP Database. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbInit(void) +{ + /* Stop active service timer. */ + if (smpDbCb.serviceTimer.isStarted == TRUE) + { + WsfTimerStop(&smpDbCb.serviceTimer); + } + + /* Reset control block. */ + memset(&smpDbCb, 0, sizeof(smpDbCb)); + + /* Setup service timer. */ + smpDbCb.serviceTimer.handlerId = smpCb.handlerId; + smpDbCb.serviceTimer.msg.event = SMP_DB_SERVICE_IND; +} + +/*************************************************************************************************/ +/*! + * \brief Get the time (msec) that pairing is disabled for a device. + * + * \param connId Connection identifier. + * + * \return Time pairing is disabled (msec), or zero if pairing isn't disabled. + */ +/*************************************************************************************************/ +uint32_t SmpDbGetPairingDisabledTime(dmConnId_t connId) +{ + smpDbDevice_t *pRec = smpDbGetRecord(connId); + + SMP_TRACE_INFO3("SmpDbGetPairingDisabledTime: connId: %d period: %d attemptMult: %d", + connId, pRec->lockMs, pRec->attemptMult); + + return pRec->lockMs; +} + +/*************************************************************************************************/ +/*! + * \brief Set the count of prior failures for a device. + * + * \param connId Connection identifier. + * \param count Failure count. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbSetFailureCount(dmConnId_t connId, uint8_t count) +{ + smpDbDevice_t *pRec = smpDbGetRecord(connId); + + SMP_TRACE_INFO2("SmpDbSetFailureCount: connId: %d count: %d", connId, count); + + pRec->failCount = count; + + if (count != 0) + { + pRec->failCountToMs = pSmpCfg->maxAttemptTimeout; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get the count of prior failures for a device. + * + * \param connId Connection identifier. + * + * \return The failure count. + */ +/*************************************************************************************************/ +uint8_t SmpDbGetFailureCount(dmConnId_t connId) +{ + smpDbDevice_t *pRec = smpDbGetRecord(connId); + + SMP_TRACE_INFO2("SmpDbGetFailureCount: connId: %d count: %d", connId, pRec->failCount); + + return pRec->failCount; +} + +/*************************************************************************************************/ +/*! + * \brief Called to report max pairing attempts was reached for a device. + * + * \param connId Connection identifier. + * + * \return Time until device can retry pairing. + */ +/*************************************************************************************************/ +uint32_t SmpDbMaxAttemptReached(dmConnId_t connId) +{ + smpDbDevice_t *pRec = smpDbGetRecord(connId); + uint16_t multiplier; + + SMP_TRACE_INFO1("SmpDbMaxAttemptReached: connId: %d", connId); + + if (pRec->attemptMult == 0) + { + /* Due to a disconnection, a record exists but the attempt multipier hasn't been set. */ + multiplier = 1; + } + else + { + multiplier = (pRec->attemptMult * pSmpCfg->attemptExp); + } + + if ((pSmpCfg->attemptTimeout * multiplier) <= pSmpCfg->maxAttemptTimeout) + { + pRec->lockMs = pSmpCfg->attemptTimeout * multiplier; + pRec->attemptMult = multiplier; + } + else + { + /* Exponential increase is greater than max timeout. */ + pRec->lockMs = pSmpCfg->maxAttemptTimeout; + } + + pRec->expDecrementMs = pSmpCfg->attemptDecTimeout; + + /* Ensure the service timer is running. */ + smpDbStartServiceTimer(); + + return pRec->lockMs; +} + +/*************************************************************************************************/ +/*! + * \brief Called to report to the SMP DB that a pairing operation failed + * + * \param connId Connection identifier. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbPairingFailed(dmConnId_t connId) +{ + smpDbDevice_t *pRec = smpDbGetRecord(connId); + + SMP_TRACE_INFO1("SmpDbPairingFailed: connId: %d", connId); + + /* Reset exponent decrement timer. */ + pRec->expDecrementMs = pSmpCfg->attemptDecTimeout; +} + +/*************************************************************************************************/ +/*! + * \brief Service the device database timers + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbService(void) +{ + uint8_t i; + smpDbDevice_t *pRec = smpDbCb.db; + + /* Service device specific records. */ + for (i = 0; i < SMP_DB_MAX_DEVICES; i++, pRec++) + { + if (smpDbRecordInUse(pRec)) + { + /* Decrement all time periods. */ + SMP_DB_DEC_TIMER(pRec->expDecrementMs); + SMP_DB_DEC_TIMER(pRec->lockMs); + SMP_DB_DEC_TIMER(pRec->failCountToMs); + + /* Process expDecrementMs timeout. */ + if (pRec->expDecrementMs == 0) + { + /* Exponential decrease of multiplier. */ + pRec->attemptMult /= pSmpCfg->attemptExp; + + if (pRec->attemptMult) + { + pRec->expDecrementMs = pSmpCfg->attemptDecTimeout; + } + } + + /* Process failCountToMs timeout. */ + if (pRec->failCountToMs == 0) + { + pRec->failCount = 0; + } + + /* If the record is in use, ensure the service timer is running. */ + if (smpDbRecordInUse(pRec)) + { + smpDbStartServiceTimer(); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Remove all records from the SMP database. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbRemoveAllDevices(void) +{ + /* Stop active service timer. */ + if (smpDbCb.serviceTimer.isStarted == TRUE) + { + WsfTimerStop(&smpDbCb.serviceTimer); + } + + /* Reset database. */ + memset(&smpDbCb.db, 0, sizeof(smpDbCb.db)); +} + +/*************************************************************************************************/ +/*! + * \brief Remove a device with the given identity from the SMP database. + *` + * \param pAddr Pointer to BD Address. + * \param addrType BD Address type. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDbRemoveDevice(uint8_t *pAddr, uint8_t addrType) +{ + smpDbDevice_t *pRec = &smpDbCb.db[SMP_DB_FIRST_REC]; + uint8_t peerAddrType = DmHostAddrType(addrType); + uint8_t i; + + for (i = SMP_DB_FIRST_REC; i < SMP_DB_MAX_DEVICES; i++, pRec++) + { + if (smpDbRecordInUse(pRec) && (pRec->addrType == peerAddrType) && BdaCmp(pRec->peerAddr, pAddr)) + { + /* Reset record. */ + memset(pRec, 0, sizeof(smpDbDevice_t)); + + return; + } + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.c new file mode 100644 index 0000000000000000000000000000000000000000..561fca4bfe1d2015e63fabcea586bd7929464847 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.c @@ -0,0 +1,860 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP main module. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_math.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "dm_api.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smp_handler.h" +#include "sec_api.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* SMP packet length table */ +const uint8_t smpPktLenTbl[] = +{ + 0, + SMP_PAIR_REQ_LEN, + SMP_PAIR_RSP_LEN, + SMP_PAIR_CNF_LEN, + SMP_PAIR_RAND_LEN, + SMP_PAIR_FAIL_LEN, + SMP_ENC_INFO_LEN, + SMP_MASTER_ID_LEN, + SMP_ID_INFO_LEN, + SMP_ID_ADDR_INFO_LEN, + SMP_SIGN_INFO_LEN, + SMP_SECURITY_REQ_LEN, + SMP_PUB_KEY_MSG_LEN, + SMP_DHKEY_CHECK_MSG_LEN, + SMP_KEYPRESS_MSG_LEN +}; + +/* Control block */ +smpCb_t smpCb; + +/*************************************************************************************************/ +/*! + * \brief L2C data callback for SMP. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpL2cDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t cmdCode; + smpCcb_t *pCcb; + + /* get connection control block for this handle, ignore packet if not found */ + if ((pCcb = smpCcbByHandle(handle)) == NULL) + { + return; + } + + /* parse command code */ + cmdCode = *(pPacket + L2C_PAYLOAD_START); + + /* verify length and that command is the expected command or pairing failed */ + if ((cmdCode >= SMP_CMD_PAIR_REQ && cmdCode < SMP_CMD_MAX) && + (len == smpPktLenTbl[cmdCode]) && + ((cmdCode == pCcb->nextCmdCode) || (cmdCode == SMP_CMD_PAIR_FAIL))) + { + smpMsg_t msg; + + /* send to state machine */ + if (cmdCode == SMP_CMD_PAIR_FAIL) + { + msg.hdr.event = SMP_MSG_CMD_PAIRING_FAILED; + msg.hdr.status = *(pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN); + } + else + { + msg.hdr.event = SMP_MSG_CMD_PKT; + } + + msg.hdr.param = pCcb->connId; + msg.data.pPacket = pPacket; + smpSmExecute(pCcb, &msg); + } + /* else ignore it */ + else + { + SMP_TRACE_WARN3("unexpected packet cmd:%d len:%d, expected:%d", cmdCode, len, pCcb->nextCmdCode); + } +} + +/*************************************************************************************************/ +/*! + * \brief L2C control callback for SMP. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpL2cCtrlCback(wsfMsgHdr_t *pMsg) +{ + smpCcb_t *pCcb; + uint8_t *pPkt; + + /* get connection control block */ + pCcb = smpCcbByConnId((dmConnId_t) pMsg->param); + + /* verify connection is open */ + if (pCcb->connId != DM_CONN_ID_NONE) + { + /* set flow */ + pCcb->flowDisabled = (pMsg->event == L2C_CTRL_FLOW_DISABLE_IND); + + /* if data flow enabled */ + if (!pCcb->flowDisabled) + { + /* if packet in qeueue */ + if (pCcb->pQueued != NULL) + { + /* send queued packet */ + pPkt = pCcb->pQueued; + pCcb->pQueued = NULL; + smpSendPkt(pCcb, pPkt); + } + + /* if SMP state not idle */ + if (!smpStateIdle(pCcb)) + { + /* trigger send of next key */ + pMsg->event = SMP_MSG_INT_SEND_NEXT_KEY; + smpSmExecute(pCcb, (smpMsg_t *) pMsg); + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Called to resume attempts state if a disconnect and reconnect occured while in the + * attempts state. + * + * \param connId Connection ID to prevent pairing. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpResumeAttemptsState(dmConnId_t connId) +{ + smpCcb_t *pCcb = smpCcbByConnId(connId); + uint32_t timeMs = SmpDbGetPairingDisabledTime(connId); + + if (timeMs) + { + if (smpCb.lescSupported) + { + pCcb->state = DmConnRole(connId) == DM_ROLE_SLAVE? SMPR_SC_SM_ST_ATTEMPTS : SMPI_SC_SM_ST_ATTEMPTS; + } + else + { + pCcb->state = DmConnRole(connId) == DM_ROLE_SLAVE? SMPR_SM_ST_ATTEMPTS : SMPI_SM_ST_ATTEMPTS; + } + + /* Start smp timer indicating the time to prevent pairing in the attempts state */ + pCcb->waitTimer.msg.event = SMP_MSG_INT_WI_TIMEOUT; + WsfTimerStartMs(&pCcb->waitTimer, timeMs); + } +} + +/*************************************************************************************************/ +/*! + * \brief DM connection callback for SMP. + * + * \param pDmEvt DM callback event. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpDmConnCback(dmEvt_t *pDmEvt) +{ + smpCcb_t *pCcb; + wsfMsgHdr_t hdr; + + pCcb = smpCcbByConnId((dmConnId_t) pDmEvt->hdr.param); + + /* if new connection created */ + if (pDmEvt->hdr.event == DM_CONN_OPEN_IND) + { + /* set up state machine for master or slave */ + if (DmConnRole((dmConnId_t) pDmEvt->hdr.param) == DM_ROLE_MASTER) + { + pCcb->initiator = TRUE; + pCcb->nextCmdCode = SMP_CMD_SECURITY_REQ; + } + else + { + pCcb->initiator = FALSE; + pCcb->nextCmdCode = SMP_CMD_PAIR_REQ; + } + + /* initialize control block */ + pCcb->handle = pDmEvt->connOpen.handle; + pCcb->connId = (dmConnId_t) pDmEvt->hdr.param; + pCcb->secReq = FALSE; + pCcb->flowDisabled = FALSE; + pCcb->attempts = SmpDbGetFailureCount((dmConnId_t) pDmEvt->hdr.param); + pCcb->lastSentKey = 0; + pCcb->state = 0; + + /* Resume the attempts state if necessary */ + smpResumeAttemptsState((dmConnId_t) pDmEvt->hdr.param); + } + /* else if connection has been opened */ + else if (pCcb->connId != DM_CONN_ID_NONE) + { + /* handle close */ + if (pDmEvt->hdr.event == DM_CONN_CLOSE_IND) + { + /* store attempts count */ + SmpDbSetFailureCount((dmConnId_t) pDmEvt->hdr.param, pCcb->attempts); + + /* send to state machine */ + hdr.param = pDmEvt->hdr.param; + hdr.event = SMP_MSG_DM_CONN_CLOSE; + hdr.status = pDmEvt->connClose.reason + DM_SEC_HCI_ERR_BASE; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + + /* clear conn ID after handling event */ + pCcb->connId = DM_CONN_ID_NONE; + + /* free queued packet buffer */ + if (pCcb->pQueued != NULL) + { + WsfMsgFree(pCcb->pQueued); + pCcb->pQueued = NULL; + } + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the given handle. + * + * \param handle The connection handle. + * + * \return Pointer to connection control block or NULL if not found. + */ +/*************************************************************************************************/ +smpCcb_t *smpCcbByHandle(uint16_t handle) +{ + dmConnId_t connId; + + if ((connId = DmConnIdByHandle(handle)) != DM_CONN_ID_NONE) + { + return &smpCb.ccb[connId - 1]; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Return the connection control block for the connection ID. + * + * \param connId Connection ID. + * + * \return Pointer to connection control block. + */ +/*************************************************************************************************/ +smpCcb_t *smpCcbByConnId(dmConnId_t connId) +{ + WSF_ASSERT((connId > 0) && (connId <= DM_CONN_MAX)); + + return &smpCb.ccb[connId - 1]; +} + +/*************************************************************************************************/ +/*! + * \brief Perform the first part of SMP calculation C1. + * + * \param pCcb Connection control block. + * \param pKey Encryption key parameter 'k'. + * \param pRand Random value 'r'. + * + * \return None. + */ +/*************************************************************************************************/ +void smpCalcC1Part1(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pRand) +{ + uint8_t buf[HCI_ENCRYPT_DATA_LEN]; + uint8_t *p; + uint8_t i; + uint8_t iAddrType; + uint8_t rAddrType; + + /* set initiator/responder address types */ + if (pCcb->initiator) + { + /* if local device's using RPA */ + if (!BdaIsZeros(DmConnLocalRpa(pCcb->connId))) + { + iAddrType = DM_ADDR_RANDOM; + } + else + { + iAddrType = DmConnLocalAddrType(pCcb->connId); + } + + /* if peer device's using RPA */ + if (!BdaIsZeros(DmConnPeerRpa(pCcb->connId))) + { + rAddrType = DM_ADDR_RANDOM; + } + else + { + rAddrType = DmConnPeerAddrType(pCcb->connId); + } + } + else + { + /* if peer device's using RPA */ + if (!BdaIsZeros(DmConnPeerRpa(pCcb->connId))) + { + iAddrType = DM_ADDR_RANDOM; + } + else + { + iAddrType = DmConnPeerAddrType(pCcb->connId); + } + + /* if local device's using RPA */ + if (!BdaIsZeros(DmConnLocalRpa(pCcb->connId))) + { + rAddrType = DM_ADDR_RANDOM; + } + else + { + rAddrType = DmConnLocalAddrType(pCcb->connId); + } + } + + /* note all numbers contained in byte arrays are little endian */ + + /* create parameter from xor of r and pres, preq, rat, and iat */ + p = buf; + *p++ = iAddrType ^ *pRand++; + *p++ = rAddrType ^ *pRand++; + for (i = 0; i < SMP_PAIR_REQ_LEN; i++) + { + *p++ = pCcb->pairReq[i] ^ *pRand++; + } + for (i = 0; i < SMP_PAIR_RSP_LEN; i++) + { + *p++ = pCcb->pairRsp[i] ^ *pRand++; + } + + /* encrypt */ + pCcb->token = SecAes(pKey, buf, smpCb.handlerId, pCcb->connId, SMP_MSG_WSF_AES_CMPL); + + if (pCcb->token == SEC_TOKEN_INVALID) + { + wsfMsgHdr_t hdr; + + /* fail on invalid token */ + hdr.status = SMP_ERR_UNSPECIFIED; + hdr.event = SMP_MSG_API_CANCEL_REQ; + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Perform the second part of SMP calculation C1. + * + * \param pCcb Connection control block. + * \param pKey Encryption key parameter 'k'. + * \param pPart1 Result from part 1. + * + * \return None. + */ +/*************************************************************************************************/ +void smpCalcC1Part2(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pPart1) +{ + uint8_t buf[HCI_ENCRYPT_DATA_LEN]; + uint8_t *p; + uint8_t i; + uint8_t *pIaddr; + uint8_t *pRaddr; + + /* set initiator/responder addresss */ + if (pCcb->initiator) + { + /* use local device's RPA */ + pIaddr = DmConnLocalRpa(pCcb->connId); + + /* if local device's not using RPA */ + if (BdaIsZeros(pIaddr)) + { + /* use local device's address */ + pIaddr = DmConnLocalAddr(pCcb->connId); + } + + /* use peer device's RPA */ + pRaddr = DmConnPeerRpa(pCcb->connId); + + /* if peer device's not using RPA */ + if (BdaIsZeros(pRaddr)) + { + /* use peer device's address */ + pRaddr = DmConnPeerAddr(pCcb->connId); + } + } + else + { + /* use peer device's RPA */ + pIaddr = DmConnPeerRpa(pCcb->connId); + + /* if peer device's not using RPA */ + if (BdaIsZeros(pIaddr)) + { + /* use peer device's address */ + pIaddr = DmConnPeerAddr(pCcb->connId); + } + + /* use local device's RPA */ + pRaddr = DmConnLocalRpa(pCcb->connId); + + /* if local device's not using RPA */ + if (BdaIsZeros(pRaddr)) + { + /* use local device's address */ + pRaddr = DmConnLocalAddr(pCcb->connId); + } + } + + /* note all numbers contained in byte arrays are little endian */ + + /* create parameter from xor of part 1 result with ia, ra, and pad */ + p = buf; + for (i = BDA_ADDR_LEN; i > 0; i--) + { + *p++ = *pRaddr++ ^ *pPart1++; + } + for (i = BDA_ADDR_LEN; i > 0; i--) + { + *p++ = *pIaddr++ ^ *pPart1++; + } + *p++ = *pPart1++; + *p++ = *pPart1++; + *p++ = *pPart1++; + *p++ = *pPart1++; + + /* encrypt */ + pCcb->token = SecAes(pKey, buf, smpCb.handlerId, pCcb->connId, SMP_MSG_WSF_AES_CMPL); + + if (pCcb->token == SEC_TOKEN_INVALID) + { + wsfMsgHdr_t hdr; + + /* fail on invalid token */ + hdr.status = SMP_ERR_UNSPECIFIED; + hdr.event = SMP_MSG_API_CANCEL_REQ; + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Perform calculation S1. + * + * \param pCcb Connection control block. + * \param pKey Encryption key parameter 'k'. + * \param pRand1 Random value 1. + * \param pRand2 Random value 2. + * + * \return None. + */ +/*************************************************************************************************/ +void smpCalcS1(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pRand1, uint8_t *pRand2) +{ + uint8_t buf[HCI_ENCRYPT_DATA_LEN]; + + /* note all numbers contained in byte arrays are little endian */ + + /* construct parameter r' from r1 and r2 */ + Calc128Cpy64(buf, pRand2); + Calc128Cpy64(&buf[SMP_RAND8_LEN], pRand1); + + /* encrypt */ + pCcb->token = SecAes(pKey, buf, smpCb.handlerId, pCcb->connId, SMP_MSG_WSF_AES_CMPL); + + if (pCcb->token == SEC_TOKEN_INVALID) + { + wsfMsgHdr_t hdr; + + /* fail on invalid token */ + hdr.status = SMP_ERR_UNSPECIFIED; + hdr.event = SMP_MSG_API_CANCEL_REQ; + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Generate LTK, EDIV, and RAND. + * + * \param pScr Pointer to scratch buffer containing input and output data. + * + * \return None. + */ +/*************************************************************************************************/ +void smpGenerateLtk(smpCcb_t *pCcb) +{ + uint8_t *p; + smpScratch_t *pScr = pCcb->pScr; + + /* generated results are stored in scratch buffer */ + p = pScr->keyInd.keyData.ltk.key; + + /* generate LTK from random number */ + SecRand(p, pScr->keyInd.encKeyLen); + p += pScr->keyInd.encKeyLen; + + /* set remaining key bytes to zero */ + memset(p, 0, (SMP_KEY_LEN - pScr->keyInd.encKeyLen)); + + /* use existing random number stored in scratch buf b4 for EDIV and RAND */ + BYTES_TO_UINT16(pScr->keyInd.keyData.ltk.ediv, pScr->buf.b4); + memcpy(pScr->keyInd.keyData.ltk.rand, &pScr->buf.b4[2], SMP_RAND8_LEN); + + /* pass key to app via DM */ + pScr->keyInd.type = DM_KEY_LOCAL_LTK; + pScr->keyInd.secLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + pScr->keyInd.hdr.event = DM_SEC_KEY_IND; + DmSmpCbackExec((dmEvt_t *) &pScr->keyInd); +} + +/*************************************************************************************************/ +/*! + * \brief Send an SMP command packet. + * + * \param pCcb Connection control block. + * \param pPkt Buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void smpSendPkt(smpCcb_t *pCcb, uint8_t *pPkt) +{ + /* if flow disabled */ + if (pCcb->flowDisabled) + { + /* if packet already queued discard it and replace it with this new packet */ + if (pCcb->pQueued != NULL) + { + SMP_TRACE_WARN1("smpSendPkt packet discarded cmd:%d", pCcb->pQueued[L2C_PAYLOAD_START]); + WsfMsgFree(pCcb->pQueued); + } + + /* queue packet */ + pCcb->pQueued = pPkt; + } + /* else send it to L2CAP */ + else + { + L2cDataReq(L2C_CID_SMP, pCcb->handle, smpPktLenTbl[pPkt[L2C_PAYLOAD_START]], pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if SMP connection is in idle state. + * + * \param pCcb Connection control block. + * + * \return TRUE if in idle state, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t smpStateIdle(smpCcb_t *pCcb) +{ + return (pCcb->state == 0); +} + +/*************************************************************************************************/ +/*! + * \brief Allocate an SMP data message buffer to be used for the SMP protocol messages. + * + * \param len Message length in bytes. + * + * \return Pointer to data message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *smpMsgAlloc(uint16_t len) +{ + return WsfMsgDataAlloc(len, HCI_TX_DATA_TAILROOM); +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by DM to send a message to SMP. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDmMsgSend(smpDmMsg_t *pMsg) +{ + WsfMsgSend(smpCb.handlerId, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief This function is called by DM to notify SMP of encrypted link status. + * + * \param pMsg Pointer to HCI message structure. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpDmEncryptInd(wsfMsgHdr_t *pMsg) +{ + /* set event to SMP event type */ + pMsg->event = (pMsg->status == HCI_SUCCESS) ? + SMP_MSG_DM_ENCRYPT_CMPL : SMP_MSG_DM_ENCRYPT_FAILED; + + /* pass event to handler */ + SmpHandler(0, pMsg); +} + +/*************************************************************************************************/ +/*! +* \brief Calculate Secure Connections security level. +* Note: calculation assumes Secure Connections was used. This function cannot be used to +* calculate a legacy pairing's security level. +* +* \param pCcb Connection control block. +* +* \return Security level. +*/ +/*************************************************************************************************/ +uint8_t smpGetScSecLevel(smpCcb_t *pCcb) +{ + uint8_t secLevel; + + if (pCcb->auth & SMP_AUTH_MITM_FLAG) + { + if (WSF_MIN(pCcb->pairReq[SMP_MAXKEY_POS], pCcb->pairRsp[SMP_MAXKEY_POS]) == SMP_KEY_SIZE_MAX) + { + secLevel = DM_SEC_LEVEL_ENC_LESC; + } + else + { + secLevel = DM_SEC_LEVEL_ENC_AUTH; + } + } + else + { + secLevel = DM_SEC_LEVEL_ENC; + } + + return secLevel; +} + +/*************************************************************************************************/ +/*! + * \brief Return the STK for the given connection. + * + * \param connId Connection identifier. + * \param pSecLevel Returns the security level of pairing when STK was created. + * + * \return Pointer to STK or NULL if not available. + */ +/*************************************************************************************************/ +uint8_t *SmpDmGetStk(dmConnId_t connId, uint8_t *pSecLevel) +{ + smpCcb_t *pCcb; + + /* get connection control block */ + pCcb = smpCcbByConnId(connId); + + if (smpCb.lescSupported && pCcb->pScCcb->lescEnabled && (pCcb->pScCcb->pLtk != NULL)) + { + /* set security level */ + *pSecLevel = smpGetScSecLevel(pCcb); + + /* return buffer containing STK */ + return pCcb->pScCcb->pLtk->ltk_t; + } + else if (pCcb->pScr != NULL) + { + /* set security level */ + *pSecLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + + /* return buffer containing STK */ + return pCcb->pScr->buf.b3; + } + else + { + return NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Return the LTK for the given connection. + * + * \param connId Connection identifier. + * + * \return Pointer to STK or NULL if not available. + */ +/*************************************************************************************************/ +uint8_t *SmpDmGetLtk(dmConnId_t connId) +{ + smpCcb_t *pCcb; + + /* get connection control block */ + pCcb = smpCcbByConnId(connId); + + if (smpCb.lescSupported) + { + /* return buffer containing STK */ + return pCcb->pScCcb->pLtk->ltk_t; + } + else + { + return NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief SMP handler init function called during system initialization. + * + * \param handlerID WSF handler ID for SMP. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpHandlerInit(wsfHandlerId_t handlerId) +{ + uint8_t i; + smpCcb_t *pCcb; + + /* store handler ID */ + smpCb.handlerId = handlerId; + + /* Initialize the SMP device database */ + SmpDbInit(); + + /* Initialize control block CCBs */ + for (i = 0, pCcb = smpCb.ccb; i < DM_CONN_MAX; i++, pCcb++) + { + /* initialize response timer */ + pCcb->rspTimer.handlerId = handlerId; + pCcb->rspTimer.msg.param = i + 1; /* param stores the conn id */ + + /* initialize wait interval timer */ + pCcb->waitTimer.handlerId = handlerId; + pCcb->waitTimer.msg.param = i + 1; /* param stores the conn id */ + } + + /* Register with L2C */ + L2cRegister(L2C_CID_SMP, smpL2cDataCback, smpL2cCtrlCback); + + /* Register with DM */ + DmConnRegister(DM_CLIENT_ID_SMP, smpDmConnCback); +} + +/*************************************************************************************************/ +/*! + * + * \brief WSF event handler for SMP. + * + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +{ + smpCcb_t *pCcb; + + /* Handle message */ + if (pMsg != NULL) + { + if (pMsg->event == SMP_DB_SERVICE_IND) + { + SmpDbService(); + } + else + { + if (pMsg->event == SMP_MSG_WSF_CMAC_CMPL) + { + secCmacMsg_t *pCmac = (secCmacMsg_t *) pMsg; + + /* Free the plain text buffer that was allocated and passed into SecCmac */ + if (pCmac->pPlainText) + { + WsfBufFree(pCmac->pPlainText); + } + } + + /* get connection control block */ + pCcb = smpCcbByConnId((dmConnId_t) pMsg->param); + + /* verify connection is open */ + if (pCcb->connId != DM_CONN_ID_NONE) + { + /* if AES result verify it is not stale */ + if (pMsg->event == SMP_MSG_WSF_AES_CMPL && pCcb->token != pMsg->status) + { + SMP_TRACE_WARN2("AES token mismatch: %d %d", pCcb->token, pMsg->status); + } + else + { + /* send to state machine */ + smpSmExecute(pCcb, (smpMsg_t *) pMsg); + } + } + } + } + /* Handle events */ + else if (event) + { + + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.h new file mode 100644 index 0000000000000000000000000000000000000000..fe9b91d9059e2ff640d9e01f8aa45f7954855136 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_main.h @@ -0,0 +1,417 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP main module. + */ +/*************************************************************************************************/ +#ifndef SMP_MAIN_H +#define SMP_MAIN_H + +#include "sec_api.h" +#include "wsf_timer.h" +#include "l2c_api.h" +#include "dm_api.h" +#include "smp_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* State machine table constants */ +#define SMP_SM_POS_EVENT 0 /* Column position for event */ +#define SMP_SM_POS_NEXT_STATE 1 /* Column position for next state */ +#define SMP_SM_POS_ACTION 2 /* Column position for action */ +#define SMP_SM_NUM_COLS 3 /* Number of columns in state table */ +#define SMP_STATE_TBL_COMMON_MAX 5 /* Number of entries in common state table */ + +/* Position of parameters in pairing request/response */ +#define SMP_IO_POS 1 +#define SMP_OOB_POS 2 +#define SMP_AUTHREQ_POS 3 +#define SMP_MAXKEY_POS 4 +#define SMP_IKEYDIST_POS 5 +#define SMP_RKEYDIST_POS 6 + +/* Position of parameters in public key message */ +#define SMP_PUB_KEY_X_POS 1 +#define SMP_PUB_KEY_Y_POS 33 + +/* LESC Authorization Types */ +#define SMP_AUTH_TYPE_UNKNOWN 0 +#define SMP_AUTH_TYPE_JUST_WORKS 1 +#define SMP_AUTH_TYPE_OOB 2 +#define SMP_AUTH_TYPE_PASSKEY 3 +#define SMP_AUTH_TYPE_NUM_COMP 4 + +/*! smpi_sm state machine states */ +enum +{ + SMPI_SM_ST_IDLE, /*!< Idle */ + SMPI_SM_ST_PAIR_RSP, /*!< Wait for pairing response */ + SMPI_SM_ST_PIN, /*!< Wait for PIN */ + SMPI_SM_ST_CNF_CALC_1, /*!< Wait for confirm calc 1 */ + SMPI_SM_ST_CNF_CALC_2, /*!< Wait for confirm calc 2 */ + SMPI_SM_ST_PAIR_CNF, /*!< Wait for pairing confirm */ + SMPI_SM_ST_PAIR_RAND, /*!< Wait for pairing random */ + SMPI_SM_ST_CNF_VER_CALC_1, /*!< Wait for confirm verify calc 1 */ + SMPI_SM_ST_CNF_VER_CALC_2, /*!< Wait for confirm verify calc 2 */ + SMPI_SM_ST_STK_CALC, /*!< Wait for STK calc */ + SMPI_SM_ST_ENCRYPT, /*!< Wait for link encryption */ + SMPI_SM_ST_KEY_DIST, /*!< Key distribution */ + SMPI_SM_ST_ATTEMPTS, /*!< Repeated attempts */ + SMPI_SM_ST_RSP_TO /*!< Response timeout state */ +}; + +/*! smpr_sm state machine states */ +enum +{ + SMPR_SM_ST_IDLE, /*!< Idle */ + SMPR_SM_ST_API_PAIR_REQ, /*!< Wait for API pairing request */ + SMPR_SM_ST_API_PAIR_RSP, /*!< Wait for API pairing response */ + SMPR_SM_ST_PIN_PAIR_1, /*!< Wait for PIN or pairing confirm 1 */ + SMPR_SM_ST_PIN_PAIR_2, /*!< Wait for PIN or pairing confirm 2 */ + SMPR_SM_ST_CNF_CALC_1, /*!< Wait for confirm calc 1 */ + SMPR_SM_ST_CNF_CALC_2, /*!< Wait for confirm calc 2 */ + SMPR_SM_ST_PAIR_RAND, /*!< Wait for pairing random */ + SMPR_SM_ST_CNF_VER_CALC_1, /*!< Wait for confirm verify calc 1 */ + SMPR_SM_ST_CNF_VER_CALC_2, /*!< Wait for confirm verify calc 2 */ + SMPR_SM_ST_STK_CALC, /*!< Wait for STK calc */ + SMPR_SM_ST_ENCRYPT, /*!< Wait for link encryption */ + SMPR_SM_ST_KEY_DIST, /*!< Key distribution */ + SMPR_SM_ST_ATTEMPTS, /*!< Repeated attempts */ + SMPR_SM_ST_RSP_TO /*!< Response timeout state */ +}; + +/*! smpi_sc_sm state machine states */ +enum +{ + SMPI_SC_SM_ST_IDLE, /*!< Idle */ + SMPI_SC_SM_ST_PAIR_RSP, /*!< Wait for pairing response */ + SMPI_SC_SM_ST_MODE_SELECT, /*!< Select the security mode (LESC or Legacy) */ + SMPI_SC_SM_ST_LESC_PIN, /*!< Wait for PIN in LESC */ + SMPI_SC_SM_ST_PUB_KEY, /*!< Wait for public key from peer */ + SMPI_SC_SM_ST_AUTH_SELECT, /*!< Select the type of LESC pairing (Just Works, Passkey, or OOB) */ + + SMPI_SC_SM_ST_JWNC_WAIT_CNF, /*!< Wait for confirm in Just Works/Numeric Comparison Pairing */ + SMPI_SC_SM_ST_JWNC_RAND, /*!< Wait for rand in Just Works/Numeric Comparison Pairing */ + SMPI_SC_SM_ST_JWNC_CHECK_1, /*!< Calculate confirm value in Just Works/Numeric Comparison Pairing */ + SMPI_SC_SM_ST_JWNC_CHECK_2, /*!< Calculate user validate value in Just Works/Numeric Comparison Pairing */ + SMPI_SC_SM_ST_JWNC_WAIT_USER, /* Wait for user to validate the confirm value */ + + SMPI_SC_SM_ST_PK_KEYPRESS, /*!< Process a keypress command in passkey pairing */ + SMPI_SC_SM_ST_PK_CALC, /*!< Calculate the confirm in passkey pairing */ + SMPI_SC_SM_ST_PK_CNF, /*!< Wait for confirm in passkey pairing */ + SMPI_SC_SM_ST_PK_RAND, /*!< Wait for rand in passkey pairing */ + SMPI_SC_SM_ST_PK_CHECK, /*!< Check the conform value in passkey pairing */ + SMPI_SC_SM_ST_PK_REPEAT, /*!< Repeat or complete the passkey pairing */ + + SMPI_SC_SM_ST_OOB_SEND_RAND, /*!< Send the rand in OOB pairing */ + SMPI_SC_SM_ST_OOB_WAIT_RAND, /*!< Wait for a rand in OOB pairing */ + + SMPI_SC_SM_ST_CALC_DHKEY, /*!< Calculate the DHKEY shared secret */ + SMPI_SC_SM_ST_CALC_F5_TKEY, /*!< Calculate the DHKEY T Key */ + SMPI_SC_SM_ST_CALC_F5_MACKEY, /*!< Calculate the DHKEY MAC Key */ + SMPI_SC_SM_ST_CALC_F5_LTK, /*!< Calculate the DHKEY LTK Key */ + SMPI_SC_SM_ST_CALC_F6_EA, /*!< Calculate the DHKEY Ea Key */ + SMPI_SC_SM_ST_CALC_F6_EB, /*!< Calculate the DHKEY Eb Key */ + SMPI_SC_SM_ST_VERIFY_DH_CHECK, /*!< Verify the DHKEY check value */ + + SMPI_SC_SM_ST_LEGACY_PIN, /*!< Wait for PIN */ + SMPI_SC_SM_ST_CNF_CALC_1, /*!< Wait for confirm calc 1 */ + SMPI_SC_SM_ST_CNF_CALC_2, /*!< Wait for confirm calc 2 */ + SMPI_SC_SM_ST_PAIR_CNF, /*!< Wait for pairing confirm */ + SMPI_SC_SM_ST_PAIR_RAND, /*!< Wait for pairing random */ + SMPI_SC_SM_ST_CNF_VER_CALC_1, /*!< Wait for confirm verify calc 1 */ + SMPI_SC_SM_ST_CNF_VER_CALC_2, /*!< Wait for confirm verify calc 2 */ + SMPI_SC_SM_ST_STK_CALC, /*!< Wait for STK calc */ + SMPI_SC_SM_ST_ENCRYPT, /*!< Wait for link encryption */ + SMPI_SC_SM_ST_KEY_DIST, /*!< Key distribution */ + SMPI_SC_SM_ST_ATTEMPTS, /*!< Repeated attempts */ + SMPI_SC_SM_ST_RSP_TO /*!< Response timeout state */ +}; + +/*! smpr_sc_sm state machine states */ +enum +{ + SMPR_SC_SM_ST_IDLE, /*!< Idle */ + SMPR_SC_SM_ST_API_PAIR_REQ, /*!< Wait for API pairing request */ + SMPR_SC_SM_ST_API_PAIR_RSP, /*!< Wait for API pairing response */ + SMPR_SC_SM_ST_MODE_SELECT, /*!< Select the security mode (LESC or Legacy) */ + SMPR_SC_SM_ST_PUB_KEY, /*!< Wait for public key from peer */ + SMPR_SC_SM_ST_LESC_PIN, /*!< Wait for pin in LESC */ + SMPR_SC_SM_ST_AUTH_SELECT, /*!< Select the type of LESC pairing (Just Works, Passkey, or OOB) */ + + SMPR_SC_SM_ST_JWNC_SETUP, /*!< Prepare for Just Works/Numeric Comparison Pairing */ + SMPR_SC_SM_ST_JWNC_WAIT_RAND, /*!< Wait for Rand in Just Works/Numeric Comparison Pairing */ + SMPR_SC_SM_ST_JWNC_CALC_G2, /*!< Calculate the user validate value in Just Works/Numeric Comparison Pairing */ + SMPR_SC_SM_ST_JWNC_WAIT_USER, /*!< Wait for user to validate the confirm value */ + SMPR_SC_SM_ST_JWNC_WAIT_USER_DH_CHECK_RCVD, /*!< Wait for user to validate the confirm value with a received DH Key Check */ + + SMPR_SC_SM_ST_PK_KEYPRESS, /*!< Process a keypress command in passkey pairing */ + SMPR_SC_SM_ST_PK_WAIT_AUTH, /*!< The confirm was received before the auth from the API, wait for the auth */ + SMPR_SC_SM_ST_PK_WAIT_CNF, /*!< Wait for the confirm command in passkey pairing */ + SMPR_SC_SM_ST_PK_CALC, /*!< Calculate the confirm in passkey pairing */ + SMPR_SC_SM_ST_PK_RAND, /*!< Send the rand command in passkey pairing */ + SMPR_SC_SM_ST_PK_CHECK, /*!< Check the confirm in passkey pairing */ + SMPR_SC_SM_ST_PK_REPEAT, /*!< Repeat or complete the passkey pairing */ + + SMPR_SC_SM_ST_OOB_SEND_RAND, /*!< Send the rand in OOB pairing */ + SMPR_SC_SM_ST_OOB_WAIT_RAND, /*!< Wait for a rand in OOB pairing */ + + SMPR_SC_SM_ST_WAIT_DH_CHECK, /*!< Wait for the DH Check command */ + SMPR_SC_SM_ST_CALC_DHKEY, /*!< Calculate the DHKEY shared secret */ + SMPR_SC_SM_ST_CALC_F5_TKEY, /*!< Calculate the DHKEY T Key */ + SMPR_SC_SM_ST_CALC_F5_MACKEY, /*!< Calculate the DHKEY MAC Key */ + SMPR_SC_SM_ST_CALC_F5_LTK, /*!< Calculate the DHKEY LTK Key */ + SMPR_SC_SM_ST_CALC_F6_EA, /*!< Calculate the DHKEY Ea Key */ + SMPR_SC_SM_ST_CALC_F6_EB, /*!< Calculate the DHKEY Eb Key */ + + SMPR_SC_SM_ST_PIN_PAIR_1, /*!< Wait for PIN or pairing confirm 1 */ + SMPR_SC_SM_ST_PIN_PAIR_2, /*!< Wait for PIN or pairing confirm 2 */ + SMPR_SC_SM_ST_CNF_CALC_1, /*!< Wait for confirm calc 1 */ + SMPR_SC_SM_ST_CNF_CALC_2, /*!< Wait for confirm calc 2 */ + SMPR_SC_SM_ST_PAIR_RAND, /*!< Wait for pairing random */ + SMPR_SC_SM_ST_CNF_VER_CALC_1, /*!< Wait for confirm verify calc 1 */ + SMPR_SC_SM_ST_CNF_VER_CALC_2, /*!< Wait for confirm verify calc 2 */ + SMPR_SC_SM_ST_STK_CALC, /*!< Wait for STK calc */ + SMPR_SC_SM_ST_ENCRYPT, /*!< Wait for link encryption */ + SMPR_SC_SM_ST_KEY_DIST, /*!< Key distribution */ + SMPR_SC_SM_ST_ATTEMPTS, /*!< Repeated attempts */ + SMPR_SC_SM_ST_RSP_TO /*!< Response timeout state */ +}; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/* Data type for state machine table entry */ +typedef uint8_t smpTblEntry_t[SMP_SM_NUM_COLS]; + +/* Pairing request/response parameters */ +typedef uint8_t smpPair_t[SMP_PAIR_REQ_LEN]; + +/* Temporary storage structure for calculations and other data. + * Note that keyInd overlaps b1 through b3 so these will be overwritten + * when key exchange occurs. + * + * Notes on usage from start of pairing to encryption with STK: + * buf.b1: PIN or OOB data + * buf.b2: RAND from peer + * buf.b3: pairing cnf received from peer, then STK (if responder) + * buf.b4: RAND used in pairing calc + * + */ +typedef union +{ + struct + { + uint8_t b1[SMP_KEY_LEN]; + uint8_t b2[SMP_KEY_LEN]; + uint8_t b3[SMP_KEY_LEN]; + uint8_t b4[SMP_KEY_LEN]; + } buf; + dmSecKeyIndEvt_t keyInd; +} smpScratch_t; + +/* SMP message handling function type */ +typedef void (*smpMsgHandler_t)(wsfMsgHdr_t *pMsg); + +/* SMP connection callback type */ +typedef void (*smpConnCback_t)(dmEvt_t *pDmEvt); + +/* SMP data message type */ +typedef struct +{ + wsfMsgHdr_t hdr; /* Header structure */ + uint8_t *pPacket; /* Pointer to buffer containing L2CAP packet */ +} smpDataMsg_t; + +/* Union of event handler data types */ +typedef union +{ + wsfMsgHdr_t hdr; /* Header structure */ + smpDmMsg_t dm; /* Union SMP DM message data types */ + secAes_t aes; /* AES Security callback parameters structure */ + smpDataMsg_t data; /* SMP data message */ +} smpMsg_t; + +/* LE LTK Calc Scratch buffer */ +typedef struct +{ + uint8_t mac[SEC_CMAC_KEY_LEN]; /* MAC Key */ + uint8_t ltk_t[SEC_CMAC_KEY_LEN]; /* LTK Key or T value of MAC/LTK calculation */ +} smpScLtk_t; + +/* ECC DH Key */ +typedef struct +{ + uint8_t pubKeyX[SMP_PUB_KEY_LEN]; /* Public Key X */ + uint8_t pubKeyY[SMP_PUB_KEY_LEN]; /* Public Key Y */ +} smpScPubKey_t; + +/* LESC Scratch Buffers */ +typedef struct +{ + uint8_t Na_Ea[SMP_RAND_LEN]; /* Initiator Na or Ea */ + uint8_t Nb_Eb[SMP_RAND_LEN]; /* Responder Nb or Eb */ + uint8_t Ra[SMP_RAND_LEN]; /* Initiator Ra */ + uint8_t Rb[SMP_RAND_LEN]; /* Responder Nb */ + uint8_t PeerCb[SMP_RAND_LEN]; /* Peer Responder Confirm */ + uint8_t PeerCa_Ea[SMP_RAND_LEN]; /* Peer Responder Confirm or DH Key Check */ +} smpScScratch_t; + +/* SMP LESC Control Block */ +typedef struct +{ + uint8_t lescEnabled; /* TRUE when LE Secure Connection pairing in use */ + uint8_t authType; /* Type of authentication (Just Works, Numeric Comparison, Passkey, or OOB) */ + uint8_t kpNotify; /* TRUE when Keypress notification in use */ + uint8_t pkPos; /* Current passkey bit position */ + bool_t display; /* Passkey display setting */ + smpScPubKey_t *pPeerPublicKey; /* Peer device's ECC Key */ + smpScPubKey_t *pLocalPublicKey; /* Local device's public ECC Key */ + uint8_t *pPrivateKey; /* Local device's private ECC Key */ + smpScScratch_t *pScratch; /* Scratch Buffer */ + smpScLtk_t *pLtk; /* LTK calculation control */ +} smpScCcb_t; + +/* SMP connection control block */ +typedef struct +{ + wsfTimer_t rspTimer; /* Response timer */ + wsfTimer_t waitTimer; /* Wait interval timer after max attempts */ + smpPair_t pairReq; /* Pair request parameters */ + smpPair_t pairRsp; /* Pair response parameters */ + smpScratch_t *pScr; /* Pointer to scratchpad buffer */ + uint8_t *pQueued; /* Pointer to queued packet buffer */ + uint16_t handle; /* Connection handle */ + bool_t initiator; /* TRUE if device is initiator */ + bool_t secReq; /* TRUE if security request sent or received */ + bool_t flowDisabled; /* TRUE if data flow disabled */ + dmConnId_t connId; /* DM connection ID */ + uint8_t state; /* State machine state */ + uint8_t nextCmdCode; /* Command code of next expected packet */ + uint8_t auth; /* Resulting authentication and bonding flags */ + uint8_t token; /* AES transaction token */ + uint8_t attempts; /* Failed pairing attempts */ + uint8_t lastSentKey; /* Command code of last sent key */ + smpScCcb_t *pScCcb; /* LE Secure Connection control blocks */ +} smpCcb_t; + +/* State machine action function type */ +typedef void (*smpAct_t)(smpCcb_t *pCcb, smpMsg_t *pMsg); + +/* SMP process pairing function */ +typedef bool_t smpProcPairing_t(smpCcb_t *pCcb, uint8_t *pOob, uint8_t *pDisplay); + +/* SMP process pairing function */ +typedef void smpProcAuthReq_t(smpCcb_t *pCcb, uint8_t oob, uint8_t display); + +/* State machine interface type */ +typedef struct +{ + smpTblEntry_t const * const *pStateTbl; /* Pointer to state table */ + smpAct_t const *pActionTbl; /* Pointer to action table */ + smpTblEntry_t const *pCommonTbl; /* Pointer to common action table */ +} smpSmIf_t; + +/* SMP main control block */ +typedef struct +{ + smpCcb_t ccb[DM_CONN_MAX]; /* Legacy Connection control blocks */ + smpSmIf_t const *pSlave; /* Slave state machine interface */ + smpSmIf_t const *pMaster; /* Master state machine interface */ + wsfHandlerId_t handlerId; /* WSF handler ID */ + smpProcPairing_t *procPairing; /* Pointer to process pairing function */ + smpProcAuthReq_t *procAuthReq; /* Pointer to process auth request function */ + bool_t lescSupported; /* TRUE if LE Secure Connections is supported */ +} smpCb_t; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* SMP packet length table */ +extern const uint8_t smpPktLenTbl[]; + +/* Control block */ +extern smpCb_t smpCb; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* utility functions from smp main */ +smpCcb_t *smpCcbByHandle(uint16_t handle); +smpCcb_t *smpCcbByConnId(dmConnId_t connId); +void smpCalcC1Part1(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pRand); +void smpCalcC1Part2(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pPart1); +void smpCalcS1(smpCcb_t *pCcb, uint8_t *pKey, uint8_t *pRand1, uint8_t *pRand2); +void smpGenerateLtk(smpCcb_t *pCcb); +void smpSendPkt(smpCcb_t *pCcb, uint8_t *pPkt); +bool_t smpStateIdle(smpCcb_t *pCcb); +void *smpMsgAlloc(uint16_t len); +uint8_t smpGetScSecLevel(smpCcb_t *pCcb); + +/* action functions and utility functions from smp act */ +void smpStartRspTimer(smpCcb_t *pCcb); +void smpActNone(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpCleanup(smpCcb_t *pCcb); +void smpActCleanup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpSendPairingFailed(smpCcb_t *pCcb, uint8_t reason); +void smpActPairingFailed(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActPairingCancel(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActStorePin(smpCcb_t *pCcb, smpMsg_t *pMsg); +bool_t smpProcPairing(smpCcb_t *pCcb, uint8_t *pOob, uint8_t *pDisplay); +void smpAuthReq(smpCcb_t *pCcb, uint8_t oob, uint8_t display); +void smpActPairCnfCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActPairCnfCalc2(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActSendPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActPairCnfVerCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActPairCnfVerCalc2(smpCcb_t *pCcb, smpMsg_t *pMsg); +bool_t smpSendKey(smpCcb_t *pCcb, uint8_t keyDist); +bool_t smpProcRcvKey(smpCcb_t *pCcb, dmSecKeyIndEvt_t *pKeyInd, uint8_t *pBuf, uint8_t keyDist); +void smpActMaxAttempts(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActAttemptRcvd(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActCheckAttempts(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActNotifyDmAttemptsFailure(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActNotifyDmRspToFailure(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpActPairingCmpl(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpSmExecute(smpCcb_t *pCcb, smpMsg_t *pMsg); + +/* diagnostic functions */ +uint8_t *smpEventStr(uint8_t eventId); +uint8_t *smpStateStr(uint8_t state); + +/* SMP DB functions */ +uint32_t SmpDbMaxAttemptReached(dmConnId_t connId); +void SmpDbPairingFailed(dmConnId_t connId); +uint32_t SmpDbGetPairingDisabledTime(dmConnId_t connId); +void SmpDbService(void); +uint8_t SmpDbGetFailureCount(dmConnId_t connId); +void SmpDbSetFailureCount(dmConnId_t connId, uint8_t count); + +#ifdef __cplusplus +}; +#endif + +#endif /* SMP_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_non.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_non.c new file mode 100644 index 0000000000000000000000000000000000000000..fc73ede6be01d46c71d74a959410ee5b57383f98 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_non.c @@ -0,0 +1,104 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Simple implementation of SMP when not supported. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_msg.h" +#include "util/bstream.h" +#include "dm_api.h" +#include "l2c_api.h" +#include "smp_api.h" +#include "smp_main.h" + +/*************************************************************************************************/ +/*! + * \brief L2C control callback for SMP. + * + * \param pMsg Pointer to message structure. + * + * \return None. + */ +/*************************************************************************************************/ +static void smpNonL2cCtrlCback(wsfMsgHdr_t *pMsg) +{ + return; +} + +/*************************************************************************************************/ +/*! + * \brief L2CAP data callback for SMP when SMP not supported. + * + * \param handle The connection handle. + * \param len The length of the L2CAP payload data in pPacket. + * \param pPacket A buffer containing the packet. + * + * \return None. + */ +/*************************************************************************************************/ +void smpNonL2cDataCback(uint16_t handle, uint16_t len, uint8_t *pPacket) +{ + uint8_t *pRsp; + uint8_t *p; + uint8_t role; + dmConnId_t connId; + + if ((connId = DmConnIdByHandle(handle)) == DM_CONN_ID_NONE) + { + return; + } + + role = DmConnRole(connId); + + p = pPacket + L2C_PAYLOAD_START; + + /* SMP is not supported so fail gracefully */ + + /* if slave and pairing request received, or master and security request received */ + if ((role == DM_ROLE_SLAVE && *p == SMP_CMD_PAIR_REQ) || + (role == DM_ROLE_MASTER && *p == SMP_CMD_SECURITY_REQ)) + { + /* send pairing failed */ + if ((pRsp = smpMsgAlloc(L2C_PAYLOAD_START + SMP_PAIR_FAIL_LEN)) != NULL) + { + p = pRsp + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_FAIL); + UINT8_TO_BSTREAM(p, SMP_ERR_PAIRING_NOT_SUP); + + L2cDataReq(L2C_CID_SMP, handle, SMP_PAIR_FAIL_LEN, pRsp); + } + } + + /* all other messages are ignored */ +} + +/*************************************************************************************************/ +/*! + * \brief Use this SMP init function when SMP is not supported. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpNonInit(void) +{ + /* Register with L2C */ + L2cRegister(L2C_CID_SMP, smpNonL2cDataCback, smpNonL2cCtrlCback); +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_act.c new file mode 100644 index 0000000000000000000000000000000000000000..63131c195b687571dbecc2fd0e3bdde3c30419b1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_act.c @@ -0,0 +1,1002 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections common action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "dm_api.h" +#include "dm_main.h" +#include "dm_conn.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smp_sc_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#ifndef SMP_DHKEY_QUAL_INCLUDED +#define SMP_DHKEY_QUAL_INCLUDED FALSE +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ +static const uint8_t smpScF5Key[] = {0x62, 0x74, 0x6c, 0x65}; + +#if SMP_DHKEY_QUAL_INCLUDED +static bool_t SMP_DhKeyZero = FALSE; + +/*************************************************************************************************/ +/*! + * \brief Called to force the DhKey to zero for qualification test purposes. + * + * \param enable TRUE - Force DhKey to zero. FALSE - Use calculated key + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScEnableZeroDhKey(bool_t enable) +{ + SMP_DhKeyZero = enable; +} +#endif /* SMP_DHKEY_QUAL_INCLUDED */ + +/*************************************************************************************************/ +/*! + * \brief Write initator BD Address to a buffer for use with toolkit functions F5 and F6. + * + * \param pCcb Connection control block. + * \param pBuf Buffer to write BD addresses to. + * + * \return None. + */ +/*************************************************************************************************/ +static uint8_t *smpScCatInitiatorBdAddr(smpCcb_t *pCcb, uint8_t *pBuf) +{ + dmConnCcb_t *pDmCcb = dmConnCcbById(pCcb->connId); + + if (pDmCcb) + { + if (pCcb->initiator) + { + /* if local device's using RPA */ + if (!BdaIsZeros(pDmCcb->localRpa)) + { + *pBuf++ = DM_ADDR_RANDOM; + WStrReverseCpy(pBuf, pDmCcb->localRpa, BDA_ADDR_LEN); + } + else + { + *pBuf++ = pDmCcb->localAddrType; + WStrReverseCpy(pBuf, pDmCcb->localAddr, BDA_ADDR_LEN); + } + } + else + { + /* if peer device's using RPA */ + if (!BdaIsZeros(pDmCcb->peerRpa)) + { + *pBuf++ = DM_ADDR_RANDOM; + WStrReverseCpy(pBuf, pDmCcb->peerRpa, BDA_ADDR_LEN); + } + else + { + *pBuf++ = pDmCcb->peerAddrType; + WStrReverseCpy(pBuf, pDmCcb->peerAddr, BDA_ADDR_LEN); + } + } + + pBuf += BDA_ADDR_LEN; + } + + return pBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Write responder BD Address to a buffer for use with toolkit functions F5 and F6. + * + * \param pCcb Connection control block. + * \param pBuf Buffer to write BD addresses to. + * + * \return None. + */ +/*************************************************************************************************/ +static uint8_t *smpScCatResponderBdAddr(smpCcb_t *pCcb, uint8_t *pBuf) +{ + dmConnCcb_t *pDmCcb = dmConnCcbById(pCcb->connId); + + if (pDmCcb) + { + if (pCcb->initiator) + { + /* if peer device's using RPA */ + if (!BdaIsZeros(pDmCcb->peerRpa)) + { + *pBuf++ = DM_ADDR_RANDOM; + WStrReverseCpy(pBuf, pDmCcb->peerRpa, BDA_ADDR_LEN); + } + else + { + *pBuf++ = pDmCcb->peerAddrType; + WStrReverseCpy(pBuf, pDmCcb->peerAddr, BDA_ADDR_LEN); + } + } + else + { + /* if local device's using RPA */ + if (!BdaIsZeros(pDmCcb->localRpa)) + { + *pBuf++ = DM_ADDR_RANDOM; + WStrReverseCpy(pBuf, pDmCcb->localRpa, BDA_ADDR_LEN); + } + else + { + *pBuf++ = pDmCcb->localAddrType; + WStrReverseCpy(pBuf, pDmCcb->localAddr, BDA_ADDR_LEN); + } + } + + pBuf += BDA_ADDR_LEN; + } + + return pBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Process a pairing request and response data. + * + * \param pCcb Connection control block. + * \param pOob Return parameter, TRUE if out-of-band data requested. + * \param pDisplay Return parameter, TRUE if pin is to be displayed. + * + * \return TRUE on success, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t smpScProcPairing(smpCcb_t *pCcb, uint8_t *pOob, uint8_t *pDisplay) +{ + bool_t justWorks = TRUE; + uint8_t localAuth; + wsfMsgHdr_t hdr; + + *pDisplay = FALSE; + *pOob = SMP_OOB_DATA_NONE; + + /* check for LE Secure Connections */ + if ((pCcb->pairReq[SMP_AUTHREQ_POS] & SMP_AUTH_SC_FLAG) && + (pCcb->pairRsp[SMP_AUTHREQ_POS] & SMP_AUTH_SC_FLAG)) + { + /* if one or both devices have OOB authentication data */ + if ((pCcb->pairReq[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) || + (pCcb->pairRsp[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT)) + { + *pOob = SMP_OOB_DATA_PRESENT; + justWorks = FALSE; + } + } + /* legacy pairing */ + else + { + /* if both devices have OOB authentication data */ + if ((pCcb->pairReq[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) && + (pCcb->pairRsp[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT)) + { + *pOob = SMP_OOB_DATA_PRESENT; + justWorks = FALSE; + } + } + + /* if OOB authentication data not present and either device has set MITM option */ + if ((*pOob == SMP_OOB_DATA_NONE) && + ((pCcb->pairReq[SMP_AUTHREQ_POS] & SMP_AUTH_MITM_FLAG) || + (pCcb->pairRsp[SMP_AUTHREQ_POS] & SMP_AUTH_MITM_FLAG))) + { + /* check for compatible I/O settings */ + if ((pCcb->pairReq[SMP_IO_POS] != SMP_IO_NO_IN_NO_OUT) && /* initiator has i/o and */ + (pCcb->pairRsp[SMP_IO_POS] != SMP_IO_NO_IN_NO_OUT) && /* responder has i/o and */ + !(((pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_ONLY) || /* both don't have display only */ + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO)) && + ((pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_ONLY) || + (pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_YES_NO)))) + { + /* use pin */ + justWorks = FALSE; + + /* check if pin should be displayed (as initiator) */ + *pDisplay = + ((pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_ONLY) || /* initiator is display only or */ + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO) || /* initiator is display y/n or */ + ((pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_DISP) && /* initiator is key/display and */ + (pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_ONLY || /* responder is key only or key/display */ + pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_DISP))); + + /* invert display setting if we are not initiator and both are not key only */ + if (!(pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_ONLY && + pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_ONLY)) + { + *pDisplay ^= !pCcb->initiator; + } + } + } + + /* Check for Secure Connections */ + if ((pCcb->pairReq[SMP_AUTHREQ_POS] & SMP_AUTH_SC_FLAG) && + (pCcb->pairRsp[SMP_AUTHREQ_POS] & SMP_AUTH_SC_FLAG)) + { + if (smpCb.lescSupported == FALSE) + { + /* cancel pairing if LESC is not initialized by application */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_AUTH_REQ; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + else + { + pCcb->pScCcb->lescEnabled = TRUE; + pCcb->pScCcb->authType = SMP_AUTH_TYPE_JUST_WORKS; + pCcb->pScCcb->display = *pDisplay; + + if (*pOob) + { + pCcb->pScCcb->authType = SMP_AUTH_TYPE_OOB; + } + else if (justWorks == FALSE) + { + pCcb->pScCcb->authType = SMP_AUTH_TYPE_PASSKEY; + + if (((pCcb->pairRsp[SMP_IO_POS] == SMP_IO_KEY_DISP) && + ((pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO) || + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_DISP))) || + + ((pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_YES_NO) && + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_KEY_DISP))) + { + pCcb->pScCcb->authType = SMP_AUTH_TYPE_NUM_COMP; + } + else if ((pCcb->pairReq[SMP_AUTHREQ_POS] & SMP_AUTH_KP_FLAG) && + (pCcb->pairRsp[SMP_AUTHREQ_POS] & SMP_AUTH_KP_FLAG)) + { + pCcb->pScCcb->kpNotify = TRUE; + } + } + else + { + /* Check for numeric comparison */ + if ((pCcb->pairRsp[SMP_IO_POS] == SMP_IO_DISP_YES_NO) && + (pCcb->pairReq[SMP_IO_POS] == SMP_IO_DISP_YES_NO)) + { + pCcb->pScCcb->authType = SMP_AUTH_TYPE_NUM_COMP; + + /* set false to add in MITM below */ + justWorks = FALSE; + } + } + } + + hdr.param = pCcb->connId; + + /* Allocate a scratch pad for Peer Key and CMAC calculations */ + if (SmpScAllocScratchBuffers(pCcb)) + { + /* Store the current ECC key */ + memcpy(pCcb->pScCcb->pLocalPublicKey->pubKeyX, DmSecGetEccKey()->pubKey_x, SMP_PUB_KEY_LEN); + memcpy(pCcb->pScCcb->pLocalPublicKey->pubKeyY, DmSecGetEccKey()->pubKey_y, SMP_PUB_KEY_LEN); + memcpy(pCcb->pScCcb->pPrivateKey, DmSecGetEccKey()->privKey, SMP_PRIVATE_KEY_LEN); + + /* Send internal message indicating LESC was requested */ + hdr.event = SMP_MSG_INT_LESC; + } + else + { + hdr.status = SMP_ERR_UNSPECIFIED; + hdr.event = SMP_MSG_API_CANCEL_REQ; + } + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } + else if ((pSmpCfg->auth & SMP_AUTH_SC_FLAG) != 0) + { + /* cancel pairing if configuration requires LESC and we are falling back to legacy */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_AUTH_REQ; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + else + { + /* in case we're falling back to legacy after being paired with SC */ + pCcb->pScCcb->lescEnabled = FALSE; + + /* Send internal message indicating legacy security was requested */ + hdr.param = pCcb->connId; + hdr.event = SMP_MSG_INT_LEGACY; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } + + if (!justWorks) + { + /* set auth flags with mitm bit set */ + pCcb->auth = (pCcb->pairReq[SMP_AUTHREQ_POS] & pCcb->pairRsp[SMP_AUTHREQ_POS]) | SMP_AUTH_MITM_FLAG; + } + else + { + /* set auth flags with mitm bit cleared */ + pCcb->auth = pCcb->pairReq[SMP_AUTHREQ_POS] & pCcb->pairRsp[SMP_AUTHREQ_POS] & ~SMP_AUTH_MITM_FLAG; + } + + /* if we ended up with 'just works' but the device configuration requires authentication */ + localAuth = (pCcb->initiator) ? pCcb->pairReq[SMP_AUTHREQ_POS] : pCcb->pairRsp[SMP_AUTHREQ_POS]; + if (justWorks && (pSmpCfg->auth & localAuth & SMP_AUTH_MITM_FLAG)) + { + /* cancel pairing */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_AUTH_REQ; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + + /* if max encryption key is less than our minimum */ + if (pCcb->pairReq[SMP_MAXKEY_POS] < pSmpCfg->minKeyLen || + pCcb->pairRsp[SMP_MAXKEY_POS] < pSmpCfg->minKeyLen) + { + /* cancel pairing */ + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_ENC_KEY_SIZE; + hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + return FALSE; + } + + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Request authentication data or send ourselves an authentication response. + * + * \param pCcb Connection control block. + * \param oob Out-of-band data requested. + * \param display TRUE if pin is to be displayed. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScAuthReq(smpCcb_t *pCcb, uint8_t oob, uint8_t display) +{ + /* use a union to save a bit of memory on the stack */ + union + { + smpDmAuthRsp_t authRsp; + dmSecAuthReqIndEvt_t authReq; + } buf; + + /* if authenticated pairing */ + if (((!pCcb->pScCcb->lescEnabled) && (pCcb->auth & SMP_AUTH_MITM_FLAG )) || + ((pCcb->pScCcb->lescEnabled) && (pCcb->pScCcb->authType == SMP_AUTH_TYPE_OOB))) + { + /* request pin or oob from user */ + buf.authReq.hdr.param = pCcb->connId; + buf.authReq.hdr.event = DM_SEC_AUTH_REQ_IND; + buf.authReq.oob = oob; + buf.authReq.display = display; + DmSmpCbackExec((dmEvt_t *) &buf.authReq); + } + else + { + /* else use just works; send ourselves a auth rsp with all zero pin */ + buf.authRsp.hdr.param = pCcb->connId; + buf.authRsp.hdr.event = SMP_MSG_API_AUTH_RSP; + buf.authRsp.authData[0] = 0; + buf.authRsp.authData[1] = 0; + buf.authRsp.authData[2] = 0; + buf.authRsp.authDataLen = SMP_PIN_LEN; + smpSmExecute(pCcb, (smpMsg_t *) &buf.authRsp); + } +} + +/*************************************************************************************************/ +/*! + * \brief Cleanup after LESC secure pairing ends. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActCleanup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smpActCleanup(pCcb, pMsg); + + /* Free scratch buffers */ + SmpScFreeScratchBuffers(pCcb); +} + +/*************************************************************************************************/ +/*! + * \brief Pairing Failed Action. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActPairingFailed(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Perform LESC Cleanup */ + smpScActCleanup(pCcb, pMsg); + + /* Process failure */ + smpActPairingFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Pairing Cancel Action. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActPairingCancel(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* send pairing failed packet */ + smpSendPairingFailed(pCcb, pMsg->hdr.status); + + smpScActPairingFailed(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Common actions upon selection of type of LESC pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActAuthSelect(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + wsfMsgHdr_t hdr; + uint8_t *pPacket = pMsg->data.pPacket + L2C_PAYLOAD_START; + + /* Process public key from peer (store in MSB first format) */ + WStrReverseCpy(pCcb->pScCcb->pPeerPublicKey->pubKeyX, &pPacket[SMP_PUB_KEY_X_POS], SMP_PUB_KEY_LEN); + WStrReverseCpy(pCcb->pScCcb->pPeerPublicKey->pubKeyY, &pPacket[SMP_PUB_KEY_Y_POS], SMP_PUB_KEY_LEN); + + /* Message state machine indicating authorization mode (JW, OOB, or passkey) */ + hdr.param = pCcb->connId; + + switch(pCcb->pScCcb->authType) + { + case SMP_AUTH_TYPE_NUM_COMP: + case SMP_AUTH_TYPE_JUST_WORKS: + hdr.event = SMP_MSG_INT_JW_NC; + break; + case SMP_AUTH_TYPE_OOB: + hdr.event = SMP_MSG_INT_OOB; + break; + case SMP_AUTH_TYPE_PASSKEY: + hdr.event = SMP_MSG_INT_PASSKEY; + break; + default: + hdr.status = SMP_ERR_UNSPECIFIED; + hdr.event = SMP_MSG_API_CANCEL_REQ; + break; + } + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); +} + +/*************************************************************************************************/ +/*! + * \brief Setup for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActPkSetup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* use a union to save a bit of memory on the stack */ + union + { + smpDmAuthRsp_t authRsp; + dmSecAuthReqIndEvt_t authReq; + } buf; + + pCcb->pScCcb->pkPos = 0; + + /* Next command is the Pair Confirm */ + pCcb->nextCmdCode = SMP_CMD_PAIR_CNF; + + /* request pin or oob from user */ + buf.authReq.hdr.param = pCcb->connId; + buf.authReq.hdr.event = DM_SEC_AUTH_REQ_IND; + buf.authReq.oob = FALSE; + buf.authReq.display = pCcb->pScCcb->display; + DmSmpCbackExec((dmEvt_t *)&buf.authReq); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the confirm value for Just Works pairing using Toolkit function F4 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActJwncCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Cb = f4(PKbx, PKax, Nb, 0x00) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + if (pCcb->initiator) + { + SMP_TRACE_256("F4 PKb", pCcb->pScCcb->pPeerPublicKey->pubKeyX); + SMP_TRACE_256("F4 PKa", pCcb->pScCcb->pLocalPublicKey->pubKeyX); + SMP_TRACE_128("F4 Nb", pCcb->pScCcb->pScratch->Nb_Eb); + + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + 0, pCcb->pScCcb->pScratch->Nb_Eb); + } + else + { + SMP_TRACE_256("F4 PKb", pCcb->pScCcb->pLocalPublicKey->pubKeyX); + SMP_TRACE_256("F4 PKa", pCcb->pScCcb->pPeerPublicKey->pubKeyX); + SMP_TRACE_128("F4 Nb", pCcb->pScCcb->pScratch->Nb_Eb); + + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + 0, pCcb->pScCcb->pScratch->Nb_Eb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate Just Works verify value using Toolkit function G2 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCmacText; + + /* g2(PKax, PKbx, Na, Nb) where g2(U, V, X, Z) = AES-CMACx (U || V || Z) mod 2^32 */ + if ((pCmacText = SmpScAlloc(SMP_G2_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* Concatinate PKax, PKbx, Nb */ + if (pCcb->initiator) + { + pCatBuf = SmpScCat(pCatBuf, pCcb->pScCcb->pLocalPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + pCatBuf = SmpScCat(pCatBuf, pCcb->pScCcb->pPeerPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + } + else + { + pCatBuf = SmpScCat(pCatBuf, pCcb->pScCcb->pPeerPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + pCatBuf = SmpScCat(pCatBuf, pCcb->pScCcb->pLocalPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + } + + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Nb_Eb); + + /* Execute CMAC with Na as the key */ + SmpScCmac(pCcb->pScCcb->pScratch->Na_Ea, pCmacText, SMP_G2_TEXT_LEN, pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify the application of the verify value calculated with Just Works pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActJwncDisplay(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + if (pCcb->pScCcb->authType == SMP_AUTH_TYPE_NUM_COMP) + { + dmSecCnfIndEvt_t cnfEvt; + + SMP_TRACE_128("JWNC Display Cnf", pMsg->aes.pCiphertext); + + /* Send the confirm value to the application for display to the user */ + Calc128Cpy(cnfEvt.confirm, pMsg->aes.pCiphertext); + cnfEvt.hdr.param = pCcb->connId; + cnfEvt.hdr.event = DM_SEC_COMPARE_IND; + cnfEvt.hdr.status = HCI_SUCCESS; + + DmSmpCbackExec((dmEvt_t *) &cnfEvt); + } + else + { + /* Just Works always reports success */ + wsfMsgHdr_t hdr; + + hdr.param = pCcb->connId; + hdr.event = SMP_MSG_API_USER_CONFIRM; + hdr.status = HCI_SUCCESS; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Notify the application of a received keypress message + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActPkKeypress(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCmd = pMsg->data.pPacket + L2C_PAYLOAD_START; + uint8_t *pPacket = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + if (*pCmd == SMP_CMD_KEYPRESS) + { + dmSecKeypressIndEvt_t keypressEvt; + + /* Notify the application a keypress message was received from the responder */ + keypressEvt.notificationType = *pPacket; + keypressEvt.hdr.param = pCcb->connId; + keypressEvt.hdr.event = DM_SEC_KEYPRESS_IND; + keypressEvt.hdr.status = HCI_SUCCESS; + + DmSmpCbackExec((dmEvt_t *) &keypressEvt); + } + else if (*pCmd == SMP_CMD_PAIR_CNF) + { + /* Handle the case where a confirm is received before the user enters the passkey */ + pMsg->hdr.event = SMP_MSG_EARLY_CNF; + pMsg->hdr.status = HCI_SUCCESS; + smpSmExecute(pCcb, pMsg); + } + else + { + /* Unexpected command */ + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a keypress command to the responder + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActPkSendKeypress(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Send keypress notification to the peer */ + smpDmKeypress_t *pKeypress = (smpDmKeypress_t *) pMsg; + uint8_t *pPkt; + uint8_t *p; + + if (pCcb->pScCcb->kpNotify) + { + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_KEYPRESS_MSG_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_KEYPRESS); + + /* Store keypress notification type */ + *p = pKeypress->keypress; + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + else + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the DHKey, alsop called shared secret, for Cryptographic Function 5 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActCalcSharedSecret(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + secEccKey_t key; + +#if SMP_DHKEY_QUAL_INCLUDED + if (SMP_DhKeyZero) + { + secEccMsg_t *pEccMsg = WsfMsgAlloc(sizeof(secEccMsg_t)); + + if (pEccMsg) + { + /* Send all zero shared secret to handler */ + memset(pEccMsg->data.sharedSecret.secret, 0, SEC_ECC_KEY_LEN); + + pEccMsg->hdr.event = SMP_MSG_WSF_ECC_CMPL; + pEccMsg->hdr.param = pCcb->connId; + pEccMsg->hdr.status = HCI_SUCCESS; + + WsfMsgSend(smpCb.handlerId, pEccMsg); + + return; + } + } +#endif + + /* Use local private key and peer public key to generate the shared secret */ + memcpy(key.privKey, pCcb->pScCcb->pPrivateKey, SMP_PRIVATE_KEY_LEN); + memcpy(key.pubKey_x, pCcb->pScCcb->pPeerPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + memcpy(key.pubKey_y, pCcb->pScCcb->pPeerPublicKey->pubKeyY, SMP_PUB_KEY_LEN); + + /* Generate the shared secret */ + if (SecEccGenSharedSecret(&key, smpCb.handlerId, pCcb->connId, SMP_MSG_WSF_ECC_CMPL) == FALSE) + { + pMsg->hdr.status = SMP_ERR_MEMORY; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Key, T, for Cryptographic Function F5 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActCalcF5TKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + secEccMsg_t *pSecretMsg = (secEccMsg_t*) pMsg; + uint8_t *pCmacText; + + if (pMsg->hdr.status == HCI_SUCCESS) + { + /* The shared secret is the DH Key */ + SMP_TRACE_256("DHKey (Shared Secret)", pSecretMsg->data.sharedSecret.secret); + + if ((pCmacText = SmpScAlloc(SMP_F5_TKEY_TEXT_LEN, pCcb, pMsg)) != NULL) + { + const uint8_t salt[] = {0x6C, 0x88, 0x83, 0x91, 0xAA, 0xF5, 0xA5, 0x38, + 0x60, 0x37, 0x0B, 0xDB, 0x5A, 0x60, 0x83, 0xBE}; + + /* T = AES-CMACsalt (DHKey) */ + memcpy(pCmacText, pSecretMsg->data.sharedSecret.secret, SMP_DHKEY_LEN); + + /* Execute CMAC with salt as the key */ + SmpScCmac(salt, pCmacText, SMP_F5_TKEY_TEXT_LEN, pCcb, pMsg); + } + } + else + { + SmpScGetCancelMsgWithReattempt(pCcb->connId, &pMsg->hdr, SMP_ERR_DH_KEY_CHECK); + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the MacKey from Cryptographic Function F5 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActCalcF5MacKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + secCmacMsg_t *pCmac = (secCmacMsg_t *) pMsg; + uint8_t *pCmacText; + + /* Copy T from the previous step in the F5 Calculation */ + Calc128Cpy(pCcb->pScCcb->pLtk->ltk_t, pCmac->pCiphertext); + + SMP_TRACE_128("T", pCcb->pScCcb->pLtk->ltk_t); + + if ((pCmacText = SmpScAlloc(SMP_F5_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* mackey || ltk = f5(W, N1, N2, A1, A2) */ + /* mackey = AES-CMACT (Counter = 0 || keyID ||N1 || N2|| A1|| A2|| Length = 256) */ + *pCatBuf++ = 0; + pCatBuf = SmpScCat(pCatBuf, smpScF5Key, 4); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Na_Ea); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Nb_Eb); + pCatBuf = smpScCatInitiatorBdAddr(pCcb, pCatBuf); + pCatBuf = smpScCatResponderBdAddr(pCcb, pCatBuf); + *pCatBuf++ = 1; + *pCatBuf++ = 0; + + /* Execute CMAC with T as the key */ + SmpScCmac(pCcb->pScCcb->pLtk->ltk_t, pCmacText, SMP_F5_TEXT_LEN, pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the LTK from Cryptographic Function F5 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActCalcF5Ltk(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + secCmacMsg_t *pCmac = (secCmacMsg_t *) pMsg; + uint8_t *pCmacText; + + SMP_TRACE_128("MAC", pMsg->aes.pCiphertext); + + /* Copy Mac Key from the previous step in the F5 Calculation */ + Calc128Cpy(pCcb->pScCcb->pLtk->mac, pCmac->pCiphertext); + + if ((pCmacText = SmpScAlloc(SMP_F5_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* mackey || ltk = f5(W, N1, N2, A1, A2) */ + /* ltk = AES-CMACT (Counter = 1 || keyID || N1 || N2|| A1|| A2 ||Length = 256) */ + *pCatBuf++ = 1; + pCatBuf = SmpScCat(pCatBuf, smpScF5Key, 4); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Na_Ea); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Nb_Eb); + pCatBuf = smpScCatInitiatorBdAddr(pCcb, pCatBuf); + pCatBuf = smpScCatResponderBdAddr(pCcb, pCatBuf); + *pCatBuf++ = 1; + *pCatBuf++ = 0; + + /* Execute CMAC with T as the key */ + SmpScCmac(pCcb->pScCcb->pLtk->ltk_t, pCmacText, SMP_F5_TEXT_LEN, pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the DH Key Check Ea with toolkit function F6 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActDHKeyCalcF6Ea(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCmacText; + + SMP_TRACE_128("LTK", pMsg->aes.pCiphertext); + + /* Copy LTK from the previous state (smpScActCalcF5Ltk) */ + WStrReverseCpy(pCcb->pScCcb->pLtk->ltk_t, pMsg->aes.pCiphertext, 16); + + if ((pCmacText = SmpScAlloc(SMP_F6_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* f6(W, N1, N2, R, IOcap, A1, A2) = AES-CMACW (N1 || N2 || R || IOcap || A1 || A2) */ + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Na_Ea); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Nb_Eb); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Rb); + + *pCatBuf++ = pCcb->pairReq[SMP_AUTHREQ_POS]; /* AuthReq */ + *pCatBuf++ = pCcb->pairReq[SMP_OOB_POS]; /* OOB Data Flag */ + *pCatBuf++ = pCcb->pairReq[SMP_IO_POS]; /* IO Capability Parameter */ + + pCatBuf = smpScCatInitiatorBdAddr(pCcb, pCatBuf); + pCatBuf = smpScCatResponderBdAddr(pCcb, pCatBuf); + + /* Execute CMAC with MACKey as the key */ + SmpScCmac(pCcb->pScCcb->pLtk->mac, pCmacText, SMP_F6_TEXT_LEN, pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the DH Key Check Eb with toolkit function F6 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScActDHKeyCalcF6Eb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCmacText; + + SMP_TRACE_128("DHKey Ea", pMsg->aes.pCiphertext); + + if ((pCmacText = SmpScAlloc(SMP_F6_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* f6(W, N1, N2, R, IOcap, A1, A2) = AES-CMACW (N1 || N2 || R || IOcap || A1 || A2) */ + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Nb_Eb); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Na_Ea); + pCatBuf = SmpScCat128(pCatBuf, pCcb->pScCcb->pScratch->Ra); + + *pCatBuf++ = pCcb->pairRsp[SMP_AUTHREQ_POS]; /* AuthReq */ + *pCatBuf++ = pCcb->pairRsp[SMP_OOB_POS]; /* OOB Data Flag */ + *pCatBuf++ = pCcb->pairRsp[SMP_IO_POS]; /* IO Capability Parameter */ + + pCatBuf = smpScCatResponderBdAddr(pCcb, pCatBuf); + pCatBuf = smpScCatInitiatorBdAddr(pCcb, pCatBuf); + + /* Execute CMAC with MACKey as the key */ + SmpScCmac(pCcb->pScCcb->pLtk->mac, pCmacText, SMP_F6_TEXT_LEN, pCcb, pMsg); + } + + /* Copy Ea from the previous state (smpScActDHKeyCalcF6Ea) */ + Calc128Cpy(pCcb->pScCcb->pScratch->Na_Ea, pMsg->aes.pCiphertext); +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.c new file mode 100644 index 0000000000000000000000000000000000000000..cbdcf08aac0d11c2534325fe61863c7c597170de --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.c @@ -0,0 +1,756 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections main module and utility functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "wsf_msg.h" +#include "sec_api.h" +#include "wsf_buf.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "dm_api.h" +#include "smp_api.h" +#include "smp_defs.h" +#include "smp_main.h" +#include "smp_sc_main.h" +#include "smp_handler.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* LE Secure Connections Control Block (TBD: Make these dynamic) */ +smpScCcb_t SMP_ScCcb[DM_CONN_MAX]; + +/*************************************************************************************************/ +/*! + * \brief Allocate LESC Scratch buffers + * + * \param pCcb SMP control block. + * + * \return TRUE if success, else FALSE. + */ +/*************************************************************************************************/ +bool_t SmpScAllocScratchBuffers(smpCcb_t *pCcb) +{ + if (pCcb->pScCcb->pScratch == NULL) + { + pCcb->pScCcb->pScratch = WsfBufAlloc(sizeof(smpScScratch_t)); + } + + if (pCcb->pScCcb->pPeerPublicKey == NULL) + { + pCcb->pScCcb->pPeerPublicKey = WsfBufAlloc(sizeof(smpScPubKey_t)); + } + + if (pCcb->pScCcb->pLtk == NULL) + { + pCcb->pScCcb->pLtk = WsfBufAlloc(sizeof(smpScLtk_t)); + } + + if (pCcb->pScCcb->pLocalPublicKey == NULL) + { + pCcb->pScCcb->pLocalPublicKey = WsfBufAlloc(sizeof(smpScPubKey_t)); + } + + if (pCcb->pScCcb->pPrivateKey == NULL) + { + pCcb->pScCcb->pPrivateKey = WsfBufAlloc(SMP_PRIVATE_KEY_LEN); + } + + if (pCcb->pScCcb->pScratch && pCcb->pScCcb->pPeerPublicKey && pCcb->pScCcb->pLtk && + pCcb->pScCcb->pLocalPublicKey && pCcb->pScCcb->pPrivateKey) + { + return TRUE; + } + + return FALSE; +} + +/*************************************************************************************************/ +/*! + * \brief Free LESC Scratch buffers + * + * \param pCcb SMP control block. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScFreeScratchBuffers(smpCcb_t *pCcb) +{ + /* free scratch buffer */ + if (pCcb->pScCcb->pScratch != NULL) + { + WsfBufFree(pCcb->pScCcb->pScratch); + pCcb->pScCcb->pScratch = NULL; + } + + /* free scratch peer public key buffer */ + if (pCcb->pScCcb->pPeerPublicKey != NULL) + { + WsfBufFree(pCcb->pScCcb->pPeerPublicKey); + pCcb->pScCcb->pPeerPublicKey = NULL; + } + + /* free scratch LTK buffer */ + if (pCcb->pScCcb->pLtk != NULL) + { + WsfBufFree(pCcb->pScCcb->pLtk); + pCcb->pScCcb->pLtk = NULL; + } + + /* free scratch local public key buffer */ + if (pCcb->pScCcb->pLocalPublicKey != NULL) + { + WsfBufFree(pCcb->pScCcb->pLocalPublicKey); + pCcb->pScCcb->pLocalPublicKey = NULL; + } + + /* free scratch private key buffer */ + if (pCcb->pScCcb->pPrivateKey != NULL) + { + WsfBufFree(pCcb->pScCcb->pPrivateKey); + pCcb->pScCcb->pPrivateKey = NULL; + } +} + +/*************************************************************************************************/ +/*! + * \brief Perform CMAC calculation or send SMP failure + * + * \param pKey CMAC Key + * \param pText Pointer to message text. + * \param textLen Length of pText in bytes. + * \param pCcb SMP control block. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScCmac(const uint8_t *pKey, uint8_t *pText, uint8_t textLen, smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + if (SecCmac(pKey, pText, textLen, smpCb.handlerId, pCcb->connId, SMP_MSG_WSF_CMAC_CMPL) == FALSE) + { + WsfBufFree(pText); + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Allocate a buffer or send SMP failure + * + * \param size Size of buffer to allocate. + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return Allocated buffer. + */ +/*************************************************************************************************/ +uint8_t *SmpScAlloc(uint8_t size, smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pBuf = WsfBufAlloc(size); + + if (pBuf == NULL) + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } + + return pBuf; +} + +/*************************************************************************************************/ +/*! + * \brief Free a buffer allocated with SmpScAlloc. + * + * \param pBuf Pointer to buffer to free. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScFree(uint8_t *pBuf) +{ + WsfBufFree(pBuf); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate cryptographic toolkit function F4. + * + * \param pCcb SMP control block + * \param pMsg WSF message. + * \param pU Pointer to U parameter of F4 function. + * \param pV Pointer to V parameter of F4 function. + * \param z Byte with z parameter of F4 function. + * \param pX Pointer to X parameter of F4 function. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pU, uint8_t *pV, uint8_t z, uint8_t *pX) +{ + uint8_t *pCmacText; + + /* f4(pU, pV, pX, z) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + if ((pCmacText = SmpScAlloc(SMP_F4_TEXT_LEN, pCcb, pMsg)) != NULL) + { + uint8_t *pCatBuf = pCmacText; + + /* Concatinate pU, pV, z */ + pCatBuf = SmpScCat(pCatBuf, pU, SMP_PUB_KEY_LEN); + pCatBuf = SmpScCat(pCatBuf, pV, SMP_PUB_KEY_LEN); + *pCatBuf = z; + + /* Execute CMAC with Nb as the key */ + SmpScCmac(pX, pCmacText, SMP_F4_TEXT_LEN, pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Initialize SMP for LESC security. + * + * \param event WSF event mask. + * \param pMsg WSF message. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpScInit(void) +{ + uint8_t i; + + for (i=0; i<DM_CONN_MAX; i++) + { + smpCb.ccb[i].pScCcb = &SMP_ScCcb[i]; + } + + smpCb.procPairing = smpScProcPairing; + smpCb.procAuthReq = smpScAuthReq; + smpCb.lescSupported = TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Concatinate a buffer and return a pointer to the next byte after concatination. + * + * \param pDst Pointer to destination. + * \param pSrc Pointer to source buffer. + * \param len Length of pSrc in bytes. + * + * \return Pointer to next byte after concatination. + */ +/*************************************************************************************************/ +uint8_t *SmpScCat(uint8_t *pDst, const uint8_t *pSrc, uint8_t len) +{ + memcpy(pDst, pSrc, len); + return pDst + len; +} + +/*************************************************************************************************/ +/*! + * \brief Concatinate a 128 bit buffer and return a pointer to the next byte after concatination. + * + * \param pDst Pointer to destination. + * \param pSrc Pointer to source buffer. + * + * \return Pointer to next byte after concatination. + */ +/*************************************************************************************************/ +uint8_t *SmpScCat128(uint8_t *pDst, uint8_t *pSrc) +{ + Calc128Cpy(pDst, pSrc); + return pDst + 16; +} + +/*************************************************************************************************/ +/*! + * \brief Send public key to peer. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Transmit the public key */ + uint8_t *pPkt; + uint8_t *p; + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PUB_KEY_MSG_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PUBLIC_KEY); + + /* Store Public Key X data in LSB first format */ + WStrReverseCpy(p, pCcb->pScCcb->pLocalPublicKey->pubKeyX, SMP_PUB_KEY_LEN); + + /* Store Public Key Y data in LSB first format */ + WStrReverseCpy(p+SMP_PUB_KEY_LEN, pCcb->pScCcb->pLocalPublicKey->pubKeyY, SMP_PUB_KEY_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + else + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send the DH Key check command to the peer. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * \param pCheck Check data. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScSendDHKeyCheck(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pCheck) +{ + uint8_t *pPkt; + uint8_t *p; + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_DHKEY_CHECK_MSG_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_DHKEY_CHECK); + + /* DH Key Check data is result of last CMAC operation (LSB first) */ + WStrReverseCpy(p, pCheck, SMP_DHKEY_CHECK_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + else + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a Pair Rand command to the peer + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * \param pRand Pointer to rand data. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pRand) +{ + /* Transmit the Pair Rand */ + uint8_t *pPkt; + uint8_t *p; + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_RAND_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_RAND); + + /* Store Random data (LSB first) */ + WStrReverseCpy(p, pRand, SMP_RAND_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + else + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a pairing confirm packet to the peer + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * \param pCnf Point to confirm data. + * + * \return None. + */ +/*************************************************************************************************/ +void smpScSendPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pCnf) +{ + uint8_t *pPkt; + uint8_t *p; + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_CNF_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_CNF); + + /* Store Confirm data (LSB first) */ + WStrReverseCpy(p, pCnf, SMP_CONFIRM_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + else + { + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Get the next bit used in Passkey calculations. + * + * \param pCcb Connection control block. + * + * \return None. + */ +/*************************************************************************************************/ +uint8_t smpGetPkBit(smpCcb_t *pCcb) +{ + smpScCcb_t *pScCb = pCcb->pScCcb; + uint8_t indx = (SMP_RAND_LEN - 1) - pScCb->pkPos / 8; + uint8_t bit = pScCb->pkPos % 8; + + if (pScCb->pScratch->Ra[indx] & 1<<bit) + return 0x81; + + return 0x80; +} + +/*************************************************************************************************/ +/*! + * \brief Get a pointer to the connection's Peer Public Key for LESC pairing + * + * \param connId Connection ID. + * + * \return Peer public Key. + */ +/*************************************************************************************************/ +smpScPubKey_t *smpGetPeerPublicKey(dmConnId_t connId) +{ + smpCcb_t *pCcb = smpCcbByConnId(connId); + + if (pCcb->pScCcb) + { + return pCcb->pScCcb->pPeerPublicKey; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Set the connection's Peer Public Key for LESC pairing + * + * \param connId Connection ID. + * \param pKey A Pointer to the peer's public key. + * + * \return none. + */ +/*************************************************************************************************/ +void smpSetPeerPublicKey(dmConnId_t connId, smpScPubKey_t *pKey) +{ + smpCcb_t *pCcb = smpCcbByConnId(connId); + + if (pCcb->pScCcb) + { + memcpy(pCcb->pScCcb->pPeerPublicKey, pKey, sizeof(smpScPubKey_t)); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set the OOB Confirm value + * + * \param connId Connection ID. + * \param pCnf OOB Configuration. + * + * \return none. + */ +/*************************************************************************************************/ +void SmpScSetOobCfg(dmConnId_t connId, dmSecLescOobCfg_t *pConfig) +{ + smpCcb_t *pCcb = smpCcbByConnId(connId); + + WSF_ASSERT(pCcb->pScCcb->pScratch); + + SMP_TRACE_128("OOB Peer Confirm", pConfig->peerConfirm); + SMP_TRACE_128("OOB Peer Random", pConfig->peerRandom); + SMP_TRACE_128("OOB Local Confirm", pConfig->localConfirm); + SMP_TRACE_128("OOB Local Random", pConfig->localRandom); + + if (pCcb->initiator) + { + Calc128Cpy(pCcb->pScCcb->pScratch->PeerCa_Ea, pConfig->localConfirm); + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, pConfig->localRandom); + Calc128Cpy(pCcb->pScCcb->pScratch->PeerCb, pConfig->peerConfirm); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, pConfig->peerRandom); + } + else + { + Calc128Cpy(pCcb->pScCcb->pScratch->PeerCb, pConfig->localConfirm); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, pConfig->localRandom); + Calc128Cpy(pCcb->pScCcb->pScratch->PeerCa_Ea, pConfig->peerConfirm); + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, pConfig->peerRandom); + } +} + +/*************************************************************************************************/ +/*! + * \brief Format a cancel message with consideration for the attempts counter + * + * \param connId Connection Id. + * \param pHdr Pointer to header of message to fill. + * \param status Status to include. + * + * \return none. + */ +/*************************************************************************************************/ +void SmpScGetCancelMsgWithReattempt(dmConnId_t connId, wsfMsgHdr_t *pHdr, uint8_t status) +{ + smpCcb_t *pCcb = smpCcbByConnId(connId); + + SMP_TRACE_INFO1("SmpScGetCancelMsgWithReattempt: %d", pCcb->attempts); + + /* update repeated attempts count */ + pCcb->attempts++; + + pHdr->param = connId; + pHdr->status = status; + + SmpDbPairingFailed(connId); + + if (pCcb->attempts == pSmpCfg->maxAttempts) + { + /* max attempts reached */ + pHdr->event = SMP_MSG_INT_MAX_ATTEMPTS; + } + else + { + /* else just fail */ + pHdr->event = SMP_MSG_API_CANCEL_REQ; + } +} + +/*************************************************************************************************/ +/*! + * \brief Process failure and check attempt count + * + * \param pCcb Connection control block. + * + * \return none. + */ +/*************************************************************************************************/ +void smpScFailWithReattempt(smpCcb_t *pCcb) +{ + wsfMsgHdr_t hdr; + + SmpScGetCancelMsgWithReattempt(pCcb->connId, &hdr, SMP_ERR_CONFIRM_VALUE); + + smpSmExecute(pCcb, (smpMsg_t *)&hdr); +} + +/*************************************************************************************************/ +/*! + * \brief Convert event into string for diagnostics. + * + * \param eventId Event ID + * + * \return Event string. + */ +/*************************************************************************************************/ +uint8_t *smpEventStr(uint8_t eventId) +{ + switch(eventId) + { + case SMP_MSG_API_PAIR_REQ: return (uint8_t*) "API_PAIR_REQ"; + case SMP_MSG_API_PAIR_RSP: return (uint8_t*) "API_PAIR_RSP"; + case SMP_MSG_API_CANCEL_REQ: return (uint8_t*) "API_CANCEL_REQ"; + case SMP_MSG_API_AUTH_RSP: return (uint8_t*) "API_AUTH_RSP"; + case SMP_MSG_API_SECURITY_REQ: return (uint8_t*) "API_SECURITY_REQ"; + case SMP_MSG_CMD_PKT: return (uint8_t*) "CMD_PKT"; + case SMP_MSG_CMD_PAIRING_FAILED: return (uint8_t*) "CMD_PAIRING_FAILED"; + case SMP_MSG_DM_ENCRYPT_CMPL: return (uint8_t*) "DM_ENCRYPT_CMPL"; + case SMP_MSG_DM_ENCRYPT_FAILED: return (uint8_t*) "DM_ENCRYPT_FAILED"; + case SMP_MSG_DM_CONN_CLOSE: return (uint8_t*) "DM_CONN_CLOSE"; + case SMP_MSG_WSF_AES_CMPL: return (uint8_t*) "WSF_AES_CMPL"; + case SMP_MSG_INT_SEND_NEXT_KEY: return (uint8_t*) "INT_SEND_NEXT_KEY"; + case SMP_MSG_INT_MAX_ATTEMPTS: return (uint8_t*) "INT_MAX_ATTEMPTS"; + case SMP_MSG_INT_PAIRING_CMPL: return (uint8_t*) "INT_PAIRING_CMPL"; + case SMP_MSG_INT_RSP_TIMEOUT: return (uint8_t*) "INT_RSP_TIMEOUT"; + case SMP_MSG_INT_WI_TIMEOUT: return (uint8_t*) "INT_WI_TIMEOUT"; + case SMP_MSG_INT_LESC: return (uint8_t*) "INT_LESC"; + case SMP_MSG_INT_LEGACY: return (uint8_t*) "INT_LEGACY"; + case SMP_MSG_INT_JW_NC: return (uint8_t*) "INT_JW_NC"; + case SMP_MSG_INT_PASSKEY: return (uint8_t*) "INT_PASSKEY"; + case SMP_MSG_INT_OOB: return (uint8_t*) "INT_OOB"; + case SMP_MSG_API_USER_CONFIRM: return (uint8_t*) "API_USER_CONFIRM"; + case SMP_MSG_API_USER_KEYPRESS: return (uint8_t*) "API_USER_KEYPRESS"; + case SMP_MSG_API_KEYPRESS_CMPL: return (uint8_t*) "API_KEYPRESS_CMPL"; + case SMP_MSG_WSF_ECC_CMPL: return (uint8_t*) "WSF_ECC_CMPL"; + case SMP_MSG_INT_PK_NEXT: return (uint8_t*) "INT_PK_NEXT"; + case SMP_MSG_INT_PK_CMPL: return (uint8_t*) "INT_PK_CMPL"; + case SMP_MSG_WSF_CMAC_CMPL: return (uint8_t*) "WSF_CMAC_CMPL"; + case SMP_MSG_DH_CHECK_FAILURE: return (uint8_t*) "DH_CHECK_FAILURE"; + + default: return (uint8_t*) "Unknown"; + } +} + +/*************************************************************************************************/ +/*! + * \brief Convert state into string for diagnostics. + * + * \param state State ID + * + * \return State string. + */ +/*************************************************************************************************/ +uint8_t *smpStateStr(uint8_t state) +{ + uint8_t initiator = smpCb.ccb[0].initiator; + + if (initiator) + { + return smpiStateStr(state); + } + + return smprStateStr(state); +} + +/*************************************************************************************************/ +/*! + * \brief Write an array of bytes to the log. + * + * \param str Prefix string printed before the byte array + * \param pArray Array of bytes + * \param len Length of pArray in bytes + * + * \return None. + */ +/*************************************************************************************************/ +void smpLogByteArray(char *str, uint8_t *pArray, uint8_t len) +{ +#if WSF_TOKEN_ENABLED == TRUE || WSF_TRACE_ENABLED == TRUE + + char buffer[512]; + int i, j=0, pos=0; + + SMP_TRACE_INFO0(str); + + while (j < len) + { + int count = 16; + + if (len-j < count) + count = j; + + buffer[pos++] = '['; + + for (i=0; i<count; i++, j++) + { + uint8_t quad; + + if (i && i % 4 == 0) + buffer[pos++] = ' '; + + quad = (pArray[j] >> 4) & 0xf; + + if (quad < 10) + buffer[pos++] = '0' + quad; + else + buffer[pos++] = 'a' + quad - 10; + + quad = pArray[j] & 0xf; + + if (quad < 10) + buffer[pos++] = '0' + quad; + else + buffer[pos++] = 'a' + quad - 10; + } + + buffer[pos++] = ']'; + buffer[pos++] = '\0'; + SMP_TRACE_INFO0(buffer); + pos = 0; + } + + if (pos) + { + buffer[pos++] = ']'; + buffer[pos++] = '\0'; + + SMP_TRACE_INFO0(buffer); + } +#endif +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.h new file mode 100644 index 0000000000000000000000000000000000000000..a63197e3ec64926257fbc767f1c1ee4152ff63e8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smp_sc_main.h @@ -0,0 +1,149 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP main module header file. + */ +/*************************************************************************************************/ +#ifndef SMP_SC_MAIN_H +#define SMP_SC_MAIN_H + +#include "smp_main.h" +#include "smp_defs.h" +#include "smp_api.h" +#include "wsf_trace.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#if WSF_TOKEN_ENABLED == TRUE || WSF_TRACE_ENABLED == TRUE +#define SMP_TRACE_128(msg, ptr) smpLogByteArray(msg, ptr, 16) +#define SMP_TRACE_256(msg, ptr) smpLogByteArray(msg, ptr, 32) +#else +#define SMP_TRACE_128(msg, ptr) +#define SMP_TRACE_256(msg, ptr) +#endif + +/************************************************************************************************** + Constants +**************************************************************************************************/ + +/* Number of bits in the Passkey */ +#define SMP_PK_BIT_COUNT 20 + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* common state machine action functions */ +void smpScActCleanup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActPairingFailed(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActPairingCancel(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActAuthSelect(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActPkSetup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActJwncCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActJwncDisplay(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActPkKeypress(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActPkSendKeypress(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActCalcSharedSecret(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActCalcF5TKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActCalcF5MacKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActCalcF5Ltk(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActDHKeyCalcF6Ea(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScActDHKeyCalcF6Eb(smpCcb_t *pCcb, smpMsg_t *pMsg); + +/* initiator state machine action functions */ +void smpiScActSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActAuthSelect(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActJwncSetup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActJwncSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActJwncCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActPkCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActPkCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActPkSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActPkSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActPkCheck(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActOobCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActOobSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActOobProcRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActDHKeyCheckSend(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiScActDHKeyCheckVerify(smpCcb_t *pCcb, smpMsg_t *pMsg); + +/* responder state machine action functions */ +void smprScActStoreLescPin(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActJwncSetup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActJwncDisplay(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActJwncSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkStoreCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkStoreCnfAndCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkStorePinAndCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActPkSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActOobSetup(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActOobCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActOobSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActStoreDhCheck(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActWaitDhCheck(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActDHKeyCheckSend(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprScActCalcDHKey(smpCcb_t *pCcb, smpMsg_t *pMsg); + +/* common functions */ +bool_t SmpScAllocScratchBuffers(smpCcb_t *pCcb); +void SmpScFreeScratchBuffers(smpCcb_t *pCcb); +bool_t smpScProcPairing(smpCcb_t *pCcb, uint8_t *pOob, uint8_t *pDisplay); +void SmpReverseCpy(uint8_t *pBuf1, uint8_t *pBuf2, uint8_t len); +void SmpScCmac(const uint8_t *pKey, uint8_t *pText, uint8_t textLen, smpCcb_t *pCcb, smpMsg_t *pMsg); +uint8_t *SmpScAlloc(uint8_t size, smpCcb_t *pCcb, smpMsg_t *pMsg); +void SmpScFree(uint8_t *pBuf); +void SmpScCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pU, uint8_t *pV, uint8_t z, uint8_t *pX); +uint8_t *SmpScCat(uint8_t *pDst, const uint8_t *pSrc, uint8_t len); +uint8_t *SmpScCat128(uint8_t *pDst, uint8_t *pSrc); +uint8_t smpGetPkBit(smpCcb_t *pCcb); +smpScPubKey_t *smpGetPeerPublicKey(dmConnId_t connId); +void smpSetPeerPublicKey(dmConnId_t connId, smpScPubKey_t *pKey); +void SmpScSetOobCfg(dmConnId_t connId, dmSecLescOobCfg_t *pConfig); +void smpScAuthReq(smpCcb_t *pCcb, uint8_t oob, uint8_t display); +void smpScFailWithReattempt(smpCcb_t *pCcb); +void SmpScInit(void); + +/* common command send functoins */ +void smpScSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpScSendDHKeyCheck(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pCheck); +void smpScSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pRand); +void smpScSendPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg, uint8_t *pCnf); + +/* diagnostics utility functions */ +void smpLogByteArray(char *str, uint8_t *pArray, uint8_t len); +uint8_t *smpiStateStr(uint8_t state); +uint8_t *smprStateStr(uint8_t state); + +#ifdef __cplusplus +}; +#endif + +#endif /* SMP_SC_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_act.c new file mode 100644 index 0000000000000000000000000000000000000000..68836ab33ba63ce02a817446cb05fbcde5cf7e11 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_act.c @@ -0,0 +1,392 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP initiator state machine action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpi_main.h" +#include "dm_api.h" + +/*************************************************************************************************/ +/*! + * \brief Initiate a pairing request. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActPairReq(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + /* set next expected packet */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RSP; + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate scratch buffer */ + pCcb->pScr = WsfBufAlloc(sizeof(smpScratch_t)); + /* handle alloc failure */ + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_REQ_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_REQ); + UINT8_TO_BSTREAM(p, pSmpCfg->ioCap); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.oob); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.auth); + UINT8_TO_BSTREAM(p, pSmpCfg->maxKeyLen); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.iKeyDist); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.rKeyDist); + + /* store pair req data */ + memcpy(pCcb->pairReq, pPkt + L2C_PAYLOAD_START, SMP_PAIR_REQ_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Check if a security request has been received when pairing is cancelled. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActCheckSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* if security req received send pairing failed */ + if (pCcb->secReq) + { + pCcb->secReq = FALSE; + smpSendPairingFailed(pCcb, pMsg->hdr.status); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a security request packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActProcSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + dmSecSlaveIndEvt_t slaveInd; + + pCcb->secReq = TRUE; + + /* parse packet */ + slaveInd.auth = *(pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN); + + /* pass to DM */ + slaveInd.hdr.param = pCcb->connId; + slaveInd.hdr.event = DM_SEC_SLAVE_REQ_IND; + DmSmpCbackExec((dmEvt_t *) &slaveInd); +} + +/*************************************************************************************************/ +/*! + * \brief Process a pairing response packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActProcPairRsp(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *p; + uint8_t oob; + uint8_t display; + + /* go to start of packet */ + p = pMsg->data.pPacket + L2C_PAYLOAD_START; + + /* store packet parameters */ + memcpy(pCcb->pairRsp, p, SMP_PAIR_RSP_LEN); + + /* verify no new key distribution bits are set */ + if (((~(pCcb->pairReq[SMP_IKEYDIST_POS]) & p[SMP_IKEYDIST_POS]) != 0) || + ((~(pCcb->pairReq[SMP_RKEYDIST_POS]) & p[SMP_RKEYDIST_POS]) != 0)) + { + /* invalid parameters; cancel pairing */ + pMsg->hdr.status = SMP_ERR_INVALID_PARAM; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + } + else + { + /* proceed to process pairing */ + if (smpCb.procPairing(pCcb, &oob, &display)) + { + smpCb.procAuthReq(pCcb, oob, display); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a pairing confirm packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActProcPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + + /* go to start of packet */ + p = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* store confirm value */ + memcpy(pCcb->pScr->buf.b3, p, SMP_CONFIRM_LEN); + + /* set next expected packet */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer and send pairing random packet */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_RAND_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_RAND); + memcpy(p, pCcb->pScr->buf.b4, SMP_RAND_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Verify the calculated confirm value. If ok, proceed with STK calculcation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActCnfVerify(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* compare calculated confirm value with value received earlier */ + if (memcmp(pMsg->aes.pCiphertext, pCcb->pScr->buf.b3, SMP_CONFIRM_LEN) != 0) + { + pMsg->hdr.status = SMP_ERR_CONFIRM_VALUE; + + /* confirm values don't match; update repeated attempts count */ + pCcb->attempts++; + SmpDbPairingFailed(pCcb->connId); + + if (pCcb->attempts == pSmpCfg->maxAttempts) + { + /* max attempts reached */ + pMsg->hdr.event = SMP_MSG_INT_MAX_ATTEMPTS; + } + else + { + /* else just fail */ + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + } + + smpSmExecute(pCcb, pMsg); + return; + } + + /* do STK calculation: key, responder rand, initiator rand */ + smpCalcS1(pCcb, pCcb->pScr->buf.b1, pCcb->pScr->buf.b2, pCcb->pScr->buf.b4); +} + +/*************************************************************************************************/ +/*! + * \brief Encrypt link with STK. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActStkEncrypt(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t buf[SMP_KEY_LEN]; + uint8_t encKeyLen; + uint8_t secLevel; + + encKeyLen = (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + /* adjust key based on max key length */ + memcpy(buf, pMsg->aes.pCiphertext, encKeyLen); + memset((buf + encKeyLen), 0, (SMP_KEY_LEN - encKeyLen)); + + secLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + DmSmpEncryptReq(pCcb->connId, secLevel, buf); +} + +/*************************************************************************************************/ +/*! + * \brief Set up key distribution. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActSetupKeyDist(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t rKeyDist; + + /* start smp response timer once for entire key distribution phase */ + smpStartRspTimer(pCcb); + + /* initialize parameters in key ind struct */ + pCcb->pScr->keyInd.hdr.param = pCcb->connId; + pCcb->pScr->keyInd.secLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? + DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + pCcb->pScr->keyInd.encKeyLen = + (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + pCcb->nextCmdCode = 0; + + /* get negotiated responder key distribution */ + rKeyDist = pCcb->pairReq[SMP_RKEYDIST_POS] & pCcb->pairRsp[SMP_RKEYDIST_POS]; + + /* set up to receive first key distribution packet */ + if (rKeyDist & SMP_KEY_DIST_ENC) + { + if (smpCb.lescSupported && pCcb->pScCcb->lescEnabled) + { + if (rKeyDist & SMP_KEY_DIST_ID) + { + pCcb->nextCmdCode = SMP_CMD_ID_INFO; + } + } + else + { + pCcb->nextCmdCode = SMP_CMD_ENC_INFO; + } + } + else if (rKeyDist & SMP_KEY_DIST_ID) + { + pCcb->nextCmdCode = SMP_CMD_ID_INFO; + } + else if (rKeyDist & SMP_KEY_DIST_SIGN) + { + pCcb->nextCmdCode = SMP_CMD_SIGN_INFO; + } + + if (pCcb->nextCmdCode == 0) + { + /* no responder keys to be distributed; start sending keys */ + pMsg->hdr.event = SMP_MSG_INT_SEND_NEXT_KEY; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Receive a key. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActRcvKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t keyDist; + + /* get responder key distribution */ + keyDist = pCcb->pairReq[SMP_RKEYDIST_POS] & pCcb->pairRsp[SMP_RKEYDIST_POS]; + + /* process received key */ + if (smpProcRcvKey(pCcb, &pCcb->pScr->keyInd, pMsg->data.pPacket, keyDist)) + { + /* no responder keys to be distributed; start sending keys */ + pCcb->nextCmdCode = 0; + + pMsg->hdr.event = SMP_MSG_INT_SEND_NEXT_KEY; + smpSmExecute(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send a key. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiActSendKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t keyDist; + + /* get initiator key distribution */ + keyDist = pCcb->pairReq[SMP_IKEYDIST_POS] & pCcb->pairRsp[SMP_IKEYDIST_POS]; + + /* send next key */ + if ((pCcb->nextCmdCode == 0) && smpSendKey(pCcb, keyDist)) + { + /* done sending keys; send ourselves pairing complete msg */ + pMsg->hdr.event = SMP_MSG_INT_PAIRING_CMPL; + smpSmExecute(pCcb, pMsg); + return; + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_main.h new file mode 100644 index 0000000000000000000000000000000000000000..46c51d47363b596cb370156ad39c47628ac2a55c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_main.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP initiator main module. + */ +/*************************************************************************************************/ +#ifndef SMPI_MAIN_H +#define SMPI_MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* state machine interface */ +extern const smpSmIf_t smpiSmIf; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* state machine action functions */ +void smpiActPairReq(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActCheckSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActProcSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActProcPairRsp(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActProcPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActCnfVerify(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActStkEncrypt(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActSetupKeyDist(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActRcvKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smpiActSendKey(smpCcb_t *pCcb, smpMsg_t *pMsg); + +#ifdef __cplusplus +}; +#endif + +#endif /* SMPI_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_act.c new file mode 100644 index 0000000000000000000000000000000000000000..a5c11c3cbb196c9bfd2fb798bec0a618019575db --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_act.c @@ -0,0 +1,495 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections initiator state machine action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpi_main.h" +#include "smp_sc_main.h" +#include "dm_api.h" + +/*************************************************************************************************/ +/*! + * \brief Process a public key and perform common auth select actions + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActAuthSelect(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Execute Common Auth Select actions */ + smpScActAuthSelect(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send public key to peer. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Next command is the Public Key from the responder */ + pCcb->nextCmdCode = SMP_CMD_PUBLIC_KEY; + + /* Send the public key */ + smpScSendPubKey(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Prepare for the Just Works/Numeric Comparison Use Case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActJwncSetup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Select Random Na (128-bits) */ + SecRand(pCcb->pScCcb->pScratch->Na_Ea, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Na", pCcb->pScCcb->pScratch->Na_Ea); + + /* Set Ra and Rb to sero */ + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t*) calc128Zeros); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t*) calc128Zeros); + + /* Next command is a Pair Confirm from Responder */ + pCcb->nextCmdCode = SMP_CMD_PAIR_CNF; +} + +/*************************************************************************************************/ +/*! + * \brief Send the rand value to the responder for Just Works use case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActJwncSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCb = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Cb from responder is in Confirm from rsponder */ + WStrReverseCpy(pCcb->pScCcb->pScratch->PeerCb, pCb, SMP_CONFIRM_LEN); + + SMP_TRACE_128("Peer Cb", pCcb->pScCcb->pScratch->PeerCb); + + /* Next command is a Pair Random from Responder */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* Send the Pair Rand */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the confirm value for just works use case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActJwncCalcF4(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNb = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Nb from responder is in pPacket */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Nb_Eb, pNb, SMP_RAND_LEN); + + smpScActJwncCalcF4(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the verify value for the just works use case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + secCmacMsg_t *pCmac = (secCmacMsg_t *) pMsg; + + SMP_TRACE_128("Local Cb", pCmac->pCiphertext); + + /* Check the result of the F4 confirm calculation */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCb, pCmac->pCiphertext, SMP_CONFIRM_LEN)) + { + smpScFailWithReattempt(pCcb); + } + else + { + smpScActJwncCalcG2(pCcb, pMsg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Cai for the passkey use case using toolkit function F4 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActPkCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Record the passkey on the first confirm */ + if (pCcb->pScCcb->pkPos == 0) + { + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t *)calc128Zeros); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t *)calc128Zeros); + + if (pMsg->dm.authRsp.authDataLen <= 3) + { + WStrReverseCpy(&pCcb->pScCcb->pScratch->Ra[13], pMsg->dm.authRsp.authData, pMsg->dm.authRsp.authDataLen); + WStrReverseCpy(&pCcb->pScCcb->pScratch->Rb[13], pMsg->dm.authRsp.authData, pMsg->dm.authRsp.authDataLen); + } + } + + /* Get random Nai */ + SecRand(pCcb->pScCcb->pScratch->Na_Ea, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Na", pCcb->pScCcb->pScratch->Na_Ea); + + /* Ca = f4(PKax, PKbx, Nai, Rai) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + smpGetPkBit(pCcb), pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Cbi for the passkey use case using toolkit function F4 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActPkCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNb = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Record the Nbi */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Nb_Eb, pNb, SMP_RAND_LEN); + + /* Cb = f4(PKbx, PKax, Nbi, Rai) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + smpGetPkBit(pCcb), pCcb->pScCcb->pScratch->Nb_Eb); +} + +/*************************************************************************************************/ +/*! + * \brief Send the Cai Confirm for the passkey use case command for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActPkSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("Cai", pMsg->aes.pCiphertext); + + /* Send the Cai to the peer */ + smpScSendPairCnf(pCcb, pMsg, pMsg->aes.pCiphertext); +} + +/*************************************************************************************************/ +/*! + * \brief Send the Nai Random command for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActPkSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCb = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Record the Cbi from the responder */ + WStrReverseCpy(pCcb->pScCcb->pScratch->PeerCb, pCb, SMP_CONFIRM_LEN); + + /* Next command is the Pair Random */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* Send the Nai */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Check the Cbi from the responder against the calculated Cbi for the passkey use case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActPkCheck(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("Cbi", pMsg->aes.pCiphertext); + + /* Verify the Calculated Cbi to previously received Cbi */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCb, pMsg->aes.pCiphertext, SMP_RAND_LEN)) + { + smpScFailWithReattempt(pCcb); + } + else + { + wsfMsgHdr_t hdr; + + /* Increment the bit position */ + if (++pCcb->pScCcb->pkPos >= SMP_PK_BIT_COUNT) + { + hdr.event = SMP_MSG_INT_PK_CMPL; + } + else + { + /* Next command is the Pair Confirm */ + pCcb->nextCmdCode = SMP_CMD_PAIR_CNF; + + hdr.event = SMP_MSG_INT_PK_NEXT; + } + + /* Post an event to move to the next passkey confirm or complete the process */ + hdr.param = pCcb->connId; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Cb to compare against the Cb sent via OOB methods + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActOobCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* If the peer device's OOB data flag does not indicate remote OOB data has been received, + clear Ra. */ + if (pCcb->pairRsp[SMP_OOB_POS] != SMP_OOB_DATA_PRESENT) + { + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t*) calc128Zeros); + } + + /* If we indicated the presence of remote OOB data has been received, calculate Cb. */ + if (pCcb->pairReq[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) + { + /* Calculate Cb using Toolkit function F4 */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + 0, pCcb->pScCcb->pScratch->Rb); + } + else + { + /* Simulate the cb calculation is complete and clear rb */ + secCmacMsg_t msg; + + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t*)calc128Zeros); + + msg.hdr.param = pCcb->connId; + msg.hdr.event = SMP_MSG_WSF_CMAC_CMPL; + msg.pPlainText = NULL; + + smpSmExecute(pCcb, (smpMsg_t *) &msg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send random Na to responder in OOB pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActOobSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Only compare Cb if we indicated that we received OOB data. */ + if (pCcb->pairReq[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) + { + SMP_TRACE_128("Initiator Cb", pMsg->aes.pCiphertext); + + /* Verify the Cb matches the value passed from the responder via OOB methods */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCb, pMsg->aes.pCiphertext, SMP_CONFIRM_LEN)) + { + smpScFailWithReattempt(pCcb); + return; + } + } + + /* Next command is a Pair Rand from Responder */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* Calculate a the Na */ + SecRand(pCcb->pScCcb->pScratch->Na_Ea, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Na", pCcb->pScCcb->pScratch->Na_Ea); + + /* Send the Na to the responder */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Process random Nb from responder in OOB pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActOobProcRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNb = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Copy the Nb from the responder */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Nb_Eb, pNb, SMP_RAND_LEN); + + /* Initiate the DH Check */ + smpScActCalcSharedSecret(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send the DH Key check. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActDHKeyCheckSend(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("DHKey Eb", pMsg->aes.pCiphertext); + + /* Copy Eb from the smpScActDHKeyCalcF6Eb in LSB first format (as it will be received from peer) */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Nb_Eb, pMsg->aes.pCiphertext, SMP_RAND_LEN); + + /* Next cmd message is the DH Key Check from the responder */ + pCcb->nextCmdCode = SMP_CMD_DHKEY_CHECK; + + /* Send the DH Key check with Ea to the responder */ + smpScSendDHKeyCheck(pCcb, pMsg, pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Verify the DH Key Check. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smpiScActDHKeyCheckVerify(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pEbPeer = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN;; + + /* Verify the DH Key Check Eb with the value received from the responder */ + if (memcmp(pEbPeer, pCcb->pScCcb->pScratch->Nb_Eb, SMP_RAND_LEN) == 0) + { + uint8_t buf[SMP_KEY_LEN]; + uint8_t encKeyLen; + + encKeyLen = (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + /* Adjust key based on max key length */ + memcpy(buf, pCcb->pScCcb->pLtk->ltk_t, encKeyLen); + memset((buf + encKeyLen), 0, (SMP_KEY_LEN - encKeyLen)); + + /* Initiate encryption */ + DmSmpEncryptReq(pCcb->connId, smpGetScSecLevel(pCcb), buf); + } + else + { + /* DH Key check failed */ + wsfMsgHdr_t hdr; + + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_DH_KEY_CHECK; + + /* update repeated attempts count */ + pCcb->attempts++; + SmpDbPairingFailed(pCcb->connId); + + if (pCcb->attempts == pSmpCfg->maxAttempts) + { + /* max attempts reached */ + hdr.event = SMP_MSG_INT_MAX_ATTEMPTS; + } + else + { + /* else just fail */ + hdr.event = SMP_MSG_DH_CHECK_FAILURE; + } + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_sm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_sm.c new file mode 100644 index 0000000000000000000000000000000000000000..855aca21a2124199b071ec0a2f55b57fee5ab1ba --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sc_sm.c @@ -0,0 +1,641 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections initiator state machine. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpi_main.h" +#include "smp_sc_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Action function enumeration */ +enum +{ + SMPI_SC_ACT_NONE, /*!< No Action */ + SMPI_SC_ACT_CLEANUP, /*!< Process Pairing Cleanup */ + SMPI_SC_ACT_PAIRING_FAILED, /*!< Process Pairing Failed */ + SMPI_SC_ACT_PAIRING_CANCEL, /*!< Process Pairing Canceled */ + SMPI_SC_ACT_PAIR_CNF_CALC_1, /*!< Process Confirm Value Calculation 1 */ + SMPI_SC_ACT_PAIR_CNF_CALC_2, /*!< Process Confirm Value Calculation 2 */ + SMPI_SC_ACT_SEND_PAIR_CNF, /*!< Process Send Confirm Value */ + SMPI_SC_ACT_PAIR_CNF_VER_CALC_1, /*!< Process Received Confirm Value Verification Calculation 1 */ + SMPI_SC_ACT_PAIR_CNF_VER_CALC_2, /*!< Process Received Confirm Value Verification Calculation 2 */ + SMPI_SC_ACT_MAX_ATTEMPTS, /*!< Process Maximum Attempts */ + SMPI_SC_ACT_ATTEMPT_RCVD, /*!< Process Attempts Received */ + SMPI_SC_ACT_CHECK_ATTEMPTS, /*!< Process Check Attempts */ + SMPI_SC_ACT_NOTIFY_DM_ATTEMPTS, /*!< Process Notify DM of Attempts Failure */ + SMPI_SC_ACT_NOTIFY_DM_RSP_TO, /*!< Process Notify DM of Response Timeout Failure */ + SMPI_SC_ACT_PAIRING_CMPL, /*!< Process Pairing Complete */ + SMPI_SC_ACT_PAIR_REQ, /*!< Process Send Pairing Request */ + SMPI_SC_ACT_CHECK_SECURITY_REQ, /*!< Process Check Slave Security Request */ + SMPI_SC_ACT_PROC_SECURITY_REQ, /*!< Process Slave Security Request */ + SMPI_SC_ACT_PROC_PAIR_RSP, /*!< Process Pairing Response */ + SMPI_SC_ACT_PROC_PAIR_CNF, /*!< Process Pairing Confirmation */ + SMPI_SC_ACT_CNF_VERIFY, /*!< Process Verify Received Confirm Value */ + SMPI_SC_ACT_STK_ENCRYPT, /*!< Process STK Encryption */ + SMPI_SC_ACT_SETUP_KEY_DIST, /*!< Process Setup Key Distribution */ + SMPI_SC_ACT_RCV_KEY, /*!< Process Received Key */ + SMPI_SC_ACT_SEND_KEY, /*!< Process Send Key */ + + SMPI_SC_ACT_SEND_PUB_KEY, /*!< Process Send Public Key */ + SMPI_SC_ACT_SC_AUTH_SELECT, /*!< Process Select Authentication Method */ + + SMPI_SC_ACT_JWNC_SETUP, /*!< Process Just Works/Numeric Comparison Setup */ + SMPI_SC_ACT_JWNC_SEND_RAND, /*!< Process JW/NC Send Random Value */ + SMPI_SC_ACT_JWNC_CALC_F4, /*!< Process JW/NC Calculate F4 */ + SMPI_SC_ACT_JWNC_CALC_G2, /*!< Process JW/NC Calculate G2 */ + SMPI_SC_ACT_JWNC_DISPLAY, /*!< Process Display Numeric Comparison */ + + SMPI_SC_ACT_PK_SETUP, /*!< Process Passkey Setup */ + SMPI_SC_ACT_PK_KEYPRESS, /*!< Process Passkey Keypress */ + SMPI_SC_ACT_PK_SEND_KEYPRESS, /*!< Process Passkey Send Keypress */ + SMPI_SC_ACT_PK_CALC_CA, /*!< Process Passkey Calcuate Ca */ + SMPI_SC_ACT_PK_CALC_CB, /*!< Process Passkey Calculate Cb */ + SMPI_SC_ACT_PK_SEND_CNF, /*!< Process Passkey Send Confirm Value */ + SMPI_SC_ACT_PK_SEND_RAND, /*!< Process Passkey Send Random Value */ + SMPI_SC_ACT_PK_CHECK, /*!< Process Passkey Check Passkey Complete */ + + SMPI_SC_ACT_OOB_CALC_CB, /*!< Process OOB Calculate Cb */ + SMPI_SC_ACT_OOB_SEND_RAND, /*!< Process OOB Send Random Value */ + SMPI_SC_ACT_OOB_PROC_RAND, /*!< Process OOB Process Received Random Value */ + + SMPI_SC_ACT_CALC_DHKEY, /*!< Process DH Key Calculation */ + SMPI_SC_ACT_CALC_F5_TKEY, /*!< Process Calculate F5 Temporary Key */ + SMPI_SC_ACT_CALC_F5_MACKEY, /*!< Process Calculate F5 MAC Key */ + SMPI_SC_ACT_CALC_F5_LTK, /*!< Process Calculate F5 LTK */ + SMPI_SC_ACT_CALC_F6_EA, /*!< Process Calculate F6 Ea */ + SMPI_SC_ACT_CALC_F6_EB, /*!< Process Calculate F6 Eb */ + SMPI_SC_ACT_SEND_DH_CHECK, /*!< Process Send DH Key Check */ + SMPI_SC_ACT_VERIFY_DH_CHECK /*!< Process Verify Received DH Key Check */ +}; + +/************************************************************************************************** + Static Variables +**************************************************************************************************/ + +/*! Action function table; order matches action function enumeration */ +static const smpAct_t smpiScActionTbl[] = +{ + smpActNone, + smpScActCleanup, + smpScActPairingFailed, + smpScActPairingCancel, + smpActPairCnfCalc1, + smpActPairCnfCalc2, + smpActSendPairCnf, + smpActPairCnfVerCalc1, + smpActPairCnfVerCalc2, + smpActMaxAttempts, + smpActAttemptRcvd, + smpActCheckAttempts, + smpActNotifyDmAttemptsFailure, + smpActNotifyDmRspToFailure, + smpActPairingCmpl, + smpiActPairReq, + smpiActCheckSecurityReq, + smpiActProcSecurityReq, + smpiActProcPairRsp, + smpiActProcPairCnf, + smpiActCnfVerify, + smpiActStkEncrypt, + smpiActSetupKeyDist, + smpiActRcvKey, + smpiActSendKey, + + smpiScActSendPubKey, + smpiScActAuthSelect, + + smpiScActJwncSetup, + smpiScActJwncSendRand, + smpiScActJwncCalcF4, + smpiScActJwncCalcG2, + smpScActJwncDisplay, + + smpScActPkSetup, + smpScActPkKeypress, + smpScActPkSendKeypress, + smpiScActPkCalcCa, + smpiScActPkCalcCb, + smpiScActPkSendCnf, + smpiScActPkSendRand, + smpiScActPkCheck, + + smpiScActOobCalcCb, + smpiScActOobSendRand, + smpiScActOobProcRand, + + smpScActCalcSharedSecret, + smpScActCalcF5TKey, + smpScActCalcF5MacKey, + smpScActCalcF5Ltk, + smpScActDHKeyCalcF6Ea, + smpScActDHKeyCalcF6Eb, + smpiScActDHKeyCheckSend, + smpiScActDHKeyCheckVerify, +}; + +/*! State table for common actions */ +static const smpTblEntry_t smpiScStateTblCommon[SMP_STATE_TBL_COMMON_MAX] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_PAIRING_FAILED}, + {0, 0, 0} +}; + + +/*! State table for IDLE */ +static const smpTblEntry_t smpiScStateTblIdle[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_PAIR_REQ, SMPI_SC_SM_ST_PAIR_RSP, SMPI_SC_ACT_PAIR_REQ}, + {SMP_MSG_DM_CONN_CLOSE, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CHECK_SECURITY_REQ}, + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PROC_SECURITY_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for PAIR_RSP */ +static const smpTblEntry_t smpiScStateTblPairRsp[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_MODE_SELECT, SMPI_SC_ACT_PROC_PAIR_RSP}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_MODE_SELECT */ +static const smpTblEntry_t smpiScStateTblModeSelect[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_LESC, SMPI_SC_SM_ST_LESC_PIN, SMPI_SC_ACT_NONE}, + {SMP_MSG_INT_LEGACY, SMPI_SC_SM_ST_LEGACY_PIN, SMPI_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_LESC_PIN */ +static const smpTblEntry_t smpiScStateTblLescPin[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPI_SC_SM_ST_PUB_KEY, SMPI_SC_ACT_SEND_PUB_KEY}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PUB_KEY */ +static const smpTblEntry_t smpiScStateTblPubKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_AUTH_SELECT, SMPI_SC_ACT_SC_AUTH_SELECT}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_AUTH_SELECT */ +static const smpTblEntry_t smpiScStateTblAuthSelect[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_JW_NC, SMPI_SC_SM_ST_JWNC_WAIT_CNF, SMPI_SC_ACT_JWNC_SETUP}, + {SMP_MSG_INT_PASSKEY, SMPI_SC_SM_ST_PK_KEYPRESS, SMPI_SC_ACT_PK_SETUP}, + {SMP_MSG_INT_OOB, SMPI_SC_SM_ST_OOB_SEND_RAND, SMPI_SC_ACT_OOB_CALC_CB}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_JWNC_WAIT_CNF */ +static const smpTblEntry_t smpiScStateTblJwNcWaitCnf[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_JWNC_RAND, SMPI_SC_ACT_JWNC_SEND_RAND}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_JWNC_RAND */ +static const smpTblEntry_t smpiScStateTblJwNcRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_JWNC_CHECK_1, SMPI_SC_ACT_JWNC_CALC_F4}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_JWNC_CHECK_1 */ +static const smpTblEntry_t smpiScStateTblJwNcCheck1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_JWNC_CHECK_2, SMPI_SC_ACT_JWNC_CALC_G2}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_JWNC_CHECK_2 */ +static const smpTblEntry_t smpiScStateTblJwNcCheck2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_JWNC_WAIT_USER, SMPI_SC_ACT_JWNC_DISPLAY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_JWNC_WAIT_USER */ +static const smpTblEntry_t smpiScStateTblJwNcWaitUser[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_USER_CONFIRM, SMPI_SC_SM_ST_CALC_DHKEY, SMPI_SC_ACT_CALC_DHKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_KEYPRESS */ +static const smpTblEntry_t smprScStateTblPasskeyKeypress[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_PK_KEYPRESS, SMPI_SC_ACT_PK_KEYPRESS}, + {SMP_MSG_API_USER_KEYPRESS, SMPI_SC_SM_ST_PK_KEYPRESS, SMPI_SC_ACT_PK_SEND_KEYPRESS}, + {SMP_MSG_API_AUTH_RSP, SMPI_SC_SM_ST_PK_CALC, SMPI_SC_ACT_PK_CALC_CA}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_CALC */ +static const smpTblEntry_t smpiScStateTblPasskeyCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_PK_CNF, SMPI_SC_ACT_PK_SEND_CNF}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_CNF */ +static const smpTblEntry_t smpiScStateTblPasskeyCnf[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_PK_RAND, SMPI_SC_ACT_PK_SEND_RAND}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_RAND */ +static const smpTblEntry_t smpiScStateTblPasskeyRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_PK_CHECK, SMPI_SC_ACT_PK_CALC_CB}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_CHECK */ +static const smpTblEntry_t smpiScStateTblPasskeyCheck[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_PK_REPEAT, SMPI_SC_ACT_PK_CHECK}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_PK_REPEAT */ +static const smpTblEntry_t smpiScStateTblPasskeyRepeat[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_PK_NEXT, SMPI_SC_SM_ST_PK_CALC, SMPI_SC_ACT_PK_CALC_CA}, + {SMP_MSG_INT_PK_CMPL, SMPI_SC_SM_ST_CALC_DHKEY, SMPI_SC_ACT_CALC_DHKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_OOB_SEND_RAND */ +static const smpTblEntry_t smpiScStateTblOobSendRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_OOB_WAIT_RAND, SMPI_SC_ACT_OOB_SEND_RAND}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_OOB_WAIT_RAND */ +static const smpTblEntry_t smpiScStateTblOobWaitRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_CALC_DHKEY, SMPI_SC_ACT_OOB_PROC_RAND}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_DHKEY */ +static const smpTblEntry_t smpiScStateTblCalcDHKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_ECC_CMPL, SMPI_SC_SM_ST_CALC_F5_TKEY, SMPI_SC_ACT_CALC_F5_TKEY}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_F5_TKEY */ +static const smpTblEntry_t smpiScStateTblCalcF5TKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_CALC_F5_MACKEY, SMPI_SC_ACT_CALC_F5_MACKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_F5_MACKEY */ +static const smpTblEntry_t smpiScStateTblCalcF5MacKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_CALC_F5_LTK, SMPI_SC_ACT_CALC_F5_LTK}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_F5_LTK */ +static const smpTblEntry_t smpiScStateTblCalcF5LTK[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_CALC_F6_EA, SMPI_SC_ACT_CALC_F6_EA}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_F6_EA */ +static const smpTblEntry_t smpiScStateTblDhCalcF6Ea[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_CALC_F6_EB, SMPI_SC_ACT_CALC_F6_EB}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_CALC_F6_EB */ +static const smpTblEntry_t smpiScStateTblDhCalcF6Eb[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPI_SC_SM_ST_VERIFY_DH_CHECK, SMPI_SC_ACT_SEND_DH_CHECK}, + {0, 0, 0} +}; + +/*! State table for SMPI_SC_SM_ST_VERIFY_DH_CHECK */ +static const smpTblEntry_t smpiScStateTblVerifyDHCheck[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_ENCRYPT, SMPI_SC_ACT_VERIFY_DH_CHECK}, + {0, 0, 0} +}; + +/*! State table for Legacy SMPI_SC_SM_ST_LEGACY_PIN */ +static const smpTblEntry_t smpiScStateTblLegacyPin[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPI_SC_SM_ST_CNF_CALC_1, SMPI_SC_ACT_PAIR_CNF_CALC_1}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_CALC_1 */ +static const smpTblEntry_t smpiScStateTblCnfCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SC_SM_ST_CNF_CALC_2, SMPI_SC_ACT_PAIR_CNF_CALC_2}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_CALC_2 */ +static const smpTblEntry_t smpiScStateTblCnfCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SC_SM_ST_PAIR_CNF, SMPI_SC_ACT_SEND_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for Legacy PAIR_CNF */ +static const smpTblEntry_t smpiScStateTblPairCnf[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_PAIR_RAND, SMPI_SC_ACT_PROC_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for Legacy PAIR_RAND */ +static const smpTblEntry_t smpiScStateTblPairRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_CNF_VER_CALC_1, SMPI_SC_ACT_PAIR_CNF_VER_CALC_1}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_VER_CALC_1 */ +static const smpTblEntry_t smpiScStateTblCnfVerCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SC_SM_ST_CNF_VER_CALC_2, SMPI_SC_ACT_PAIR_CNF_VER_CALC_2}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_VER_CALC_2 */ +static const smpTblEntry_t smpiScStateTblCnfVerCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SC_SM_ST_STK_CALC, SMPI_SC_ACT_CNF_VERIFY}, + {0, 0, 0} +}; + +/*! State table for Legacy STK_CALC */ +static const smpTblEntry_t smpiScStateTblStkCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SC_SM_ST_ENCRYPT, SMPI_SC_ACT_STK_ENCRYPT}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for ENCRYPT */ +static const smpTblEntry_t smpiScStateTblEncrypt[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_ENCRYPT_CMPL, SMPI_SC_SM_ST_KEY_DIST, SMPI_SC_ACT_SETUP_KEY_DIST}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_ENCRYPT, SMPI_SC_ACT_NONE}, + {SMP_MSG_DH_CHECK_FAILURE, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for KEY_DIST */ +static const smpTblEntry_t smpiScStateTblKeyDist[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_KEY_DIST, SMPI_SC_ACT_RCV_KEY}, + {SMP_MSG_INT_SEND_NEXT_KEY, SMPI_SC_SM_ST_KEY_DIST, SMPI_SC_ACT_SEND_KEY}, + {SMP_MSG_INT_PAIRING_CMPL, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_PAIRING_CMPL}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_KEY_DIST, SMPI_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for ATTEMPTS */ +static const smpTblEntry_t smpiScStateTblAttempts[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_WI_TIMEOUT, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CHECK_ATTEMPTS}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PKT, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_ATTEMPT_RCVD}, + {SMP_MSG_API_PAIR_REQ, SMPI_SC_SM_ST_PAIR_RSP, SMPI_SC_ACT_NOTIFY_DM_ATTEMPTS}, + {SMP_MSG_DM_CONN_CLOSE, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SC_SM_ST_ATTEMPTS, SMPI_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for RSP_TO */ +static const smpTblEntry_t smpiScStateTblRspTo[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPI_SC_SM_ST_IDLE, SMPI_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_NONE}, + {SMP_MSG_API_PAIR_REQ, SMPI_SC_SM_ST_RSP_TO, SMPI_SC_ACT_NOTIFY_DM_RSP_TO}, + {0, 0, 0} +}; + +/*! Table of individual state tables */ +static const smpTblEntry_t * const smpiScStateTbl[] = +{ + smpiScStateTblIdle, + smpiScStateTblPairRsp, + smpiScStateTblModeSelect, + smpiScStateTblLescPin, + smpiScStateTblPubKey, + smpiScStateTblAuthSelect, + smpiScStateTblJwNcWaitCnf, + smpiScStateTblJwNcRand, + smpiScStateTblJwNcCheck1, + smpiScStateTblJwNcCheck2, + smpiScStateTblJwNcWaitUser, + + smprScStateTblPasskeyKeypress, + smpiScStateTblPasskeyCalc, + smpiScStateTblPasskeyCnf, + smpiScStateTblPasskeyRand, + smpiScStateTblPasskeyCheck, + smpiScStateTblPasskeyRepeat, + + smpiScStateTblOobSendRand, + smpiScStateTblOobWaitRand, + + smpiScStateTblCalcDHKey, + smpiScStateTblCalcF5TKey, + smpiScStateTblCalcF5MacKey, + smpiScStateTblCalcF5LTK, + smpiScStateTblDhCalcF6Ea, + smpiScStateTblDhCalcF6Eb, + smpiScStateTblVerifyDHCheck, + + smpiScStateTblLegacyPin, + smpiScStateTblCnfCalc1, + smpiScStateTblCnfCalc2, + smpiScStateTblPairCnf, + smpiScStateTblPairRand, + smpiScStateTblCnfVerCalc1, + smpiScStateTblCnfVerCalc2, + smpiScStateTblStkCalc, + smpiScStateTblEncrypt, + smpiScStateTblKeyDist, + smpiScStateTblAttempts, + smpiScStateTblRspTo +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! state machine interface */ +const smpSmIf_t smpiScSmIf = +{ + smpiScStateTbl, + smpiScActionTbl, + smpiScStateTblCommon +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize SMP initiator role. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpiScInit(void) +{ + /* set up callback interface */ + smpCb.pMaster = &smpiScSmIf; + + /* General SMP LESC Initialization */ + SmpScInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Convert state into string for diagnostics. + * + * \param state State ID + * + * \return State string. + */ +/*************************************************************************************************/ +uint8_t *smpiStateStr(uint8_t state) +{ + switch(state) + { + case SMPI_SC_SM_ST_IDLE: return (uint8_t*) "I_IDLE"; + case SMPI_SC_SM_ST_PAIR_RSP: return (uint8_t*) "I_PAIR_RSP"; + case SMPI_SC_SM_ST_MODE_SELECT: return (uint8_t*) "I_MODE_SELECT"; + case SMPI_SC_SM_ST_LESC_PIN: return (uint8_t*) "I_LESC_PIN"; + case SMPI_SC_SM_ST_PUB_KEY: return (uint8_t*) "I_PUB_KEY"; + case SMPI_SC_SM_ST_AUTH_SELECT: return (uint8_t*) "I_AUTH_SELECT"; + case SMPI_SC_SM_ST_JWNC_WAIT_CNF: return (uint8_t*) "I_JWNC_WAIT_CNF"; + case SMPI_SC_SM_ST_JWNC_RAND: return (uint8_t*) "I_JWNC_RAND"; + case SMPI_SC_SM_ST_JWNC_CHECK_1: return (uint8_t*) "I_JWNC_CHECK_1"; + case SMPI_SC_SM_ST_JWNC_CHECK_2: return (uint8_t*) "I_JWNC_CHECK_2"; + case SMPI_SC_SM_ST_JWNC_WAIT_USER: return (uint8_t*) "I_JWNC_WAIT_USER"; + case SMPI_SC_SM_ST_PK_KEYPRESS: return (uint8_t*) "I_PK_KEYPRESS"; + case SMPI_SC_SM_ST_PK_CALC: return (uint8_t*) "I_PK_CALC"; + case SMPI_SC_SM_ST_PK_CNF: return (uint8_t*) "I_PK_CNF"; + case SMPI_SC_SM_ST_PK_RAND: return (uint8_t*) "I_PK_RAND"; + case SMPI_SC_SM_ST_PK_CHECK: return (uint8_t*) "I_PK_CHECK"; + case SMPI_SC_SM_ST_PK_REPEAT: return (uint8_t*) "I_PK_REPEAT"; + + case SMPI_SC_SM_ST_OOB_SEND_RAND: return (uint8_t*) "I_OOB_SEND_RAND"; + case SMPI_SC_SM_ST_OOB_WAIT_RAND: return (uint8_t*) "I_OOB_WAIT_RAND"; + + case SMPI_SC_SM_ST_CALC_DHKEY: return (uint8_t*) "I_CALC_DHKEY"; + case SMPI_SC_SM_ST_CALC_F5_TKEY: return (uint8_t*) "I_CALC_F5_TKEY"; + case SMPI_SC_SM_ST_CALC_F5_MACKEY: return (uint8_t*) "I_CALC_F5_MACKEY"; + case SMPI_SC_SM_ST_CALC_F5_LTK: return (uint8_t*) "I_CALC_F5_LTK"; + case SMPI_SC_SM_ST_CALC_F6_EA: return (uint8_t*) "I_CALC_F6_EA"; + case SMPI_SC_SM_ST_CALC_F6_EB: return (uint8_t*) "I_CALC_F6_EB"; + case SMPI_SC_SM_ST_VERIFY_DH_CHECK: return (uint8_t*) "I_VERIFY_DH_CHECK"; + + case SMPI_SC_SM_ST_LEGACY_PIN: return (uint8_t*) "I_LEGACY_PIN"; + case SMPI_SC_SM_ST_CNF_CALC_1: return (uint8_t*) "I_CNF_CALC_1"; + case SMPI_SC_SM_ST_CNF_CALC_2: return (uint8_t*) "I_CNF_CALC_2"; + case SMPI_SC_SM_ST_PAIR_CNF: return (uint8_t*) "I_PAIR_CNF"; + case SMPI_SC_SM_ST_PAIR_RAND: return (uint8_t*) "I_PAIR_RAND"; + case SMPI_SC_SM_ST_CNF_VER_CALC_1: return (uint8_t*) "I_CNF_VER_CALC_1"; + case SMPI_SC_SM_ST_CNF_VER_CALC_2: return (uint8_t*) "I_CNF_VER_CALC_2"; + case SMPI_SC_SM_ST_STK_CALC: return (uint8_t*) "I_STK_CALC"; + case SMPI_SC_SM_ST_ENCRYPT: return (uint8_t*) "I_ENCRYPT"; + case SMPI_SC_SM_ST_KEY_DIST: return (uint8_t*) "I_KEY_DIST"; + case SMPI_SC_SM_ST_ATTEMPTS: return (uint8_t*) "I_ATTEMPTS"; + case SMPI_SC_SM_ST_RSP_TO: return (uint8_t*) "I_RSP_TO"; + + default: return (uint8_t*) "I_Unknown"; + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sm.c new file mode 100644 index 0000000000000000000000000000000000000000..850f2f656614f28882b72cad5cae111b0ab663e9 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpi_sm.c @@ -0,0 +1,286 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP initiator state machine. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpi_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Action function enumeration */ +enum +{ + SMPI_ACT_NONE, /*!< No Action */ + SMPI_ACT_CLEANUP, /*!< Process Pairing Cleanup */ + SMPI_ACT_PAIRING_FAILED, /*!< Process Pairing Failed */ + SMPI_ACT_PAIRING_CANCEL, /*!< Process Pairing Canceled */ + SMPI_ACT_PAIR_CNF_CALC_1, /*!< Process Confirm Value Calculation 1 */ + SMPI_ACT_PAIR_CNF_CALC_2, /*!< Process Confirm Value Calculation 2 */ + SMPI_ACT_SEND_PAIR_CNF, /*!< Process Send Confirm Value */ + SMPI_ACT_PAIR_CNF_VER_CALC_1, /*!< Process Received Confirm Value Verification Calculation 1 */ + SMPI_ACT_PAIR_CNF_VER_CALC_2, /*!< Process Received Confirm Value Verification Calculation 2 */ + SMPI_ACT_MAX_ATTEMPTS, /*!< Process Maximum Attempts */ + SMPI_ACT_ATTEMPT_RCVD, /*!< Process Attempts Received */ + SMPI_ACT_CHECK_ATTEMPTS, /*!< Process Check Attempts */ + SMPI_ACT_NOTIFY_DM_ATTEMPTS, /*!< Process Notify DM of Attempts Failure */ + SMPI_ACT_NOTIFY_DM_RSP_TO, /*!< Process Notify DM of Response Timeout Failure */ + SMPI_ACT_PAIRING_CMPL, /*!< Process Pairing Complete */ + SMPI_ACT_PAIR_REQ, /*!< Process Send Pairing Request */ + SMPI_ACT_CHECK_SECURITY_REQ, /*!< Process Check Security Request */ + SMPI_ACT_PROC_SECURITY_REQ, /*!< Process Security Request */ + SMPI_ACT_PROC_PAIR_RSP, /*!< Process Pairing Response */ + SMPI_ACT_PROC_PAIR_CNF, /*!< Process Pairing Confirmation */ + SMPI_ACT_CNF_VERIFY, /*!< Process Verify Received Confirm Value */ + SMPI_ACT_STK_ENCRYPT, /*!< Process STK Encryption */ + SMPI_ACT_SETUP_KEY_DIST, /*!< Process Setup Key Distribution */ + SMPI_ACT_RCV_KEY, /*!< Process Received Key */ + SMPI_ACT_SEND_KEY /*!< Process Send Key */ +}; + +/************************************************************************************************** + Static Variables +**************************************************************************************************/ + +/*! Action function table; order matches action function enumeration */ +static const smpAct_t smpiActionTbl[] = +{ + smpActNone, + smpActCleanup, + smpActPairingFailed, + smpActPairingCancel, + smpActPairCnfCalc1, + smpActPairCnfCalc2, + smpActSendPairCnf, + smpActPairCnfVerCalc1, + smpActPairCnfVerCalc2, + smpActMaxAttempts, + smpActAttemptRcvd, + smpActCheckAttempts, + smpActNotifyDmAttemptsFailure, + smpActNotifyDmRspToFailure, + smpActPairingCmpl, + smpiActPairReq, + smpiActCheckSecurityReq, + smpiActProcSecurityReq, + smpiActProcPairRsp, + smpiActProcPairCnf, + smpiActCnfVerify, + smpiActStkEncrypt, + smpiActSetupKeyDist, + smpiActRcvKey, + smpiActSendKey +}; + +/*! State table for common actions */ +static const smpTblEntry_t smpiStateTblCommon[SMP_STATE_TBL_COMMON_MAX] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPI_SM_ST_IDLE, SMPI_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SM_ST_IDLE, SMPI_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_IDLE, SMPI_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SM_ST_RSP_TO, SMPI_ACT_PAIRING_FAILED}, + {0, 0, 0} +}; + + +/*! State table for IDLE */ +static const smpTblEntry_t smpiStateTblIdle[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_PAIR_REQ, SMPI_SM_ST_PAIR_RSP, SMPI_ACT_PAIR_REQ}, + {SMP_MSG_DM_CONN_CLOSE, SMPI_SM_ST_IDLE, SMPI_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_IDLE, SMPI_ACT_CHECK_SECURITY_REQ}, + {SMP_MSG_CMD_PKT, SMPI_SM_ST_IDLE, SMPI_ACT_PROC_SECURITY_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SM_ST_IDLE, SMPI_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SM_ST_IDLE, SMPI_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for PAIR_RSP */ +static const smpTblEntry_t smpiStateTblPairRsp[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SM_ST_PIN, SMPI_ACT_PROC_PAIR_RSP}, + {0, 0, 0} +}; + +/*! State table for PIN */ +static const smpTblEntry_t smpiStateTblPin[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPI_SM_ST_CNF_CALC_1, SMPI_ACT_PAIR_CNF_CALC_1}, + {0, 0, 0} +}; + +/*! State table for CNF_CALC_1 */ +static const smpTblEntry_t smpiStateTblCnfCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SM_ST_CNF_CALC_2, SMPI_ACT_PAIR_CNF_CALC_2}, + {0, 0, 0} +}; + +/*! State table for CNF_CALC_2 */ +static const smpTblEntry_t smpiStateTblCnfCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SM_ST_PAIR_CNF, SMPI_ACT_SEND_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for PAIR_CNF */ +static const smpTblEntry_t smpiStateTblPairCnf[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SM_ST_PAIR_RAND, SMPI_ACT_PROC_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for PAIR_RAND */ +static const smpTblEntry_t smpiStateTblPairRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SM_ST_CNF_VER_CALC_1, SMPI_ACT_PAIR_CNF_VER_CALC_1}, + {0, 0, 0} +}; + +/*! State table for CNF_VER_CALC_1 */ +static const smpTblEntry_t smpiStateTblCnfVerCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SM_ST_CNF_VER_CALC_2, SMPI_ACT_PAIR_CNF_VER_CALC_2}, + {0, 0, 0} +}; + +/*! State table for CNF_VER_CALC_2 */ +static const smpTblEntry_t smpiStateTblCnfVerCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SM_ST_STK_CALC, SMPI_ACT_CNF_VERIFY}, + {0, 0, 0} +}; + +/*! State table for STK_CALC */ +static const smpTblEntry_t smpiStateTblStkCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPI_SM_ST_ENCRYPT, SMPI_ACT_STK_ENCRYPT}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPI_SM_ST_ATTEMPTS, SMPI_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for ENCRYPT */ +static const smpTblEntry_t smpiStateTblEncrypt[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_ENCRYPT_CMPL, SMPI_SM_ST_KEY_DIST, SMPI_ACT_SETUP_KEY_DIST}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPI_SM_ST_IDLE, SMPI_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_ENCRYPT, SMPI_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for KEY_DIST */ +static const smpTblEntry_t smpiStateTblKeyDist[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPI_SM_ST_KEY_DIST, SMPI_ACT_RCV_KEY}, + {SMP_MSG_INT_SEND_NEXT_KEY, SMPI_SM_ST_KEY_DIST, SMPI_ACT_SEND_KEY}, + {SMP_MSG_INT_PAIRING_CMPL, SMPI_SM_ST_IDLE, SMPI_ACT_PAIRING_CMPL}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_KEY_DIST, SMPI_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for ATTEMPTS */ +static const smpTblEntry_t smpiStateTblAttempts[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_WI_TIMEOUT, SMPI_SM_ST_IDLE, SMPI_ACT_CHECK_ATTEMPTS}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SM_ST_RSP_TO, SMPI_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PKT, SMPI_SM_ST_ATTEMPTS, SMPI_ACT_ATTEMPT_RCVD}, + {SMP_MSG_API_PAIR_REQ, SMPI_SM_ST_PAIR_RSP, SMPI_ACT_NOTIFY_DM_ATTEMPTS}, + {SMP_MSG_DM_CONN_CLOSE, SMPI_SM_ST_IDLE, SMPI_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_IDLE, SMPI_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SM_ST_ATTEMPTS, SMPI_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for RSP_TO */ +static const smpTblEntry_t smpiStateTblRspTo[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPI_SM_ST_IDLE, SMPI_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPI_SM_ST_RSP_TO, SMPI_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPI_SM_ST_RSP_TO, SMPI_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPI_SM_ST_RSP_TO, SMPI_ACT_NONE}, + {SMP_MSG_API_PAIR_REQ, SMPI_SM_ST_RSP_TO, SMPI_ACT_NOTIFY_DM_RSP_TO}, + {0, 0, 0} +}; + +/*! Table of individual state tables */ +static const smpTblEntry_t * const smpiStateTbl[] = +{ + smpiStateTblIdle, + smpiStateTblPairRsp, + smpiStateTblPin, + smpiStateTblCnfCalc1, + smpiStateTblCnfCalc2, + smpiStateTblPairCnf, + smpiStateTblPairRand, + smpiStateTblCnfVerCalc1, + smpiStateTblCnfVerCalc2, + smpiStateTblStkCalc, + smpiStateTblEncrypt, + smpiStateTblKeyDist, + smpiStateTblAttempts, + smpiStateTblRspTo +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! state machine interface */ +const smpSmIf_t smpiSmIf = +{ + smpiStateTbl, + smpiActionTbl, + smpiStateTblCommon +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize SMP initiator role. + * + * \return None. + */ +/*************************************************************************************************/ +void SmpiInit(void) +{ + /* set up callback interface */ + smpCb.pMaster = &smpiSmIf; + smpCb.procPairing = smpProcPairing; + smpCb.procAuthReq = smpAuthReq; +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_act.c new file mode 100644 index 0000000000000000000000000000000000000000..72e60965d7731529f67919d5475c1a2812ac47ae --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_act.c @@ -0,0 +1,416 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP responder state machine action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpr_main.h" +#include "dm_api.h" + +/*************************************************************************************************/ +/*! + * \brief Send a slave security request. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActSendSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_SECURITY_REQ_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_SECURITY_REQ); + UINT8_TO_BSTREAM(p, pMsg->dm.securityReq.auth); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process a pairing request packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActProcPairReq(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + dmSecPairIndEvt_t pairInd; + uint8_t *p; + + /* allocate scratch buffer */ + if (pCcb->pScr == NULL) + { + if ((pCcb->pScr = WsfBufAlloc(sizeof(smpScratch_t))) == NULL) + { + /* alloc failed; cancel pairing */ + pMsg->hdr.status = SMP_ERR_UNSPECIFIED; + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + smpSmExecute(pCcb, pMsg); + return; + } + } + else + { + /* should not happen */ + SMP_TRACE_ERR0("pScr already allocated"); + } + + /* set connection busy */ + DmConnSetIdle(pCcb->connId, DM_IDLE_SMP_PAIR, DM_CONN_BUSY); + + p = pMsg->data.pPacket + L2C_PAYLOAD_START; + + /* store packet for later */ + memcpy(pCcb->pairReq, p, SMP_PAIR_REQ_LEN); + + /* parse packet to callback event structure */ + p++; /* skip command code */ + p++; /* skip IO capabilities */ + BSTREAM_TO_UINT8(pairInd.oob, p); + BSTREAM_TO_UINT8(pairInd.auth, p); + p++; /* skip max key len */ + BSTREAM_TO_UINT8(pairInd.iKeyDist, p); + BSTREAM_TO_UINT8(pairInd.rKeyDist, p); + + /* call app callback */ + pairInd.hdr.param = pCcb->connId; + pairInd.hdr.event = DM_SEC_PAIR_IND; + DmSmpCbackExec((dmEvt_t *) &pairInd); +} + +/*************************************************************************************************/ +/*! + * \brief Send a pairing response packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActSendPairRsp(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + uint8_t oob; + uint8_t display; + + /* build packet to pairing response buffer in ccb */ + p = pCcb->pairRsp; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_RSP); + UINT8_TO_BSTREAM(p, pSmpCfg->ioCap); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.oob); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.auth); + UINT8_TO_BSTREAM(p, pSmpCfg->maxKeyLen); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.iKeyDist); + UINT8_TO_BSTREAM(p, pMsg->dm.pair.rKeyDist); + + /* process pairing request and response data */ + if (smpCb.procPairing(pCcb, &oob, &display)) + { + /* set next expected packet */ + if ((pCcb->pairReq[SMP_AUTHREQ_POS] & pMsg->dm.pair.auth & SMP_AUTH_SC_FLAG) == SMP_AUTH_SC_FLAG) + { + pCcb->nextCmdCode = SMP_CMD_PUBLIC_KEY; + } + else + { + pCcb->nextCmdCode = SMP_CMD_PAIR_CNF; + } + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* send pairing response; allocate packet buffer */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_RSP_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet from pairing response buffer */ + memcpy(pPkt + L2C_PAYLOAD_START, pCcb->pairRsp, SMP_PAIR_RSP_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } + + /* request authentication data */ + smpCb.procAuthReq(pCcb, oob, display); + } +} + +/*************************************************************************************************/ +/*! + * \brief Store pairing confirm value. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActProcPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *p; + + /* go to start of packet */ + p = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* store confirm value */ + memcpy(pCcb->pScr->buf.b3, p, SMP_CONFIRM_LEN); + + /* discard any packets received erroneously at this point */ + pCcb->nextCmdCode = 0; +} + +/*************************************************************************************************/ +/*! + * \brief Store pairing confirm value and perform first part of pairing confirm calculation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActProcPairCnfCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smprActProcPairCnf(pCcb, pMsg); + + /* get random number to scratchpad */ + SecRand(pCcb->pScr->buf.b4, SMP_RAND_LEN); + + /* execute calculation */ + smpCalcC1Part1(pCcb, pCcb->pScr->buf.b1, pCcb->pScr->buf.b4); +} + +/*************************************************************************************************/ +/*! + * \brief Verify the calculated confirm value. If ok, proceed with STK calculcation. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActCnfVerify(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* compare calculated confirm value with value received earlier */ + if (memcmp(pMsg->aes.pCiphertext, pCcb->pScr->buf.b3, SMP_CONFIRM_LEN) != 0) + { + /* confirm values don't match; update repeated attempts count */ + pCcb->attempts++; + SmpDbPairingFailed(pCcb->connId); + pMsg->hdr.status = SMP_ERR_CONFIRM_VALUE; + + if (pCcb->attempts == pSmpCfg->maxAttempts) + { + /* max attempts reached */ + pMsg->hdr.event = SMP_MSG_INT_MAX_ATTEMPTS; + } + else + { + /* else just fail */ + pMsg->hdr.event = SMP_MSG_API_CANCEL_REQ; + } + + smpSmExecute(pCcb, pMsg); + return; + } + + /* do STK calculation: key, responder rand, initiator rand */ + smpCalcS1(pCcb, pCcb->pScr->buf.b1, pCcb->pScr->buf.b4, pCcb->pScr->buf.b2); +} + +/*************************************************************************************************/ +/*! + * \brief Store STK and then send a pairing random packet. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActSendPairRandom(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pPkt; + uint8_t *p; + uint8_t encKeyLen; + + /* get max STK length */ + encKeyLen = (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + /* store STK and adjust based on max key length */ + memcpy(pCcb->pScr->buf.b3, pMsg->aes.pCiphertext, encKeyLen); + memset((pCcb->pScr->buf.b3 + encKeyLen), 0, (SMP_KEY_LEN - encKeyLen)); + + /* start smp response timer */ + smpStartRspTimer(pCcb); + + /* allocate packet buffer and send pairing random packet */ + if ((pPkt = smpMsgAlloc(SMP_PAIR_RAND_LEN + L2C_PAYLOAD_START)) != NULL) + { + /* build packet */ + p = pPkt + L2C_PAYLOAD_START; + UINT8_TO_BSTREAM(p, SMP_CMD_PAIR_RAND); + memcpy(p, pCcb->pScr->buf.b4, SMP_RAND_LEN); + + /* send packet */ + smpSendPkt(pCcb, pPkt); + } +} + +/*************************************************************************************************/ +/*! + * \brief Set up key distribution. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActSetupKeyDist(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* don't receive anything yet */ + pCcb->nextCmdCode = 0; + + /* start smp response timer once for entire key distribution phase */ + smpStartRspTimer(pCcb); + + /* initialize parameters in key ind struct */ + pCcb->pScr->keyInd.hdr.param = pCcb->connId; + pCcb->pScr->keyInd.secLevel = (pCcb->auth & SMP_AUTH_MITM_FLAG) ? + DM_SEC_LEVEL_ENC_AUTH : DM_SEC_LEVEL_ENC; + pCcb->pScr->keyInd.encKeyLen = + (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + /* start key distribution */ + smprActSendKey(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send a key. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActSendKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t keyDist; + + /* get responder key distribution */ + keyDist = pCcb->pairReq[SMP_RKEYDIST_POS] & pCcb->pairRsp[SMP_RKEYDIST_POS]; + + /* send next key; if done sending keys set up to receive keys */ + if ((pCcb->nextCmdCode == 0) && smpSendKey(pCcb, keyDist)) + { + pCcb->nextCmdCode = 0; + + /* get initiator key distribution */ + keyDist = pCcb->pairReq[SMP_IKEYDIST_POS] & pCcb->pairRsp[SMP_IKEYDIST_POS]; + + /* set up to receive first key distribution packet */ + if (keyDist & SMP_KEY_DIST_ENC) + { + if (smpCb.lescSupported && pCcb->pScCcb->lescEnabled) + { + if (keyDist & SMP_KEY_DIST_ID) + { + pCcb->nextCmdCode = SMP_CMD_ID_INFO; + } + } + else + { + pCcb->nextCmdCode = SMP_CMD_ENC_INFO; + } + } + else if (keyDist & SMP_KEY_DIST_ID) + { + pCcb->nextCmdCode = SMP_CMD_ID_INFO; + } + else if (keyDist & SMP_KEY_DIST_SIGN) + { + pCcb->nextCmdCode = SMP_CMD_SIGN_INFO; + } + + if (pCcb->nextCmdCode == 0) + { + /* no keys to receive; send ourselves pairing complete msg */ + pMsg->hdr.event = SMP_MSG_INT_PAIRING_CMPL; + smpSmExecute(pCcb, pMsg); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Receive a key. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprActRcvKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t keyDist; + + /* get initiator key distribution */ + keyDist = pCcb->pairReq[SMP_IKEYDIST_POS] & pCcb->pairRsp[SMP_IKEYDIST_POS]; + + /* process received key */ + if (smpProcRcvKey(pCcb, &pCcb->pScr->keyInd, pMsg->data.pPacket, keyDist)) + { + /* no more keys to receive; send ourselves pairing complete msg */ + pMsg->hdr.event = SMP_MSG_INT_PAIRING_CMPL; + smpSmExecute(pCcb, pMsg); + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_main.h b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_main.h new file mode 100644 index 0000000000000000000000000000000000000000..e4ce0165177ad17bc4884b9552283a5f1246e73e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_main.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP responder main module. + */ +/*************************************************************************************************/ +#ifndef SMPR_MAIN_H +#define SMPR_MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/* state machine interface */ +extern const smpSmIf_t smprSmIf; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +void smprActSendSecurityReq(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActProcPairReq(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActSendPairRsp(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActProcPairCnf(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActProcPairCnfCalc1(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActCnfVerify(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActSendPairRandom(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActSetupKeyDist(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActSendKey(smpCcb_t *pCcb, smpMsg_t *pMsg); +void smprActRcvKey(smpCcb_t *pCcb, smpMsg_t *pMsg); + +#ifdef __cplusplus +}; +#endif + +#endif /* SMPR_MAIN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_act.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_act.c new file mode 100644 index 0000000000000000000000000000000000000000..5691b00a31c77d4d571754d4e37c9f5b9a21ebe5 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_act.c @@ -0,0 +1,557 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections responder state machine action functions. + */ +/*************************************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "util/calc128.h" +#include "util/wstr.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpi_main.h" +#include "smp_sc_main.h" +#include "dm_api.h" + +/*************************************************************************************************/ +/*! + * \brief Store the pin. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActStoreLescPin(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + if (pCcb->pScCcb->authType == SMP_AUTH_TYPE_PASSKEY) + { + /* Store the pin */ + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t *)calc128Zeros); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t *)calc128Zeros); + + if (pMsg->dm.authRsp.authDataLen <= 3) + { + WStrReverseCpy(&pCcb->pScCcb->pScratch->Ra[13], pMsg->dm.authRsp.authData, pMsg->dm.authRsp.authDataLen); + WStrReverseCpy(&pCcb->pScCcb->pScratch->Rb[13], pMsg->dm.authRsp.authData, pMsg->dm.authRsp.authDataLen); + } + } +} + +/*************************************************************************************************/ +/*! + * \brief Responder public key exchange. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActSendPubKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Execute Common Auth Select actions */ + smpScActAuthSelect(pCcb, pMsg); + + /* Send our public key */ + smpScSendPubKey(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Prepare for the Just Works/Numeric Comparison Use Case + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActJwncSetup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Select Random Na (128-bits) */ + SecRand(pCcb->pScCcb->pScratch->Nb_Eb, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Nb", pCcb->pScCcb->pScratch->Nb_Eb); + + /* Set Ra and Rb to zero */ + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t*) calc128Zeros); + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t*) calc128Zeros); + + /* Next command is a Pair Rand from Initiator */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* Perform F4 Calculation of Cb */ + smpScActJwncCalcF4(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send the confirm to the initiator for Just Works/Numeric Comparison pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActJwncSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("JWNC Confirm", pMsg->aes.pCiphertext); + + smpScSendPairCnf(pCcb, pMsg, pMsg->aes.pCiphertext); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate Toolkit function G2 for Just Works pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActJwncCalcG2(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Na from initiator is in Random Cmd from initiator */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Na_Ea, pNa, SMP_RAND_LEN); + + /* Calculate Vb using G2 */ + smpScActJwncCalcG2(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! +* \brief Notify the application of the verify value calculated with Just Works pairing +* +* \param pCcb Connection control block. +* \param pMsg State machine message. +* +* \return None. +*/ +/*************************************************************************************************/ +void smprScActJwncDisplay(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Next command is a DH Key Check */ + pCcb->nextCmdCode = SMP_CMD_DHKEY_CHECK; + + /* Send Pair Rand Nb to the Initiator */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Nb_Eb); + + /* Send Numeric Comparison to application, if applicable */ + smpScActJwncDisplay(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Store the confirm value from the initiator + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkStoreCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pCa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Store the Cai from the initiator */ + WStrReverseCpy(pCcb->pScCcb->pScratch->PeerCa_Ea, pCa, SMP_CONFIRM_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Store the Confirm and Calculate the Cbi using toolkit function F4 for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkStoreCnfAndCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smprScActPkStoreCnf(pCcb, pMsg); + smprScActPkCalcCb(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Store the Pin and Calculate the Cbi using toolkit function F4 for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkStorePinAndCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + smprScActStoreLescPin(pCcb, pMsg); + smprScActPkCalcCb(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Cbi using toolkit function F4 for passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkCalcCb(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Get random Nbi */ + SecRand(pCcb->pScCcb->pScratch->Nb_Eb, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Nb", pCcb->pScCcb->pScratch->Nb_Eb); + + /* Next command is the Pair Random */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; + + /* Cb = f4(PKbx, PKax, Nbi, Rbi) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + smpGetPkBit(pCcb), pCcb->pScCcb->pScratch->Nb_Eb); +} + +/*************************************************************************************************/ +/*! + * \brief Send the Cbi to the initiator in a Confirm Command Message in passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkSendCnf(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("Cbi", pMsg->aes.pCiphertext); + + /* Send the Cbi to the peer */ + smpScSendPairCnf(pCcb, pMsg, pMsg->aes.pCiphertext); +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the Cai to be checked against the confirm value from the initiator + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Copy the Nai from the initiator */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Na_Ea, pNa, SMP_RAND_LEN); + + /* Cai = f4(PKax, PKbx, Nbi, Rbi) where f4(U, V, x, Z) = AES-CMACx (U || V || Z) */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + pCcb->pScCcb->pLocalPublicKey->pubKeyX, + smpGetPkBit(pCcb), pCcb->pScCcb->pScratch->Na_Ea); +} + +/*************************************************************************************************/ +/*! + * \brief Send the Nai in a Random Command Message in passkey pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActPkSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("Ca", pMsg->aes.pCiphertext); + SMP_TRACE_128("Ca Peer", pCcb->pScCcb->pScratch->PeerCa_Ea); + + /* Verify the Calculated Cai to previously received Cai */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCa_Ea, pMsg->aes.pCiphertext, SMP_RAND_LEN)) + { + smpScFailWithReattempt(pCcb); + } + else + { + wsfMsgHdr_t hdr; + + /* Increment the bit position */ + if (++pCcb->pScCcb->pkPos >= SMP_PK_BIT_COUNT) + { + hdr.event = SMP_MSG_INT_PK_CMPL; + } + else + { + /* Next command is the Pair Confirm */ + pCcb->nextCmdCode = SMP_CMD_PAIR_CNF; + hdr.event = SMP_MSG_INT_PK_NEXT; + + /* Send the Nbi */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Nb_Eb); + } + + /* Post an event to move to the next passkey confirm or complete the process */ + hdr.param = pCcb->connId; + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + +/*************************************************************************************************/ +/*! + * \brief Setup for OOB pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActOobSetup(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* The next command is the Pair Rand from the initiator */ + pCcb->nextCmdCode = SMP_CMD_PAIR_RAND; +} + +/*************************************************************************************************/ +/*! + * \brief Check the confirm passed via OOB methods + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActOobCalcCa(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pNa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Copy the Na from the initiator */ + WStrReverseCpy(pCcb->pScCcb->pScratch->Na_Ea, pNa, SMP_CONFIRM_LEN); + + /* If the peer device's OOB data flag does not indicate remote OOB data has been received, + clear Rb. */ + if (pCcb->pairReq[SMP_OOB_POS] != SMP_OOB_DATA_PRESENT) + { + Calc128Cpy(pCcb->pScCcb->pScratch->Rb, (uint8_t*) calc128Zeros); + } + + /* If we indicated the presence of remote OOB data has been received, calculate Ca. */ + if (pCcb->pairRsp[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) + { + /* Calculate Ca using Toolkit function F4 */ + SmpScCalcF4(pCcb, pMsg, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + pCcb->pScCcb->pPeerPublicKey->pubKeyX, + 0, pCcb->pScCcb->pScratch->Ra); + } + else + { + /* Simulate the ca calculation is complete and clear ra */ + secCmacMsg_t msg; + + Calc128Cpy(pCcb->pScCcb->pScratch->Ra, (uint8_t*)calc128Zeros); + + msg.hdr.param = pCcb->connId; + msg.hdr.event = SMP_MSG_WSF_CMAC_CMPL; + msg.pPlainText = NULL; + + smpSmExecute(pCcb, (smpMsg_t *) &msg); + } +} + +/*************************************************************************************************/ +/*! + * \brief Send the random value to the initiator when using OOB pairing + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActOobSendRand(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Only compare Ca if we indicated that we received OOB data. */ + if (pCcb->pairRsp[SMP_OOB_POS] == SMP_OOB_DATA_PRESENT) + { + SMP_TRACE_128("Ca", pMsg->aes.pCiphertext); + + /* Check that the Ca value passed via OOB methods match expectations */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCa_Ea, pMsg->aes.pCiphertext, SMP_CONFIRM_LEN)) + { + smpScFailWithReattempt(pCcb); + return; + } + } + + /* Next command is a DK Key Check from initiator */ + pCcb->nextCmdCode = SMP_CMD_DHKEY_CHECK; + + /* Get a random Nb */ + SecRand(pCcb->pScCcb->pScratch->Nb_Eb, SMP_RAND_LEN); + + SMP_TRACE_128("Rand Nb", pCcb->pScCcb->pScratch->Nb_Eb); + + /* Send the rand Nb to the initiator */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Nb_Eb); +} + +/*************************************************************************************************/ +/*! +* \brief Store DH Key Check from Initiator and wait for user input on Numeric Comparison +* +* \param pCcb Connection control block. +* \param pMsg State machine message. +* +* \return None. +*/ +/*************************************************************************************************/ +void smprScActStoreDhCheck(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + uint8_t *pEa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* Signal that not further commands are expected until Key Distribution phase (if applicable) */ + pCcb->nextCmdCode = SMP_CMD_MAX; + + /* The Ea from the peer is in the cmd message (copy as MSB First) */ + WStrReverseCpy(pCcb->pScCcb->pScratch->PeerCa_Ea, pEa, SMP_CONFIRM_LEN); +} + +/*************************************************************************************************/ +/*! + * \brief Prepare to wait for the DH Key Check Cmd from the initiator + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActWaitDhCheck(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + /* Next command is a DH Key Check */ + pCcb->nextCmdCode = SMP_CMD_DHKEY_CHECK; + + if (pCcb->pScCcb->authType == SMP_AUTH_TYPE_PASSKEY) + { + /* Send the Pair Rand Nb */ + smpScSendRand(pCcb, pMsg, pCcb->pScCcb->pScratch->Nb_Eb); + } +} + +/*************************************************************************************************/ +/*! + * \brief Calculate the DHKey, for Cryptographic Function 5 + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActCalcDHKey(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + if (pCcb->nextCmdCode == SMP_CMD_DHKEY_CHECK) + { + uint8_t *pEa = pMsg->data.pPacket + L2C_PAYLOAD_START + SMP_HDR_LEN; + + /* The Ea from the peer is in the cmd message (copy as MSB First) */ + WStrReverseCpy(pCcb->pScCcb->pScratch->PeerCa_Ea, pEa, SMP_CONFIRM_LEN); + } + + /* Complete the calculation */ + smpScActCalcSharedSecret(pCcb, pMsg); +} + +/*************************************************************************************************/ +/*! + * \brief Send the DH Key check. + * + * \param pCcb Connection control block. + * \param pMsg State machine message. + * + * \return None. + */ +/*************************************************************************************************/ +void smprScActDHKeyCheckSend(smpCcb_t *pCcb, smpMsg_t *pMsg) +{ + SMP_TRACE_128("DHKey Eb", pMsg->aes.pCiphertext); + + /* The Eb from the CMAC calculation */ + Calc128Cpy(pCcb->pScCcb->pScratch->Nb_Eb, pMsg->aes.pCiphertext); + + /* Verify the DH Key Check Ea with the value received from the initiator */ + if (memcmp(pCcb->pScCcb->pScratch->PeerCa_Ea, pCcb->pScCcb->pScratch->Na_Ea, SMP_RAND_LEN) == 0) + { + /* Adjust key based on max key length */ + uint8_t encKeyLen = (pCcb->pairReq[SMP_MAXKEY_POS] < pCcb->pairRsp[SMP_MAXKEY_POS]) ? + pCcb->pairReq[SMP_MAXKEY_POS] : pCcb->pairRsp[SMP_MAXKEY_POS]; + + memset((pCcb->pScCcb->pLtk->ltk_t + encKeyLen), 0, (SMP_KEY_LEN - encKeyLen)); + + /* Send the DH Key check Eb to the initiator */ + smpScSendDHKeyCheck(pCcb, pMsg, pCcb->pScCcb->pScratch->Nb_Eb); + } + else + { + /* DH Key check failed */ + wsfMsgHdr_t hdr; + + hdr.param = pCcb->connId; + hdr.status = SMP_ERR_DH_KEY_CHECK; + + /* update repeated attempts count */ + pCcb->attempts++; + SmpDbPairingFailed(pCcb->connId); + + if (pCcb->attempts == pSmpCfg->maxAttempts) + { + /* max attempts reached */ + hdr.event = SMP_MSG_INT_MAX_ATTEMPTS; + } + else + { + /* else just fail */ + hdr.event = SMP_MSG_DH_CHECK_FAILURE; + } + + smpSmExecute(pCcb, (smpMsg_t *) &hdr); + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_sm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_sm.c new file mode 100644 index 0000000000000000000000000000000000000000..cae5206c342f30688a4e78617f19ab3b963ccc22 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sc_sm.c @@ -0,0 +1,683 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP Secure Connections initiator state machine. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpr_main.h" +#include "smp_sc_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Action function enumeration */ +enum +{ + SMPR_SC_ACT_NONE, /*!< No Action */ + SMPR_SC_ACT_CLEANUP, /*!< Process Pairing Cleanup */ + SMPR_SC_ACT_PAIRING_FAILED, /*!< Process Pairing Failed */ + SMPR_SC_ACT_PAIRING_CANCEL, /*!< Process Pairing Canceled */ + SMPR_SC_ACT_SEND_PUB_KEY, /*!< Process Send Public Key */ + SMPR_SC_ACT_STORE_LEGACY_PIN, /*!< Process Store Legacy Pin */ + SMPR_SC_ACT_STORE_LESC_PIN, /*!< Process Store LESC Pin */ + + SMPR_SC_ACT_PAIR_CNF_CALC_1, /*!< Process Confirm Value Calculation 1 */ + SMPR_SC_ACT_PAIR_CNF_CALC_2, /*!< Process Confirm Value Calculation 2 */ + SMPR_SC_ACT_SEND_PAIR_CNF, /*!< Process Send Confirm Value */ + SMPR_SC_ACT_PAIR_CNF_VER_CALC_1, /*!< Process Received Confirm Value Verification Calculation 1 */ + SMPR_SC_ACT_PAIR_CNF_VER_CALC_2, /*!< Process Received Confirm Value Verification Calculation 2 */ + SMPR_SC_ACT_MAX_ATTEMPTS, /*!< Process Maximum Attempts */ + SMPR_SC_ACT_PAIRING_CMPL, /*!< Process Pairing Complete */ + SMPR_SC_ACT_CHECK_ATTEMPTS, /*!< Process Check Attempts */ + SMPR_SC_ACT_NOTIFY_DM_ATTEMPTS, /*!< Process Notify DM of Attempts Failure */ + SMPR_SC_ACT_NOTIFY_DM_RSP_TO, /*!< Process Notify DM of Response Timeout Failure */ + SMPR_SC_ACT_ATTEMPT_RCVD, /*!< Process Attempts Received */ + + SMPR_SC_ACT_SEND_SECURITY_REQ, /*!< Process Send Slave Security Request */ + SMPR_SC_ACT_PROC_PAIR_REQ, /*!< Process Pairing Request */ + SMPR_SC_ACT_SEND_PAIR_RSP, /*!< Process Send Pairing Response */ + SMPR_SC_ACT_PROC_PAIR_CNF, /*!< Process Received Confirm Value */ + + SMPR_SC_ACT_JWNC_SETUP, /*!< Process Just Works/Numeric Comparison Setup */ + SMPR_SC_ACT_JWNC_SEND_CNF, /*!< Process JW/NC Send Confirm Value */ + SMPR_SC_ACT_JWNC_CALC_G2, /*!< Process JW/NC Calculate G2 */ + SMPR_SC_ACT_JWNC_DISPLAY, /*!< Process JW/NC Display Numeric Comparison */ + + SMPR_SC_ACT_PK_SETUP, /*!< Process Passkey Setup */ + SMPR_SC_ACT_PK_KEYPRESS, /*!< Process Passkey Keypress */ + SMPR_SC_ACT_PK_SEND_KEYPRESS, /*!< Process Passkey Send Keypress */ + SMPR_SC_ACT_PK_STORE_CNF, /*!< Process Passkey Store Received Confirm Value */ + SMPR_SC_ACT_PK_STORE_CNF_CALC_CB, /*!< Process Passkey Store Confirm Value Calculation Cb */ + SMPR_SC_ACT_PK_STORE_PIN_CALC_CB, /*!< Process Passkey Store Pin Value Calculation Cb */ + SMPR_SC_ACT_PK_CALC_CB, /*!< Process Passkey Calculate Cb */ + SMPR_SC_ACT_PK_SEND_CNF, /*!< Process Passkey Send Confirm Value */ + SMPR_SC_ACT_PK_CALC_CA, /*!< Process Passkey Calculate Ca */ + SMPR_SC_ACT_PK_SEND_RAND, /*!< Process Passkey Send Random Value */ + + SMPR_SC_ACT_OOB_SETUP, /*!< Process OOB Setup */ + SMPR_SC_ACT_OOB_CALC_CA, /*!< Process OOB Calculate Ca */ + SMPR_SC_ACT_OOB_SEND_RAND, /*!< Process OOB Send Random Value */ + + SMPR_SC_ACT_STORE_DH_CHECK, /*!< Process Store DH Key Check */ + SMPR_SC_ACT_WAIT_DH_CHECK, /*!< Process Wait DH Key Check */ + SMPR_SC_ACT_CALC_DHKEY, /*!< Process Calculate DH Key Check */ + SMPR_SC_ACT_CALC_F5_TKEY, /*!< Process Calculate F5 Temporary Key */ + SMPR_SC_ACT_CALC_F5_MACKEY, /*!< Process Calculate F5 MAC Key */ + SMPR_SC_ACT_CALC_F5_LTK, /*!< Process Calculate LTK */ + SMPR_SC_ACT_CALC_F6_EA, /*!< Process Calculate Ea */ + SMPR_SC_ACT_CALC_F6_EB, /*!< Process Calculate Eb */ + SMPR_SC_ACT_SEND_DH_CHECK, /*!< Process Send DH Key Check */ + + SMPR_SC_ACT_PROC_PAIR_CNF_CALC_1, /*!< Process Confirm Value Calcuation 1 */ + SMPR_SC_ACT_CNF_VERIFY, /*!< Process Confirm Value Verification */ + SMPR_SC_ACT_SEND_PAIR_RANDOM, /*!< Process Send Random Value */ + SMPR_SC_ACT_SETUP_KEY_DIST, /*!< Processs Setup Key Distribution */ + SMPR_SC_ACT_RCV_KEY, /*!< Process Received Key */ + SMPR_SC_ACT_SEND_KEY /*!< Process Send Key */ +}; + +/************************************************************************************************** + Static Variables +**************************************************************************************************/ + +/*! Action function table; order matches action function enumeration */ +static const smpAct_t smprScActionTbl[] = +{ + smpActNone, + smpScActCleanup, + smpScActPairingFailed, + smpScActPairingCancel, + smprScActSendPubKey, + smpActStorePin, + smprScActStoreLescPin, + + smpActPairCnfCalc1, + smpActPairCnfCalc2, + smpActSendPairCnf, + smpActPairCnfVerCalc1, + smpActPairCnfVerCalc2, + smpActMaxAttempts, + smpActPairingCmpl, + smpActCheckAttempts, + smpActNotifyDmAttemptsFailure, + smpActNotifyDmRspToFailure, + smpActAttemptRcvd, + + smprActSendSecurityReq, + smprActProcPairReq, + smprActSendPairRsp, + smprActProcPairCnf, + + smprScActJwncSetup, + smprScActJwncSendCnf, + smprScActJwncCalcG2, + smprScActJwncDisplay, + + smpScActPkSetup, + smpScActPkKeypress, + smpScActPkSendKeypress, + smprScActPkStoreCnf, + smprScActPkStoreCnfAndCalcCb, + smprScActPkStorePinAndCalcCb, + smprScActPkCalcCb, + smprScActPkSendCnf, + smprScActPkCalcCa, + smprScActPkSendRand, + + smprScActOobSetup, + smprScActOobCalcCa, + smprScActOobSendRand, + + smprScActStoreDhCheck, + smprScActWaitDhCheck, + smprScActCalcDHKey, + smpScActCalcF5TKey, + smpScActCalcF5MacKey, + smpScActCalcF5Ltk, + smpScActDHKeyCalcF6Ea, + smpScActDHKeyCalcF6Eb, + smprScActDHKeyCheckSend, + + smprActProcPairCnfCalc1, + smprActCnfVerify, + smprActSendPairRandom, + smprActSetupKeyDist, + smprActRcvKey, + smprActSendKey +}; + +/*! State table for common actions */ +static const smpTblEntry_t smprScStateTblCommon[SMP_STATE_TBL_COMMON_MAX] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_PAIRING_FAILED}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_IDLE */ +static const smpTblEntry_t smprScStateTblIdle[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_SECURITY_REQ, SMPR_SC_SM_ST_API_PAIR_REQ, SMPR_SC_ACT_SEND_SECURITY_REQ}, + {SMP_MSG_DM_CONN_CLOSE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_API_PAIR_RSP, SMPR_SC_ACT_PROC_PAIR_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_API_PAIR_REQ */ +static const smpTblEntry_t smprScStateTblApiPairReq[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_API_PAIR_RSP, SMPR_SC_ACT_PROC_PAIR_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_DM_ENCRYPT_CMPL, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_API_PAIR_RSP */ +static const smpTblEntry_t smprScStateTblApiPairRsp[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_PAIR_RSP, SMPR_SC_SM_ST_MODE_SELECT, SMPR_SC_ACT_SEND_PAIR_RSP}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_MODE_SELECT */ +static const smpTblEntry_t smprScStateTblModeSelect[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_LESC, SMPR_SC_SM_ST_LESC_PIN, SMPR_SC_ACT_NONE}, + {SMP_MSG_INT_LEGACY, SMPR_SC_SM_ST_PIN_PAIR_1, SMPR_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for LESC SMPR_SC_SM_ST_LESC_PIN */ +static const smpTblEntry_t smprScStateTblLescPin[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SC_SM_ST_PUB_KEY, SMPR_SC_ACT_STORE_LESC_PIN}, + {0, 0, 0} +}; + +/*! State table for LESC SMPR_SC_SM_ST_PUB_KEY */ +static const smpTblEntry_t smprScStateTblPubKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_AUTH_SELECT, SMPR_SC_ACT_SEND_PUB_KEY}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_AUTH_SELECT */ +static const smpTblEntry_t smprScStateTblAuthSelect[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_JW_NC, SMPR_SC_SM_ST_JWNC_SETUP, SMPR_SC_ACT_JWNC_SETUP}, + {SMP_MSG_INT_PASSKEY, SMPR_SC_SM_ST_PK_KEYPRESS, SMPR_SC_ACT_PK_SETUP}, + {SMP_MSG_INT_OOB, SMPR_SC_SM_ST_OOB_WAIT_RAND, SMPR_SC_ACT_OOB_SETUP}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_JWNC_SETUP */ +static const smpTblEntry_t smprScStateTblJwNcSetup[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_JWNC_WAIT_RAND, SMPR_SC_ACT_JWNC_SEND_CNF}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_JWNC_WAIT_RAND */ +static const smpTblEntry_t smprScStateTblJwNcWaitRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_JWNC_CALC_G2, SMPR_SC_ACT_JWNC_CALC_G2}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_JWNC_CALC_G2 */ +static const smpTblEntry_t smprScStateTblJwNcCalcG2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_JWNC_WAIT_USER, SMPR_SC_ACT_JWNC_DISPLAY}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_JWNC_WAIT_USER */ +static const smpTblEntry_t smprScStateTblJwNcWaitUser[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_USER_CONFIRM, SMPR_SC_SM_ST_WAIT_DH_CHECK, SMPR_SC_ACT_WAIT_DH_CHECK}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_JWNC_WAIT_USER_DH_CHECK_RCVD, SMPR_SC_ACT_STORE_DH_CHECK}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_JWNC_WAIT_USER_DH_CHECK_RCVD */ +static const smpTblEntry_t smprScStateTblJwNcWaitUserDhCheckRcvd[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_USER_CONFIRM, SMPR_SC_SM_ST_CALC_DHKEY, SMPR_SC_ACT_CALC_DHKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_KEYPRESS */ +static const smpTblEntry_t smprScStateTblPassKeyKeypress[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_PK_KEYPRESS, SMPR_SC_ACT_PK_KEYPRESS}, + {SMP_MSG_EARLY_CNF, SMPR_SC_SM_ST_PK_WAIT_AUTH, SMPR_SC_ACT_PK_STORE_CNF}, + {SMP_MSG_API_USER_KEYPRESS, SMPR_SC_SM_ST_PK_KEYPRESS, SMPR_SC_ACT_PK_SEND_KEYPRESS}, + {SMP_MSG_API_AUTH_RSP, SMPR_SC_SM_ST_PK_WAIT_CNF, SMPR_SC_ACT_STORE_LESC_PIN}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_WAIT_AUTH */ +static const smpTblEntry_t smprScStateTblPassWaitAuthRsp[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SC_SM_ST_PK_CALC, SMPR_SC_ACT_PK_STORE_PIN_CALC_CB}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_WAIT_CNF */ +static const smpTblEntry_t smprScStateTblPasskeyWaitCnf[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_PK_CALC, SMPR_SC_ACT_PK_STORE_CNF_CALC_CB}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_CALC */ +static const smpTblEntry_t smprScStateTblPasskeyCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_PK_RAND, SMPR_SC_ACT_PK_SEND_CNF}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_RAND */ +static const smpTblEntry_t smprScStateTblPasskeyRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_PK_CHECK, SMPR_SC_ACT_PK_CALC_CA}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_CHECK */ +static const smpTblEntry_t smprScStateTblPasskeyCheck[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_PK_REPEAT, SMPR_SC_ACT_PK_SEND_RAND}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_PK_REPEAT */ +static const smpTblEntry_t smprScStateTblPasskeyRepeat[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_PK_NEXT, SMPR_SC_SM_ST_PK_WAIT_CNF, SMPR_SC_ACT_NONE}, + {SMP_MSG_INT_PK_CMPL, SMPR_SC_SM_ST_WAIT_DH_CHECK, SMPR_SC_ACT_WAIT_DH_CHECK}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_OOB_WAIT_RAND */ +static const smpTblEntry_t smprScStateTblOobWaitRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_OOB_SEND_RAND, SMPR_SC_ACT_OOB_CALC_CA}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_OOB_SEND_RAND */ +static const smpTblEntry_t smprScStateTblOobSendRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_WAIT_DH_CHECK, SMPR_SC_ACT_OOB_SEND_RAND}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_WAIT_DH_CHECK */ +static const smpTblEntry_t smprScStateTblWaitDhCheck[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_CALC_DHKEY, SMPR_SC_ACT_CALC_DHKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_DHKEY */ +static const smpTblEntry_t smprScStateTblCalcDHKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_ECC_CMPL, SMPR_SC_SM_ST_CALC_F5_TKEY, SMPR_SC_ACT_CALC_F5_TKEY}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_F5_TKEY */ +static const smpTblEntry_t smprScStateTblCalcF5TKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_CALC_F5_MACKEY, SMPR_SC_ACT_CALC_F5_MACKEY}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_F5_MACKEY */ +static const smpTblEntry_t smprScStateTblCalcF5MacKey[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_CALC_F5_LTK, SMPR_SC_ACT_CALC_F5_LTK}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_F5_LTK */ +static const smpTblEntry_t smprScStateTblCalcF5LTK[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_CALC_F6_EA, SMPR_SC_ACT_CALC_F6_EA}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_F6_EA */ +static const smpTblEntry_t smprScStateTblDhCalcF6Ea[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_CALC_F6_EB, SMPR_SC_ACT_CALC_F6_EB}, + {0, 0, 0} +}; + +/*! State table for SMPR_SC_SM_ST_CALC_F6_EB */ +static const smpTblEntry_t smprScStateTblDhCalcF6Eb[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_CMAC_CMPL, SMPR_SC_SM_ST_ENCRYPT, SMPR_SC_ACT_SEND_DH_CHECK}, + {0, 0, 0} +}; + +/*! State table for Legacy PIN_PAIR_1 */ +static const smpTblEntry_t smprStateTblPinPair1[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SC_SM_ST_PIN_PAIR_2, SMPR_SC_ACT_STORE_LEGACY_PIN}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_PIN_PAIR_2, SMPR_SC_ACT_PROC_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for Legacy PIN_PAIR_2 */ +static const smpTblEntry_t smprStateTblPinPair2[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SC_SM_ST_CNF_CALC_1, SMPR_SC_ACT_PAIR_CNF_CALC_1}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_CNF_CALC_1, SMPR_SC_ACT_PROC_PAIR_CNF_CALC_1}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_CALC_1 */ +static const smpTblEntry_t smprStateTblCnfCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SC_SM_ST_CNF_CALC_2, SMPR_SC_ACT_PAIR_CNF_CALC_2}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_CALC_2 */ +static const smpTblEntry_t smprStateTblCnfCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SC_SM_ST_PAIR_RAND, SMPR_SC_ACT_SEND_PAIR_CNF}, + {0, 0, 0} +}; + + +/*! State table for Legacy PAIR_RAND */ +static const smpTblEntry_t smprStateTblPairRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_CNF_VER_CALC_1, SMPR_SC_ACT_PAIR_CNF_VER_CALC_1}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_VER_CALC_1 */ +static const smpTblEntry_t smprStateTblCnfVerCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SC_SM_ST_CNF_VER_CALC_2, SMPR_SC_ACT_PAIR_CNF_VER_CALC_2}, + {0, 0, 0} +}; + +/*! State table for Legacy CNF_VER_CALC_2 */ +static const smpTblEntry_t smprStateTblCnfVerCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SC_SM_ST_STK_CALC, SMPR_SC_ACT_CNF_VERIFY}, + {0, 0, 0} +}; + +/*! State table for Legacy STK_CALC */ +static const smpTblEntry_t smprScStateTblStkCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SC_SM_ST_ENCRYPT, SMPR_SC_ACT_SEND_PAIR_RANDOM}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for ENCRYPT */ +static const smpTblEntry_t smprScStateTblEncrypt[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_ENCRYPT_CMPL, SMPR_SC_SM_ST_KEY_DIST, SMPR_SC_ACT_SETUP_KEY_DIST}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_ENCRYPT, SMPR_SC_ACT_NONE}, + {SMP_MSG_DH_CHECK_FAILURE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for KEY_DIST */ +static const smpTblEntry_t smprScStateTblKeyDist[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_KEY_DIST, SMPR_SC_ACT_RCV_KEY}, + {SMP_MSG_INT_SEND_NEXT_KEY, SMPR_SC_SM_ST_KEY_DIST, SMPR_SC_ACT_SEND_KEY}, + {SMP_MSG_INT_PAIRING_CMPL, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_PAIRING_CMPL}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_KEY_DIST, SMPR_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for ATTEMPTS */ +static const smpTblEntry_t smprScStateTblAttempts[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_WI_TIMEOUT, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CHECK_ATTEMPTS}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PKT, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_ATTEMPT_RCVD}, + {SMP_MSG_API_SECURITY_REQ, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_NOTIFY_DM_ATTEMPTS}, + {SMP_MSG_DM_CONN_CLOSE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SC_SM_ST_ATTEMPTS, SMPR_SC_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for RSP_TO */ +static const smpTblEntry_t smprScStateTblRspTo[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SC_SM_ST_IDLE, SMPR_SC_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_NONE}, + {SMP_MSG_API_SECURITY_REQ, SMPR_SC_SM_ST_RSP_TO, SMPR_SC_ACT_NOTIFY_DM_RSP_TO}, + {0, 0, 0} +}; + +/*! Table of individual state tables */ +static const smpTblEntry_t * const smprScStateTbl[] = +{ + smprScStateTblIdle, + smprScStateTblApiPairReq, + smprScStateTblApiPairRsp, + smprScStateTblModeSelect, + smprScStateTblPubKey, + smprScStateTblLescPin, + smprScStateTblAuthSelect, + + smprScStateTblJwNcSetup, + smprScStateTblJwNcWaitRand, + smprScStateTblJwNcCalcG2, + smprScStateTblJwNcWaitUser, + smprScStateTblJwNcWaitUserDhCheckRcvd, + + smprScStateTblPassKeyKeypress, + smprScStateTblPassWaitAuthRsp, + smprScStateTblPasskeyWaitCnf, + smprScStateTblPasskeyCalc, + smprScStateTblPasskeyRand, + smprScStateTblPasskeyCheck, + smprScStateTblPasskeyRepeat, + + smprScStateTblOobSendRand, + smprScStateTblOobWaitRand, + + smprScStateTblWaitDhCheck, + smprScStateTblCalcDHKey, + smprScStateTblCalcF5TKey, + smprScStateTblCalcF5MacKey, + smprScStateTblCalcF5LTK, + smprScStateTblDhCalcF6Ea, + smprScStateTblDhCalcF6Eb, + + smprStateTblPinPair1, + smprStateTblPinPair2, + smprStateTblCnfCalc1, + smprStateTblCnfCalc2, + smprStateTblPairRand, + smprStateTblCnfVerCalc1, + smprStateTblCnfVerCalc2, + + smprScStateTblStkCalc, + smprScStateTblEncrypt, + smprScStateTblKeyDist, + smprScStateTblAttempts, + smprScStateTblRspTo +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! state machine interface */ +const smpSmIf_t smprScSmIf = +{ + smprScStateTbl, + smprScActionTbl, + smprScStateTblCommon +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize SMP initiator role. + * + * \return None. + */ +/*************************************************************************************************/ +void SmprScInit(void) +{ + /* set up callback interface */ + smpCb.pSlave = &smprScSmIf; + + /* General SMP LESC Initialization */ + SmpScInit(); +} + +/*************************************************************************************************/ +/*! + * \brief Convert state into string for diagnostics. + * + * \param state State ID + * + * \return State string. + */ +/*************************************************************************************************/ +uint8_t *smprStateStr(uint8_t state) +{ + switch(state) + { + case SMPR_SC_SM_ST_IDLE: return (uint8_t*) "R_IDLE"; + case SMPR_SC_SM_ST_API_PAIR_REQ: return (uint8_t*) "R_API_PAIR_REQ"; + case SMPR_SC_SM_ST_API_PAIR_RSP: return (uint8_t*) "R_API_PAIR_RSP"; + case SMPR_SC_SM_ST_MODE_SELECT: return (uint8_t*) "R_MODE_SELECT"; + case SMPR_SC_SM_ST_PUB_KEY: return (uint8_t*) "R_PUB_KEY"; + case SMPR_SC_SM_ST_LESC_PIN: return (uint8_t*) "R_LESC_PIN"; + case SMPR_SC_SM_ST_AUTH_SELECT: return (uint8_t*) "R_AUTH_SELECT"; + case SMPR_SC_SM_ST_JWNC_SETUP: return (uint8_t*) "R_JWNC_SETUP"; + case SMPR_SC_SM_ST_JWNC_WAIT_RAND: return (uint8_t*) "R_JWNC_WAIT_RAND"; + case SMPR_SC_SM_ST_JWNC_CALC_G2: return (uint8_t*) "R_JWNC_CALC_G2"; + case SMPR_SC_SM_ST_JWNC_WAIT_USER: return (uint8_t*) "R_JWNC_WAIT_USER"; + case SMPR_SC_SM_ST_JWNC_WAIT_USER_DH_CHECK_RCVD: return (uint8_t*) "R_JWNC_WAIT_USER_DH"; + + case SMPR_SC_SM_ST_PK_KEYPRESS: return (uint8_t*) "R_PK_KEYPRESS"; + case SMPR_SC_SM_ST_PK_WAIT_AUTH: return (uint8_t*) "R_PK_WAIT_AUTH"; + case SMPR_SC_SM_ST_PK_WAIT_CNF: return (uint8_t*) "R_PK_WAIT_CNF"; + case SMPR_SC_SM_ST_PK_CALC: return (uint8_t*) "R_PK_CALC"; + case SMPR_SC_SM_ST_PK_RAND: return (uint8_t*) "R_PK_RAND"; + case SMPR_SC_SM_ST_PK_CHECK: return (uint8_t*) "R_PK_CHECK"; + case SMPR_SC_SM_ST_PK_REPEAT: return (uint8_t*) "R_PK_REPEAT"; + + case SMPR_SC_SM_ST_OOB_SEND_RAND: return (uint8_t*) "R_OOB_SEND_RAND"; + case SMPR_SC_SM_ST_OOB_WAIT_RAND: return (uint8_t*) "R_OOB_WAIT_RAND"; + + case SMPR_SC_SM_ST_WAIT_DH_CHECK: return (uint8_t*) "R_WAIT_DH_CHECK"; + case SMPR_SC_SM_ST_CALC_DHKEY: return (uint8_t*) "R_CALC_DHKEY"; + case SMPR_SC_SM_ST_CALC_F5_TKEY: return (uint8_t*) "R_CALC_F5_TKEY"; + case SMPR_SC_SM_ST_CALC_F5_MACKEY: return (uint8_t*) "R_CALC_F5_MACKEY"; + case SMPR_SC_SM_ST_CALC_F5_LTK: return (uint8_t*) "R_CALC_F5_LTK"; + case SMPR_SC_SM_ST_CALC_F6_EA: return (uint8_t*) "R_CALC_F6_EA"; + case SMPR_SC_SM_ST_CALC_F6_EB: return (uint8_t*) "R_CALC_F6_EB"; + case SMPR_SC_SM_ST_PIN_PAIR_1: return (uint8_t*) "R_PIN_PAIR_1"; + case SMPR_SC_SM_ST_PIN_PAIR_2: return (uint8_t*) "R_PIN_PAIR_2"; + case SMPR_SC_SM_ST_CNF_CALC_1: return (uint8_t*) "R_CNF_CALC_1"; + case SMPR_SC_SM_ST_CNF_CALC_2: return (uint8_t*) "R_CNF_CALC_2"; + case SMPR_SC_SM_ST_PAIR_RAND: return (uint8_t*) "R_PAIR_RAND"; + case SMPR_SC_SM_ST_CNF_VER_CALC_1: return (uint8_t*) "R_CNF_VER_CALC_1"; + case SMPR_SC_SM_ST_CNF_VER_CALC_2: return (uint8_t*) "R_CNF_VER_CALC_2"; + case SMPR_SC_SM_ST_STK_CALC: return (uint8_t*) "R_STK_CALC"; + case SMPR_SC_SM_ST_ENCRYPT: return (uint8_t*) "R_ENCRYPT"; + case SMPR_SC_SM_ST_KEY_DIST: return (uint8_t*) "R_KEY_DIST"; + case SMPR_SC_SM_ST_ATTEMPTS: return (uint8_t*) "R_ATTEMPTS"; + case SMPR_SC_SM_ST_RSP_TO: return (uint8_t*) "R_RSP_TO"; + + default: return (uint8_t*) "R_Unknown"; + } +} + diff --git a/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sm.c b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sm.c new file mode 100644 index 0000000000000000000000000000000000000000..c76226fa6e0122e8066c4b9a521e76ef99c1a318 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/ble-host/sources/stack/smp/smpr_sm.c @@ -0,0 +1,308 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief SMP responder state machine. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "smp_api.h" +#include "smp_main.h" +#include "smpr_main.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! Action function enumeration */ +enum +{ + SMPR_ACT_NONE, /*!< No Action */ + SMPR_ACT_CLEANUP, /*!< Process Pairing Cleanup */ + SMPR_ACT_PAIRING_FAILED, /*!< Process Pairing Failed */ + SMPR_ACT_PAIRING_CANCEL, /*!< Process Pairing Canceled */ + SMPR_ACT_STORE_PIN, /*!< Process Store Pin */ + SMPR_ACT_PAIR_CNF_CALC_1, /*!< Process Confirm Value Calculation 1 */ + SMPR_ACT_PAIR_CNF_CALC_2, /*!< Process Confirm Value Calculation 2 */ + SMPR_ACT_SEND_PAIR_CNF, /*!< Process Send Confirm Value */ + SMPR_ACT_PAIR_CNF_VER_CALC_1, /*!< Process Received Confirm Value Verification Calculation 1 */ + SMPR_ACT_PAIR_CNF_VER_CALC_2, /*!< Process Received Confirm Value Verification Calculation 2 */ + SMPR_ACT_MAX_ATTEMPTS, /*!< Process Maximum Attempts */ + SMPR_ACT_ATTEMPT_RCVD, /*!< Process Attempts Received */ + SMPR_ACT_CHECK_ATTEMPTS, /*!< Process Check Attempts */ + SMPR_ACT_NOTIFY_DM_ATTEMPTS, /*!< Process Notify DM of Attempts Failure */ + SMPR_ACT_NOTIFY_DM_RSP_TO, /*!< Process Notify DM of Response Timeout Failure */ + SMPR_ACT_PAIRING_CMPL, /*!< Process Pairing Complete */ + SMPR_ACT_SEND_SECURITY_REQ, /*!< Process Send Slave Security Request */ + SMPR_ACT_PROC_PAIR_REQ, /*!< Process Pairing Request */ + SMPR_ACT_SEND_PAIR_RSP, /*!< Process Send Pairing Response */ + SMPR_ACT_PROC_PAIR_CNF, /*!< Process Pair Confirm Value */ + SMPR_ACT_PROC_PAIR_CNF_CALC_1, /*!< Process Received Confirm Value */ + SMPR_ACT_CNF_VERIFY, /*!< Process Recevied Confirm Value Verification */ + SMPR_ACT_SEND_PAIR_RANDOM, /*!< Process Send Random Value */ + SMPR_ACT_SETUP_KEY_DIST, /*!< Process Setup Key Distribution */ + SMPR_ACT_SEND_KEY, /*!< Process Send Key */ + SMPR_ACT_RCV_KEY /*!< Process Received Key */ +}; + + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Static Variables +**************************************************************************************************/ + +/*! Action function table; order matches action function enumeration */ +static const smpAct_t smprActionTbl[] = +{ + smpActNone, + smpActCleanup, + smpActPairingFailed, + smpActPairingCancel, + smpActStorePin, + smpActPairCnfCalc1, + smpActPairCnfCalc2, + smpActSendPairCnf, + smpActPairCnfVerCalc1, + smpActPairCnfVerCalc2, + smpActMaxAttempts, + smpActAttemptRcvd, + smpActCheckAttempts, + smpActNotifyDmAttemptsFailure, + smpActNotifyDmRspToFailure, + smpActPairingCmpl, + smprActSendSecurityReq, + smprActProcPairReq, + smprActSendPairRsp, + smprActProcPairCnf, + smprActProcPairCnfCalc1, + smprActCnfVerify, + smprActSendPairRandom, + smprActSetupKeyDist, + smprActSendKey, + smprActRcvKey +}; + +/*! State table for common actions */ +static const smpTblEntry_t smprStateTblCommon[SMP_STATE_TBL_COMMON_MAX] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_CANCEL}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SM_ST_RSP_TO, SMPR_ACT_PAIRING_FAILED}, + {0, 0, 0} +}; + +/*! State table for IDLE */ +static const smpTblEntry_t smprStateTblIdle[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_SECURITY_REQ, SMPR_SM_ST_API_PAIR_REQ, SMPR_ACT_SEND_SECURITY_REQ}, + {SMP_MSG_DM_CONN_CLOSE, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_API_PAIR_RSP, SMPR_ACT_PROC_PAIR_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SM_ST_IDLE, SMPR_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SM_ST_IDLE, SMPR_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for API_PAIR_REQ */ +static const smpTblEntry_t smprStateTblApiPairReq[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_API_PAIR_RSP, SMPR_ACT_PROC_PAIR_REQ}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_DM_ENCRYPT_CMPL, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {0, 0, 0} +}; + +/*! State table for API_PAIR_RSP */ +static const smpTblEntry_t smprStateTblApiPairRsp[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_PAIR_RSP, SMPR_SM_ST_PIN_PAIR_1, SMPR_ACT_SEND_PAIR_RSP}, + {0, 0, 0} +}; + +/*! State table for PIN_PAIR_1 */ +static const smpTblEntry_t smprStateTblPinPair1[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SM_ST_PIN_PAIR_2, SMPR_ACT_STORE_PIN}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_PIN_PAIR_2, SMPR_ACT_PROC_PAIR_CNF}, + {0, 0, 0} +}; + +/*! State table for PIN_PAIR_2 */ +static const smpTblEntry_t smprStateTblPinPair2[] = +{ +/* Event Next state Action */ + {SMP_MSG_API_AUTH_RSP, SMPR_SM_ST_CNF_CALC_1, SMPR_ACT_PAIR_CNF_CALC_1}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_CNF_CALC_1, SMPR_ACT_PROC_PAIR_CNF_CALC_1}, + {0, 0, 0} +}; + +/*! State table for CNF_CALC_1 */ +static const smpTblEntry_t smprStateTblCnfCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SM_ST_CNF_CALC_2, SMPR_ACT_PAIR_CNF_CALC_2}, + {0, 0, 0} +}; + +/*! State table for CNF_CALC_2 */ +static const smpTblEntry_t smprStateTblCnfCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SM_ST_PAIR_RAND, SMPR_ACT_SEND_PAIR_CNF}, + {0, 0, 0} +}; + + +/*! State table for PAIR_RAND */ +static const smpTblEntry_t smprStateTblPairRand[] = +{ +/* Event Next state Action */ + {SMP_MSG_CMD_PKT, SMPR_SM_ST_CNF_VER_CALC_1, SMPR_ACT_PAIR_CNF_VER_CALC_1}, + {0, 0, 0} +}; + +/*! State table for CNF_VER_CALC_1 */ +static const smpTblEntry_t smprStateTblCnfVerCalc1[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SM_ST_CNF_VER_CALC_2, SMPR_ACT_PAIR_CNF_VER_CALC_2}, + {0, 0, 0} +}; + +/*! State table for CNF_VER_CALC_2 */ +static const smpTblEntry_t smprStateTblCnfVerCalc2[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SM_ST_STK_CALC, SMPR_ACT_CNF_VERIFY}, + {0, 0, 0} +}; + +/*! State table for STK_CALC */ +static const smpTblEntry_t smprStateTblStkCalc[] = +{ +/* Event Next state Action */ + {SMP_MSG_WSF_AES_CMPL, SMPR_SM_ST_ENCRYPT, SMPR_ACT_SEND_PAIR_RANDOM}, + {SMP_MSG_INT_MAX_ATTEMPTS, SMPR_SM_ST_ATTEMPTS, SMPR_ACT_MAX_ATTEMPTS}, + {0, 0, 0} +}; + +/*! State table for ENCRYPT */ +static const smpTblEntry_t smprStateTblEncrypt[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_ENCRYPT_CMPL, SMPR_SM_ST_KEY_DIST, SMPR_ACT_SETUP_KEY_DIST}, + {SMP_MSG_DM_ENCRYPT_FAILED, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_FAILED}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_ENCRYPT, SMPR_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for KEY_DIST */ +static const smpTblEntry_t smprStateTblKeyDist[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_SEND_NEXT_KEY, SMPR_SM_ST_KEY_DIST, SMPR_ACT_SEND_KEY}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_KEY_DIST, SMPR_ACT_RCV_KEY}, + {SMP_MSG_INT_PAIRING_CMPL, SMPR_SM_ST_IDLE, SMPR_ACT_PAIRING_CMPL}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_KEY_DIST, SMPR_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for ATTEMPTS */ +static const smpTblEntry_t smprStateTblAttempts[] = +{ +/* Event Next state Action */ + {SMP_MSG_INT_WI_TIMEOUT, SMPR_SM_ST_IDLE, SMPR_ACT_CHECK_ATTEMPTS}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SM_ST_RSP_TO, SMPR_ACT_PAIRING_FAILED}, + {SMP_MSG_CMD_PKT, SMPR_SM_ST_ATTEMPTS, SMPR_ACT_ATTEMPT_RCVD}, + {SMP_MSG_API_SECURITY_REQ, SMPR_SM_ST_IDLE, SMPR_ACT_NOTIFY_DM_ATTEMPTS}, + {SMP_MSG_DM_CONN_CLOSE, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SM_ST_ATTEMPTS, SMPR_ACT_NONE}, + {0, 0, 0} +}; + +/*! State table for RSP_TO */ +static const smpTblEntry_t smprStateTblRspTo[] = +{ +/* Event Next state Action */ + {SMP_MSG_DM_CONN_CLOSE, SMPR_SM_ST_IDLE, SMPR_ACT_CLEANUP}, + {SMP_MSG_CMD_PAIRING_FAILED, SMPR_SM_ST_RSP_TO, SMPR_ACT_NONE}, + {SMP_MSG_API_CANCEL_REQ, SMPR_SM_ST_RSP_TO, SMPR_ACT_NONE}, + {SMP_MSG_INT_RSP_TIMEOUT, SMPR_SM_ST_RSP_TO, SMPR_ACT_NONE}, + {SMP_MSG_API_SECURITY_REQ, SMPR_SM_ST_RSP_TO, SMPR_ACT_NOTIFY_DM_RSP_TO}, + {0, 0, 0} +}; + +/*! Table of individual state tables */ +const smpTblEntry_t * const smprStateTbl[] = +{ + smprStateTblIdle, + smprStateTblApiPairReq, + smprStateTblApiPairRsp, + smprStateTblPinPair1, + smprStateTblPinPair2, + smprStateTblCnfCalc1, + smprStateTblCnfCalc2, + smprStateTblPairRand, + smprStateTblCnfVerCalc1, + smprStateTblCnfVerCalc2, + smprStateTblStkCalc, + smprStateTblEncrypt, + smprStateTblKeyDist, + smprStateTblAttempts, + smprStateTblRspTo +}; + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! state machine interface */ +const smpSmIf_t smprSmIf = +{ + smprStateTbl, + smprActionTbl, + smprStateTblCommon +}; + +/*************************************************************************************************/ +/*! + * \brief Initialize SMP responder role. + * + * \return None. + */ +/*************************************************************************************************/ +void SmprInit(void) +{ + /* set up state machine interface */ + smpCb.pSlave = &smprSmIf; + smpCb.procPairing = smpProcPairing; + smpCb.procAuthReq = smpAuthReq; +} diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_api.h similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_api.h index 48eebb8a938438dd62297303d43a8cc9ad2c672b..e379cd1cf838aaed989c10d6cc72a22306371f61 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_api.h @@ -80,7 +80,7 @@ enum APP_DISC_FAILED, /*!< \brief Service discovery failed */ APP_DISC_CFG_START, /*!< \brief Service configuration started */ APP_DISC_CFG_CONN_START, /*!< \brief Configuration for connection setup started */ - APP_DISC_CFG_CMPL, /*!< \brief Service configuration complete */ + APP_DISC_CFG_CMPL /*!< \brief Service configuration complete */ }; /*! \brief Actions for incoming requests */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_cfg.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_cfg.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_cfg.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_cfg.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_db.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_db.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_db.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_db.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_hw.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_hw.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_hw.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_hw.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_param.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_param.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_param.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_param.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_terminal.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_terminal.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_terminal.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_terminal.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_ui.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_ui.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/include/app/app_ui.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/include/app/app_ui.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_disc.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_disc.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_disc.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_disc.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master_ae.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master_ae.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master_ae.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master_leg.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_master_leg.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_master_leg.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_server.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_server.c similarity index 93% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_server.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_server.c index 73366b4127667cdaaaa1fe3fe70e4a1d1d1a5af3..0311b41cab9e8e9109227922a422696024f87c9c 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_server.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_server.c @@ -43,7 +43,13 @@ static void appServerSetSigningInfo(dmConnId_t connId) ((pPeerKey = AppDbGetKey(dbHdl, DM_KEY_CSRK, NULL)) != NULL)) { /* set peer's CSRK and sign counter on this connection */ - AttsSetCsrk(connId, pPeerKey->csrk.key); + + // TODO: Determine what the correct parameter is for AttsSetCsrk + // Legacy function did not have third argument, default to FALSE for now. + + // AttsSetCsrk(connId, pPeerKey->csrk.key); + AttsSetCsrk(connId, pPeerKey->csrk.key, FALSE); + AttsSetSignCounter(connId, AppDbGetPeerSignCounter(dbHdl)); } } diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave_ae.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave_ae.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave_ae.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave_ae.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave_leg.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave_leg.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_slave_leg.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave_leg.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_terminal.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_terminal.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/app_terminal.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_terminal.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_db.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_db.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_db.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_db.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_hw.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_hw.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_hw.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_hw.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_ui.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_ui.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/app/common/app_ui.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/common/app_ui.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/cycling/cycling_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/cycling/cycling_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/cycling/cycling_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/cycling/cycling_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/cycling/cycling_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/cycling/cycling_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/cycling/cycling_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/cycling/cycling_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/datc/datc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/datc/datc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/datc/datc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/datc/datc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/datc/datc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/datc/datc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/datc/datc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/datc/datc_main.c index fa7259c5b67a427d1d25a51a94bb451d841a582e..cbf8bea8fa1f4eb83f802030e7c4264ea61bad61 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/datc/datc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/datc/datc_main.c @@ -1165,7 +1165,7 @@ void DatcHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) * \return None. */ /*************************************************************************************************/ -static void datcInitSvcHdlList() +static void datcInitSvcHdlList(void) { uint8_t i; diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/dats/dats_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/dats/dats_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/dats/dats_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/dats/dats_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/dats/dats_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/dats/dats_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/dats/dats_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/dats/dats_main.c diff --git a/lib/sdk/Applications/EvKitExamples/BLE_fit/fit_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/fit/fit_api.h similarity index 100% rename from lib/sdk/Applications/EvKitExamples/BLE_fit/fit_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/fit/fit_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/fit/fit_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/fit/fit_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/fit/fit_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/fit/fit_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/gluc/gluc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/gluc/gluc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/gluc/gluc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/gluc/gluc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/gluc/gluc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/gluc/gluc_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/gluc/gluc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/gluc/gluc_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/hidapp/hidapp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/hidapp/hidapp_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/hidapp/hidapp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/hidapp/hidapp_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/hidapp/hidapp_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/hidapp/hidapp_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/hidapp/hidapp_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/hidapp/hidapp_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_blp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_blp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_blp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_blp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_glp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_glp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_glp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_glp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_hrp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_hrp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_hrp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_hrp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_htp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_htp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_htp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_htp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_plx.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_plx.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_plx.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_plx.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_wsp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_wsp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/medc/medc_wsp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/medc/medc_wsp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_blp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_blp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_blp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_blp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_glp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_glp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_glp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_glp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_htp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_htp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_htp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_htp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_plx.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_plx.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_plx.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_plx.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_wsp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_wsp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/meds/meds_wsp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/meds/meds_wsp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/sensor/sensor_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/sensor/sensor_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/sensor/sensor_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/sensor/sensor_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/sensor/sensor_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/sensor/sensor_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/sensor/sensor_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/sensor/sensor_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_main_wdxs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_main_wdxs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/tag/tag_main_wdxs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/tag/tag_main_wdxs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/uribeacon/uribeacon_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/uribeacon/uribeacon_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/uribeacon/uribeacon_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/uribeacon/uribeacon_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/uribeacon/uribeacon_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/uribeacon/uribeacon_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/uribeacon/uribeacon_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/uribeacon/uribeacon_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/watch/watch_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/watch/watch_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/watch/watch_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/watch/watch_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/watch/watch_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/watch/watch_main.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/watch/watch_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/watch/watch_main.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/wdxs/wdxs_oad.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/wdxs/wdxs_oad.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/apps/wdxs/wdxs_oad.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/wdxs/wdxs_oad.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/anpc/anpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/anpc/anpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/anpc/anpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/anpc/anpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/anpc/anpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/anpc/anpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/anpc/anpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/anpc/anpc_main.c index ea28963e6a70de4da9bb0e2c343d53dcad0606c0..b1656c169b2827a9f19484bb9e9d02312ea8170b 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/anpc/anpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/anpc/anpc_main.c @@ -23,7 +23,7 @@ #include "wsf_trace.h" #include "util/bstream.h" #include "app_api.h" -#include "anpc_api.h" +#include "anpc/anpc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/bas/bas_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/bas/bas_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/bas/bas_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/bas/bas_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/bas/bas_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/bas/bas_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/bas/bas_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/bas/bas_main.c index 42d6b326027020210e961865a18a6e5c02c5e081..4899a817396143e5ba4d026430453ef850fd9aa7 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/bas/bas_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/bas/bas_main.c @@ -27,7 +27,7 @@ #include "svc_batt.h" #include "app_api.h" #include "app_hw.h" -#include "bas_api.h" +#include "bas/bas_api.h" /************************************************************************************************** Macros diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blpc/blpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blpc/blpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blpc/blpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blpc/blpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blpc/blpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blpc/blpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blpc/blpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blpc/blpc_main.c index fac51ccaa11cb082d0cb2db55062b99d78de13c2..acb8f5e90b97d07828adc65cf1803f30c883848a 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blpc/blpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blpc/blpc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "blpc_api.h" +#include "blpc/blpc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blps/blps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blps/blps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blps/blps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blps/blps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blps/blps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blps/blps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blps/blps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blps/blps_main.c index b4e5337180bde8d3f43a216ae4719b9b7de5c91a..ce308b1a1cc388975eaf6f9a51bead37a45693aa 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/blps/blps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/blps/blps_main.c @@ -26,7 +26,7 @@ #include "svc_bps.h" #include "app_api.h" #include "app_hw.h" -#include "blps_api.h" +#include "blps/blps_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cpp/cpp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cpp/cpp_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cpp/cpp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cpp/cpp_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cpp/cpps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cpp/cpps_main.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cpp/cpps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cpp/cpps_main.c index b87848fbd0b5018439616423d0c80947ee3c2396..6d1681e55b252ef5bc6079b0672a047a69db7422 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cpp/cpps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cpp/cpps_main.c @@ -25,7 +25,7 @@ #include "dm_api.h" #include "svc_cps.h" #include "svc_ch.h" -#include "cpp_api.h" +#include "cpp/cpp_api.h" /************************************************************************************************* * Constant Definitions @@ -117,8 +117,7 @@ void CppsSetSensorLocation(uint8_t location) /*************************************************************************************************/ void CppsSetFeatures(uint32_t features) { - uint8_t tempData[4] = {UINT32_TO_BYTES(features)}; - AttsSetAttr(CPS_CPF_HDL, sizeof(tempData), tempData); + AttsSetAttr(CPS_CPF_HDL, sizeof(features), (uint8_t*)&features); } /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cscp/cscp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cscp/cscp_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cscp/cscp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cscp/cscp_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cscp/cscps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cscp/cscps_main.c similarity index 97% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cscp/cscps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cscp/cscps_main.c index aa2d2d24ed36d5e9ae03b6ba5a85f167758e9bb3..85c64a1d35d5e9f528b7e97a88b712f3aaa47452 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/cscp/cscps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/cscp/cscps_main.c @@ -25,7 +25,7 @@ #include "dm_api.h" #include "svc_cscs.h" #include "svc_ch.h" -#include "cscp_api.h" +#include "cscp/cscp_api.h" /************************************************************************************************* * Constant Definitions @@ -127,8 +127,7 @@ void CscpsSetSensorLocation(uint8_t location) /*************************************************************************************************/ void CscpsSetFeatures(uint16_t features) { - uint8_t tempData[2] = {UINT16_TO_BYTES(features)}; - AttsSetAttr(CSCS_CSF_HDL, sizeof(tempData), tempData); + AttsSetAttr(CSCS_CSF_HDL, sizeof(features), (uint8_t*)&features); } /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/dis/dis_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/dis/dis_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/dis/dis_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/dis/dis_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/dis/dis_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/dis/dis_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/dis/dis_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/dis/dis_main.c index dd0a6548f55ed4e271ab7e57614219f0c96dc8f7..03c52cbd92cd31ef84d0cd83b09173e1ee3d4d50 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/dis/dis_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/dis/dis_main.c @@ -23,7 +23,7 @@ #include "wsf_trace.h" #include "svc_ch.h" #include "app_api.h" -#include "dis_api.h" +#include "dis/dis_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/fmpl/fmpl_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/fmpl/fmpl_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/fmpl/fmpl_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/fmpl/fmpl_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/fmpl/fmpl_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/fmpl/fmpl_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/fmpl/fmpl_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/fmpl/fmpl_main.c index 34033287e665ee612288ef852e0a2067d68c7b1a..99271bf4d940761464c22b4e47f53a9810d7de15 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/fmpl/fmpl_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/fmpl/fmpl_main.c @@ -20,7 +20,7 @@ #include "wsf_types.h" #include "wsf_assert.h" #include "app_api.h" -#include "fmpl_api.h" +#include "fmpl/fmpl_api.h" /************************************************************************************************** Global Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gap/gap_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gap/gap_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gap/gap_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gap/gap_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_main.c index ad6dc5b7e59644d984f2d68d61fd9e0406a9da87..baa16b940121e26a262f8f86825b28f5985a14b0 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gap/gap_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gap/gap_main.c @@ -22,7 +22,7 @@ #include "wsf_trace.h" #include "app_db.h" #include "app_api.h" -#include "gap_api.h" +#include "gap/gap_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gatt/gatt_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gatt/gatt_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gatt/gatt_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gatt/gatt_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gatt/gatt_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gatt/gatt_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gatt/gatt_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gatt/gatt_main.c index 33423830ede971cbda36ebaa6230e110e678ba84..d7aeb9af7b81add8fa9f09aebd5afbf1e0330915 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/gatt/gatt_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/gatt/gatt_main.c @@ -20,7 +20,7 @@ #include "wsf_types.h" #include "wsf_assert.h" #include "app_api.h" -#include "gatt_api.h" +#include "gatt/gatt_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glpc/glpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glpc/glpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glpc/glpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glpc/glpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glpc/glpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glpc/glpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glpc/glpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glpc/glpc_main.c index 8e41abb857805be929f67c394f1cab0134cc8740..17d7acef8aa0cfedc5c69eb823ea7376178cc456 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glpc/glpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glpc/glpc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "glpc_api.h" +#include "glpc/glpc_api.h" /************************************************************************************************** Macros diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_db.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_db.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_db.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_db.c index da794fe292c9dafd973c1f90c46562b1982001d8..c793bb4b1fe395e48ba52fd74f27bcc52c33ec74 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_db.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_db.c @@ -25,8 +25,8 @@ #include "svc_ch.h" #include "svc_gls.h" #include "app_api.h" -#include "glps_api.h" -#include "glps_main.h" +#include "glps/glps_api.h" +#include "glps/glps_main.h" /************************************************************************************************** Macros diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_main.c index 612828bf58f940cd986e724dcc41a1f4c69a3087..6ae2c41c718a7d334ed2702ba5720bb99248a1f2 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_main.c @@ -27,8 +27,8 @@ #include "svc_gls.h" #include "app_api.h" #include "app_ui.h" -#include "glps_api.h" -#include "glps_main.h" +#include "glps/glps_api.h" +#include "glps/glps_main.h" /************************************************************************************************** Local Variables @@ -790,9 +790,7 @@ uint8_t GlpsRacpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation /*************************************************************************************************/ void GlpsSetFeature(uint16_t feature) { - uint8_t buf[2] = {UINT16_TO_BYTES(feature)}; - - AttsSetAttr(GLS_GLF_HDL, sizeof(buf), buf); + AttsSetAttr(GLS_GLF_HDL, sizeof(feature), (uint8_t*)&feature); } /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/glps/glps_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/glps/glps_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hid/hid_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hid/hid_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hid/hid_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hid/hid_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hid/hid_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hid/hid_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hid/hid_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hid/hid_main.c index 2a990f711643910b361e052c824c780ed5d0bc8d..6ba44cf035496d1e23b7712cdb5a649e4b575c21 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hid/hid_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hid/hid_main.c @@ -24,7 +24,7 @@ #include "att_api.h" #include "svc_hid.h" #include "app_api.h" -#include "hid_api.h" +#include "hid/hid_api.h" /************************************************************************************************** Global Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrpc/hrpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrpc/hrpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrpc/hrpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrpc/hrpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrpc/hrpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrpc/hrpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrpc/hrpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrpc/hrpc_main.c index 625527c2f2f0ed332fe30dcd2bda3c68c5456790..3bf2022f0eef5b90bc1554a724b5fd09de4db589 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrpc/hrpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrpc/hrpc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "hrpc_api.h" +#include "hrpc/hrpc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrps/hrps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrps/hrps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrps/hrps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrps/hrps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrps/hrps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrps/hrps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrps/hrps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrps/hrps_main.c index 1342d93261bf231f0124ef354609e829e9b40835..5bf41fe792b3edf79993adeed494a451230d7011 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/hrps/hrps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/hrps/hrps_main.c @@ -28,7 +28,7 @@ #include "svc_hrs.h" #include "app_api.h" #include "app_hw.h" -#include "hrps_api.h" +#include "hrps/hrps_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htpc/htpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htpc/htpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htpc/htpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htpc/htpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htpc/htpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htpc/htpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htpc/htpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htpc/htpc_main.c index 9cf39e20f87b2afd93d60b9f23d18069613e8da6..a53898e1abd41fb135965da8ec2c5a7fdbef29cb 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htpc/htpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htpc/htpc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "htpc_api.h" +#include "htpc/htpc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htps/htps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htps/htps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htps/htps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htps/htps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htps/htps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htps/htps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htps/htps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htps/htps_main.c index 51bdba96a9231d361f0e89dc791be28bd89ae4ef..78ffcac0ff69e085861412d5e5a7704c6be88b0c 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/htps/htps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/htps/htps_main.c @@ -26,7 +26,7 @@ #include "svc_hts.h" #include "app_api.h" #include "app_hw.h" -#include "htps_api.h" +#include "htps/htps_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/include/wdx_defs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/include/wdx_defs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/include/wdx_defs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/include/wdx_defs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/paspc/paspc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/paspc/paspc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/paspc/paspc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/paspc/paspc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/paspc/paspc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/paspc/paspc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/paspc/paspc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/paspc/paspc_main.c index af265de09d5e5fb3fdb08a32c57e2d1f5872a6a7..4e04436f5bfe43fc3261c209e6599128744098ed 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/paspc/paspc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/paspc/paspc_main.c @@ -22,7 +22,7 @@ #include "wsf_trace.h" #include "util/bstream.h" #include "app_api.h" -#include "paspc_api.h" +#include "paspc/paspc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxpc/plxpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxpc/plxpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxpc/plxpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxpc/plxpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxpc/plxpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxpc/plxpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxpc/plxpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxpc/plxpc_main.c index b4463a3c637f04bded874e25122a92f968566a72..db5accae5341c0d5338c8e69cc9769af2adf4bfb 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxpc/plxpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxpc/plxpc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "plxpc_api.h" +#include "plxpc/plxpc_api.h" /************************************************************************************************** Macros diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_db.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_db.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_db.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_db.c index 63d7b2ba095852c55f43cf2f1bb535f90bcf8238..4e715cc87ad802e66589583c8de8795538d40a01 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_db.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_db.c @@ -25,8 +25,8 @@ #include "svc_ch.h" #include "svc_gls.h" #include "app_api.h" -#include "plxps_api.h" -#include "plxps_main.h" +#include "plxps/plxps_api.h" +#include "plxps/plxps_main.h" /************************************************************************************************** Macros @@ -38,6 +38,7 @@ /************************************************************************************************** Local Variables **************************************************************************************************/ +static const plxpsRec_t *plxpsDbGetEnd(void); /*! Control block */ static struct @@ -99,7 +100,7 @@ static const plxpsRec_t plxpsDb[PLXPS_DB_NUM_RECORDS] = * \return Pointer to record or NULL if no record. */ /*************************************************************************************************/ -static const plxpsRec_t *plxpsDbGetEnd() +static const plxpsRec_t *plxpsDbGetEnd(void) { return plxpsDb + plxpsDbCb.numRec; } diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_main.c index 0fb750fa73b990e17c61b7bcac341efcbb0c3d62..120073d57bc0daf8a2a9ad94c70157a8b2f9df57 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_main.c @@ -27,8 +27,8 @@ #include "svc_plxs.h" #include "app_api.h" #include "app_ui.h" -#include "plxps_api.h" -#include "plxps_main.h" +#include "plxps/plxps_api.h" +#include "plxps/plxps_main.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/plxps/plxps_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/plxps/plxps_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/rscp/rscp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/rscp/rscp_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/rscp/rscp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/rscp/rscp_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/rscp/rscps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/rscp/rscps_main.c similarity index 97% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/rscp/rscps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/rscp/rscps_main.c index 013109695d90eab25ad46dff3a3488de5d62a2bf..91d1aebdb45b9649d2e37be566954dfea153d535 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/rscp/rscps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/rscp/rscps_main.c @@ -25,7 +25,7 @@ #include "dm_api.h" #include "svc_rscs.h" #include "svc_ch.h" -#include "rscp_api.h" +#include "rscp/rscp_api.h" /************************************************************************************************* * Constant Definitions @@ -89,8 +89,7 @@ void RscpsSetSensorLocation(uint8_t location) /*************************************************************************************************/ void RscpsSetFeatures(uint16_t features) { - uint8_t tempData[2] = {UINT16_TO_BYTES(features)}; - AttsSetAttr(RSCS_RSF_HDL, sizeof(tempData), tempData); + AttsSetAttr(RSCS_RSF_HDL, sizeof(features), (uint8_t*)&features); } /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/scpps/scpps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/scpps/scpps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/scpps/scpps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/scpps/scpps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/scpps/scpps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/scpps/scpps_main.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/scpps/scpps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/scpps/scpps_main.c index 6dc6a59c3b57f8049452cbe1638c7dd663496a7f..fa0c36237b537aaee4435cb163bc9253f11f3822 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/scpps/scpps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/scpps/scpps_main.c @@ -22,7 +22,7 @@ #include "wsf_trace.h" #include "util/bstream.h" #include "app_api.h" -#include "scpps_api.h" +#include "scpps/scpps_api.h" #include "svc_scpss.h" /************************************************************************************************** diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/gyro_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/gyro_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/gyro_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/gyro_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/gyro_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/gyro_main.c similarity index 96% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/gyro_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/gyro_main.c index 5439ff7061964299809dc47e9dce66c084ead61c..6449f832d32202d6ebde8ae40c7e274e66d3497a 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/gyro_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/gyro_main.c @@ -25,7 +25,7 @@ #include "wsf_trace.h" #include "util/bstream.h" -#include "gyro_api.h" +#include "sensor/gyro_api.h" #include "svc_gyro.h" /************************************************************************************************** @@ -221,11 +221,15 @@ void GyroMeasStart(void) /*************************************************************************************************/ void GyroMeasComplete(dmConnId_t connId, int16_t x, int16_t y, int16_t z) { + uint16_t gyroData[3]; gyroCb.measTimerStarted = FALSE; - uint8_t gyroData[6] = {UINT16_TO_BYTES(x), UINT16_TO_BYTES(y), UINT16_TO_BYTES(z)}; - AttsSetAttr(GYRO_HANDLE_DATA, sizeof(gyroData), gyroData); - AttsHandleValueNtf(connId, GYRO_HANDLE_DATA, sizeof(gyroData), gyroData); + gyroData[0] = UINT16_TO_BYTES(x); + gyroData[1] = UINT16_TO_BYTES(y); + gyroData[2] = UINT16_TO_BYTES(z); + + AttsSetAttr(GYRO_HANDLE_DATA, sizeof(gyroData), (uint8_t*)gyroData); + AttsHandleValueNtf(connId, GYRO_HANDLE_DATA, sizeof(gyroData), (uint8_t*)gyroData); gyroUpdateTimer(); } diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/temp_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/temp_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/temp_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/temp_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/temp_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/temp_main.c similarity index 96% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/temp_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/temp_main.c index 66646460ec787c4bb9f5ac8a182e619881e69dcb..1e2a18f6964a01c2b1a997bf3d66bd34e1f13e40 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/sensor/temp_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/sensor/temp_main.c @@ -25,7 +25,7 @@ #include "wsf_trace.h" #include "util/bstream.h" -#include "temp_api.h" +#include "sensor/temp_api.h" #include "svc_temp.h" /************************************************************************************************** @@ -219,9 +219,8 @@ void TempMeasComplete(dmConnId_t connId, int16_t temp) { tempCb.measTimerStarted = FALSE; - uint8_t tempData[2] = {UINT16_TO_BYTES(temp)}; - AttsSetAttr(TEMP_HANDLE_DATA, sizeof(tempData), tempData); - AttsHandleValueNtf(connId, TEMP_HANDLE_DATA, sizeof(tempData), tempData); + AttsSetAttr(TEMP_HANDLE_DATA, sizeof(temp),(uint8_t*)&temp); + AttsHandleValueNtf(connId, TEMP_HANDLE_DATA, sizeof(temp), (uint8_t*)&temp); tempUpdateTimer(); } diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/tipc/tipc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/tipc/tipc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/tipc/tipc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/tipc/tipc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/tipc/tipc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/tipc/tipc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/tipc/tipc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/tipc/tipc_main.c index 7189ed182005dc2cc7239b5c6b5ba75f35f8fe9b..c6cb10b6f0b02cd096bc9395216877edafa6f93e 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/tipc/tipc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/tipc/tipc_main.c @@ -22,7 +22,7 @@ #include "wsf_trace.h" #include "util/bstream.h" #include "app_api.h" -#include "tipc_api.h" +#include "tipc/tipc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/udsc/udsc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/udsc/udsc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/udsc/udsc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/udsc/udsc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/udsc/udsc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/udsc/udsc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/udsc/udsc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/udsc/udsc_main.c index add7b3e9406325a9b4e5d270c7d2fe8725a4f4d5..89fea430c702504f5e94d585a01fb4c7affd2b57 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/udsc/udsc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/udsc/udsc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "udsc_api.h" +#include "udsc/udsc_api.h" /************************************************************************************************** Macros diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_api.h similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_api.h index ffe06b1729dfdf6e210824f59ad365f61dab62ab..e65f4137940071f79a27e517b9914b44414fb933 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_api.h +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_api.h @@ -30,7 +30,7 @@ extern "C" { #include "wsf_types.h" #include "att_api.h" #include "svc_uricfg.h" -#include "uricfg_defs.h" +#include "uribeacon/uricfg_defs.h" /************************************************************************************************** Data Types diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_defs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_defs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_defs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_defs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_main.c similarity index 96% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_main.c index aa4dfc228f8b2adc36d00bfcad3fe2ae32c8ff36..ac66c01efbe7dbb04579dd5219b4bc75d5e97c60 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/uribeacon/uricfg_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/uribeacon/uricfg_main.c @@ -19,12 +19,12 @@ #include <string.h> -#include "uricfg_api.h" +#include "uribeacon/uricfg_api.h" #include "app_api.h" #include "att_api.h" #include "wsf_trace.h" #include "util/bstream.h" -#include "uricfg_defs.h" +#include "uribeacon/uricfg_defs.h" /************************************************************************************************** Global Variables @@ -194,8 +194,7 @@ static uint8_t uriCfgBeaconWriteCback(dmConnId_t connId, uint16_t handle, uint8_ } } - uint8_t beaconPeriodVal[2] = {UINT16_TO_BYTES(beaconPeriod)}; - AttsSetAttr(handle, sizeof(beaconPeriod), beaconPeriodVal); + AttsSetAttr(handle, sizeof(beaconPeriod), (uint8_t*)&beaconPeriod); if (uriCfgAttWriteCback != NULL) { uriCfgAttWriteCback(handle, sizeof(beaconPeriod), (uint8_t *)&beaconPeriod); @@ -247,8 +246,7 @@ static uint8_t uriCfgBeaconWriteCback(dmConnId_t connId, uint16_t handle, uint8_ /* reset beacon period */ beaconPeriod = URICFG_ATT_BEACONPERIOD_DEFAULT; - uint8_t beaconPeriodVal[2] = {UINT16_TO_BYTES(beaconPeriod)}; - AttsSetAttr(URICFG_HANDLE_BEACONPERIOD, sizeof(beaconPeriod), beaconPeriodVal); + AttsSetAttr(URICFG_HANDLE_BEACONPERIOD, sizeof(beaconPeriod), (uint8_t*)&beaconPeriod); if (uriCfgAttWriteCback != NULL) { uriCfgAttWriteCback(URICFG_HANDLE_BEACONPERIOD, sizeof(beaconPeriod), (uint8_t *)&beaconPeriod); @@ -287,17 +285,17 @@ static uint8_t uriCfgBeaconWriteCback(dmConnId_t connId, uint16_t handle, uint8_ void UriCfgStart(const uint8_t *pUriData, uint8_t uriDataLen, uint8_t uriFlags, int8_t *pAdvTxPwrLevels, uint8_t txPwrMode, uint16_t beaconPeriod) { + uint8_t lockState; SvcUriCfgAddGroup(); SvcUriCfgCbackRegister(uriCfgBeaconWriteCback); + lockState = 0; - uint8_t lockState = 0; AttsSetAttr(URICFG_HANDLE_LOCKSTATE, sizeof(lockState), &lockState); AttsSetAttr(URICFG_HANDLE_URIDATA, uriDataLen, (uint8_t *)pUriData); AttsSetAttr(URICFG_HANDLE_URIFLAGS, sizeof(uriFlags), &uriFlags); AttsSetAttr(URICFG_HANDLE_TXPWRLEVELS, URICFG_SIZE_TXPWRLEVELS_ATT,(uint8_t *)pAdvTxPwrLevels); AttsSetAttr(URICFG_HANDLE_TXPWRMODE, sizeof(txPwrMode), &txPwrMode); - uint8_t beaconPeriodVal[2] = {UINT16_TO_BYTES(beaconPeriod)}; - AttsSetAttr(URICFG_HANDLE_BEACONPERIOD, sizeof(beaconPeriod), beaconPeriodVal); + AttsSetAttr(URICFG_HANDLE_BEACONPERIOD, sizeof(beaconPeriod), (uint8_t*)&beaconPeriod); uriCfgAttWriteCback = NULL; uriCfgLockChangeCback = NULL; diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_ft.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_ft.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_ft.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_ft.c index 3ffd22afc23af26a95420316bc50da3d9fb87252..e5bbc9804d4b554ceaa3cab964c302432f1cecb3 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_ft.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_ft.c @@ -26,8 +26,8 @@ #include "util/bstream.h" #include "svc_wdxs.h" #include "wdx_defs.h" -#include "wdxc_api.h" -#include "wdxc_main.h" +#include "wdxc/wdxc_api.h" +#include "wdxc/wdxc_main.h" #include "dm_api.h" #include "app_api.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_main.c index 538847393bcc380f68e3ad33ef4c76fd43d643df..0bd0d42f124e97e240cfead9f07847d4c139847c 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_main.c @@ -31,8 +31,8 @@ #include "app_api.h" #include "svc_wdxs.h" #include "wdx_defs.h" -#include "wdxc_api.h" -#include "wdxc_main.h" +#include "wdxc/wdxc_api.h" +#include "wdxc/wdxc_main.h" /************************************************************************************************** Global Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_stream.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_stream.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_stream.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_stream.c index c8d30a0db44e72cea4a00c956fee6a87ef4110b9..7fb7558ac62381918ba7c417891c18ff363ed963 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxc/wdxc_stream.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxc/wdxc_stream.c @@ -28,8 +28,8 @@ #include "att_api.h" #include "app_api.h" #include "wdx_defs.h" -#include "wdxc_api.h" -#include "wdxc_main.h" +#include "wdxc/wdxc_api.h" +#include "wdxc/wdxc_main.h" /************************************************************************************************** External Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_au.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_au.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_au.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_au.c index 622745924cdd9c1947cac52cec83d188dfeadc37..7f5bfaae89102c312b5521edc201fc52a370db45 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_au.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_au.c @@ -26,8 +26,8 @@ #include "wsf_os.h" #include "sec_api.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" #include "dm_api.h" #include "att_api.h" #include "app_api.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_dc.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_dc.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_dc.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_dc.c index 74d6f3a2cfcc026ba140f1baf6a7b87b726df1c0..5f762b605f2d6fa78f870906e8cdb024e200a97d 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_dc.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_dc.c @@ -25,8 +25,8 @@ #include "wsf_efs.h" #include "util/bstream.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" #include "dm_api.h" #include "app_api.h" #include "app_hw.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_ft.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_ft.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_ft.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_ft.c index c28d71b085dc690a6d657e0e8b95935a985eb64a..e08aad792f48d54f5145c5091caa143bbc041e70 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_ft.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_ft.c @@ -25,8 +25,8 @@ #include "wsf_efs.h" #include "util/bstream.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" #include "dm_api.h" #include "app_api.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_main.c similarity index 97% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_main.c index 2076f580615aa756d5232df16772e13cbd109af3..7b46b21c93ce5313ca416620925631c537e99984 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_main.c @@ -27,8 +27,8 @@ #include "sec_api.h" #include "util/bstream.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" #include "dm_api.h" #include "att_api.h" #include "app_api.h" @@ -69,17 +69,7 @@ void WdxsAuSecComplete(secAes_t *pAes); static uint8_t WdxsRamBlock[WDXS_RAM_SIZE]; /*! EFS RAM Media Control Block */ -static const wsfEfsMedia_t WDXS_RamMediaCtrl = -{ - WDXS_RAM_LOCATION, - WDXS_RAM_LOCATION + WDXS_RAM_SIZE, - 1, - NULL, - WdxsRamErase, - WdxsRamRead, - WdxsRamWrite, - NULL -}; +static wsfEfsMedia_t WDXS_RamMediaCtrl; /*************************************************************************************************/ /*! @@ -476,6 +466,15 @@ void WdxsHandlerInit(wsfHandlerId_t handlerId) /* Register the RAM Media */ memset(WdxsRamBlock, 0xFF, sizeof(WdxsRamBlock)); + WDXS_RamMediaCtrl.startAddress = WDXS_RAM_LOCATION; + WDXS_RamMediaCtrl.endAddress = WDXS_RAM_LOCATION + WDXS_RAM_SIZE; + WDXS_RamMediaCtrl.pageSize = 1; + WDXS_RamMediaCtrl.init = NULL; + WDXS_RamMediaCtrl.erase = WdxsRamErase; + WDXS_RamMediaCtrl.read = WdxsRamRead; + WDXS_RamMediaCtrl.write = WdxsRamWrite; + WDXS_RamMediaCtrl.handleCmd = NULL; + WsfEfsRegisterMedia(&WDXS_RamMediaCtrl, WDX_RAM_MEDIA); /* Set attributes for the WDXS File List */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_main.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_main.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_main.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_main.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_phy.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_phy.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_phy.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_phy.c index 1195d70fa5c543ad393efc4fd6f7e47e11ad17a8..00ad36ee45e0cbbad994afce895ee270e9512089 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_phy.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_phy.c @@ -25,8 +25,8 @@ #include "wsf_efs.h" #include "util/bstream.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" #include "dm_api.h" #include "app_api.h" #include "app_hw.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_stream.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.c similarity index 98% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_stream.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.c index 7fb676d38301f08166d5a97c03752f8c3f33c275..f70057960e50e9a7fd9527a122e1c5bcdcf0b289 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_stream.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.c @@ -25,9 +25,9 @@ #include "wsf_efs.h" #include "util/bstream.h" #include "svc_wdxs.h" -#include "wdxs_api.h" -#include "wdxs_main.h" -#include "wdxs_stream.h" +#include "wdxs/wdxs_api.h" +#include "wdxs/wdxs_main.h" +#include "wdxs/wdxs_stream.h" #include "dm_api.h" #include "att_api.h" #include "app_api.h" diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_stream.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wdxs/wdxs_stream.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wdxs/wdxs_stream.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wpc/wpc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wpc/wpc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wpc/wpc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wpc/wpc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wpc/wpc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wpc/wpc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wpc/wpc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wpc/wpc_main.c index c5ba3eed722c16d3d400c096e67ce91ff71827c8..ce19b8200c43a1a63d907165f1fc28e9be5be92d 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wpc/wpc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wpc/wpc_main.c @@ -22,7 +22,7 @@ #include "wsf_assert.h" #include "util/bstream.h" #include "app_api.h" -#include "wpc_api.h" +#include "wpc/wpc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wspc/wspc_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wspc/wspc_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wspc/wspc_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wspc/wspc_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wspc/wspc_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wspc/wspc_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wspc/wspc_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wspc/wspc_main.c index 0a359789b94b89f56695fbe6eaf50063159a7f90..47e4b857d03e8153d1214ea379639e6f32f38071 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wspc/wspc_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wspc/wspc_main.c @@ -24,7 +24,7 @@ #include "util/bstream.h" #include "svc_ch.h" #include "app_api.h" -#include "wspc_api.h" +#include "wspc/wspc_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wsps/wsps_api.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wsps/wsps_api.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wsps/wsps_api.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wsps/wsps_api.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wsps/wsps_main.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wsps/wsps_main.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wsps/wsps_main.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wsps/wsps_main.c index 58c13f7b8237e7278ba913a9447f5b5b3f6f61c1..e1c0cd3665cfec2d8e1199b907ae113e4dfc6d2f 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/profiles/wsps/wsps_main.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/profiles/wsps/wsps_main.c @@ -26,7 +26,7 @@ #include "svc_wss.h" #include "app_api.h" #include "app_hw.h" -#include "wsps_api.h" +#include "wsps/wsps_api.h" /************************************************************************************************** Local Variables diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_alert.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_alert.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_alert.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_alert.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_alert.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_alert.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_alert.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_alert.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_batt.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_batt.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_batt.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_batt.c index 496f83cd787204f9f0c7eca6502bd7f3e18a1cf5..9b58497a2165bb522ef40c20b947889bd27da262 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_batt.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_batt.c @@ -160,7 +160,7 @@ void SvcBattCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback * \return None. */ /*************************************************************************************************/ -void *SvcBattAddGroupDyn() +void *SvcBattAddGroupDyn(void) { void *pSHdl; uint8_t initCcc[] = {UINT16_TO_BYTES(0x0000)}; diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_batt.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_batt.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_batt.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_batt.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_bps.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_bps.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_bps.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_bps.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_bps.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_bps.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_bps.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_bps.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cfg.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cfg.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cfg.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cfg.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ch.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ch.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ch.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ch.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_core.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_core.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_core.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_core.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_core.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_core.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_core.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_core.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cps.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cps.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cps.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cps.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cps.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cps.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cps.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cps.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cscs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cscs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cscs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cscs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cscs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cscs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_cscs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_cscs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_dis.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_dis.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_dis.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_dis.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_dis.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_dis.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_dis.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_dis.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gls.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gls.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gls.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gls.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gls.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gls.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gls.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gls.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gyro.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gyro.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gyro.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gyro.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gyro.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gyro.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_gyro.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_gyro.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hid.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hid.c similarity index 99% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hid.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hid.c index 7f36126b03f4cbaecd9f63ea1b6a8189073ae35f..3d6d9f19eba2e0d912e15d5e762a66506e315afb 100644 --- a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hid.c +++ b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hid.c @@ -573,7 +573,7 @@ void SvcHidRegister(attsWriteCback_t writeCb, attsReadCback_t readCb) * \return None. */ /*************************************************************************************************/ -void *SvcHidAddGroupDyn() +void *SvcHidAddGroupDyn(void) { void *pSHdl; uint8_t initCcc[] = {UINT16_TO_BYTES(0x0000)}; diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hid.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hid.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hid.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hid.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hrs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hrs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hrs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hrs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hrs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hrs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hrs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hrs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hts.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hts.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hts.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hts.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hts.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hts.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_hts.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_hts.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ipss.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ipss.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ipss.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ipss.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ipss.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ipss.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_ipss.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_ipss.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_plxs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_plxs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_plxs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_plxs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_plxs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_plxs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_plxs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_plxs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_px.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_px.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_px.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_px.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_px.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_px.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_px.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_px.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_rscs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_rscs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_rscs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_rscs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_rscs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_rscs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_rscs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_rscs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_scpss.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_scpss.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_scpss.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_scpss.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_scpss.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_scpss.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_scpss.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_scpss.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_temp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_temp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_temp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_temp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_temp.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_temp.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_temp.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_temp.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_time.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_time.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_time.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_time.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_time.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_time.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_time.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_time.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_uricfg.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_uricfg.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_uricfg.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_uricfg.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_uricfg.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_uricfg.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_uricfg.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_uricfg.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wdxs.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wdxs.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wdxs.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wdxs.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wdxs.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wdxs.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wdxs.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wdxs.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wp.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wp.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wp.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wp.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wp.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wp.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wp.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wp.h diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wss.c b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wss.c similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wss.c rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wss.c diff --git a/lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wss.h b/lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wss.h similarity index 100% rename from lib/sdk/NDALibraries/BTLE/ble-profiles/sources/services/svc_wss.h rename to lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_wss.h diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_audio_amp.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_audio_amp.h new file mode 100644 index 0000000000000000000000000000000000000000..2d809aaa43fd861b138bcd493567fcc3d753d715 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_audio_amp.h @@ -0,0 +1,66 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Audio amplifier driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_AUDIO_AMP_H +#define PAL_AUDIO_AMP_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Operational states. */ +typedef enum +{ + PAL_AUDIO_AMP_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_AUDIO_AMP_STATE_ERROR = 0, /*!< Error state. */ + PAL_AUDIO_AMP_STATE_READY, /*!< Ready state. */ + PAL_AUDIO_AMP_STATE_BUSY /*!< BUSY state. */ +} PalAudioAmpState_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalAudioAmpInit(void); +void PalAudioAmpDeInit(void); + +/* Control and Status */ +PalAudioAmpState_t PalAudioAmpGetState(void); +uint8_t PalAudioAmpGetVol(void); +void PalAudioAmpSetVolUp(void); +void PalAudioAmpSetVolDown(void); +void PalAudioAmpMute(void); +void PalAudioAmpUnmute(void); + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_AUDIO_AMP_H */ + diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb.h new file mode 100644 index 0000000000000000000000000000000000000000..c10b659a621b82fc6ae32f5e270ab5c36d5b0c4d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb.h @@ -0,0 +1,271 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_BB_H +#define PAL_BB_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Protocol types */ +enum +{ + BB_PROT_NONE, /*!< Non-protocol specific operation. */ + BB_PROT_BLE, /*!< Bluetooth Low Energy normal mode. */ + BB_PROT_BLE_DTM, /*!< Bluetooth Low Energy direct test mode. */ + BB_PROT_PRBS15, /*!< Enable the continuous PRBS15 transmit sequence. */ + BB_PROT_15P4, /*!< 802.15.4. */ + BB_PROT_NUM /*!< Number of protocols. */ +}; + +/*! \brief Status codes */ +enum +{ + BB_STATUS_SUCCESS, /*!< Operation successful. */ + BB_STATUS_FAILED, /*!< General failure. */ + BB_STATUS_CANCELED, /*!< Receive canceled. */ + BB_STATUS_RX_TIMEOUT, /*!< Receive packet timeout. */ + BB_STATUS_CRC_FAILED, /*!< Receive packet with CRC verification failed. */ + BB_STATUS_FRAME_FAILED, /*!< Receive packet with frame verification failed. */ + BB_STATUS_ACK_FAILED, /*!< ACK packet failure. */ + BB_STATUS_ACK_TIMEOUT, /*!< ACK packet timeout. */ + BB_STATUS_TX_CCA_FAILED, /*!< Transmit CCA failure. */ + BB_STATUS_TX_FAILED /*!< Transmit failure. */ +}; + +/*! \brief PHY types. */ +enum +{ + BB_PHY_BLE_1M = 1, /*!< Bluetooth Low Energy 1Mbps PHY. */ + BB_PHY_BLE_2M = 2, /*!< Bluetooth Low Energy 2Mbps PHY. */ + BB_PHY_BLE_CODED = 3, /*!< Bluetooth Low Energy Coded PHY (data coding unspecified). */ + BB_PHY_15P4 = 4, /*!< 802.15.4 PHY. */ +}; + +/*! \brief PHY options. */ +enum +{ + BB_PHY_OPTIONS_DEFAULT = 0, /*!< BB defined PHY Options behavior. */ + BB_PHY_OPTIONS_BLE_S2 = 1, /*!< Always use S=2 coding when transmitting on LE Coded PHY. */ + BB_PHY_OPTIONS_BLE_S8 = 2 /*!< Always use S=8 coding when transmitting on LE Coded PHY. */ +}; + +#ifndef BB_CLK_RATE_HZ +/*! \brief BB clock rate in hertz. */ +#define BB_CLK_RATE_HZ 1000000 +#endif + +/*! \brief Binary divide with 1,000,000 divisor (n[max]=0xFFFFFFFF). */ +#define BB_MATH_DIV_10E6(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(4295)) >> 32)) + +#if (BB_CLK_RATE_HZ == 1000000) +/*! \brief Return microseconds (no conversion required). */ +#define BB_US_TO_BB_TICKS(us) (us) +#elif (BB_CLK_RATE_HZ == 8000000) +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) ((uint32_t)((us) << 3)) +#elif (BB_CLK_RATE_HZ == 32768) +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) ((uint32_t)(((uint64_t)(us) * UINT64_C(549755)) >> 24)) /* calculated value may be one tick low */ +#else +/*! \brief Compute BB ticks from given time in microseconds (max time is interval=1,996s). */ +#define BB_US_TO_BB_TICKS(us) BB_MATH_DIV_10E6((uint64_t)(us) * (uint64_t)(BB_CLK_RATE_HZ)) +#endif + +#define RTC_CLOCK_RATE 32768 +#define USE_RTC_BB_CLK (BB_CLK_RATE_HZ == RTC_CLOCK_RATE) +#define HFCLK_OSC_SETTLE_TICKS (RTC_CLOCK_RATE / 1000) + +#if (BB_CLK_RATE_HZ == 1000000) +/*! \brief BB ticks to microseconds (no conversion required). */ +#define BB_TICKS_TO_US(n) (n) +#elif (BB_CLK_RATE_HZ == 8000000) +/*! \brief BB ticks to microseconds (8MHz). */ +#define BB_TICKS_TO_US(n) ((n) >> 3) +#elif (BB_CLK_RATE_HZ == 32768) +/*! \brief BB ticks to microseconds (32768 Hz). */ +#define BB_TICKS_TO_US(n) (uint32_t)(((uint64_t)(n) * 15625) >> 9) +#else +/*! \brief BB ticks to microseconds. */ +#define BB_TICKS_TO_US(n) (uint32_t)((uint64_t)(n) * 1000000 / BB_CLK_RATE_HZ) +#endif + +/*! \brief Typical maximum duration to scan in a scan interval (BbRtCfg_t::maxScanPeriodMs). */ +#define BB_MAX_SCAN_PERIOD_MS 1000 + +/*! \brief Typical RF setup delay (BbRtCfg_t::rfSetupDelayUs). */ +#define BB_RF_SETUP_DELAY_US 150 + +/*! \brief Typical operation setup delay in microseconds (BbRtCfg_t::schSetupDelayUs). */ +#define BB_SCH_SETUP_DELAY_US 500 + +/************************************************************************************************** + Type Definitions +**************************************************************************************************/ + +/*! \brief IRQ callback datatypes. */ +typedef void (*bbDrvIrqCback_t)(void); + +/*! \brief BB configuration. */ +typedef struct +{ + uint16_t clkPpm; /*!< Clock accuracy in PPM. */ + uint8_t rfSetupDelayUsec; /*!< RF setup delay in microseconds. */ + uint16_t maxScanPeriodMsec; /*!< Maximum scan period in milliseconds. */ + uint16_t schSetupDelayUsec; /*!< Schedule setup delay in microseconds. */ +} PalBbCfg_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*! \addtogroup PAL_BB_INIT + * \{ + * This section contains driver routines which initialize as well as enable the sleep mode + * of the BB hardware. + */ + +/*************************************************************************************************/ +/*! + * \brief Initialize the baseband driver. + * + * \return None. + * + * One-time initialization of baseband resources. This routine can be used to setup baseband + * resources, load RF trim parameters and execute RF calibrations and seed the random number + * generator. + * + * This routine should block until the BB hardware is completely initialized. + */ +/*************************************************************************************************/ +void PalBbInit(void); + +/*************************************************************************************************/ +/*! + * \brief Enable the BB hardware. + * + * \return None. + * + * This routine brings the BB hardware out of low power (enable power and clocks) just before a + * first BB operation is executed. + */ +/*************************************************************************************************/ +void PalBbEnable(void); + +/*************************************************************************************************/ +/*! + * \brief Disable the BB hardware. + * + * \return None. + * + * This routine signals the BB hardware to go into low power (disable power and clocks) after all + * BB operations have been disabled. + */ +/*************************************************************************************************/ +void PalBbDisable(void); + +/*************************************************************************************************/ +/*! + * \brief Load BB timing configuration. + * + * \param pCfg Return configuration values. + * + * \return None. + */ +/*************************************************************************************************/ +void PalBbLoadCfg(PalBbCfg_t *pCfg); + +/*! \} */ /* PAL_BB_INIT */ + +/*! \addtogroup PAL_BB_CLOCK + * \{ + * This section contains driver routines related to the BB clock. + */ + +/*************************************************************************************************/ +/*! + * \brief Get the current BB clock value. + * + * \param useRtcBBClk Use RTC BB clock. + * + * \return Current BB clock value, units are microseconds. + * + * This routine reads the current value from the BB clock and returns its value. The clock should + * increment at the rate BB_CLK_RATE_HZ (wrapping as appropriate) whenever the BB is enabled. + */ +/*************************************************************************************************/ +uint32_t PalBbGetCurrentTime(bool_t useRtcBBClk); + +/*************************************************************************************************/ +/*! + * \brief Get the current FRC time. + * + * \param pTime Pointer to return the current time. + * + * \return TRUE if time is valid, FALSE otherwise. + * + * Get the current FRC time. + * + * \note FRC is limited to the same bit-width as the BB clock. Return value is available + * only when the BB is active. + */ +/*************************************************************************************************/ +bool_t PalBbGetTimestamp(uint32_t *pTime); + +/*************************************************************************************************/ +/*! + * \brief Called to register a protocol's Radio and Timer IRQ callback functions. + * + * \param protId Protocol ID. + * \param timerCback Timer IRQ callback. + * \param radioCback Timer IRQ callback. + * + * \return None. + */ +/*************************************************************************************************/ +void PalBbRegisterProtIrq(uint8_t protId, bbDrvIrqCback_t timerCback, bbDrvIrqCback_t radioCback); + +/*************************************************************************************************/ +/*! + * \brief Set protocol ID. + * + * \param protId Protocol ID. + * + * \return None. + */ +/*************************************************************************************************/ +void PalBbSetProtId(uint8_t protId); + +/*! \} */ /* PAL_BB_CLOCK */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_BB_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble.h new file mode 100644 index 0000000000000000000000000000000000000000..bbf90276e20cd8781f7a60da9ab3a816b44327ad --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble.h @@ -0,0 +1,385 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE Baseband interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_BB_BLE_H +#define PAL_BB_BLE_H + +#include "stack/platform/include/pal_bb.h" +#include "stack/platform/include/pal_crypto.h" +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#ifndef LL_ENABLE_TESTER +#define LL_ENABLE_TESTER 0 /*!< Enable LL tester extensions. */ +#endif + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Nonce modes. */ +enum +{ + PAL_BB_NONCE_MODE_PKT_CNTR, /*!< Packet counter mode (default). */ + PAL_BB_NONCE_MODE_CIS_CNTR, /*!< CIS counter mode, PalCryptoEnc_t::pTxPktCounter/pRxPktCounter must be non-NULL. */ + PAL_BB_NONCE_MODE_EVT_CNTR /*!< Event counter mode, PalCryptoEnc_t::pEventCounter must be non-NULL. */ +}; + +/*! \brief Connection type. */ +enum +{ + PAL_BB_TYPE_ACL, /*!< ACL. */ + PAL_BB_TYPE_CIS, /*!< CIS. */ + PAL_BB_TYPE_BIS /*!< BIS. */ +}; + +/*! \addtogroup PAL_BB_BLE_CHAN + * \{ */ + +/*! \brief BLE channelization parameters. */ +typedef struct +{ + uint8_t opType; /*!< Operation type. */ + uint8_t chanIdx; /*!< Channel index. */ + int8_t txPower; /*!< Transmit power, unit is dBm. */ + uint32_t accAddr; /*!< Access address. */ + uint32_t crcInit; /*!< CRC initialization value. */ + uint8_t txPhy; /*!< Transmitter PHY. */ + uint8_t rxPhy; /*!< Receiver PHY. */ + uint8_t initTxPhyOptions; /*!< Initial Tx PHY options. */ + uint8_t tifsTxPhyOptions; /*!< TIFS Tx PHY options. */ + bool_t peerTxStableModIdx; /*!< Peer uses stable modulation index on transmitter. */ + bool_t peerRxStableModIdx; /*!< Peer uses stable modulation index on receiver. */ + PalCryptoEnc_t enc; /*!< Encryption parameters (NULL if disabled). */ + +#if (LL_ENABLE_TESTER) + uint32_t accAddrRx; /*!< Access address override for receptions. */ + uint32_t accAddrTx; /*!< Access address override for transmissions. */ + uint32_t crcInitRx; /*!< CRC initialization override for receptions. */ + uint32_t crcInitTx; /*!< CRC initialization override for transmissions. */ +#endif +} PalBbBleChan_t; + +/*! \} */ /* PAL_BB_BLE_CHAN */ + +/*! \addtogroup PAL_BB_BLE_DATA + * \{ + * This section contains driver routines used for packet transmission. + */ + +/*! \brief Transmit complete ISR callback signature. */ +typedef void (*PalBbBleTxIsr_t)(uint8_t status); + +/*! \brief Receive complete ISR callback signature. */ +typedef void (*PalBbBleRxIsr_t)(uint8_t status, int8_t rssi, uint32_t crc, uint32_t timestamp, uint8_t rxPhyOptions); + +/*! \brief BLE data transfer parameters. */ +typedef struct +{ + PalBbBleTxIsr_t txCback; /*!< Transmit completion callback. */ + PalBbBleRxIsr_t rxCback; /*!< Receive completion callback. */ + + uint32_t due; /*!< Due time of the first packet. */ + uint32_t rxTimeoutUsec; /*!< Receive timeout in microseconds. */ + uint16_t dueOffsetUsec; /*!< Due time offset in microseconds. */ +} PalBbBleDataParam_t; + +/*! \brief Operation parameters. */ +typedef struct +{ + bool_t ifsSetup; /*!< TRUE if IFS timer should be set up for next operation. */ + uint16_t ifsUsec; /*!< IFS time in microseconds. */ +} PalBbBleOpParam_t; + +/*! \brief Transmit buffer descriptor. */ +typedef struct +{ + uint16_t len; /*!< Length of buffer. */ + uint8_t *pBuf; /*!< Pointer to buffer. */ +} PalBbBleTxBufDesc_t; + +/*! \} */ /* PAL_BB_BLE_DATA */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*! \addtogroup PAL_BB_BLE_INIT + * \{ + * This section contains driver routines which initialize as well as enable the BLE mode of the + * BB hardware. + */ + +/*************************************************************************************************/ +/*! + * \brief Initialize the BLE baseband driver. + * + * \return None. + * + * One-time initialization of BLE baseband driver. + */ +/*************************************************************************************************/ +void PalBbBleInit(void); + +/*************************************************************************************************/ +/*! + * \brief Enable the BB hardware. + * + * \return None. + * + * Wake the BB hardware out of sleep and enable for operation. All BB functionality is + * available when this routine completes. BB clock is set to zero and started. + */ +/*************************************************************************************************/ +void PalBbBleEnable(void); + +/*************************************************************************************************/ +/*! + * \brief Disable the BB hardware. + * + * \return None. + * + * Disable the baseband and put radio hardware to sleep. Must be called from an idle state. + * A radio operation cannot be in progress. + */ +/*************************************************************************************************/ +void PalBbBleDisable(void); + +/*! \} */ /* PAL_BB_BLE_INIT */ + +/*! \addtogroup PAL_BB_BLE_CHAN + * \{ + * This section contains the driver routine used to set the chanelization parameters. + */ + +/*************************************************************************************************/ +/*! + * \brief Set channelization parameters. + * + * \param pChan Channelization parameters. + * + * \return None. + * + * Calling this routine will set parameters for all future transmit and receive operations + * until this routine is called again providing new parameters. + * + * The setting of channelization parameters influence the operations of the following listed + * routines. Therefore, this routine is called to set the channel characteristics before + * the use of data routines described in \a PAL_BB_BLE_DATA. + * + * \note The \a pParam contents are not guaranteed to be static and is only valid in the + * context of the call to this routine. Therefore parameters requiring persistence + * should be copied. + */ +/*************************************************************************************************/ +void PalBbBleSetChannelParam(PalBbBleChan_t *pChan); + +/*! \} */ /* PAL_BB_BLE_CHAN */ + +/*! \addtogroup PAL_BB_BLE_DATA + * \{ + * This section contains driver routines used for packet transmission. + */ + +/*************************************************************************************************/ +/*! + * \brief Set the data packet exchange parameters. + * + * \param pParam Data exchange parameters. + * + * \return None. + * + * Calling this routine will set parameters for all future transmit and receive operations + * until this routine is called again providing new parameters. + */ +/*************************************************************************************************/ +void PalBbBleSetDataParams(const PalBbBleDataParam_t *pParam); + +/*************************************************************************************************/ +/*! + * \brief Set the operation parameters. + * + * \param pOpParam Operations parameters. + * + * \return None. + * + * Calling this routine will set parameters for the next transmit or receive operations. + */ +/*************************************************************************************************/ +void PalBbBleSetOpParams(const PalBbBleOpParam_t *pOpParam); + +/*************************************************************************************************/ +/*! + * \brief Transmit a packet. + * + * \param descs Array of transmit buffer descriptors. + * \param cnt Number of descriptors. + * + * \return None. + * + * Set the first data buffer for the first packet of an alternating Tx-Rx data exchange cycle. + */ +/*************************************************************************************************/ +void PalBbBleTxData(PalBbBleTxBufDesc_t descs[], uint8_t cnt); + +/*************************************************************************************************/ +/*! + * \brief Transmit packet at TIFS after the last packet received. + * + * \param descs Array of transmit buffer descriptor. + * \param cnt Number of descriptors. + * + * \return None. + * + * If possible, the transmit will occur at the TIFS timing. If not possible, the callback status + * will indicate this. + */ +/*************************************************************************************************/ +void PalBbBleTxTifsData(PalBbBleTxBufDesc_t descs[], uint8_t cnt); + +/*************************************************************************************************/ +/*! + * \brief Receive packet. + * + * \param pBuf Receive data buffer. + * \param len Length of data buffer. + * + * \return None. + * + * Set the first data buffer for the first packet of an alternating Rx-Tx data exchange cycle. + */ +/*************************************************************************************************/ +void PalBbBleRxData(uint8_t *pBuf, uint16_t len); + +/*************************************************************************************************/ +/*! + * \brief Receive packet at TIFS after the last packet transmitted. + * + * \param pBuf Receive data buffer. + * \param len Length of data buffer. + * + * \return None. + * + * If possible, the receive will occur on the TIFS timing. If not possible, the callback status + * will indicate this. + */ +/*************************************************************************************************/ +void PalBbBleRxTifsData(uint8_t *pBuf, uint16_t len); + +/*************************************************************************************************/ +/*! + * \brief Cancel TIFS timer. + * + * \return None. + * + * This stops any active TIFS timer operation. This routine is always called in the callback + * (i.e. ISR) context. + */ +/*************************************************************************************************/ +void PalBbBleCancelTifs(void); + +/*************************************************************************************************/ +/*! + * \brief Cancel a pending transmit or receive. + * + * \return None. + * + * This stops any active radio operation. This routine is never called in the callback + * (i.e. ISR) context. + */ +/*************************************************************************************************/ +void PalBbBleCancelData(void); + +/*! \} */ /* PAL_BB_BLE_DATA */ + +/*! \addtogroup PAL_BB_BLE_TEST + * \{ + * This section contains driver routines used for test modes. + */ + +/*************************************************************************************************/ +/*! + * \brief Enable or disable data whitening. + * + * \param enable Flag to indicate data whitening. + * + * \return None. + * + * Sets an internal variable that indicates if data whitening is enabled or not. + */ +/*************************************************************************************************/ +void PalBbBleEnableDataWhitening(bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Enable or disable PRBS15. + * + * \param enable Flag to indicate PRBS15. + * + * \return None. + * + * Immediately enable or disable continuous PRBS15 bitstream. Setting the channelization + * parameters with \a PalBbBleSetChannelParam() must precede enabling PRBS15. + * + * Use of \a PAL_BB_BLE_DATA routines is not allowed while PRBS15 is enabled. + */ +/*************************************************************************************************/ +void PalBbBleEnablePrbs15(bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Set inline encryption/decryption direction bit. + * + * \param dir 0=slave, non-zero=master + * + * \return None. + * + */ +/*************************************************************************************************/ +void PalBbBleInlineEncryptDecryptSetDirection(uint8_t dir); + +/*************************************************************************************************/ +/*! + * \brief Set the inline encryption packet count for transmit. + * + * \param count Packet counter value, a 39-bit value + * + * \return None. + * + */ +/*************************************************************************************************/ +void PalBbBleInlineEncryptSetPacketCount(uint64_t count); + +/*! \} */ /* PAL_BB_BLE_TEST */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_BB_BLE_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble_tester.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble_tester.h new file mode 100644 index 0000000000000000000000000000000000000000..180ebafaf528e2c4aaec6b3670565a19c269d7af --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_bb_ble_tester.h @@ -0,0 +1,115 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief BLE Baseband tester interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_BB_BLE_TESTER_H +#define PAL_BB_BLE_TESTER_H + +#include "stack/platform/include/pal_types.h" + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Enable bypassing PDU filtering. + * + * \param enable If TRUE enable bypass PDU filtering, FALSE otherwise. + * + * \return None. + * + * Enable bypassing PDU filtering. + */ +/*************************************************************************************************/ +void PalBbTesterEnablePduFilterBypass(bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Invalidate access address value. + * + * \param chanMask Invalidate channel mask. + * \param invalidMask Enable mask for invalidating access address (0 to disable). + * \param shiftMask TRUE if corrupting AA by one bit and corrupted bit location is shifted every TX/RX. + * \param forRx TRUE for Rx, FALSE for Tx. + * + * \return None. + * + * Force the receiver to receive a miss a packet if the receive channel is in + * \b chanMask while stepping through the invalid pattern in \b invalidMask. + */ +/*************************************************************************************************/ +void PalBbTesterSetInvalidAccessAddress(uint64_t chanMask, uint32_t invalidMask, bool_t shiftMask, bool_t forRx); + +/*************************************************************************************************/ +/*! + * \brief Invalidate CRC initialization value. + * + * \param chanMask Invalidate channel mask. + * \param adjMask Number of adjustments (0 to disable). + * \param forRx TRUE for Rx, FALSE for Tx. + * + * \return None. + * + * Force the receiver to receive a packet with CRC error if the receive channel is in + * \b chanMask while stepping through the invalid pattern in \b invalidMask. + */ +/*************************************************************************************************/ +void PalBbTesterSetInvalidCrcInit(uint64_t chanMask, uint32_t adjMask, bool_t forRx); + +/*************************************************************************************************/ +/*! + * \brief Trigger channel modifications on matching Tx packet header. + * + * \param hdrMask Header mask. + * \param hdrValue Match value. + * + * \return None. + * + * Modify the transmit channel parameters of a packet only when the Tx packet header matches + * the given parameters. This applies to the modification parameter provided by the following + * routines: + * + * - \ref PalBbTesterSetInvalidCrcInit() + * - \ref PalBbTesterSetInvalidAccessAddress() + */ +/*************************************************************************************************/ +void PalBbTesterSetModifyTxPktTrigger(uint16_t hdrMask, uint16_t hdrValue); + +/*************************************************************************************************/ +/*! + * \brief Adjust Tx TIFS timing value. + * + * \param adjNs Adjustment value in nanoseconds. + * + * \return None. + * + * Adjust the TIFS timing of transmit by the given signed value of timer ticks. + * If adjustment value is out of range, maximum allowed value is used. + */ +/*************************************************************************************************/ + +void PalBbTesterAdjTxTifsNs(int16_t adjNs); +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_BB_BLE_TESTER_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_btn.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_btn.h new file mode 100644 index 0000000000000000000000000000000000000000..c10fbd2db41d7b7dbd927e28a2e4ee06bb00ed13 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_btn.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Button driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_BTN_H +#define PAL_BTN_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_BUTTON + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Button state. */ +typedef enum +{ + PAL_BTN_STATE_UP, /*!< Button is released. */ + PAL_BTN_STATE_DOWN, /*!< Button is pressed. */ +} PalBtnState_t; + +/*! \brief Action callback. This may be returned in interrupt context. */ +typedef void (*PalBtnActionCback_t)(uint8_t btnId, PalBtnState_t state); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalBtnInit(void); +void PalBtnDeInit(void); +void PalBtnRegister(PalBtnActionCback_t actCback); + +/* Control and Status */ +PalBtnState_t PalBtnGetState(uint8_t id); + +/*! \} */ /* PAL_BUTTON */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_BTN_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_cfg.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_cfg.h new file mode 100644 index 0000000000000000000000000000000000000000..ac764556c645fc749257ce4aa69f03a527b38c1a --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_cfg.h @@ -0,0 +1,61 @@ + /* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief System configuration definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_CFG_H +#define PAL_CFG_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_CFG + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Configuration ID. */ +typedef enum +{ + PAL_CFG_ID_BD_ADDR, /*!< BD address. */ + PAL_CFG_ID_BLE_PHY, /*!< Ble PHY. */ + PAL_CFG_ID_LL_PARAM, /*!< LL parameters. */ + PAL_CFG_ID_MAC_ADDR, /*!< MAC address. */ + PAL_CFG_ID_UUID, /*!< UUID. */ +} PalCfgId_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ +void PalCfgLoadData(uint8_t cfgId, uint8_t *pBuf, uint32_t len); +void PalCfgSetDeviceUuid(uint8_t *pBuf); + +/*! \} */ /* PAL_CFG */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_CFG_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_crypto.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_crypto.h new file mode 100644 index 0000000000000000000000000000000000000000..ed1aa6a993594b0ae6b7a153fc8e4f4f200ca25d --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_crypto.h @@ -0,0 +1,125 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Crypto driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_CRYPTO_H +#define PAL_CRYPTO_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_CRYPTO + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief AES block size. */ +#define PAL_CRYPTO_AES_BLOCK_SIZE 16 + +#define PAL_CRYPTO_LL_KEY_LEN 16 /*!< Encryption key length. */ +#define PAL_CRYPTO_LL_IV_LEN 8 /*!< Initialization vector length. */ +#define PAL_CRYPTO_LL_DATA_MIC_LEN 4 /*!< Data channel PDU MIC length. */ + +/*! \brief CCM-Mode algorithm lengths. */ +#define SEC_CCM_KEY_LEN 16 + +/*! \brief CCM-Mode algorithm maximum additional length. */ +#define SEC_CCM_MAX_ADDITIONAL_LEN ((1<<16) - (1<<8)) + +/*! \brief CCM-Mode algorithm length. */ +#define SEC_CCM_L 2 + +/*! \brief CCM-Mode algorithm nonce length. */ +#define SEC_CCM_NONCE_LEN (15-SEC_CCM_L) + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Operational states. */ +typedef enum +{ + PAL_CRYPTO_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_CRYPTO_STATE_ERROR = 0, /*!< Error state. */ + PAL_CRYPTO_STATE_READY /*!< Ready state. */ +} PalCryptoState_t; + +/*! \brief Encryption data. */ +typedef struct +{ + /* SK placed here for 32-bit alignment. */ + uint8_t sk[PAL_CRYPTO_LL_KEY_LEN]; /*!< Session/Encryption key. */ + uint8_t iv[PAL_CRYPTO_LL_IV_LEN]; /*!< Initialization vector. */ + bool_t enaEncrypt; /*!< Tx/Encryption enabled flag. */ + bool_t enaDecrypt; /*!< Rx/Decryption enabled flag. */ + bool_t enaAuth; /*!< Enable authentication. */ + uint8_t nonceMode; /*!< Nonce mode. */ + uint16_t *pEventCounter; /*!< Connection event counter. */ + uint64_t *pCisTxPktCounter; /*!< CIS Tx packet counter. Set when nonceMode = PAL_BB_NONCE_MODE_CIS_CNTR. */ + uint64_t *pCisRxPktCounter; /*!< CIS Rx packet counter. Set when nonceMode = PAL_BB_NONCE_MODE_CIS_CNTR.*/ + uint8_t dir; /*!< Direction value. */ + uint8_t type; /*!< Type, ACL, CIS, BIS */ + void *pEncryptCtx; /*!< Tx/Encryption context. */ + void *pDecryptCtx; /*!< Rx/Decryption context. */ +} PalCryptoEnc_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalCryptoInit(void); +void PalCryptoDeInit(void); + +/* Key genration */ +void PalCryptoGenerateP256KeyPair(const uint8_t *pPrivKey, uint8_t *pPubKey); +void PalCryptoGenerateDhKey(const uint8_t *pPubKey, const uint8_t *pPrivKey, uint8_t *pDhKey); +bool_t PalCryptoValidatePublicKey(const uint8_t *pPubKey, bool_t generateKey); +void PalCryptoGenerateRandomNumber(uint8_t *pBuf, uint8_t len); + +/* CCM */ +uint32_t PalCryptoCcmDec(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pCypherText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t *pMic, uint8_t micLen, + uint8_t *pResult, uint8_t handlerId, uint16_t param, uint8_t event); +void PalCryptoCcmEnc(const uint8_t *pKey, uint8_t *pNonce, uint8_t *pPlainText, uint16_t textLen, + uint8_t *pClear, uint16_t clearLen, uint8_t micLen, uint8_t *pResult, + uint8_t handlerId, uint16_t param, uint8_t event); + +/* Crypto AES */ +void PalCryptoAesEcb(const uint8_t *pKey, uint8_t *pOut, const uint8_t *pIn); +void PalCryptoAesSetupCipherBlock(PalCryptoEnc_t *pEnc, uint8_t id, uint8_t localDir); +bool_t PalCryptoAesCcmEncrypt(PalCryptoEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic); +bool_t PalCryptoAesCcmDecrypt(PalCryptoEnc_t *pEnc, uint8_t *pBuf); +void PalCryptoSetEncryptPacketCount(PalCryptoEnc_t *pEnc, uint64_t pktCnt); +void PalCryptoSetDecryptPacketCount(PalCryptoEnc_t *pEnc, uint64_t pktCnt); + +/*! \} */ /* PAL_CRYPTO */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_CRYPTO_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_io_exp.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_io_exp.h new file mode 100644 index 0000000000000000000000000000000000000000..14cac155141ea1ec994b9dc1d0c1ad978ec48474 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_io_exp.h @@ -0,0 +1,87 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief I/O expander driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_IO_EXP_H +#define PAL_IO_EXP_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_IO_EXP + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Read register completion callback. */ +typedef void (*PalIoExpRdRegCompCback_t)(bool_t status, uint8_t portValue); + +/*! \brief Write register completion callback. */ +typedef void (*PalIoExpWrRegCompCback_t)(bool_t status); + +/*! \brief Operational states. */ +typedef enum +{ + PAL_IO_EXP_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_IO_EXP_STATE_ERROR = 0, /*!< Error state. */ + PAL_IO_EXP_STATE_INIT = 1, /*!< Initialized state. */ + PAL_IO_EXP_STATE_READY = 2, /*!< Ready state. */ + PAL_IO_EXP_STATE_BUSY = 3, /*!< Busy state. */ +} PalIoExpState_t; + +/*! \brief Operations. */ +typedef enum +{ + PAL_IO_EXP_OP_INPUT = 0x00, /*!< Input Port. Read only. */ + PAL_IO_EXP_OP_OUTPUT = 0x01, /*!< Output Port. Read/write. */ + PAL_IO_EXP_OP_POL_INV = 0x02, /*!< Polarity Inversion. Read/write. */ + PAL_IO_EXP_OP_CONFIG = 0x03 /*!< Configuration. Read/write. */ +} PalIoOp_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalIoExpInit(void); +void PalIoExpDeInit(void); +uint8_t PalIoExpRegisterDevice(uint8_t subAddr); +void PalIoExpRegisterCback(uint8_t devHandle, PalIoExpRdRegCompCback_t rdCback, PalIoExpWrRegCompCback_t wrCback); + +/* Control and Status */ +PalIoExpState_t PalIoExpGetState(uint8_t devHandle); + +/* Data transfer */ +void PalIoExpRead(uint8_t devHandle, PalIoOp_t op); +void PalIoExpWrite(uint8_t devHandle, PalIoOp_t op, uint8_t value); + +/*! \} */ /* PAL_IO_EXP */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_IO_EXP_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_led.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_led.h new file mode 100644 index 0000000000000000000000000000000000000000..2a7edeadf433b5eaf80af2b76dfdc72ddfcf460c --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_led.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief LED driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_LED_H +#define PAL_LED_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_LED + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Reserved LED IDs. */ +typedef enum +{ + /* Common debug signals. */ + PAL_LED_ID_CPU_ACTIVE = 0x18, /*!< CPU active LED ID. */ + PAL_LED_ID_ERROR = 0x19 /*!< Error LED ID. */ +} PalLedId_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalLedInit(void); +void PalLedDeInit(void); + +/* Control and Status */ +void PalLedOn(uint8_t id); +void PalLedOff(uint8_t id); +void PalLedOnGroup(uint32_t mask); +void PalLedOffGroup(uint32_t mask); + +/*! \} */ /* PAL_LED */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_LED_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_nvm.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_nvm.h new file mode 100644 index 0000000000000000000000000000000000000000..0de49fc924696266b97af066c6fdf70e2e20a257 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_nvm.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Pal NVM driver. + */ +/*************************************************************************************************/ + +#ifndef PAL_NVM_H +#define PAL_NVM_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_NVM + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! NVM sector size. */ +#define PAL_NVM_SECTOR_SIZE 0x1000 + +/*! NVM word size. */ +#define PAL_NVM_WORD_SIZE 4 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Callback. This may be returned in interrupt context. */ +typedef void (*PalNvmCback_t)(bool_t status); + +/*! \brief Operational states. */ +typedef enum +{ + PAL_NVM_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_NVM_STATE_ERROR = 0, /*!< Error state. */ + PAL_NVM_STATE_READY, /*!< Ready state. */ + PAL_NVM_STATE_BUSY /*!< Busy state. */ +} PalNvmState_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalNvmInit(PalNvmCback_t actCback); +void PalNvmDeInit(void); + +/* Control and Status */ +PalNvmState_t PalNvmGetState(void); + +/* Data Transfer */ +void PalNvmRead(void *pBuf, uint32_t size, uint32_t srcAddr); +void PalNvmWrite(void *pBuf, uint32_t size, uint32_t dstAddr); +void PalNvmEraseSector(uint32_t size, uint32_t startAddr); + +/*! \} */ /* PAL_NVM */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_NVM_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_radio.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_radio.h new file mode 100644 index 0000000000000000000000000000000000000000..efe84d3b5a79f29fad39366ee1c443c6920495d4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_radio.h @@ -0,0 +1,114 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Radio interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_RADIO_H +#define PAL_RADIO_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_RADIO + * \{ */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize RF path compensation. + * + * \return None. + */ +/*************************************************************************************************/ +void PalRadioInitPathComp(void); + +/*************************************************************************************************/ +/*! + * \brief Get the actual Tx power at the antenna (expressed in 1dBm units). + * + * \param txPwr Tx power provided by the host (expressed in 1dBm units). + * \param compFlag Flag to apply Tx path compensation or not. + * + * \return Actual Tx power at the antenna (expressed in 1dBm units). + * + * Tx path compensation is only used for extended ADV header. + * Compensation is not considered when filling in HCI events. + */ +/*************************************************************************************************/ +int8_t PalRadioGetActualTxPower(int8_t txPwr, bool_t compFlag); + +/*************************************************************************************************/ +/*! + * \brief Set RF path compensation. + * + * \param txPathComp RF transmit path compensation value (expressed in 0.1dBm units). + * \param rxPathComp RF receive path compensation value (expressed in 0.1dBm units). + * + * \return TRUE if successful, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t PalRadioWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Get supported transmit power. + * + * \param pMinTxPwr Return buffer for minimum transmit power (expressed in 1dBm units). + * \param pMaxTxPwr Return buffer for maximum transmit power (expressed in 1dBm units). + * + * \return None. + */ +/*************************************************************************************************/ +void PalRadioGetSupTxPower(int8_t *pMinTxPwr, int8_t *pMaxTxPwr); + +/*************************************************************************************************/ +/*! + * \brief Read RF path compensation. + * + * \param pTxPathComp Return buffer for RF transmit path compensation value (expressed in 0.1dBm units). + * \param pRxPathComp Return buffer for RF receive path compensation value (expressed in 0.1dBm units). + * + * \return None. + */ +/*************************************************************************************************/ +void PalRadioReadRfPathComp(int16_t *pTxPathComp, int16_t *pRxPathComp); + +/*************************************************************************************************/ +/*! + * \brief Get receive RF path compensation. + * + * \return Transmit RF path compensation (in 1-dBm units). + */ +/*************************************************************************************************/ +int8_t PalRadioGetRxRfPathComp(void); + +/*! \} */ /* PAL_RADIO */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_RADIO_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_rtc.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_rtc.h new file mode 100644 index 0000000000000000000000000000000000000000..dd3ae97769affe37186e898beda5a4925dce4aec --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_rtc.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief RTC timer interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_RTC_H +#define PAL_RTC_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_RTC + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Max value of RTC. */ +#define PAL_MAX_RTC_COUNTER_VAL (0x00FFFFFF) + +/*! \brief Clock frequency of the RTC timer used. */ +#define PAL_RTC_TICKS_PER_SEC (32768) /* RTC ticks per second (with prescaler) */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalRtcInit(void); + +/* Control and Status */ +void PalRtcEnableCompareIrq(void); +void PalRtcDisableCompareIrq(void); +uint32_t PalRtcCounterGet(void); +void PalRtcCompareSet(uint32_t value); +uint32_t PalRtcCompareGet(void); + +/*! \} */ /* PAL_RTC */ + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_sys.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_sys.h new file mode 100644 index 0000000000000000000000000000000000000000..18272cf2328e4041091fd861d30ee681344af539 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_sys.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief System hooks. + */ +/*************************************************************************************************/ + +#ifndef PAL_SYS_H +#define PAL_SYS_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_SYS + * \{ */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ +void PalSysAssertTrap(void); +void PalSysSetTrap(bool_t enable); +uint32_t PalSysGetAssertCount(void); +uint32_t PalSysGetStackUsage(void); +void PalSysSleep(void); +bool_t PalSysIsBusy(void); +void PalSysSetBusy(void); +void PalSysSetIdle(void); +void PalSysInit(void); + +/*! \} */ /* PAL_SYS */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_SYS_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_timer.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_timer.h new file mode 100644 index 0000000000000000000000000000000000000000..4b249f4a92232f0b4670c13cf63c1352301e77aa --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_timer.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Timer interface file. + */ +/*************************************************************************************************/ + +#ifndef PAL_TIMER_H +#define PAL_TIMER_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_TIMER + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Timer micro seconds to ticks. */ +#define PAL_TIMER_US_TO_TICKS(us) (us) + +/*! \brief Timer ticks to micro seconds. */ +#define PAL_TIMER_TICKS_TO_US(ticks) (ticks) + +/*! \brief Operational states. */ +typedef enum +{ + PAL_TIMER_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_TIMER_STATE_ERROR = 0, /*!< Error state. */ + PAL_TIMER_STATE_READY, /*!< Ready state. */ + PAL_TIMER_STATE_BUSY /*!< Busy state. */ +} PalTimerState_t; + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Completion callback. */ +typedef void (*PalTimerCompCback_t)(void); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalTimerInit(PalTimerCompCback_t expCback); +void PalTimerDeInit(void); + +/* Control and Status */ +PalTimerState_t PalTimerGetState(void); +uint32_t PalTimerGetCurrentTime(void); +void PalTimerStart(uint32_t startTime); +void PalTimerStop(void); + +/*! \} */ /* PAL_TIMER */ + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_twi.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_twi.h new file mode 100644 index 0000000000000000000000000000000000000000..6a3761e6cc4a5fb3a59c1d93661f39a871aa6783 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_twi.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief TWI driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_TWI_H +#define PAL_TWI_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_TWI + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Invalid device ID. */ +#define PAL_TWI_INVALID_ID 0xFF + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Operation ready callback. */ +typedef void (*PalTwiOpReadyCback_t)(uint8_t id); + +/*! \brief Completion callback (success=TRUE if ACK received, FALSE otherwise). */ +typedef void (*PalTwiCompCback_t)(uint8_t id, bool_t success); + +/*! \brief TWI device configuration. */ +typedef struct +{ + uint8_t devAddr; /*!< Device address. */ + PalTwiOpReadyCback_t opReadyCback; /*!< Operation ready callback. */ + PalTwiCompCback_t rdCback; /*!< Read data completion callback. */ + PalTwiCompCback_t wrCback; /*!< Write data completion callback. */ +} PalTwiDevConfig_t; + +/*! \brief Operational states. */ +typedef enum +{ + PAL_TWI_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_TWI_STATE_ERROR = 0, /*!< Error state. */ + PAL_TWI_STATE_READY, /*!< Ready state. */ + PAL_TWI_STATE_BUSY /*!< Busy (data transfer) state. */ +} PalTwiState_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalTwiInit(void); +void PalTwiDeInit(void); +uint8_t PalTwiRegisterDevice(PalTwiDevConfig_t *pDevCfg); + +/* Control and Status */ +PalTwiState_t PalTwiGetState(void); + +/* Data Transfer */ +void PalTwiStartOperation(uint8_t id); +void PalTwiStopOperation(uint8_t id); +void PalTwiReadData(uint8_t id, uint8_t *pData, uint8_t len); +void PalTwiWriteData(uint8_t id, const uint8_t *pData, uint8_t len); + +/*! \} */ /* PAL_TWI */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_TWI_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_types.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_types.h new file mode 100644 index 0000000000000000000000000000000000000000..c7ceaff352a8f299b9ef679b526b3bc519fad798 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_types.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Platform-independent data types. + */ +/*************************************************************************************************/ +#ifndef PAL_TYPES_H +#define PAL_TYPES_H + +#include <stdint.h> +#ifndef __CROSSWORKS +#include <stdbool.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_TYPES + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#ifndef NULL +/*! \brief NULL reference */ +#define NULL 0 +#endif + +#ifndef TRUE +/*! \brief Boolean True */ +#define TRUE 1 +#endif + +#ifndef FALSE +/*! \brief Boolean False */ +#define FALSE 0 +#endif + +/*! \brief Boolean data type */ +#ifndef __CROSSWORKS +typedef uint8_t bool_t; +#endif + +/*! \} */ /* PAL_TYPES */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_TYPES_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/include/pal_uart.h b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_uart.h new file mode 100644 index 0000000000000000000000000000000000000000..b95e162b7db6c78893f36cd5c243bad5fe1212da --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/include/pal_uart.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief UART driver definition. + */ +/*************************************************************************************************/ + +#ifndef PAL_UART_H +#define PAL_UART_H + +#include "stack/platform/include/pal_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup PAL_UART + * \{ */ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Completion callback. */ +typedef void (*PalUartCompCback_t)(void); + +/*! \brief Peripheral configuration. */ +typedef struct +{ + uint32_t baud; /*!< Baud rate. */ + PalUartCompCback_t rdCback; /*!< Read data completion callback. */ + PalUartCompCback_t wrCback; /*!< Write data completion callback. */ + bool_t hwFlow; /*!< Use HW Flow control */ +} PalUartConfig_t; + +/*! \brief Operational states. */ +typedef enum +{ + PAL_UART_STATE_UNINIT = 0, /*!< Uninitialized state. */ + PAL_UART_STATE_ERROR = 0, /*!< Error state. */ + PAL_UART_STATE_READY = 1, /*!< Ready state. */ + PAL_UART_STATE_BUSY = 2 /*!< Busy state. */ +} PalUartState_t; + +/*! \brief Reserved UART ID. */ +typedef enum +{ + PAL_UART_ID_USER = 0x00, /*!< UART 0. */ + PAL_UART_ID_CHCI = 0xF0, /*!< UART CHCI. */ + PAL_UART_ID_TERMINAL = 0xF1 /*!< UART TERMINAL. */ +} PalUartId_t; + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/* Initialization */ +void PalUartInit(PalUartId_t id, const PalUartConfig_t *pCfg); +void PalUartDeInit(PalUartId_t id); + +/* Control and Status */ +PalUartState_t PalUartGetState(PalUartId_t id); + +/* Data Transfer */ +void PalUartReadData(PalUartId_t id, uint8_t *pData, uint16_t len); +void PalUartWriteData(PalUartId_t id, const uint8_t *pData, uint16_t len); + +/*! \} */ /* PAL_UART */ + +#ifdef __cplusplus +}; +#endif + +#endif /* PAL_UART_H */ diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv.c new file mode 100644 index 0000000000000000000000000000000000000000..fc1eb3eb1bc703a3131e9d7c46030969dd8cd399 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv.c @@ -0,0 +1,25 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "chci_tr_serial.h" + +uint16_t hciDrvWrite(uint8_t type, uint16_t len, uint8_t *pData) +{ + // Write data to the controller HCI layer + chciTrSerialRxIncoming(&type, 1); + chciTrSerialRxIncoming(pData, len); + return len; +} diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.c new file mode 100644 index 0000000000000000000000000000000000000000..4486002ca6eaa9fe45b961ab77e0ec0f38420032 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.c @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-07-12 08:43:53 -0500 (Fri, 12 Jul 2019) $ + * $Revision: 44590 $ + * + ******************************************************************************/ + +#include <string.h> +#include "wsf_types.h" +#include "hci_drv.h" +#include "hci_tr.h" +#include "sema_regs.h" +#include "ipc_defs.h" +#include "max32665.h" +#include "mcr_regs.h" +#include "simo_regs.h" +#include "gcr_regs.h" +#include "sdma_regs.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/* OTP Access Control register */ +#define MXC_R_OTP_ACNTL *((volatile uint32_t*)(0x40029040)) +#define OTP_OFFSET 0x10800400 +#define OTP_LEN 0x40 + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +#ifdef __ICCARM__ +_Pragma("location=\".shared\"") shared_mem_t arm_shared_mem; +#else +shared_mem_t __attribute__ ((section (".arm_shared"))) arm_shared_mem; +#endif + +#ifdef __ICCARM__ +_Pragma("location=\".shared\"") shared_mem_t sdma_shared_mem; +#else +shared_mem_t __attribute__ ((section (".sdma_shared"))) sdma_shared_mem; +#endif + +#ifdef __ICCARM__ +_Pragma("location=\".bin\"") uint8_t sdma_code[] = { +#else +volatile uint8_t __attribute__ ((section (".sdma_code"))) sdma_code[] = { +#include "sdma.inc" +}; +#endif + +// SDMA can not read from OTP, have to copy it into an SRAM section +#ifdef __ICCARM__ +_Pragma("location=\".otp\"") uint8_t otp[OTP_LEN]; +#else +uint8_t __attribute__ ((section (".otp"))) otp[OTP_LEN]; +#endif + +extern void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len); + +/******************************************************************************/ +void hciDrvInit(void) +{ + /* Disable SDMA, assert reset */ + MXC_SDMA->ctrl &= ~(MXC_F_SDMA_CTRL_EN); + + /* Enable SDMA clock */ + MXC_GCR->perckcn1 &= ~(MXC_F_GCR_PERCKCN1_SDMAD); + + /* Setup code address */ + MXC_SDMA->ip_addr = (uint32_t)&sdma_code; + + /* Unlock OTP */ + MXC_R_OTP_ACNTL = 0x3a7f5ca3; + MXC_R_OTP_ACNTL = 0xa1e34f20; + MXC_R_OTP_ACNTL = 0x9608b2c1; + + /* Copy the OTP into the OTP memory section */ + memcpy((void*)otp, (void*)OTP_OFFSET, OTP_LEN); + + // Disable ARM BLE interrupts + NVIC_DisableIRQ(BTLE_TX_DONE_IRQn); + NVIC_DisableIRQ(BTLE_RX_RCVD_IRQn); + NVIC_DisableIRQ(BTLE_RX_ENG_DET_IRQn); + NVIC_DisableIRQ(BTLE_SFD_DET_IRQn); + NVIC_DisableIRQ(BTLE_SFD_TO_IRQn); + NVIC_DisableIRQ(BTLE_GP_EVENT_IRQn); + NVIC_DisableIRQ(BTLE_CFO_IRQn); + NVIC_DisableIRQ(BTLE_SIG_DET_IRQn); + NVIC_DisableIRQ(BTLE_AGC_EVENT_IRQn); + NVIC_DisableIRQ(BTLE_RFFE_SPIM_IRQn); + NVIC_DisableIRQ(BTLE_TX_AES_IRQn); + NVIC_DisableIRQ(BTLE_RX_AES_IRQn); + NVIC_DisableIRQ(BTLE_INV_APB_ADDR_IRQn); + NVIC_DisableIRQ(BTLE_IQ_DATA_VALID_IRQn); + + // Disable interrupt mux and poll BLE interrupts with A1 + MXC_SDMA->int_mux_ctrl0 = 0; + MXC_SDMA->int_mux_ctrl1 = 0; + MXC_SDMA->int_mux_ctrl2 = 0; + MXC_SDMA->int_mux_ctrl3 = 0; + + // Initialize the SDMA shared memory segment + memset((void*)arm_shared_mem.data, 0, SHARED_MEM_DATA_LEN); + arm_shared_mem.dirty = 1; + arm_shared_mem.len = 0; + + /* Enable SDMA */ + MXC_SDMA->ctrl |= MXC_F_SDMA_CTRL_EN; + + /* Wait for the SDMA to finish initialization */ + while(!MXC_SDMA->irq_flag) {} + + // Clear any pending SDMA interrupts + MXC_SDMA->irq_flag = 0x1; + NVIC_ClearPendingIRQ(SDMA_IRQn); + + // Enable interrupt from SDMA + MXC_SDMA->irq_ie = 1; + NVIC_EnableIRQ(SDMA_IRQn); +} + +/******************************************************************************/ +uint16_t hciDrvWrite(uint8_t type, uint16_t len, uint8_t *pData) +{ + uint16_t len_written = 0; + uint32_t sema_val; + + // Add 1 byte for type + len++; + + __disable_irq(); + + // Attempt to lock the SDMA_SEMA + // Reading the register does an atomic test and set, returns previous value + sema_val = MXC_SEMA->semaphores[SDMA_SEMA]; + + // Write the data to the shared memory segment + if(!sema_val && sdma_shared_mem.dirty) { + + + if(len > SHARED_MEM_DATA_LEN) { + len_written = SHARED_MEM_DATA_LEN; + } else { + len_written = len; + } + + memcpy((void*)sdma_shared_mem.data,(void*)&type, 1); + memcpy((void*)&sdma_shared_mem.data[1], (void*)pData, len_written-1); + sdma_shared_mem.len = len_written; + sdma_shared_mem.dirty = 0; + } + + if(len_written) { + // Adjust the len_written that we're returning for they type + len_written--; + + // Interrupt the SDMA to signal that there is data to process + MXC_SDMA->int_in_ctrl = 0x1; + } + + // Unlock the SDMA_SEMA + if(!sema_val) { + MXC_SEMA->semaphores[SDMA_SEMA] = 0x0; + } + + __enable_irq(); + + return len_written; +} + +/******************************************************************************/ +void SDMA0_IRQHandler(void) +{ + uint32_t sema_val = 1; + + while(sema_val) { + // Attempt to lock the ARM_SEMA + // Reading the register does an atomic test and set, returns previous value + sema_val = MXC_SEMA->semaphores[ARM_SEMA]; + } + + // Clear the SDMA interrupt + MXC_SDMA->irq_flag = 0x1; + + if(!arm_shared_mem.dirty) { + hciTrSerialRxIncoming((uint8_t*)arm_shared_mem.data, arm_shared_mem.len); + arm_shared_mem.dirty = 1; + } + + // Unlock the ARM_SEMA + MXC_SEMA->semaphores[ARM_SEMA] = 0x0; +} diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.h b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.h new file mode 100644 index 0000000000000000000000000000000000000000..3e3a77c8acbe75cbeb5620617938ab1715b9a0a6 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_drv_sdma.h @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-20 14:32:57 -0500 (Thu, 20 Jun 2019) $ + * $Revision: 44107 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief HCI Interface for the SDMA. + */ +/*************************************************************************************************/ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \fn hciDrvInit + * + * \brief Initialize the HCI interface. + * + * \return None. + */ +/*************************************************************************************************/ +void hciDrvInit(void); diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_tr.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_tr.c new file mode 100644 index 0000000000000000000000000000000000000000..9bdce2df1a2b5696a28983d28db91f003de93986 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_tr.c @@ -0,0 +1,261 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wsf_types.h" +#include "wsf_msg.h" +#include "wsf_trace.h" +#include "wsf_assert.h" +#include "util/bstream.h" +#include "hci_api.h" +#include "hci_core.h" +#include "hci_drv.h" + + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +#define HCI_HDR_LEN_MAX HCI_ACL_HDR_LEN + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +typedef enum +{ + HCI_RX_STATE_IDLE, + HCI_RX_STATE_HEADER, + HCI_RX_STATE_DATA, + HCI_RX_STATE_COMPLETE +} hciRxState_t; + +/*************************************************************************************************/ +/*! + * \fn hciTrSendAclData + * + * \brief Send a complete HCI ACL packet to the transport. + * + * \param pContext Connection context. + * \param pData WSF msg buffer containing an ACL packet. + * + * \return None. + */ +/*************************************************************************************************/ +void hciTrSendAclData(void *pContext, uint8_t *pData) +{ + uint16_t len; + + /* get 16-bit length */ + BYTES_TO_UINT16(len, &pData[2]); + len += HCI_ACL_HDR_LEN; + + /* dump event for protocol analysis */ + HCI_PDUMP_TX_ACL(len, pData); + + /* transmit ACL header and data */ + if (hciDrvWrite(HCI_ACL_TYPE, len, pData) == len) + { + /* free buffer */ + hciCoreTxAclComplete(pContext, pData); + } +} + + +/*************************************************************************************************/ +/*! + * \fn hciTrSendCmd + * + * \brief Send a complete HCI command to the transport. + * + * \param pData WSF msg buffer containing an HCI command. + * + * \return None. + */ +/*************************************************************************************************/ +void hciTrSendCmd(uint8_t *pData) +{ + uint16_t len; + + /* get length */ + len = pData[2] + HCI_CMD_HDR_LEN; + + /* dump event for protocol analysis */ + HCI_PDUMP_CMD(len, pData); + + /* transmit ACL header and data */ + if (hciDrvWrite(HCI_CMD_TYPE, len, pData) == len) + { + /* free buffer */ + WsfMsgFree(pData); + } +} + + +/*************************************************************************************************/ +/*! + * \fn hciSerialRxIncoming + * + * \brief Receive function. Gets called by external code when bytes are received. + * + * \param pBuf Pointer to buffer of incoming bytes. + * \param len Number of bytes in incoming buffer. + * + * \return None. + */ +/*************************************************************************************************/ +void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len) +{ + static uint8_t stateRx = HCI_RX_STATE_IDLE; + static uint8_t pktIndRx; + static uint16_t iRx; + static uint8_t hdrRx[HCI_HDR_LEN_MAX]; + static uint8_t *pPktRx; + static uint8_t *pDataRx; + + uint8_t dataByte; + + /* loop until all bytes of incoming buffer are handled */ + while (len--) + { + /* read single byte from incoming buffer and advance to next byte */ + dataByte = *pBuf++; + + /* --- Idle State --- */ + if (stateRx == HCI_RX_STATE_IDLE) + { + /* save the packet type */ + pktIndRx = dataByte; + iRx = 0; + stateRx = HCI_RX_STATE_HEADER; + } + + /* --- Header State --- */ + else if (stateRx == HCI_RX_STATE_HEADER) + { + uint8_t hdrLen = 0; + uint16_t dataLen = 0; + + /* copy current byte into the temp header buffer */ + hdrRx[iRx++] = dataByte; + + /* determine header length based on packet type */ + switch (pktIndRx) + { + case HCI_CMD_TYPE: + hdrLen = HCI_CMD_HDR_LEN; + break; + case HCI_ACL_TYPE: + hdrLen = HCI_ACL_HDR_LEN; + break; + case HCI_EVT_TYPE: + hdrLen = HCI_EVT_HDR_LEN; + break; + default: + /* invalid packet type */ + WSF_ASSERT(0); + break; + } + + /* see if entire header has been read */ + if (iRx == hdrLen) + { + /* extract data length from header */ + switch (pktIndRx) + { + case HCI_CMD_TYPE: + dataLen = hdrRx[2]; + break; + case HCI_ACL_TYPE: + BYTES_TO_UINT16(dataLen, &hdrRx[2]); + break; + case HCI_EVT_TYPE: + dataLen = hdrRx[1]; + break; + default: + break; + } + + /* allocate data buffer to hold entire packet */ + if (pktIndRx == HCI_ACL_TYPE) + { + pPktRx = (uint8_t*)WsfMsgDataAlloc(hdrLen + dataLen, 0); + } + else + { + pPktRx = (uint8_t*)WsfMsgAlloc(hdrLen + dataLen); + } + + if (pPktRx != NULL) + { + pDataRx = pPktRx; + + /* copy header into data packet (note: memcpy is not so portable) */ + { + uint8_t i; + for (i = 0; i < hdrLen; i++) + { + *pDataRx++ = hdrRx[i]; + } + } + + /* save number of bytes left to read */ + iRx = dataLen; + if (iRx == 0) + { + stateRx = HCI_RX_STATE_COMPLETE; + } + else + { + stateRx = HCI_RX_STATE_DATA; + } + } + else + { + WSF_ASSERT(0); /* allocate falied */ + } + + } + } + + /* --- Data State --- */ + else if (stateRx == HCI_RX_STATE_DATA) + { + /* write incoming byte to allocated buffer */ + *pDataRx++ = dataByte; + + /* determine if entire packet has been read */ + iRx--; + if (iRx == 0) + { + stateRx = HCI_RX_STATE_COMPLETE; + } + } + + /* --- Complete State --- */ + /* ( Note Well! There is no else-if construct by design. ) */ + if (stateRx == HCI_RX_STATE_COMPLETE) + { + /* deliver data */ + if (pPktRx != NULL) + { + hciCoreRecv(pktIndRx, pPktRx); + } + + /* reset state machine */ + stateRx = HCI_RX_STATE_IDLE; + } + } +} diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.c new file mode 100644 index 0000000000000000000000000000000000000000..cd2fe7f084d2e2fd5551aafd01e8b6f70be7b9de --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.c @@ -0,0 +1,471 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <string.h> +#include "hci_defs.h" +#include "hci_api.h" +#include "wsf_os.h" +#include "wsf_trace.h" +#include "hci_main.h" +#include "hci_core.h" +#include "hci_vs.h" +#include "bb_ble_api.h" +#include "bstream.h" +#include "hci_drv_sdma.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ +/* Cordio vendor specific OCF range is 0x3E0-0x3FF. */ +// #define HCI_OPCODE_VS_SET_SCAN_CH_MAP HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E0) /*!< Set Scan Channel Map opcode. */ +// #define HCI_OPCODE_VS_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E1) /*!< Set Vendor Specific Event Mask opcode. */ +// #define HCI_OPCODE_VS_SET_RSRC_MGR_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E2) /*!< DEPRECATED. */ +// #define HCI_OPCODE_VS_ENA_ACL_SINK HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E3) /*!< Enable ACL Packet Sink opcode. */ +// #define HCI_OPCODE_VS_GENERATE_ACL HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E4) /*!< Generate ACL Packets opcode. */ +// #define HCI_OPCODE_VS_ENA_AUTO_GEN_ACL HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E5) /*!< Enable Auto Generate ACL Packets opcode. */ +// #define HCI_OPCODE_VS_SET_TX_TEST_ERR_PATT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E6) /*!< Set Tx Test Error Pattern opcode. */ +// #define HCI_OPCODE_VS_SET_CONN_OP_FLAGS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E7) /*!< Set Connection Operational Flags opcode. */ +// #define HCI_OPCODE_VS_SET_P256_PRIV_KEY HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E8) /*!< Set P-256 Private Key opcode. */ +// #define HCI_OPCODE_VS_GET_ACL_TEST_REPORT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E9) /*!< Get ACL Test Report opcode. */ +// #define HCI_OPCODE_VS_SET_LOCAL_MIN_USED_CHAN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3EA) /*!< Set local minimum number of used channels. */ +// #define HCI_OPCODE_VS_GET_PEER_MIN_USED_CHAN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3EB) /*!< Get peer minimum number of used channels. */ +#define HCI_OPCODE_VS_SET_BD_ADDR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F0) /*!< Set BD address opcode. */ +// #define HCI_OPCODE_VS_GET_RAND_ADDR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F1) /*!< Get Random Address opcode. */ +#define HCI_OPCODE_VS_SET_LOCAL_FEAT HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F2) /*!< Set Local Feature opcode. */ +// #define HCI_OPCODE_VS_SET_OP_FLAGS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F3) /*!< Set Operational Flags opcode. */ +// #define HCI_OPCODE_VS_SET_ADV_TX_PWR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F5) /*!< Set Advertising Tx Power opcode. */ +#define HCI_OPCODE_VS_SET_CONN_TX_PWR HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F6) /*!< Set Connection Tx Power opcode. */ +// #define HCI_OPCODE_VS_SET_ENC_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F7) /*!< Set Encryption Mode opcode. */ +// #define HCI_OPCODE_VS_SET_CHAN_MAP HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F8) /*!< Set Channel Map opcode. */ + +// #define HCI_OPCODE_VS_SET_DIAG_MODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F9) /*!< Set Diagnostic Mode opcode. */ + +// #define HCI_OPCODE_VS_GET_PDU_FILT_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F4) /*!< Get PDU Filter Statistics opcode. */ +// #define HCI_OPCODE_VS_GET_SYS_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FA) /*!< Get Memory Statistics opcode. */ +#define HCI_OPCODE_VS_GET_ADV_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FB) /*!< Get Advertising Statistics opcode. */ +#define HCI_OPCODE_VS_GET_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FC) /*!< Get Scan Statistics opcode. */ +#define HCI_OPCODE_VS_GET_CONN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FD) /*!< Get Connection Statistics opcode. */ +#define HCI_OPCODE_VS_GET_TEST_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FE) /*!< Get Test Statistics opcode. */ +// #define HCI_OPCODE_VS_GET_POOL_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FF) /*!< Get Pool Statistics opcode. */ + +// #define HCI_OPCODE_VS_SET_AUX_DELAY HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D0) /*!< Set Additional AuxPtr offset. */ +// #define HCI_OPCODE_VS_SET_EXT_ADV_FRAG_LEN HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D1) /*!< Set extended advertising data fragmentation length. */ +// #define HCI_OPCODE_VS_SET_EXT_ADV_PHY_OPTS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D2) /*!< Set extended advertising PHY options. */ +// #define HCI_OPCODE_VS_SET_EXT_ADV_DEF_PHY_OPTS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3D3) /*!< Set extended advertising default PHY options. */ + +// #define HCI_OPCODE_VS_GET_AUX_ADV_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DA) /*!< Get Auxiliary Advertising Statistics opcode. */ +// #define HCI_OPCODE_VS_GET_AUX_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DB) /*!< Get Auxiliary Scanning Statistics opcode. */ +// #define HCI_OPCODE_VS_GET_PER_SCAN_STATS HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DC) /*!< Get Periodic Scanning Statistics opcode. */ + +#define HCI_OPCODE_VS_SET_DEF_TX_POWER HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DD) /*!< Set default transmit power. */ +#define HCI_OPCODE_VS_CALIBRATE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DE) /*!< Run AFE calibration. */ + +/*************************************************************************************************/ +/*! + * \fn hciCoreResetStart + * + * \brief Start the HCI reset sequence. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreResetStart(void) +{ + +#ifdef ENABLE_SDMA + hciDrvInit(); +#endif + + /* Reset the controller to start the sequence */ + HciResetCmd(); +} + +/*************************************************************************************************/ +/*! + * \fn hciCoreResetSequence + * + * \brief Implement the HCI reset sequence. + * + * \param pMsg HCI event message from previous command in the sequence. + * + * \return None. + */ +/*************************************************************************************************/ +void hciCoreResetSequence(uint8_t *pMsg) +{ + uint16_t opcode; + wsfMsgHdr_t hdr; + static uint8_t randCnt; + + /* if event is a command complete event */ + if (*pMsg == HCI_CMD_CMPL_EVT) + { + /* parse parameters */ + pMsg += HCI_EVT_HDR_LEN; + pMsg++; /* skip num packets */ + BSTREAM_TO_UINT16(opcode, pMsg); + pMsg++; /* skip status */ + + /* decode opcode */ + switch (opcode) + { + case HCI_OPCODE_RESET: + /* initialize rand command count */ + randCnt = 0; + + /* send next command in sequence */ + HciSetEventMaskCmd((uint8_t *) hciEventMask); + break; + + case HCI_OPCODE_SET_EVENT_MASK: + /* send next command in sequence */ + HciSetEventMaskPage2Cmd((uint8_t *)hciEventMaskPage2); + break; + + case HCI_OPCODE_SET_EVENT_MASK_PAGE2: + /* send next command in sequence */ + HciLeSetEventMaskCmd((uint8_t*)hciLeEventMask); + break; + + case HCI_OPCODE_LE_SET_EVENT_MASK: + /* send next command in sequence */ + HciReadBdAddrCmd(); + break; + + case HCI_OPCODE_READ_BD_ADDR: + /* parse and store event parameters */ + BdaCpy(hciCoreCb.bdAddr, pMsg); + + /* send next command in sequence */ + HciLeReadBufSizeCmd(); + break; + + case HCI_OPCODE_LE_READ_BUF_SIZE: + /* parse and store event parameters */ + BSTREAM_TO_UINT16(hciCoreCb.bufSize, pMsg); + BSTREAM_TO_UINT8(hciCoreCb.numBufs, pMsg); + + /* initialize ACL buffer accounting */ + hciCoreCb.availBufs = hciCoreCb.numBufs; + + /* send next command in sequence */ + HciLeReadSupStatesCmd(); + break; + + case HCI_OPCODE_LE_READ_SUP_STATES: + /* parse and store event parameters */ + memcpy(hciCoreCb.leStates, pMsg, HCI_LE_STATES_LEN); + + /* send next command in sequence */ + HciLeReadWhiteListSizeCmd(); + break; + + case HCI_OPCODE_LE_READ_WHITE_LIST_SIZE: + /* parse and store event parameters */ + BSTREAM_TO_UINT8(hciCoreCb.whiteListSize, pMsg); + + /* send next command in sequence */ + HciLeRandCmd(); + break; + + case HCI_OPCODE_LE_RAND: + /* check if need to send second rand command */ + if (randCnt == 0) + { + randCnt++; + HciLeRandCmd(); + } + else + { + /* last command in sequence; set resetting state and call callback */ + hciCb.resetting = FALSE; + hdr.param = 1; + hdr.event = HCI_RESET_SEQ_CMPL_CBACK_EVT; + (*hciCb.evtCback)((hciEvt_t *) &hdr); + } + break; + + default: + break; + } + } + /* else if vendor specific event */ + else if (*pMsg == HCI_VENDOR_SPEC_EVT) + { + } +} + +/*************************************************************************************************/ +/*! + * \fn hciCoreVsCmdCmplRcvd + * + * \brief Perform internal HCI processing of vendor specific command complete events. + * + * \param opcode HCI command opcode. + * \param pMsg Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return HCI callback event code or zero. + */ +/*************************************************************************************************/ +uint8_t hciCoreVsCmdCmplRcvd(uint16_t opcode, uint8_t *pMsg, uint8_t len) +{ + switch (opcode) { + case HCI_OPCODE_VS_GET_ADV_STATS: + { +#if WSF_TRACE_ENABLED + uint8_t status; + BbBleAdvPktStats_t stats; + + BSTREAM_TO_UINT8(status, pMsg); + if(status != HCI_SUCCESS) { + HCI_TRACE_ERR0("Error with HCI_OPCODE_VS_GET_ADV_STATS"); + break; + } + + BSTREAM_TO_UINT32(stats.txAdv, pMsg); + BSTREAM_TO_UINT32(stats.rxReq, pMsg); + BSTREAM_TO_UINT32(stats.rxReqCrc, pMsg); + BSTREAM_TO_UINT32(stats.rxReqTimeout, pMsg); + BSTREAM_TO_UINT32(stats.txRsp, pMsg); + BSTREAM_TO_UINT32(stats.errAdv, pMsg); + BSTREAM_TO_UINT16(stats.rxSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.txSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.rxIsrUsec, pMsg); + BSTREAM_TO_UINT16(stats.txIsrUsec, pMsg); + + HCI_TRACE_INFO0("Advertising stats:"); + HCI_TRACE_INFO3("txAdv = 0x%04x rxReq = 0x%04x rxReqCrc = 0x%04x", stats.txAdv, stats.rxReq, stats.rxReqCrc); + HCI_TRACE_INFO3("rxReqTimeout = 0x%04x txRsp = 0x%04x errAdv = 0x%04x", stats.rxReqTimeout, stats.txRsp, stats.errAdv); + HCI_TRACE_INFO2("rxSetupUsec = 0x%04x txSetupUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); + HCI_TRACE_INFO2("rxIsrUsec = 0x%04x txIsrUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); +#endif + break; + } + + case HCI_OPCODE_VS_GET_SCAN_STATS: + { +#if WSF_TRACE_ENABLED + uint8_t status; + BbBleScanPktStats_t stats; + + BSTREAM_TO_UINT8(status, pMsg); + if(status != HCI_SUCCESS) { + HCI_TRACE_ERR0("Error with HCI_OPCODE_VS_GET_SCAN_STATS"); + break; + } + + BSTREAM_TO_UINT32(stats.rxAdv, pMsg); + BSTREAM_TO_UINT32(stats.rxAdvCrc, pMsg); + BSTREAM_TO_UINT32(stats.rxAdvTimeout, pMsg); + BSTREAM_TO_UINT32(stats.txReq, pMsg); + BSTREAM_TO_UINT32(stats.rxRsp, pMsg); + BSTREAM_TO_UINT32(stats.rxRspCrc, pMsg); + BSTREAM_TO_UINT32(stats.rxRspTimeout, pMsg); + BSTREAM_TO_UINT32(stats.errScan, pMsg); + BSTREAM_TO_UINT16(stats.rxSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.txSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.rxIsrUsec, pMsg); + BSTREAM_TO_UINT16(stats.txIsrUsec, pMsg); + + HCI_TRACE_INFO0("Scanning stats:"); + HCI_TRACE_INFO3("rxAdv = 0x%04x rxAdvCrc = 0x%04x rxAdvTimeout = 0x%04x", stats.rxAdv, stats.rxAdvCrc, stats.rxAdvTimeout); + HCI_TRACE_INFO3("txReq = 0x%04x rxRsp = 0x%04x rxRspCrc = 0x%04x", stats.txReq, stats.rxRsp, stats.rxRspCrc); + HCI_TRACE_INFO2("rxRspTimeout = 0x%04x errScan = 0x%04x", stats.rxRspTimeout, stats.errScan); + HCI_TRACE_INFO2("rxSetupUsec = 0x%04x txSetupUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); + HCI_TRACE_INFO2("rxIsrUsec = 0x%04x txIsrUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); +#endif + break; + } + + case HCI_OPCODE_VS_GET_CONN_STATS: + { +#if WSF_TRACE_ENABLED + uint8_t status; + BbBleDataPktStats_t stats; + + BSTREAM_TO_UINT8(status, pMsg); + if(status != HCI_SUCCESS) { + HCI_TRACE_ERR0("Error with HCI_OPCODE_VS_GET_CONN_STATS"); + break; + } + + BSTREAM_TO_UINT32(stats.rxData, pMsg); + BSTREAM_TO_UINT32(stats.rxDataCrc, pMsg); + BSTREAM_TO_UINT32(stats.rxDataTimeout, pMsg); + BSTREAM_TO_UINT32(stats.txData, pMsg); + BSTREAM_TO_UINT32(stats.errData, pMsg); + BSTREAM_TO_UINT16(stats.rxSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.txSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.rxIsrUsec, pMsg); + BSTREAM_TO_UINT16(stats.txIsrUsec, pMsg); + + HCI_TRACE_INFO0("Connection stats:"); + HCI_TRACE_INFO3("rxData = 0x%04x rxDataCrc = 0x%04x rxDataTimeout = 0x%04x", stats.rxData, stats.rxDataCrc, stats.rxDataTimeout); + HCI_TRACE_INFO2("txData = 0x%04x drrData = 0x%04x ", stats.txData, stats.errData); + HCI_TRACE_INFO2("rxSetupUsec = 0x%04x txSetupUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); + HCI_TRACE_INFO2("rxIsrUsec = 0x%04x txIsrUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); +#endif + break; + } + + case HCI_OPCODE_VS_GET_TEST_STATS: + { +#if WSF_TRACE_ENABLED + uint8_t status; + BbBleDataPktStats_t stats; + + BSTREAM_TO_UINT8(status, pMsg); + if(status != HCI_SUCCESS) { + HCI_TRACE_ERR0("Error with HCI_OPCODE_VS_GET_TEST_STATS"); + break; + } + + BSTREAM_TO_UINT32(stats.rxData, pMsg); + BSTREAM_TO_UINT32(stats.rxDataCrc, pMsg); + BSTREAM_TO_UINT32(stats.rxDataTimeout, pMsg); + BSTREAM_TO_UINT32(stats.txData, pMsg); + BSTREAM_TO_UINT32(stats.errData, pMsg); + BSTREAM_TO_UINT16(stats.rxSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.txSetupUsec, pMsg); + BSTREAM_TO_UINT16(stats.rxIsrUsec, pMsg); + BSTREAM_TO_UINT16(stats.txIsrUsec, pMsg); + + HCI_TRACE_INFO0("Test stats:"); + HCI_TRACE_INFO3("rxData = 0x%04x rxDataCrc = 0x%04x rxDataTimeout = 0x%04x", stats.rxData, stats.rxDataCrc, stats.rxDataTimeout); + HCI_TRACE_INFO2("txData = 0x%04x drrData = 0x%04x ", stats.txData, stats.errData); + HCI_TRACE_INFO2("rxSetupUsec = 0x%04x txSetupUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); + HCI_TRACE_INFO2("rxIsrUsec = 0x%04x txIsrUsec = 0x%04x", stats.rxSetupUsec, stats.txSetupUsec); +#endif + break; + } + + default: + break; + } + return HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT; +} + +/*************************************************************************************************/ +/*! + * \fn hciCoreVsEvtRcvd + * + * \brief Perform internal HCI processing of vendor specific HCI events. + * + * \param p Pointer to input HCI event parameter byte stream. + * \param len Parameter byte stream length. + * + * \return HCI callback event code or zero. + */ +/*************************************************************************************************/ +uint8_t hciCoreVsEvtRcvd(uint8_t *p, uint8_t len) +{ + return HCI_VENDOR_SPEC_EVT; +} + +/*************************************************************************************************/ +/*! + * \fn hciCoreHwErrorRcvd + * + * \brief Perform internal HCI processing of hardware error event. + * + * \param p Pointer to input HCI event parameter byte stream. + * + * \return HCI callback event code or zero. + */ +/*************************************************************************************************/ +uint8_t hciCoreHwErrorRcvd(uint8_t *p) +{ + return 0; +} + +/*************************************************************************************************/ +/*! + * \fn HciVsInit + * + * \brief Vendor-specific controller initialization function. + * + * \param param Vendor-specific parameter. + * + * \return None + */ +/*************************************************************************************************/ +void HciVsInit(uint8_t param) +{ + // TODO: maxAdvDataLen should be increased and set inside of reset sequence. + hciCoreCb.maxAdvDataLen = HCI_EXT_ADV_DATA_LEN; + hciCoreCb.extResetSeq = NULL; +} + +/*************************************************************************************************/ +void HciVsSetBdAddr(uint8_t *pAddr) +{ + BdaCpy(hciCoreCb.bdAddr, pAddr); + HciVendorSpecificCmd(HCI_OPCODE_VS_SET_BD_ADDR, sizeof(bdAddr_t), pAddr); +} + +/*************************************************************************************************/ +void HciVsSetDefaultTxPower(int8_t power) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_SET_DEF_TX_POWER, sizeof(int8_t), (uint8_t*)&power); +} + +/*************************************************************************************************/ +void HciVsCalibrate(void) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_CALIBRATE, 0, NULL); +} + +/*************************************************************************************************/ +void HciVsSetLocalFeatures(uint8_t *pFeatures) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_SET_LOCAL_FEAT, HCI_FEAT_LEN, pFeatures); +} + +/*************************************************************************************************/ +void HciVsSetConnTxPower(uint16_t handle, int8_t power) +{ + uint8_t params[3]; + + memcpy(¶ms[0], &handle, sizeof(uint16_t)); + params[2] = (uint8_t)power; + + HciVendorSpecificCmd(HCI_OPCODE_VS_SET_CONN_TX_PWR, 3, params); +} + +/*************************************************************************************************/ +void HciVsGetAdvStats(void) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_GET_ADV_STATS, 0, NULL); +} + +/*************************************************************************************************/ +void HciVsGetScanStats(void) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_GET_SCAN_STATS, 0, NULL); +} + +/*************************************************************************************************/ +void HciVsGetConnStats(void) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_GET_CONN_STATS, 0, NULL); +} + +/*************************************************************************************************/ +void HciVsGetTestStats(void) +{ + HciVendorSpecificCmd(HCI_OPCODE_VS_GET_TEST_STATS, 0, NULL); +} diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.h b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.h new file mode 100644 index 0000000000000000000000000000000000000000..7ac1d39875a75ba760f4416407f9dc40673ed9f8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/hci_vs.h @@ -0,0 +1,161 @@ +/******************************************************************************* + * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2019-06-19 10:12:00 -0500 (Wed, 19 Jun 2019) $ + * $Revision: 44073 $ + * + ******************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Vendor specific HCI Interface. + */ +/*************************************************************************************************/ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \fn HciVsSetAddr + * + * \brief Vendor-specific HCI command to set Bluetooth device address to be used by LL. + * + * \param pAddr Bluetooth device address. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsSetBdAddr(uint8_t *pAddr); + +/*************************************************************************************************/ +/*! + * \fn HciVsSetDefaultTxPower + * + * \brief Vendor-specific HCI command to defautlt transmit power. + * + * \param power Default power setting. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsSetDefaultTxPower(int8_t power); + +/*************************************************************************************************/ +/*! + * \fn HciVsCalibrate + * + * \brief Vendor-specific HCI command to re-calibrate the BLE AFE. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsCalibrate(void); + +/*************************************************************************************************/ +/*! + * \fn HciVsSetLocalFeatures + * + * \brief Vendor-specific HCI command to set controller features. + * + * \param pFeatures Supported features bitmask. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsSetLocalFeatures(uint8_t *pFeatures); + +/*************************************************************************************************/ +/*! + * \fn HciVsSetConnTx Power + * + * \brief Vendor-specific HCI command to the TX power for a specified connection. + * + * \param handle Connection handle. + * \param power Desired power setting. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsSetConnTxPower(uint16_t handle, int8_t power); + +/*************************************************************************************************/ +/*! + * \fn HciVsGetAdvStats + * + * \brief Vendor-specific HCI command to get the advertising statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsGetAdvStats(void); + +/*************************************************************************************************/ +/*! + * \fn HciVsGetScanStats + * + * \brief Vendor-specific HCI command to get the scanning statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsGetScanStats(void); + +/*************************************************************************************************/ +/*! + * \fn HciVsGetConnStats + * + * \brief Vendor-specific HCI command to get the connection statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsGetConnStats(void); + +/*************************************************************************************************/ +/*! + * \fn HciVsGetTestStats + * + * \brief Vendor-specific HCI command to get the test statistics. + * + * \return None. + */ +/*************************************************************************************************/ +void HciVsGetTestStats(void); diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/ipc_defs.h b/lib/sdk/Libraries/BTLE/stack/platform/max32665/ipc_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..ee1dc534c4b3a83785a8aac11e6f4250b392d64f --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/ipc_defs.h @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Id: ipc_defs.h 44107 2019-06-20 19:32:57Z kevin.gillespie $ + * + ******************************************************************************* + */ + +#define ARM_SEMA 0 +#define SDMA_SEMA 1 + +// Memory sizes and locations allocated in the linker file +// 3 bytes for dirty and length +#define SHARED_MEM_LEN 0x200 +#define SHARED_MEM_DATA_LEN (SHARED_MEM_LEN-3) + +#ifdef __CROSSWORKS +typedef __packed struct { +#else +typedef struct __attribute__((packed)) { +#endif + volatile uint8_t dirty; + volatile uint16_t len; + volatile uint8_t data[SHARED_MEM_DATA_LEN]; +} shared_mem_t; + +// Shared addr defined in Makefile + +#ifdef __CROSSWORKS +#define ARM_SHARED_MEM_BASE ((uint32_t)SHARED_ADDR) +#define ARM_SHARED_MEM ((shared_mem_t*)ARM_SHARED_MEM_BASE) + +#define SDMA_SHARED_MEM_BASE ((uint32_t)(SHARED_ADDR+SHARED_MEM_LEN)) +#define SDMA_SHARED_MEM ((shared_mem_t*)SDMA_SHARED_MEM_BASE) +#endif diff --git a/lib/sdk/Libraries/BTLE/stack/platform/max32665/sdma.inc b/lib/sdk/Libraries/BTLE/stack/platform/max32665/sdma.inc new file mode 100644 index 0000000000000000000000000000000000000000..f9f092f1af29dfee97e7e96e8c7f3ebe623d9228 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/sdma.inc @@ -0,0 +1,11497 @@ +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x28,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x75,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x79,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x71,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x7E,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x90,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xA2,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xB4,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xC6,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xD8,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xEA,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0xFC,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8D,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x20,0x0B,0x04,0x0B,0x04,0x0B,0x40,0x1D,0x07,0xD8,0x20,0x0B,0x02,0x0B,0xA4,0x0B, +0xF4,0x3F,0x2D,0x0B,0xD8,0x6D,0x01,0x7D,0x00,0x1F,0xFE,0x4D,0xFD,0x5D,0x07,0x08, +0x88,0xF9,0x02,0x0B,0x00,0x2A,0x00,0x2B,0x79,0x88,0x00,0x18,0x00,0x30,0x01,0x0B, +0x77,0x00,0x04,0x0B,0x06,0x20,0x10,0x0B,0x00,0x0B,0x02,0x6B,0x28,0x01,0x00,0x6B, +0x04,0x11,0x00,0x6B,0x00,0x21,0x87,0xD8,0x10,0x0B,0x00,0x0B,0x04,0x0B,0x81,0x0C, +0x79,0x8D,0x40,0x0B,0x04,0x0B,0x20,0x0B,0x08,0x3F,0x9F,0xF9,0x40,0x1A,0xF9,0x1C, +0x40,0x0B,0x04,0x0B,0x20,0x0B,0x1C,0x3F,0x0D,0x8F,0x0D,0x8C,0x0F,0x8A,0x0D,0x8C, +0x8F,0x8A,0x0D,0x8C,0x9F,0x8A,0x0D,0x8C,0x18,0x8D,0x07,0x18,0x6F,0x8A,0x00,0x18, +0x6F,0x8A,0x0D,0x98,0x0D,0x8C,0x07,0xD8,0x0D,0x8C,0x87,0xD8,0x0D,0x8C,0x01,0x60, +0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x4B,0x0B,0xF2,0x0C,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x3E,0x0C,0x77,0xA0,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x07,0x0C,0x0A,0x8D,0x18,0x8D, +0x08,0x8D,0x00,0x1B,0xD1,0x8A,0xFF,0x0B,0xFE,0x0B,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,0x4A,0xCA,0x79,0xB7,0x04,0x6C,0x10,0x0B, +0x01,0x0B,0x3D,0x0B,0x4A,0x3D,0x39,0xF9,0x4A,0xCA,0x79,0xC7,0x04,0x6C,0x10,0x0B, +0x01,0x0B,0x3D,0x0B,0x69,0x3D,0x39,0xF9,0x4A,0xCA,0x79,0xD7,0x04,0x6C,0x10,0x0B, +0x01,0x0B,0x3D,0x0B,0xD5,0x3D,0x39,0xF9,0x4A,0xCA,0x79,0xF7,0x04,0x6C,0x10,0x0B, +0x01,0x0B,0x3D,0x0B,0xB6,0x3D,0x10,0x0B,0x00,0x0B,0x03,0x0B,0x6D,0x3D,0x0D,0xB9, +0x0D,0x8C,0x8C,0x3D,0x10,0x0B,0x00,0x0B,0x05,0x0B,0x25,0x3D,0x10,0x0B,0x00,0x0B, +0x03,0x0B,0x6F,0x3D,0x05,0x0C,0xAC,0x3D,0x10,0x0B,0x00,0x0B,0x0B,0x0B,0x18,0x3D, +0xFA,0x0C,0x0D,0x8C,0x20,0x0B,0x00,0x0B,0x02,0x0B,0x43,0x79,0x00,0x69,0x02,0x0B, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x20,0x0B,0x00,0x0B,0x02,0x0B, +0x40,0x3F,0x01,0x1F,0x20,0x0B,0x00,0x0B,0x02,0x0B,0x41,0x3F,0x00,0x1F,0x00,0x1F, +0x40,0x0B,0x03,0x0B,0x60,0x0B,0xA8,0x3F,0x01,0x6F,0x0D,0x8C,0x00,0x0D,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x69,0x89,0x59,0x99,0x00,0x2B,0x49,0xF9, +0x00,0x39,0x09,0xF9,0xFF,0x1A,0x02,0x78,0x02,0x3C,0x02,0x79,0x01,0x0C,0x04,0x79, +0x07,0x08,0xFF,0x1A,0x1D,0xE9,0x14,0x4A,0x69,0xBF,0x79,0x9F,0x01,0x08,0x01,0x4A, +0x4A,0xCA,0x10,0x0B,0x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4D,0x03,0x08,0x59,0xAA,0x04,0x08, +0x69,0xAA,0x79,0x8E,0x06,0x3E,0x1E,0xE9,0x69,0xD9,0x59,0xE9,0x8A,0xCA,0x7A,0xCA, +0x8A,0xCA,0x7A,0xCA,0x30,0x6D,0x05,0x08,0x2A,0x8A,0x06,0x08,0x5A,0x8A,0xFB,0x4D, +0x05,0x08,0x39,0xAA,0x06,0x08,0x49,0xAA,0x79,0x8E,0x07,0x3E,0x1E,0xC9,0x49,0xB9, +0x39,0xC9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x38,0x6D,0x03,0x08,0x2A,0x8A, +0x04,0x08,0x5A,0x8A,0xFB,0x4D,0x03,0x08,0x59,0xAA,0x04,0x08,0x69,0xAA,0x49,0xF9, +0x39,0xE9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x59,0xB9,0x69,0xC9,0x03,0x08,0xFF,0x1A, +0x79,0xBF,0x39,0x9F,0x59,0xB9,0x69,0xC9,0x08,0x6D,0x04,0x08,0xAA,0x8A,0x03,0x08, +0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x79,0x8E,0x01,0x3E,0x39,0x9E,0x59,0xB9,0x69,0xC9, +0x10,0x6D,0x04,0x08,0xAA,0x8A,0x03,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x79,0x8E, +0x02,0x3E,0x39,0x9E,0x59,0xB9,0x69,0xC9,0x18,0x6D,0x04,0x08,0xAA,0x8A,0x03,0x08, +0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x79,0x8E,0x03,0x3E,0x39,0x9E,0x59,0xB9,0x69,0xC9, +0x49,0xB9,0x00,0x49,0x03,0x08,0xFF,0x1A,0x79,0x8E,0x04,0x3E,0x39,0x9E,0x59,0xB9, +0x69,0xC9,0x28,0x6D,0x04,0x08,0xAA,0x8A,0x03,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A, +0x79,0x8E,0x05,0x3E,0x39,0x9E,0x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x00,0x0B,0x7F,0x0B,0x47,0x3D,0x79,0xA9,0x06,0x0C,0x01,0x08,0x1C,0x4A,0xFF,0x1A, +0x02,0x0C,0x00,0x79,0x08,0x0C,0xE9,0xF9,0x29,0xE9,0x19,0xD9,0x10,0x0B,0x00,0x0B, +0x0C,0x0B,0xBE,0x3D,0x01,0x79,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x79,0x99,0x00,0x29,0x00,0x39,0x19,0xBF,0x4F,0xF9,0x4A,0xCA,0xFF,0x0B, +0xFC,0x78,0x01,0x3C,0x04,0x0C,0x03,0x08,0x28,0x4A,0xFF,0x1A,0x02,0x0C,0x00,0x79, +0x08,0x0C,0x19,0xF9,0x29,0xE9,0x39,0xD9,0x10,0x0B,0x00,0x0B,0x0C,0x0B,0xBE,0x3D, +0x01,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0x99,0x69,0x89,0x00,0x29,0x00,0x39,0x19,0xBF,0x4F,0xF9,0x4A,0xCA, +0xFF,0x0B,0xF5,0x78,0x04,0x3C,0xFF,0x0B,0xFB,0x78,0x08,0x3C,0x0B,0x0C,0x09,0xBF, +0x1F,0xF9,0x10,0x0B,0x00,0x0B,0x7A,0x0B,0x50,0x3D,0x06,0x0C,0x03,0x08,0x20,0x4A, +0xFF,0x1A,0x02,0x0C,0x00,0x79,0x08,0x0C,0x19,0xF9,0x29,0xE9,0x39,0xD9,0x10,0x0B, +0x00,0x0B,0x0C,0x0B,0xBE,0x3D,0x01,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x00,0x79,0x0D,0x8C,0x00,0x79,0x0D,0x8C,0x39,0x8D,0x79,0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,0x7C,0x3F,0x39,0xEF,0x19,0xF9,0xFF,0x1A,0x0C,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x03,0x08,0x79,0xCA,0x09,0xF9,0x39,0xE9, +0x29,0xDA,0x07,0x08,0x69,0xDA,0x02,0x6C,0x00,0x79,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC6,0x0B,0x78,0x3F,0x19,0x9F,0x39,0xF9,0x29,0xDA,0x4A,0xCA,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x69,0xC9,0x20,0x0B,0x02,0x0B, +0xC6,0x0B,0x82,0x3F,0x00,0x1F,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x81,0x3F,0x00,0x1F, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x80,0x3F,0x00,0x1F,0x49,0xB9,0x03,0x1A,0x05,0x1C, +0x49,0xB9,0x00,0x2B,0x03,0x0A,0x04,0x4A,0x39,0xC9,0x20,0x0B,0x02,0x0B,0xC6,0x0B, +0x84,0x3F,0x49,0xEF,0x79,0xB9,0xFF,0x1A,0x3A,0x8A,0x2A,0x8A,0x04,0x08,0x39,0xCA, +0x59,0xB9,0x49,0xA9,0x69,0xDA,0x03,0x08,0x29,0xDA,0x02,0x6C,0x00,0x79,0x09,0x0C, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x81,0x3F,0x79,0x9F,0x49,0xB9,0x69,0xDA,0x4A,0xCA, +0x39,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0xFF,0x1A, +0x39,0xA9,0x29,0xB9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x30,0x6D,0x02,0x08, +0x2A,0x8A,0x03,0x08,0x5A,0x8A,0xFB,0x4D,0x05,0x08,0x29,0xAA,0x06,0x08,0x39,0xAA, +0x00,0x49,0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9,0x03,0x08,0x29,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA, +0xAF,0x2C,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B, +0xC6,0x0B,0x80,0x3F,0x01,0x1F,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x80,0x3F, +0x00,0x1F,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x80,0x3F,0x1F,0xF9,0x0D,0x8C, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x00,0x2B, +0x79,0xF9,0x00,0x2B,0x69,0xE9,0x59,0xA9,0x49,0xB9,0x0F,0x08,0x70,0x1C,0x29,0xBF, +0x1F,0xF9,0x3A,0x1C,0x39,0xBF,0x6F,0xE9,0x6F,0xF9,0x28,0x6D,0x07,0x08,0xAA,0x8A, +0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xC0,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08,0x40,0x78, +0x2B,0x7C,0x07,0x08,0x29,0x5C,0x39,0xBF,0x6F,0xE9,0x6F,0xF9,0x69,0x89,0x79,0x99, +0x0E,0x08,0x0B,0x1C,0x19,0xF9,0x09,0xE9,0x29,0xD9,0x39,0xC9,0x10,0x0B,0x00,0x0B, +0x21,0x0B,0x59,0x3D,0x01,0x79,0x4C,0x0C,0x16,0x0C,0x19,0xF9,0x09,0xE9,0x29,0xD9, +0x39,0xC9,0x10,0x0B,0x00,0x0B,0x20,0x0B,0x7B,0x3D,0x07,0x08,0x03,0x1C,0x01,0x79, +0x3F,0x0C,0x09,0x0C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x18,0x3F,0x8F,0xF9,0x01,0x4A, +0x79,0xDF,0x00,0x79,0x35,0x0C,0x33,0x0C,0x29,0xBF,0x1F,0xF9,0x39,0xBF,0x6F,0xD9, +0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x22,0x0B,0x2C,0x3D,0x07,0x08,0x00,0x78,0x07,0x3C, +0x01,0x78,0x05,0x3C,0x02,0x78,0x05,0x3C,0x03,0x78,0x03,0x3C,0x20,0x0C,0x01,0x79, +0x1F,0x0C,0x29,0xBF,0x1F,0xF9,0x39,0xBF,0x6F,0xD9,0x6F,0xE9,0x1D,0xC9,0x18,0x4A, +0x10,0x0B,0x00,0x0B,0x1F,0x0B,0xA3,0x3D,0x07,0x08,0x05,0x1C,0x1D,0xF9,0x18,0x4A, +0x79,0xBF,0x1F,0xF9,0x0A,0x5C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x12,0x3F,0x8F,0xF9, +0x01,0x4A,0x79,0xDF,0x02,0x79,0x04,0x0C,0x02,0x0C,0x01,0x79,0x01,0x0C,0x01,0x79, +0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x1D,0x8E, +0x06,0x3E,0x6E,0xB9,0x07,0x3E,0x6E,0x99,0x6E,0xA9,0x07,0x08,0x21,0x1C,0x01,0x08, +0x49,0xF8,0x0B,0x7C,0x02,0x08,0x59,0xF8,0x08,0x7C,0x69,0x89,0xFF,0x1A,0x00,0x2B, +0x39,0xF9,0xFF,0x1A,0x00,0x08,0xF9,0xF8,0x0A,0x3C,0x20,0x0B,0x02,0x0B,0x9B,0x0B, +0x02,0x3F,0x8F,0x89,0x01,0x4A,0x09,0xDF,0x02,0x79,0x0B,0x0C,0x09,0x0C,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x04,0x3F,0x8F,0x89,0x01,0x4A,0x09,0xDF,0x01,0x79,0x01,0x0C, +0x00,0x79,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x69,0x89,0x49,0xA9,0x59,0xB9, +0x01,0x08,0x30,0x1C,0x02,0x08,0x12,0x5C,0x03,0x08,0x10,0x5C,0x10,0x0B,0x00,0x0B, +0x18,0x0B,0xE2,0x3D,0x07,0x08,0x01,0x78,0x09,0x7C,0x20,0x0B,0x02,0x0B,0x9B,0x0B, +0x00,0x3F,0x8F,0xF9,0x01,0x4A,0x79,0xDF,0x01,0x79,0x1D,0x0C,0x09,0xF9,0x39,0xE9, +0x29,0xD9,0x10,0x0B,0x00,0x0B,0x17,0x0B,0xDC,0x3D,0x07,0x08,0x0A,0x5C,0x20,0x0B, +0x02,0x0B,0x9A,0x0B,0xFE,0x3F,0x8F,0xF9,0x01,0x4A,0x79,0xDF,0x02,0x79,0x0B,0x0C, +0x09,0x0C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x00,0x3F,0x8F,0xF9,0x01,0x4A,0x79,0xDF, +0x01,0x79,0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x99,0x69,0x89, +0x00,0x2B,0x59,0xF9,0x1D,0x8E,0x07,0x3E,0x6E,0xA9,0x6E,0xB9,0x05,0x3E,0x49,0xEE, +0x01,0x08,0x59,0x1C,0x0F,0x08,0x36,0x1C,0x39,0xF9,0x29,0xE9,0x28,0x6D,0x07,0x08, +0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xC0,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08, +0x40,0x78,0x28,0x7C,0x07,0x08,0x26,0x5C,0x00,0x08,0x0A,0x1C,0x39,0xF9,0x29,0xE9, +0x1D,0xD9,0x14,0x4A,0x1D,0xC9,0x24,0x4A,0x10,0x0B,0x00,0x0B,0x21,0x0B,0xE0,0x3D, +0x1D,0x8E,0x09,0x3E,0x6E,0xE9,0x6E,0xF9,0x79,0x8D,0x69,0x8D,0x39,0xF9,0x29,0xE9, +0x1D,0xD9,0x1C,0x4A,0x59,0xBF,0x1F,0xD9,0x10,0x0B,0x00,0x0B,0x21,0x0B,0x06,0x3D, +0x0D,0xA8,0x0D,0xA8,0x07,0x08,0x03,0x1C,0x01,0x79,0x26,0x0C,0x02,0x0C,0x00,0x79, +0x23,0x0C,0x21,0x0C,0x1D,0xF9,0x14,0x4A,0x79,0xBF,0x1F,0xF9,0x1D,0x8E,0x09,0x3E, +0x6E,0xD9,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x22,0x0B,0x56,0x3D,0x07,0x08,0x00,0x78, +0x07,0x3C,0x01,0x78,0x05,0x3C,0x02,0x78,0x05,0x3C,0x03,0x78,0x03,0x3C,0x0B,0x0C, +0x00,0x79,0x0A,0x0C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x14,0x3F,0x8F,0xF9,0x01,0x4A, +0x79,0xDF,0x02,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0x1D,0x8E,0x06,0x3E,0x6E,0xB9,0x07,0x3E,0x6E,0x99,0x6E,0xA9,0x07,0x08, +0x21,0x1C,0x01,0x08,0x49,0xF8,0x0B,0x7C,0x02,0x08,0x59,0xF8,0x08,0x7C,0x69,0x89, +0xFF,0x1A,0x00,0x2B,0x39,0xF9,0xFF,0x1A,0x00,0x08,0xF9,0xF8,0x0A,0x3C,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x06,0x3F,0x8F,0x89,0x01,0x4A,0x09,0xDF,0x02,0x79,0x0B,0x0C, +0x09,0x0C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x08,0x3F,0x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C,0x20,0x0B,0x02,0x0B,0x9A,0x0B,0xFC,0x3F,0x8F,0xF9,0x01,0x4A, +0x79,0xDF,0xF9,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08, +0x2A,0x8A,0xFD,0x4D,0x06,0x08,0x01,0x0B,0x80,0x1A,0x05,0x1C,0x01,0x79,0x10,0x0B, +0x00,0x0B,0x1C,0x0B,0xB8,0x0C,0x39,0x8E,0x10,0x3E,0xF9,0x9E,0x39,0x8E,0x11,0x3E, +0xA9,0x9E,0x09,0xBF,0x1F,0xF9,0xFF,0x1A,0xAA,0x8A,0xBA,0x8A,0xFA,0x8A,0xFF,0x1A, +0x01,0x1A,0xFF,0x1A,0x00,0x2B,0x79,0xB9,0x09,0xF9,0x02,0x4A,0x10,0x0B,0x00,0x0B, +0x06,0x0B,0x2D,0x3D,0x1D,0x8E,0x0B,0x3E,0x69,0xEE,0x79,0xEE,0x1D,0x8E,0x0B,0x3E, +0x6E,0xE9,0x6E,0xF9,0x39,0x8E,0x02,0x3E,0x69,0xEE,0x79,0xEE,0x39,0xBF,0x69,0xEF, +0x79,0xEF,0x39,0x8E,0x13,0x3E,0xB9,0x9E,0x39,0x8E,0x12,0x3E,0xB9,0x9E,0x00,0x19, +0x29,0x8E,0x01,0x3E,0xAE,0xE7,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x1D,0xE9, +0x34,0x4A,0x69,0xBF,0x1F,0xE9,0x39,0xD9,0x13,0x4A,0x39,0xC9,0x08,0x4A,0x10,0x0B, +0x00,0x0B,0x18,0x0B,0xE8,0x3D,0x07,0x08,0x00,0x78,0x0C,0x3C,0x01,0x78,0x03,0x3C, +0x02,0x78,0x03,0x3C,0x09,0x0C,0x01,0x19,0x07,0x0C,0x00,0x79,0x10,0x0B,0x00,0x0B, +0x1C,0x0B,0xB8,0x0C,0x00,0x19,0x00,0x0C,0x29,0x8E,0x01,0x3E,0x4E,0xF9,0x4A,0xCA, +0xF9,0xE9,0xFF,0x1A,0x01,0x59,0x06,0x08,0x04,0x1C,0x69,0xED,0x05,0x08,0x2A,0x8A, +0xFD,0x4D,0x05,0x08,0x79,0x9A,0x02,0x5C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08, +0xFF,0x1A,0x39,0x8E,0x13,0x3E,0x1E,0xE9,0x39,0x8E,0x02,0x3E,0x6E,0xC9,0x6E,0xD9, +0x10,0x0B,0x00,0x0B,0x19,0x0B,0xA8,0x3D,0x00,0x2B,0x79,0x99,0x29,0x8E,0x04,0x3E, +0x6E,0xE9,0x6E,0xF9,0x79,0x8D,0x69,0x8D,0x29,0x8E,0x01,0x3E,0xAE,0xB7,0x02,0x2C, +0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0x8D,0x29,0x8E,0x01,0x3E,0xAE,0xA7,0x02,0x2C, +0x00,0x79,0x01,0x0C,0x01,0x79,0x39,0x8E,0x13,0x3E,0x1E,0xE9,0x39,0x8E,0x02,0x3E, +0x6E,0xC9,0x6E,0xD9,0x10,0x0B,0x00,0x0B,0x19,0x0B,0x72,0x3D,0x0D,0xA8,0x0D,0xA8, +0x0D,0xA8,0x09,0x08,0x79,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x21,0x2C,0x29,0x8E, +0x01,0x3E,0x4E,0xF9,0x4A,0xCA,0xF9,0xE9,0xFF,0x1A,0x01,0x59,0x06,0x08,0x04,0x1C, +0x69,0xED,0x05,0x08,0x2A,0x8A,0xFD,0x4D,0x05,0x08,0x79,0x9A,0x02,0x5C,0x00,0x79, +0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x39,0x8E,0x13,0x3E,0x1E,0xE9,0x39,0x8E, +0x02,0x3E,0x6E,0xC9,0x6E,0xD9,0x10,0x0B,0x00,0x0B,0x19,0x0B,0xA8,0x3D,0x23,0x0C, +0x29,0x8E,0x04,0x3E,0x6E,0xE9,0x6E,0xF9,0x79,0x8D,0x69,0x8D,0x29,0x8E,0x01,0x3E, +0xAE,0xB7,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0x8D,0x29,0x8E,0x01,0x3E, +0xAE,0xA7,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x39,0x8E,0x13,0x3E,0x1E,0xE9, +0x39,0x8E,0x02,0x3E,0x6E,0xC9,0x6E,0xD9,0x10,0x0B,0x00,0x0B,0x19,0x0B,0x72,0x3D, +0x0D,0xA8,0x0D,0xA8,0x0D,0xA8,0x07,0x08,0xFF,0x1A,0x1D,0xE9,0x38,0x4A,0x69,0xBF, +0x79,0x9F,0x1D,0xF9,0x38,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x11,0x3C,0x01,0x78, +0x0D,0x3C,0x02,0x78,0x01,0x3C,0x11,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78,0x05,0x7C, +0x00,0x79,0x10,0x0B,0x00,0x0B,0x1C,0x0B,0xB8,0x0C,0x07,0x0C,0x01,0x19,0x05,0x0C, +0x19,0xF9,0xFF,0x1A,0x01,0x5C,0x01,0x19,0x00,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78, +0x02,0x3C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x39,0x8E,0x14,0x3E, +0x79,0x9E,0x39,0x8E,0x15,0x3E,0x01,0x1E,0xF9,0xF9,0xFF,0x1A,0x01,0x78,0x08,0x3C, +0x03,0x78,0x06,0x3C,0x05,0x78,0x04,0x3C,0x10,0x0B,0x00,0x0B,0x1C,0x0B,0xB6,0x0C, +0x09,0xBF,0x1F,0xF9,0xFF,0x1A,0xAA,0x8A,0xBA,0x8A,0xEA,0x8A,0xFF,0x1A,0x01,0x1A, +0xFF,0x1A,0x00,0x2B,0x79,0xE9,0x09,0xF9,0x08,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B, +0x2D,0x3D,0x00,0x2B,0x69,0xC9,0x00,0x2B,0x79,0xD9,0x39,0x8E,0x02,0x3E,0x6E,0xE9, +0x6E,0xF9,0x79,0x8D,0x69,0x8D,0xD9,0x8D,0xC9,0x8D,0x29,0x8E,0x01,0x3E,0xAE,0xC7, +0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x1D,0xE9,0x44,0x4A,0x69,0xBF,0x1F,0xE9, +0xE9,0xD9,0x39,0x8E,0x13,0x3E,0x1E,0xC9,0x10,0x0B,0x00,0x0B,0x19,0x0B,0xE8,0x3D, +0x0D,0xA8,0x0D,0xA8,0x0D,0xA8,0x0D,0xA8,0x07,0x08,0x00,0x78,0x09,0x3C,0x01,0x78, +0x03,0x3C,0x02,0x78,0x03,0x3C,0x05,0x0C,0x01,0x79,0x52,0x0C,0x00,0x79,0x50,0x0C, +0x00,0x0C,0x29,0x8E,0x02,0x3E,0x6E,0xE9,0x6E,0xF9,0x79,0x8D,0x69,0x8D,0x29,0x8E, +0x01,0x3E,0xAE,0x97,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0x8D,0x29,0x8E, +0x01,0x3E,0xAE,0x87,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0xE9,0xE9,0xD9,0xD9, +0xC9,0xC9,0x10,0x0B,0x00,0x0B,0x1A,0x0B,0x5C,0x3D,0x0D,0xA8,0x0D,0xA8,0x0D,0xA8, +0x07,0x08,0x00,0x78,0x29,0x3C,0x01,0x78,0x27,0x3C,0x02,0x78,0x01,0x3C,0x25,0x0C, +0x0E,0x08,0x20,0x1C,0xD9,0xF9,0xC9,0xE9,0x28,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08, +0xDA,0x8A,0xFB,0x4D,0xC0,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08,0x40,0x78,0x12,0x7C, +0x07,0x08,0x10,0x5C,0x29,0x8E,0x01,0x3E,0xAE,0xD7,0x0C,0x6C,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0x1A,0x3F,0x8F,0xF9,0x01,0x4A,0x79,0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D,0x09,0x8D,0x79,0x99,0x69,0xA9,0x59,0x89,0x29,0xB9,0x20,0x0B, +0x02,0x0B,0xC6,0x0B,0x8D,0x3F,0x00,0x1F,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x8C,0x3F, +0x00,0x1F,0x39,0xF9,0x03,0x1A,0x05,0x1C,0x39,0xF9,0x00,0x2B,0x03,0x0A,0x04,0x4A, +0x79,0xB9,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x90,0x3F,0x39,0xEF,0x19,0xF9,0xFF,0x1A, +0x44,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x03,0x08,0x79,0xCA,0x09,0xF9, +0x39,0xE9,0x29,0xDA,0x07,0x08,0x69,0xDA,0x02,0x6C,0x00,0x79,0x08,0x0C,0x20,0x0B, +0x02,0x0B,0xC6,0x0B,0x8C,0x3F,0x19,0x9F,0x39,0xF9,0x29,0xDA,0x4A,0xCA,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x88,0x3F, +0x79,0xEF,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x89,0x59,0x99, +0x69,0xA9,0x09,0xF9,0xFF,0x1A,0x79,0xE9,0x69,0xF9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA, +0x7A,0xCA,0x30,0x6D,0x06,0x08,0x2A,0x8A,0x07,0x08,0x5A,0x8A,0xFB,0x4D,0x01,0x08, +0x69,0xAA,0x02,0x08,0x79,0xAA,0x00,0x39,0x28,0x0C,0x39,0xF9,0xFF,0x1A,0x44,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x90,0x3F, +0x07,0x08,0x9F,0xCA,0x79,0x8E,0x08,0x3E,0x6E,0xE9,0x6E,0xF9,0x06,0x08,0x19,0xF8, +0x11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07,0x08,0x5A,0x8A,0xFB,0x4D, +0x00,0x08,0x69,0xAA,0x01,0x08,0x79,0xAA,0x39,0x8E,0x08,0x3E,0x09,0xEE,0x19,0xEE, +0x39,0xF9,0xE9,0xE9,0x10,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x39,0x8E, +0x40,0x3E,0x01,0x1E,0x00,0x29,0x0D,0x0C,0x29,0xF9,0xFF,0x1A,0x39,0xCA,0x79,0xBF, +0x1F,0xF9,0x04,0x1C,0x39,0x8E,0x40,0x3E,0x00,0x1E,0x07,0x0C,0x02,0x08,0x01,0x4A, +0xFF,0x1A,0x29,0xF9,0xFF,0x1A,0x10,0x5A,0xEF,0x2C,0x39,0xF9,0x10,0x4A,0xD9,0xE9, +0x10,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x39,0x8E,0x41,0x3E,0x01,0x1E, +0x00,0x29,0x0E,0x0C,0x29,0xF9,0xFF,0x1A,0x39,0xCA,0x79,0x8E,0x10,0x3E,0x1E,0xF9, +0x04,0x1C,0x39,0x8E,0x41,0x3E,0x00,0x1E,0x07,0x0C,0x02,0x08,0x01,0x4A,0xFF,0x1A, +0x29,0xF9,0xFF,0x1A,0x10,0x5A,0xEE,0x2C,0x39,0x8E,0x0A,0x3E,0x00,0x6E,0x00,0x6E, +0x39,0x8E,0x0C,0x3E,0x00,0x6E,0x00,0x6E,0x39,0x8E,0x0E,0x3E,0x00,0x6E,0x00,0x6E, +0x39,0x8E,0x42,0x3E,0x00,0x1E,0x39,0x8E,0x43,0x3E,0x00,0x1E,0x39,0x8E,0x41,0x3E, +0x1E,0xF9,0x0A,0x5C,0x39,0xF9,0x10,0x4A,0x10,0x0B,0x00,0x0B,0x1E,0x0B,0x00,0x3D, +0x39,0x8E,0x0C,0x3E,0x69,0xEE,0x79,0xEE,0x01,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B, +0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x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,0x89,0x69,0x99,0x00,0x2B,0x49,0xF9,0x29,0xF9,0x19,0xE9,0x09,0xD9, +0x10,0x0B,0x00,0x0B,0x1D,0x0B,0x5A,0x3D,0x79,0xB9,0x07,0x1C,0x39,0x8E,0x43,0x3E, +0x1E,0xF9,0xF9,0xBF,0x79,0x9F,0x01,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0xF9,0x8D,0x79,0xA9,0x59,0x89,0x69,0x99,0x00,0x2B,0x49,0xF9,0x29,0xF9, +0x19,0xE9,0x09,0xD9,0x10,0x0B,0x00,0x0B,0x1D,0x0B,0x5A,0x3D,0x79,0xB9,0x11,0x1C, +0x39,0x8E,0x0A,0x3E,0x6E,0xE9,0x6E,0xF9,0x06,0x08,0x02,0x5C,0x07,0x08,0x09,0x1C, +0x39,0x8E,0x0A,0x3E,0x6E,0xE9,0x6E,0xF9,0xF9,0xBF,0x69,0xEF,0x79,0xEF,0x01,0x79, +0x01,0x0C,0x00,0x79,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0xA9,0x59,0x89, +0x69,0x99,0x00,0x2B,0x49,0xF9,0x29,0xF9,0x19,0xE9,0x09,0xD9,0x10,0x0B,0x00,0x0B, +0x1D,0x0B,0x5A,0x3D,0x79,0xB9,0x11,0x1C,0x39,0x8E,0x0C,0x3E,0x6E,0xE9,0x6E,0xF9, +0x06,0x08,0x02,0x5C,0x07,0x08,0x09,0x1C,0x39,0x8E,0x0C,0x3E,0x6E,0xE9,0x6E,0xF9, +0xF9,0xBF,0x69,0xEF,0x79,0xEF,0x01,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B,0x0D,0xF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xE9,0x8D,0xD9,0x8D, +0x00,0x2B,0x69,0xF9,0x79,0x89,0x00,0x2B,0x59,0xE9,0x00,0x2B,0x49,0xD9,0x00,0x29, +0x57,0x0C,0x29,0xF9,0xFF,0x1A,0x44,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x90,0x3F,0x07,0x08,0x9F,0xCA,0x79,0xB9,0x39,0x8E, +0x40,0x3E,0x1E,0xF9,0x42,0x5C,0x00,0x19,0x39,0x8E,0x0A,0x3E,0x6E,0xE9,0x6E,0xF9, +0x06,0x08,0xF9,0xF8,0x05,0x7C,0x07,0x08,0x09,0xF8,0x02,0x7C,0x01,0x19,0x18,0x0C, +0x39,0xF9,0x09,0xE9,0xF9,0xD9,0x10,0x0B,0x00,0x0B,0x1E,0x0B,0x3A,0x3D,0x07,0x08, +0x0F,0x1C,0x39,0x8E,0x0A,0x3E,0xF9,0xEE,0x09,0xEE,0x39,0x8E,0x42,0x3E,0x00,0x1E, +0x01,0x19,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x0C,0x3F,0x8F,0xF9,0x01,0x4A,0x79,0xDF, +0x01,0x08,0x1B,0x1C,0x39,0x8E,0x08,0x3E,0x6E,0xE9,0x6E,0xF9,0x30,0x6D,0x07,0x08, +0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0x01,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08, +0xFF,0x1A,0xE9,0xBF,0x69,0x9F,0x39,0x8E,0x08,0x3E,0x6E,0xE9,0x6E,0xF9,0x4A,0xCA, +0xD9,0xBF,0x69,0xEF,0x79,0xEF,0x01,0x79,0x18,0x0C,0x02,0x08,0x01,0x4A,0xFF,0x1A, +0x29,0xF9,0xFF,0x1A,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x8D,0x3F,0x1F,0xE9,0x07,0x08, +0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,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0x3D,0x79,0xB9,0x14,0x1C,0x39,0x8E,0x0A,0x3E,0x6E,0xE9,0x6E,0xF9, +0x06,0x08,0x02,0x5C,0x07,0x08,0x03,0x1C,0x03,0x79,0x0B,0x0C,0x09,0x0C,0x39,0x8E, +0x40,0x3E,0x1E,0xF9,0x03,0x1C,0x01,0x79,0x04,0x0C,0x02,0x0C,0x02,0x79,0x01,0x0C, +0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x79,0xA9,0x59,0x89,0x69,0x99,0x29,0xF9,0x19,0xE9,0x09,0xD9, +0x10,0x0B,0x00,0x0B,0x1D,0x0B,0x5A,0x3D,0x79,0xB9,0x14,0x1C,0x39,0x8E,0x0C,0x3E, +0x6E,0xE9,0x6E,0xF9,0x06,0x08,0x02,0x5C,0x07,0x08,0x03,0x1C,0x03,0x79,0x0B,0x0C, +0x09,0x0C,0x39,0x8E,0x41,0x3E,0x1E,0xF9,0x03,0x1C,0x01,0x79,0x04,0x0C,0x02,0x0C, +0x02,0x79,0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x00,0x29,0x30,0x0C,0x29,0xF9,0xFF,0x1A,0x44,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x90,0x3F,0x07,0x08, +0x9F,0xCA,0x79,0xB9,0x39,0x8E,0x41,0x3E,0x1E,0xF9,0x0A,0x5C,0x39,0xF9,0x10,0x4A, +0x10,0x0B,0x00,0x0B,0x1E,0x0B,0x00,0x3D,0x39,0x8E,0x0C,0x3E,0x69,0xEE,0x79,0xEE, +0x39,0x8E,0x40,0x3E,0x1E,0xF9,0x0D,0x5C,0x39,0x8E,0x42,0x3E,0x1E,0xF9,0x09,0x1C, +0x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x0C,0x3F,0x9F,0x8E,0x01,0x3E,0x00,0x6E, +0x05,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x00,0x6F,0x0D,0x0C,0x79,0x8E, +0x01,0x3E,0x6E,0xE9,0x79,0xBF,0x9F,0x8E,0x01,0x3E,0x69,0xEE,0x79,0xBF,0x6F,0xE9, +0x79,0x8E,0x01,0x3E,0xAE,0xBF,0x69,0xEF,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9, +0x00,0x39,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x6F,0xF9,0x02,0x5C,0x00,0x79, +0x26,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x6F,0xF9,0x29,0xF8,0x1B,0x7C, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x04,0x3F,0x1F,0xF9,0x02,0x78,0x11,0x7C,0x29,0xF9, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0xF7,0x3D,0x79,0xB9,0x07,0x08,0xFF,0x1A,0x01,0x78, +0x06,0x7C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x3C,0x3D,0x84,0x3D,0x01,0x39,0x02,0x0C, +0x81,0x3D,0x01,0x39,0x03,0x0C,0x29,0xF9,0x9C,0x3D,0x01,0x39,0x39,0xF9,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0x99, +0x59,0x89,0x00,0x39,0x29,0x8E,0x16,0x3E,0x1E,0xF9,0x19,0x8E,0x16,0x3E,0x1E,0xE9, +0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x6C,0x01,0x39,0x13,0x0C, +0x29,0x8E,0x16,0x3E,0x1E,0xF9,0x19,0x8E,0x16,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8, +0x0A,0x7C,0x00,0x08,0x08,0x1C,0x29,0xF9,0x19,0xE9,0x09,0xBD,0x07,0x08,0x29,0xF8, +0x01,0x7C,0x01,0x39,0x00,0x0C,0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x00,0x2B, +0x79,0xF9,0x69,0xB9,0x00,0x29,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x79,0x99,0x39,0xBF, +0x6F,0xF9,0x79,0x89,0x39,0xF9,0x89,0x3D,0x79,0xA9,0x07,0x08,0xFF,0x1A,0x01,0x78, +0x23,0x7C,0x01,0x08,0x07,0x1C,0xF9,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B, +0x81,0x3D,0x0E,0x0C,0x00,0x08,0x07,0x1C,0xF9,0xF9,0x09,0xE9,0x10,0x0B,0x00,0x0B, +0x26,0x0B,0x98,0x3D,0x05,0x0C,0xF9,0xF9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x71,0x3D, +0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x07,0x1C,0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x00,0x2B, +0x79,0xE9,0x39,0xF9,0xE9,0xBD,0x00,0x0C,0x29,0xF9,0x00,0x2B,0x0D,0xE9,0x00,0x2B, +0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x14,0x3F,0x6F,0xF9,0x0F,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x10,0x3F, +0x1F,0xF9,0x09,0x1C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x3C,0x3D,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x10,0x3F,0x00,0x1F,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8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3D,0x10,0x0B, +0x00,0x0B,0x26,0x0B,0x37,0x3D,0x79,0x99,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D, +0x07,0x08,0x4A,0xCA,0x79,0xE9,0x69,0xF9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA, +0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9, +0x00,0x79,0x69,0x89,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x00,0x08,0x79,0xCA, +0x39,0x8E,0x02,0x3E,0x09,0xEE,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x6F,0xF9, +0x09,0x5C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x71,0x3D,0x10,0x0B,0x00,0x0B, +0x29,0x0B,0x45,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x9F,0x8E,0x02,0x3E, +0x6E,0xF9,0x19,0xDA,0x79,0x89,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08, +0x4A,0xCA,0x39,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B, +0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E, +0x02,0x3E,0x06,0x08,0xAE,0xCA,0x19,0xDA,0x00,0x08,0x69,0xDA,0x14,0x2C,0x10,0x0B, +0x00,0x0B,0x26,0x0B,0x4F,0x3D,0x07,0x08,0x0E,0x1C,0x39,0xF9,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x08,0x3F,0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x81,0x3D,0x10,0x0B, +0x00,0x0B,0x29,0x0B,0x45,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x6F,0xF9, +0x79,0xA9,0x10,0x0B,0x00,0x0B,0x29,0x0B,0x41,0x0C,0x39,0x8E,0x02,0x3E,0x6E,0xF9, +0x79,0x89,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x29,0x8E, +0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x29,0x8E,0x02,0x3E,0x06,0x08, +0xAE,0xCA,0x00,0x08,0x69,0xDA,0x23,0x6C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D, +0x07,0x08,0x4A,0xCA,0x29,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B, +0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79, +0x29,0x8E,0x02,0x3E,0x06,0x08,0xAE,0xCA,0x39,0x8E,0x02,0x3E,0x69,0xEE,0x29,0x8E, +0x01,0x3E,0x6E,0xF9,0x2B,0x1C,0x29,0x8E,0x01,0x3E,0xAE,0x8E,0x02,0x3E,0x6E,0xF9, +0x19,0xDA,0x79,0x89,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA, +0x39,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E, +0x06,0x08,0xAE,0xCA,0x19,0xDA,0x00,0x08,0x69,0xDA,0x07,0x2C,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0x26,0x0B,0x98,0x3D,0x08,0x0C,0x29,0x8E,0x01,0x3E,0x6E,0xF9, +0x79,0xA9,0x10,0x0B,0x00,0x0B,0x28,0x0B,0xBD,0x0C,0x10,0x0B,0x00,0x0B,0x2E,0x0B, +0xAC,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x79,0xA9,0x00,0x2B,0x69,0xF9,0x00,0x19, +0x10,0x0B,0x00,0x0B,0x27,0x0B,0xAE,0x3D,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x37,0x3D, +0x79,0x89,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x2F,0x0B,0x18,0x3D,0x07,0x08,0x05,0x5C, +0x00,0x79,0x10,0x0B,0x00,0x0B,0x2A,0x0B,0x34,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x08,0x3F,0x6F,0xF9,0x0A,0x5C,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x71,0x3D, +0x01,0x19,0x10,0x0B,0x00,0x0B,0x2A,0x0B,0x24,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x08,0x3F,0x6F,0xF9,0x79,0xB9,0x10,0x0B,0x00,0x0B,0x2A,0x0B,0x20,0x0C,0x29,0x8E, +0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x39,0x8E,0x02,0x3E,0x6E,0xE9,0x09,0xDA,0x07,0x08, +0x69,0xDA,0x3F,0x6C,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x00,0x2B,0x79,0xE9, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x29,0x8E,0x03,0x3E, +0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x29,0x8E,0x02,0x3E,0x06,0x08,0xAE,0xCA, +0x09,0xDA,0x0E,0x08,0x69,0xDA,0x0C,0x6C,0x29,0xF9,0x39,0xE9,0xF9,0xD9,0x10,0x0B, +0x00,0x0B,0x27,0x0B,0xC4,0x3D,0x79,0x99,0x07,0x08,0xFF,0x1A,0x01,0x78,0x07,0x7C, +0x29,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x81,0x3D,0x01,0x19,0x54,0x0C, +0x4B,0x0C,0x29,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x00,0x2B,0x79,0xE9,0x10,0x0B, +0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x39,0x8E,0x03,0x3E,0xAE,0xCA, +0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E,0x06,0x08,0xAE,0xCA,0x09,0xDA, +0x0E,0x08,0x69,0xDA,0x15,0x6C,0x29,0xF9,0x39,0xE9,0xF9,0xD9,0x10,0x0B,0x00,0x0B, +0x27,0x0B,0xC4,0x3D,0x79,0x99,0x07,0x08,0xFF,0x1A,0x01,0x78,0x07,0x7C,0x29,0xF9, +0x39,0xE9,0x10,0x0B,0x00,0x0B,0x27,0x0B,0x69,0x3D,0x79,0x99,0x15,0x0C,0x0C,0x0C, +0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x08,0x5C,0x29,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B, +0x26,0x0B,0x98,0x3D,0x01,0x19,0x08,0x0C,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x79,0xB9, +0x10,0x0B,0x00,0x0B,0x29,0x0B,0x87,0x0C,0x01,0x08,0x0D,0x1C,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x08,0x3F,0x6F,0xF9,0x02,0x08,0x79,0xF8,0x05,0x7C,0x10,0x0B,0x00,0x0B, +0x2E,0x0B,0xF2,0x3D,0x79,0x99,0x19,0xF9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0x79,0xB9,0x00,0x2B, +0x69,0xD9,0x00,0x2B,0x59,0xC9,0x00,0x19,0x10,0x0B,0x00,0x0B,0x27,0x0B,0xAE,0x3D, +0x10,0x0B,0x00,0x0B,0x26,0x0B,0x37,0x3D,0x79,0x89,0x39,0x8E,0x02,0x3E,0x6E,0xF9, +0x00,0x2B,0x79,0xF9,0x39,0x8E,0x02,0x3E,0xAE,0xF9,0xD9,0xCA,0x79,0xFE,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x2F,0x0B,0x18,0x3D,0x07,0x08,0x10,0x0B,0x00,0x0B,0x2B,0x0B, +0xB9,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x6F,0xF9,0x0A,0x5C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x26,0x0B,0x71,0x3D,0x01,0x19,0x10,0x0B,0x00,0x0B,0x2B,0x0B, +0xB9,0x0C,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x08,0x3F,0x9F,0x8E,0x02,0x3E,0x6E,0xE9,0x09,0xDA,0x07,0x08,0x69,0xDA,0x43,0x6C, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F,0x9F,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA, +0x00,0x2B,0x79,0xB9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA, +0x39,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E, +0x06,0x08,0xAE,0xCA,0x09,0xDA,0x0B,0x08,0x69,0xDA,0x15,0x2C,0x10,0x0B,0x00,0x0B, +0x26,0x0B,0x4F,0x3D,0x07,0x08,0x0F,0x1C,0x39,0xF9,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x08,0x3F,0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x81,0x3D,0x01,0x19,0x10,0x0B, +0x00,0x0B,0x2B,0x0B,0xB9,0x0C,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x00,0x2B, +0x79,0xB9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0x0C,0x3F,0x9F,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79, +0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9, +0x00,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x0C,0x3F,0x9F,0x8E,0x02,0x3E,0x06,0x08, +0xAE,0xCA,0x09,0xDA,0x0B,0x08,0x69,0xDA,0x0F,0x2C,0x39,0xF9,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x0C,0x3F,0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x98,0x3D,0x01,0x19, +0x10,0x0B,0x00,0x0B,0x2B,0x0B,0xB9,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F, +0x6F,0xF9,0x79,0xA9,0x10,0x0B,0x00,0x0B,0x2B,0x0B,0xB4,0x0C,0x39,0x8E,0x02,0x3E, +0x6E,0xF9,0x00,0x2B,0x79,0xB9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08, +0x4A,0xCA,0x29,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B, +0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x29,0x8E, +0x02,0x3E,0x06,0x08,0xAE,0xCA,0x0B,0x08,0x69,0xDA,0x23,0x6C,0x10,0x0B,0x00,0x0B, +0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x29,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9, +0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x79,0xE9,0x00,0x79,0x29,0x8E,0x02,0x3E,0x06,0x08,0xAE,0xCA,0x39,0x8E,0x02,0x3E, +0x69,0xEE,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0xF9,0xDA,0x00,0x2B,0x79,0xE9,0xE9,0xF9, +0xD9,0xDA,0x46,0x2C,0xC9,0xF9,0xE9,0xDA,0x43,0x2C,0x29,0x8E,0x01,0x3E,0x6E,0xF9, +0x09,0x5C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x98,0x3D,0x01,0x19, +0x40,0x0C,0x36,0x0C,0x29,0x8E,0x01,0x3E,0xAE,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA, +0x00,0x2B,0x79,0xB9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA, +0x39,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E, +0x06,0x08,0xAE,0xCA,0x09,0xDA,0x0B,0x08,0x69,0xDA,0x0A,0x2C,0x39,0xF9,0x29,0x8E, +0x01,0x3E,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0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00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x0B,0x08,0x69,0xDA, +0x39,0x8E,0x02,0x3E,0xB9,0xEE,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x2F,0x0B,0x18,0x3D, +0x07,0x08,0x04,0x5C,0x10,0x0B,0x00,0x0B,0x2D,0x0B,0x2A,0x0C,0x39,0x8E,0x02,0x3E, +0x6E,0xF9,0xE9,0xDA,0x79,0x89,0x09,0xF9,0xC9,0xDA,0x11,0x2C,0xD9,0xF9,0x09,0xDA, +0x0E,0x2C,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x4F,0x3D,0x07,0x08,0x08,0x1C,0x39,0xF9, +0x29,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x81,0x3D,0x01,0x19,0x73,0x0C,0x6A,0x0C, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x29,0xBF,0x9F,0x8E, +0x03,0x3E,0xAE,0xCA,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x29,0xBF,0x9F,0x8E,0x02,0x3E, +0x06,0x08,0xAE,0xCA,0x39,0x8E,0x02,0x3E,0x69,0xEE,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x2F,0x0B,0x18,0x3D,0x07,0x08,0x01,0x5C,0x45,0x0C,0x39,0x8E,0x02,0x3E,0x6E,0xF9, +0xE9,0xDA,0x79,0x89,0x09,0xF9,0xC9,0xDA,0x35,0x2C,0xD9,0xF9,0x09,0xDA,0x32,0x2C, +0x29,0x8E,0x02,0x3E,0x6E,0xF9,0xF9,0xDA,0x00,0x2B,0x79,0xB9,0x10,0x0B,0x00,0x0B, +0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x39,0x8E,0x03,0x3E,0xAE,0xCA,0x79,0xE9, +0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E,0x06,0x08,0xAE,0xCA,0xF9,0xDA,0x0B,0x08, +0x69,0xDA,0x08,0x2C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x26,0x0B,0x81,0x3D, +0x01,0x19,0x08,0x0C,0x29,0xBF,0x6F,0xF9,0x79,0xA9,0x02,0x08,0x10,0x0B,0x00,0x0B, +0x2C,0x0B,0x6A,0x5C,0x01,0x08,0x0D,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F, +0x6F,0xF9,0x03,0x08,0x79,0xF8,0x05,0x7C,0x10,0x0B,0x00,0x0B,0x2E,0x0B,0xF2,0x3D, +0x79,0x99,0x19,0xF9,0xFF,0x1A,0x03,0x5C,0x39,0x8E,0x02,0x3E,0xE9,0xEE,0x19,0xF9, +0x00,0x2B,0x0D,0xB9,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x00,0x29,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F, +0x6F,0xF9,0x02,0x5C,0x00,0x79,0x64,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x08,0x3F, +0x6F,0xF9,0x39,0xF8,0x4A,0x7C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x04,0x3F,0x1F,0xF9, +0x02,0x78,0x2D,0x7C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xF7,0x3D,0x79,0xA9, +0x07,0x08,0xFF,0x1A,0x01,0x78,0x1E,0x7C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x3C,0x3D, +0x10,0x0B,0x00,0x0B,0x26,0x0B,0xB2,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x04,0x3F, +0x01,0x1F,0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x06,0x1C,0x39,0x8E,0x07,0x3E,0x6E,0xF9, +0x79,0x99,0x39,0xF9,0x19,0xBD,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x04,0x3F,0x00,0x1F, +0x01,0x29,0x04,0x0C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x7A,0x3D,0x0F,0x0C,0x10,0x0B, +0x00,0x0B,0x26,0x0B,0xB2,0x3D,0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x06,0x1C,0x39,0x8E, +0x07,0x3E,0x6E,0xF9,0x79,0x99,0x39,0xF9,0x19,0xBD,0x01,0x29,0x02,0x08,0x04,0x1C, +0x10,0x0B,0x00,0x0B,0x2E,0x0B,0xAC,0x3D,0x10,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x26,0x0B,0xD1,0x3D,0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x06,0x1C,0x39,0x8E,0x07,0x3E, +0x6E,0xF9,0x79,0x99,0x39,0xF9,0x19,0xBD,0x01,0x29,0x02,0x08,0x00,0x1C,0x29,0xF9, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x08,0x3F,0x6F,0xF9,0x39,0xF8,0x0A,0x7C,0x10,0x0B,0x00,0x0B,0x26,0x0B, +0x4F,0x3D,0x07,0x08,0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F9, +0x09,0xBD,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x04,0x3F,0x00,0x1F,0x65,0x3D,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x07,0x08,0x19,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B, +0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x06,0x08, +0x4A,0xCA,0x69,0xA9,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x2C,0x3F,0x4F,0xF9,0x4A,0xCA, +0x29,0xE9,0x4A,0xCA,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x05,0x6C, +0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x2C,0x3F,0x29,0xCF,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x00,0x39,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x08,0x3F,0x6F,0xF9,0x79,0xA9,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x2F,0x0B,0x18,0x3D, +0x07,0x08,0x1E,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x05,0x3F,0x00,0x1F,0x29,0xF9, +0x10,0x0B,0x00,0x0B,0x24,0x0B,0xD1,0x3D,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x86,0x3D, +0x07,0x08,0x02,0x5C,0x01,0x39,0x0B,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x05,0x3F, +0x1F,0xF9,0x01,0x1C,0x01,0x39,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x3C,0x3D,0x00,0x0C, +0x39,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x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0x19,0x8D,0x09,0x8D,0x79,0x89,0x00,0x39,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0xDF,0x3D,0x79,0xA9,0x09,0x8E,0x02,0x3E,0x6E,0xF9,0x29,0xDA,0x79,0x99, +0x19,0xF9,0x80,0x0B,0x00,0x0B,0x00,0x0B,0x00,0x5A,0x01,0x6C,0x01,0x39,0x39,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0xA9,0x69,0x99,0x59,0x89,0x11,0x39,0x29,0xE9,0x69,0xF9,0x06,0x08, +0x01,0x4A,0x69,0xA9,0x79,0xBF,0x19,0x9F,0x29,0xF9,0x09,0xE9,0x10,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x03,0x49,0x79,0xA9,0x29,0xB9,0x02,0x08, +0x01,0x4A,0x29,0xF9,0x39,0xBF,0x69,0x9F,0x59,0xB9,0x4A,0xCA,0xFF,0x1A,0x79,0x99, +0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x59,0xB9,0x4A,0xCA, +0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9, +0x29,0xBF,0x39,0x9F,0x49,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x05,0x39,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A, +0x19,0xF9,0x29,0xBF,0x69,0x9F,0x59,0xA9,0x4A,0xCA,0xFF,0x1A,0x79,0x89,0x09,0x99, +0x00,0x08,0x01,0x4A,0x09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,0x39,0xE9, +0x06,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x06,0x4A,0x39,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x1F,0xF9,0x29,0x8E,0x0D,0x3E, +0x79,0x9E,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x1F,0xF9, +0x29,0x8E,0x0E,0x3E,0x79,0x9E,0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x89,0x69,0x99, +0x00,0x2B,0x59,0xF9,0xF9,0xF9,0x09,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B, +0x36,0x3D,0x79,0xA9,0x07,0x08,0x01,0x5C,0x3F,0x0C,0x29,0xB9,0x09,0xBF,0x4F,0xF9, +0x4A,0xCA,0x20,0x0B,0x06,0x78,0x0A,0x3C,0x20,0x0B,0x07,0x78,0x0E,0x3C,0x20,0x0B, +0x08,0x78,0x04,0x3C,0x20,0x0B,0x09,0x78,0x01,0x3C,0x28,0x0C,0x39,0xF9,0x19,0xE9, +0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x22,0x0C,0x1D,0xF9,0x14,0x4A,0x79,0xBF, +0x00,0x1F,0x1D,0xF9,0x14,0x4A,0x10,0x0B,0x00,0x0B,0x7A,0x0B,0x56,0x3D,0x79,0x99, +0x39,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x03,0x08,0x79,0xCA, +0x1D,0xF9,0x14,0x4A,0x79,0xBF,0x1F,0xF9,0x6A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x01,0x0C,0x00,0x0C,0x29,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x11,0x3D,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x00,0x0D, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x89,0x69,0xB9,0x09,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0x14,0x0B,0x55,0x3D,0x07,0x08,0x02,0x1C,0x01,0x79,0x71,0x0C, +0x00,0x19,0x00,0x29,0x09,0xBF,0x4F,0xF9,0x4A,0xCA,0x20,0x0B,0x06,0x78,0x25,0x3C, +0x20,0x0B,0x07,0x78,0x0A,0x3C,0x20,0x0B,0x08,0x78,0x09,0x3C,0x20,0x0B,0x09,0x78, +0x11,0x3C,0x20,0x0B,0x0A,0x78,0x4B,0x3C,0x52,0x0C,0x02,0x29,0x52,0x0C,0x39,0xBF, +0x1F,0xF9,0x39,0xE9,0x01,0x4A,0x10,0x0B,0x00,0x0B,0x7B,0x0B,0xBE,0x3D,0x79,0x99, +0x01,0x29,0x47,0x0C,0x39,0xBF,0x1F,0xF9,0x39,0xE9,0x01,0x4A,0x10,0x0B,0x00,0x0B, +0x7B,0x0B,0xF1,0x3D,0x79,0x99,0x01,0x29,0x3C,0x0C,0x1D,0xF9,0x10,0x4A,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0x30,0x0B,0xF6,0x3D,0x1D,0xF9,0x1E,0x4A,0x79,0xBF,0x1F,0xF9, +0x79,0x8D,0x1D,0xF9,0x21,0x4A,0x79,0xBF,0x1F,0xF9,0x79,0x8D,0x1D,0xF9,0x1F,0x4A, +0x79,0x8D,0x1D,0xF9,0x22,0x4A,0x79,0xBF,0x1F,0xF9,0x79,0x8D,0x1D,0x8E,0x10,0x3E, +0x4E,0xF9,0x1D,0x8E,0x11,0x3E,0x4E,0xE9,0x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,0x0B,0x50,0x79,0x1D,0xE9,0x3C,0x4A,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xD8,0x3D, +0x00,0x2B,0x79,0xB9,0x07,0x08,0xED,0x5C,0x19,0xF9,0x4A,0xCA,0x79,0x97,0x5E,0x6C, +0x50,0x0C,0x1D,0xF9,0x2C,0x4A,0x29,0xE9,0xAD,0x3D,0x07,0x08,0x29,0xCA,0x79,0x89, +0x1D,0xF9,0x2C,0x4A,0x09,0xE9,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x66,0x3D,0x07,0x08, +0x3B,0x5C,0x00,0x39,0x39,0xF9,0x3A,0x8A,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xA8,0x4A, +0x79,0xBF,0x6F,0xF9,0x11,0x1C,0x39,0xF9,0x3A,0x8A,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0xA8,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B,0x79,0x99,0x1D,0xF9,0x2C,0x4A,0x09,0xE9, +0x99,0xBD,0x07,0x08,0x01,0x1C,0x05,0x0C,0x03,0x08,0x01,0x4A,0x39,0xF9,0x0E,0x5A, +0xE1,0x2C,0x03,0x08,0x0E,0x78,0x18,0x7C,0x0F,0x79,0x04,0x69,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x18,0x3D,0x00,0x2B,0x79,0xF9,0x07,0x08,0x0E,0x1C,0xF9,0xF9,0x01,0x69, +0x1D,0x8E,0x16,0x3E,0x4E,0xD9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xAA,0x3D,0xF9,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0xA7,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x58,0x79,0x1D,0xE9,0x38,0x4A,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0xD8,0x3D,0x79,0xA9,0x07,0x08,0xA3,0x5C,0x19,0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D,0x19,0x8D,0x04,0x49,0x79,0xA9,0x29,0xB9, +0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x69,0x9F,0x79,0xA9,0x29,0xB9,0x02,0x08, +0x01,0x4A,0x29,0xF9,0x39,0xBF,0x01,0x1F,0x59,0xB9,0x4A,0xCA,0xFF,0x1A,0x79,0x99, +0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x59,0xB9,0x4A,0xCA, +0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9, +0x29,0xBF,0x39,0x9F,0x49,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x03,0x59,0x79,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xF9,0x49,0xBF, +0x01,0x1F,0x69,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0xC9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A, +0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x59,0xF9, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x01,0x59,0x79,0xB9,0x39,0xC9,0x03,0x08, +0x01,0x4A,0x39,0xF9,0x49,0xBF,0x69,0x9F,0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x79,0xB9,0x39,0xF9,0x02,0x5A,0x10,0x0B,0x00,0x0B,0x46,0x0B,0xFD,0x3D,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x05,0x5A,0x10,0x0B,0x00,0x0B,0x46,0x0B, +0xFD,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99, +0x69,0x89,0x19,0xF9,0x09,0xE9,0x10,0x0B,0x00,0x0B,0x14,0x0B,0x83,0x3D,0x07,0x08, +0x02,0x1C,0x01,0x79,0x2A,0x0C,0x00,0x39,0x00,0x29,0x19,0xBF,0x4F,0xF9,0x4A,0xCA, +0x20,0x0B,0x25,0x78,0x04,0x3C,0x20,0x0B,0x26,0x78,0x08,0x3C,0x11,0x0C,0x10,0x0B, +0x00,0x0B,0x7C,0x0B,0x92,0x3D,0x79,0xB9,0xFF,0x29,0x0C,0x0C,0x09,0xF9,0x09,0xE9, +0x20,0x4A,0x10,0x0B,0x00,0x0B,0x7C,0x0B,0x97,0x3D,0x79,0xB9,0xFF,0x29,0x02,0x0C, +0x00,0x79,0x0B,0x0C,0x29,0xF9,0xFF,0x1A,0xFF,0x78,0x06,0x7C,0x19,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0x38,0x0B,0x70,0x3D,0x01,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x1F,0x19, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x0A,0x1F,0x29,0x8E, +0x04,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF, +0x79,0x9F,0x29,0x8E,0x03,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x03,0x3E,0x4E,0xF9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x08,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x09,0x3E,0x1E,0xF9, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9, +0x29,0xE9,0x0A,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B,0xDB,0x3D,0x03,0x08,0x06,0x4A, +0x39,0xF9,0x29,0xE9,0x17,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B,0xDB,0x3D,0x03,0x08, +0x06,0x4A,0x39,0xF9,0x29,0xE9,0x1D,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B,0xDB,0x3D, +0x03,0x08,0x06,0x4A,0x29,0x8E,0x08,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x08,0x3E, +0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x09,0x3E,0x4E,0xF9,0x4A,0xCA, +0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x29,0x8E,0x09,0x3E,0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x0A,0x3E, +0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x29,0x8E,0x0A,0x3E,0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A, +0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x29,0x8E,0x16,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0x99,0x00,0x39,0x19,0x8E,0x02,0x3E,0x1E,0xF9,0x05,0x78, +0x01,0x3C,0x2E,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x6F,0xE9,0x6F,0xF9, +0x06,0x08,0x9A,0xEA,0x24,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x6F,0xE9, +0x6F,0xF9,0x06,0x08,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x07,0x08,0xDF,0x0B, +0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x10,0x1C,0x3E,0x79, +0x1F,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x07,0x1C, +0x39,0xA9,0x29,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x5A,0x3D,0x01,0x0C, +0x00,0x0C,0x03,0x08,0x07,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D, +0x01,0x79,0x01,0x0C,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0x99,0x69,0xA9,0x08,0x39,0x29,0xF9,0x10,0x0B,0x00,0x0B, +0x05,0x0B,0x41,0x3D,0x19,0xBF,0x69,0xEF,0x79,0xEF,0x02,0x08,0x08,0x4A,0x39,0xF9, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0x04,0x39,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x69,0x9F, +0x59,0xA9,0x4A,0xCA,0xFF,0x1A,0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9, +0x19,0xBF,0x29,0x9F,0x59,0xA9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x89, +0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F,0x49,0xA9,0x4A,0xCA, +0xFF,0x1A,0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F, +0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99,0x09,0x29,0x1D,0xF9, +0x10,0x4A,0x1D,0xE9,0x14,0x4A,0x1D,0xD9,0x0C,0x4A,0x10,0x0B,0x00,0x0B,0x7D,0x0B, +0x57,0x3D,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x19,0x9F, +0x1D,0xF9,0x14,0x4A,0x79,0xBF,0x1F,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x1D,0x8E,0x06,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,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E,0x25,0x3E,0x8E,0xF9,0x03,0x2A,0x79,0xAE,0x39,0x8E, +0x27,0x3E,0x8E,0xF9,0x03,0x2A,0x79,0xAE,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xBC,0x3F, +0x6F,0xF9,0x10,0x1C,0x39,0x8E,0x25,0x3E,0x8E,0xF9,0x60,0x2A,0x79,0xAE,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0xAC,0x3F,0x6F,0xF9,0x05,0x1C,0x39,0x8E,0x25,0x3E,0x8E,0xF9, +0x80,0x2A,0x79,0xAE,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xCC,0x3F,0x6F,0xF9,0x05,0x1C, +0x39,0x8E,0x25,0x3E,0x8E,0xF9,0x1C,0x2A,0x79,0xAE,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0xC0,0x3F,0x6F,0xF9,0x05,0x1C,0x39,0x8E,0x26,0x3E,0x8E,0xF9,0x7F,0x2A,0x79,0xAE, +0x29,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0xB9,0x69,0x99,0x09,0x29,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9, +0x79,0xBF,0x19,0x9F,0x39,0xF9,0x00,0x59,0x60,0x69,0x10,0x0B,0x00,0x0B,0x05,0x0B, +0xD3,0x3D,0x03,0x08,0x08,0x4A,0x29,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x0F,0x79,0x04,0x69,0x10,0x0B, +0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x01,0x5C,0x0D,0x0C,0x39,0xF9, +0x19,0xE9,0x29,0xBF,0x4F,0xD9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xAA,0x3D,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x00,0x0D,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x00,0x2B,0x79,0xF9,0x69,0xA9,0x00,0x2B,0x59,0xE9, +0xE9,0xF9,0xF9,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x36,0x3D,0x79,0x99, +0x07,0x08,0x04,0x5C,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x57,0x0C,0x19,0xB9,0xF9,0xBF, +0x4F,0xF9,0x4A,0xCA,0x00,0x78,0x6A,0x3C,0x0C,0x0B,0x01,0x78,0x67,0x3C,0x0C,0x0B, +0x63,0x78,0x64,0x3C,0x10,0x0B,0x01,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B,0x4D,0x3C, +0x10,0x0B,0x02,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B,0x57,0x3C,0x10,0x0B,0x03,0x78, +0x10,0x0B,0x00,0x0B,0x39,0x0B,0x61,0x3C,0x10,0x0B,0x09,0x78,0x10,0x0B,0x00,0x0B, +0x39,0x0B,0x6B,0x3C,0x20,0x0B,0x01,0x78,0x49,0x3C,0x20,0x0B,0x02,0x78,0x10,0x0B, +0x00,0x0B,0x39,0x0B,0x7C,0x3C,0x20,0x0B,0x03,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B, +0x94,0x3C,0x20,0x0B,0x05,0x78,0x3A,0x3C,0x20,0x0B,0x0F,0x78,0x54,0x3C,0x20,0x0B, +0x10,0x78,0x34,0x3C,0x20,0x0B,0x11,0x78,0x31,0x3C,0x20,0x0B,0x12,0x78,0x2E,0x3C, +0x20,0x0B,0x18,0x78,0x35,0x3C,0x20,0x0B,0x1C,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B, +0xA5,0x3C,0x20,0x0B,0x1D,0x78,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x0E,0x3C,0x20,0x0B, +0x1E,0x78,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x15,0x3C,0x20,0x0B,0x1F,0x78,0x10,0x0B, +0x00,0x0B,0x3A,0x0B,0x1C,0x3C,0x20,0x0B,0x4B,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B, +0xB6,0x3C,0x20,0x0B,0x4C,0x78,0x10,0x0B,0x00,0x0B,0x39,0x0B,0xC9,0x3C,0x20,0x0B, +0x4D,0x78,0x04,0x3C,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x51,0x0C,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C, +0x08,0x09,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x03,0x08, +0x79,0xCA,0x39,0xF9,0x09,0xE9,0x10,0x0B,0x01,0x0B,0x45,0x0B,0xFA,0x3D,0x10,0x0B, +0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B, +0xFB,0x3D,0x03,0x08,0x79,0xCA,0x10,0x0B,0x00,0x0B,0x7D,0x0B,0xBA,0x3D,0x39,0xBF, +0x79,0x9F,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0x36,0x0B,0xA6,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9, +0x29,0xE9,0x10,0x0B,0x00,0x0B,0x37,0x0B,0x2C,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B, +0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x38,0x0B,0x55,0x3D,0x10,0x0B, +0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B, +0xFB,0x3D,0x03,0x08,0x79,0xCA,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x7C,0x0B,0xDC,0x3D, +0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x10,0x0B,0x00,0x0B,0x82,0x0B,0xC1,0x3D, +0x07,0x08,0x4A,0xCA,0x00,0x2B,0x79,0xD9,0x10,0x0B,0x00,0x0B,0x82,0x0B,0xB9,0x3D, +0x79,0xD9,0xD9,0xC9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x36,0x0B,0x74,0x3D, +0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B, +0x34,0x0B,0xFB,0x3D,0x03,0x08,0x79,0xCA,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x7D,0x0B, +0x83,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x03,0x08,0x79,0xCA,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x7D,0x0B,0x72,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B,0x52,0x0C,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x03,0x08,0x79,0xCA,0x39,0xF9,0x39,0xE9, +0x01,0x4A,0x10,0x0B,0x00,0x0B,0x7E,0x0B,0x77,0x3D,0x10,0x0B,0x00,0x0B,0x3A,0x0B, +0x52,0x0C,0x1D,0xF9,0x28,0x4A,0x1D,0xE9,0x24,0x4A,0x10,0x0B,0x00,0x0B,0x7E,0x0B, +0x84,0x3D,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,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0x0B, +0x01,0x78,0x10,0x0B,0x00,0x0B,0x3B,0x0B,0x5A,0x3C,0x20,0x0B,0x02,0x78,0x10,0x0B, +0x00,0x0B,0x3B,0x0B,0x65,0x3C,0x20,0x0B,0x03,0x78,0x10,0x0B,0x00,0x0B,0x3B,0x0B, +0x67,0x3C,0x20,0x0B,0x05,0x78,0x3C,0x3C,0x20,0x0B,0x0F,0x78,0x44,0x3C,0x20,0x0B, +0x10,0x78,0x46,0x3C,0x20,0x0B,0x11,0x78,0x4D,0x3C,0x20,0x0B,0x12,0x78,0x58,0x3C, +0x20,0x0B,0x18,0x78,0x28,0x3C,0x20,0x0B,0x1C,0x78,0x10,0x0B,0x00,0x0B,0x3B,0x0B, +0x69,0x3C,0x20,0x0B,0x1D,0x78,0x10,0x0B,0x00,0x0B,0x3B,0x0B,0xB4,0x3C,0x20,0x0B, +0x1E,0x78,0x10,0x0B,0x00,0x0B,0x3B,0x0B,0xBE,0x3C,0x20,0x0B,0x1F,0x78,0x10,0x0B, +0x00,0x0B,0x3B,0x0B,0xCE,0x3C,0x20,0x0B,0x4B,0x78,0x7D,0x3C,0x20,0x0B,0x4C,0x78, +0x10,0x0B,0x00,0x0B,0x3B,0x0B,0x98,0x3C,0x20,0x0B,0x4D,0x78,0x76,0x3C,0x10,0x0B, +0x00,0x0B,0x3B,0x0B,0xD0,0x0C,0x09,0x39,0x10,0x0B,0x00,0x0B,0x3B,0x0B,0xD2,0x0C, +0x29,0xF9,0x10,0x0B,0x00,0x0B,0x7C,0x0B,0xED,0x3D,0x79,0x99,0x01,0x39,0x10,0x0B, +0x00,0x0B,0x3B,0x0B,0xD2,0x0C,0x02,0x39,0x10,0x0B,0x00,0x0B,0x3B,0x0B,0xD2,0x0C, +0x10,0x0B,0x00,0x0B,0x7D,0x0B,0xBF,0x3D,0x79,0x99,0x01,0x39,0x10,0x0B,0x00,0x0B, +0x3B,0x0B,0xD2,0x0C,0x29,0xBF,0x1F,0xF9,0x29,0xE9,0x01,0x4A,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B,0x69,0xE9,0x02,0x08,0x02,0x4A,0xF9,0xF9, +0xE9,0xE9,0x10,0x0B,0x00,0x0B,0x7E,0x0B,0x91,0x3D,0x79,0x99,0x01,0x39,0x3A,0x0C, +0x05,0x39,0x38,0x0C,0x10,0x0B,0x00,0x0B,0x6E,0x0B,0xA4,0x3D,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x18,0x3F,0x00,0x6F,0x00,0x6F,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x20,0x3F, +0x00,0x6F,0x00,0x6F,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x00,0x6F,0x00,0x6F, +0x01,0x79,0x28,0x0C,0x01,0x39,0x1E,0x0C,0x29,0xBF,0x1F,0xF9,0x00,0x69,0x10,0x0B, +0x00,0x0B,0x76,0x0B,0x7F,0x3D,0x79,0x99,0x01,0x39,0x14,0x0C,0x29,0xBF,0x1F,0xF9, +0x29,0x8E,0x01,0x3E,0x1E,0xE9,0x29,0x8E,0x02,0x3E,0x1E,0xD9,0x00,0x49,0x10,0x0B, +0x00,0x0B,0x74,0x0B,0x09,0x3D,0x79,0x99,0x01,0x39,0x04,0x0C,0x03,0x39,0x02,0x0C, +0x00,0x79,0x08,0x0C,0x09,0xF9,0x19,0xE9,0x39,0xD9,0x10,0x0B,0x00,0x0B,0x38,0x0B, +0x90,0x3D,0x01,0x79,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x0C,0x59,0x69,0xBF,0x1F,0xC9,0x4A,0xCA, +0x4A,0xCA,0x69,0x8E,0x01,0x3E,0x1E,0xB9,0x4A,0xCA,0x4A,0xCA,0x6A,0x8A,0x6A,0x8A, +0x49,0xCA,0x4A,0xCA,0x79,0xBF,0x39,0xCF,0x06,0x08,0x02,0x4A,0x69,0xBF,0x1F,0xC9, +0x4A,0xCA,0x4A,0xCA,0x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F9,0x19,0xBF, +0x29,0x9F,0x59,0xA9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x89,0x09,0x99, +0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F,0x49,0xA9,0x6A,0xCA,0xFF,0x1A, +0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F,0x39,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x08,0x6D,0x00,0x0D,0xFE,0x4D, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D, +0x00,0x2B,0x79,0xE9,0x69,0xA9,0x00,0x2B,0x59,0xD9,0x00,0x2B,0x49,0xC9,0x1D,0x8E, +0x11,0x3E,0x6E,0x99,0xD9,0xF9,0xE9,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B, +0x36,0x3D,0x79,0x89,0x07,0x08,0x04,0x5C,0x10,0x0B,0x00,0x0B,0x3E,0x0B,0x29,0x0C, +0x09,0xB9,0xE9,0xBF,0x4F,0xF9,0x4A,0xCA,0x0C,0x0B,0x2D,0x78,0x10,0x0B,0x00,0x0B, +0x3D,0x0B,0xC5,0x3C,0x14,0x0B,0x05,0x78,0x10,0x0B,0x00,0x0B,0x3D,0x0B,0xE8,0x3C, +0x20,0x0B,0x15,0x78,0x10,0x0B,0x00,0x0B,0x3D,0x0B,0xFC,0x3C,0x20,0x0B,0x20,0x78, +0x1D,0x3C,0x20,0x0B,0x21,0x78,0x1A,0x3C,0x20,0x0B,0x22,0x78,0x17,0x3C,0x20,0x0B, +0x23,0x78,0x36,0x3C,0x20,0x0B,0x24,0x78,0x07,0x3C,0x20,0x0B,0x2F,0x78,0x78,0x3C, +0x10,0x0B,0x00,0x0B,0x3E,0x0B,0x23,0x0C,0x39,0xF9,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0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x01,0x0C,0x00,0x0C,0x09,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B, +0x11,0x3D,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B, +0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x08,0x6D,0x0D,0xA8,0xFE,0x4D, +0x0D,0x8C,0x07,0x6D,0x00,0x0D,0xFE,0x4D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0xA9,0x8D,0x99,0x8D,0x00,0x2B, +0x79,0xF9,0x69,0xB9,0xF9,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x13,0x0B,0xE7,0x3D, +0x07,0x08,0x05,0x1C,0x01,0x79,0x10,0x0B,0x00,0x0B,0x40,0x0B,0x2E,0x0C,0x00,0x09, +0x00,0x19,0x00,0x2B,0x00,0x69,0x00,0x29,0xF9,0xBF,0x4F,0xF9,0x4A,0xCA,0x04,0x0B, +0x06,0x78,0x46,0x3C,0x04,0x0B,0x1D,0x78,0x10,0x0B,0x00,0x0B,0x3F,0x0B,0xFE,0x3C, +0x0C,0x0B,0x2D,0x78,0x10,0x0B,0x00,0x0B,0x3F,0x0B,0x79,0x3C,0x14,0x0B,0x05,0x78, +0x10,0x0B,0x00,0x0B,0x3F,0x0B,0x90,0x3C,0x20,0x0B,0x13,0x78,0x56,0x3C,0x20,0x0B, +0x15,0x78,0x10,0x0B,0x00,0x0B,0x3F,0x0B,0xEC,0x3C,0x20,0x0B,0x16,0x78,0x10,0x0B, +0x00,0x0B,0x3F,0x0B,0xD4,0x3C,0x20,0x0B,0x20,0x78,0x6B,0x3C,0x20,0x0B,0x21,0x78, +0x10,0x0B,0x00,0x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x06,0x3E,0x49,0x9E,0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B,0x59,0xF9, +0xF9,0xF9,0x19,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x36,0x3D,0x79,0xB9, +0x07,0x08,0x01,0x5C,0x15,0x0C,0x39,0xA9,0x19,0xBF,0x4F,0xF9,0x4A,0xCA,0x20,0x0B, +0x0B,0x78,0x01,0x3C,0x07,0x0C,0x29,0xF9,0x09,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B, +0xFB,0x3D,0x01,0x0C,0x00,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x11,0x3D, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x89,0x69,0xB9,0x09,0xF9, +0x39,0xE9,0x10,0x0B,0x00,0x0B,0x14,0x0B,0x36,0x3D,0x07,0x08,0x02,0x1C,0x01,0x79, +0x2E,0x0C,0x00,0x29,0x00,0x19,0x09,0xBF,0x4F,0xF9,0x4A,0xCA,0x20,0x0B,0x0B,0x78, +0x04,0x3C,0x20,0x0B,0x0C,0x78,0x11,0x3C,0x1B,0x0C,0x1D,0xF9,0x10,0x4A,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0x41,0x0B,0x41,0x3D,0x1D,0xF9,0x10,0x4A,0x10,0x0B,0x00,0x0B, +0x83,0x0B,0x57,0x3D,0x79,0xA9,0x01,0x19,0x0D,0x0C,0x39,0xBF,0x1F,0xF9,0x39,0x8E, +0x01,0x3E,0x1E,0xE9,0x10,0x0B,0x00,0x0B,0x84,0x0B,0x1F,0x3D,0x01,0x79,0x07,0x0C, +0x00,0x79,0x05,0x0C,0x09,0xF9,0x29,0xE9,0x19,0xD9,0x91,0x3D,0x01,0x79,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0xA8,0x0D,0x8C,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0xB4,0x3F,0x6F,0xF9,0x12,0x5C,0x10,0x0B,0x00,0x0B,0x30,0x0B,0x1E,0x79, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xB4,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B,0x43,0x0B, +0xED,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x7C,0x3F,0x79,0xEF,0x0D,0x8C,0x10,0x0B, +0x00,0x0B,0x31,0x0B,0xBC,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xC4,0x3F,0x79,0xEF, +0x10,0x0B,0x00,0x0B,0x44,0x0B,0xAD,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x8C,0x3F, +0x79,0xEF,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x42,0x19, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x08,0x1F,0x39,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x00,0x1F,0x39,0xF9,0x29,0xE9, +0x05,0x4A,0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x20,0x4A, +0x39,0xF9,0x29,0xE9,0x25,0x4A,0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D, +0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0xB9,0x69,0x99,0x22,0x29,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9, +0x79,0xBF,0x09,0x1F,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF, +0x00,0x1F,0x39,0xF9,0x19,0xE9,0x05,0x4A,0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B, +0x32,0x3D,0x29,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x79,0xA9,0x00,0x39,0x29,0x8E,0x02,0x3E,0x1E,0xF9,0x13,0x78,0x03,0x3C,0x14,0x78, +0x28,0x3C,0x51,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x9F,0xF7,0x20,0x6C, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0xFF,0x0B, +0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x07,0x08,0xDF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A, +0x06,0x08,0x02,0x5C,0x07,0x08,0x0C,0x1C,0x3E,0x79,0x42,0x69,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x03,0x1C,0x39,0xF9,0x29,0xE9,0x82,0x3D, +0x2B,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08, +0x8A,0xEA,0x20,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x6F,0xE9,0x6F,0xF9, +0x06,0x08,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x07,0x08,0xDF,0x0B,0xFF,0x0B, +0xFF,0x2B,0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x0C,0x1C,0x3E,0x79,0x22,0x69, +0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x03,0x1C,0x39,0xF9, +0x29,0xE9,0x83,0x3D,0x01,0x0C,0x00,0x0C,0x03,0x08,0x07,0x1C,0x39,0xF9,0x10,0x0B, +0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x00,0x39,0x19,0x8E,0x02,0x3E, +0x1E,0xF9,0x08,0x78,0x01,0x3C,0x1C,0x0C,0x0E,0x79,0x04,0x69,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x12,0x1C,0x39,0xA9,0x29,0xF9,0x20,0x0B, +0x0E,0x69,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xD7,0x3D,0x02,0x08,0x79,0xCA,0x29,0xF9, +0x19,0x8E,0x04,0x3E,0x1E,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x06,0x0C, +0x19,0xF9,0x10,0x0B,0x00,0x0B,0x4B,0x0B,0x8C,0x3D,0x0A,0x0C,0x03,0x08,0x07,0x1C, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x04,0x59,0x69,0x8E, +0x04,0x3E,0x1E,0xC9,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF, +0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9, +0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x08,0x3E,0x1E,0xC9,0x79,0xA9,0x29,0xB9, +0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x59,0xF9,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x03,0x59,0x69,0x8E,0x04,0x3E,0x1E,0xC9,0x79,0xA9, +0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E, +0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9, +0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A, +0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F, +0x59,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9, +0x69,0xA9,0x0D,0x19,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF, +0x05,0x1F,0x29,0x8E,0x02,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x02,0x3E,0x4E,0xF9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0xE9,0x06,0x4A,0x08,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x08,0x4A,0x29,0x8E,0x07,0x3E,0x4E,0xF9, +0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF, +0x79,0x9F,0x29,0x8E,0x07,0x3E,0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x19,0xF9, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x02,0x59,0x69,0x8E, +0x02,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x02,0x3E,0x4E,0xC9,0x4A,0xCA,0xBA,0x8A, +0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF, +0x49,0x9F,0x59,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9, +0x00,0x39,0x29,0x8E,0x02,0x3E,0x1E,0xF9,0x0B,0x78,0x14,0x3C,0x0C,0x78,0x28,0x3C, +0x0D,0x78,0x45,0x3C,0x0E,0x78,0x10,0x0B,0x00,0x0B,0x44,0x0B,0x8C,0x3C,0x0F,0x78, +0x10,0x0B,0x00,0x0B,0x44,0x0B,0x8C,0x3C,0x11,0x78,0x6C,0x3C,0x10,0x0B,0x00,0x0B, +0x44,0x0B,0x8C,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x9F,0xF7,0x0F,0x6C, +0x08,0x79,0x04,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08, +0x06,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x43,0x0B,0x1C,0x3D,0x6D,0x0C, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0x00,0x1A, +0x07,0x08,0x80,0x0B,0x00,0x1A,0x06,0x08,0x02,0x5C,0x07,0x08,0x0F,0x1C,0x30,0x79, +0x03,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x06,0x1C, +0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x43,0x0B,0x51,0x3D,0x4E,0x0C,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x9F,0xC7,0x23,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A, +0x07,0x08,0xDF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08, +0x0F,0x1C,0x3E,0x79,0x0D,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9, +0x07,0x08,0x06,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x43,0x0B,0x7C,0x3D, +0x03,0x08,0x07,0x5C,0x29,0x8E,0x02,0x3E,0x4E,0xF9,0x10,0x0B,0x00,0x0B,0x79,0x0B, +0x88,0x3D,0x1B,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x20,0x3F,0x6F,0xE9,0x6F,0xF9, +0x06,0x08,0x8A,0xCA,0x7A,0xEA,0x0F,0x6C,0x57,0x79,0x02,0x69,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x06,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0x43,0x0B,0xCC,0x3D,0x01,0x0C,0x00,0x0C,0x03,0x08,0x07,0x1C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x1B,0x79,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0xD0,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B,0x42,0x0B,0x76,0x79,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0x98,0x3F,0x79,0xEF,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0x99,0x00,0x39,0x19,0xF9,0x10,0x0B,0x00,0x0B,0x50,0x0B,0x50,0x3D,0x07,0x08, +0x02,0x1C,0x01,0x79,0x2D,0x0C,0x19,0x8E,0x02,0x3E,0x1E,0xF9,0x03,0x78,0x01,0x3C, +0x1C,0x0C,0x0E,0x79,0x04,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9, +0x07,0x08,0x12,0x1C,0x39,0xA9,0x29,0xF9,0x20,0x0B,0x0A,0x69,0x10,0x0B,0x00,0x0B, +0x34,0x0B,0xD7,0x3D,0x02,0x08,0x79,0xCA,0x29,0xF9,0x19,0x8E,0x03,0x3E,0x1E,0xE9, +0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x01,0x0C,0x00,0x0C,0x03,0x08,0x07,0x1C, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B,0x59,0xF9,0xF9,0xF9,0x19,0xBF,0x4F,0xE9, +0x10,0x0B,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9,0x06,0x08, +0x01,0x4A,0x69,0xB9,0x79,0xBF,0x1F,0xF9,0x1D,0xE9,0x20,0x4A,0x69,0xBF,0x79,0x9F, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x1F,0xF9,0x1D,0xE9, +0x22,0x4A,0x69,0xBF,0x79,0x9F,0x1D,0x8E,0x09,0x3E,0x39,0xEE,0x03,0x08,0x06,0x4A, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x1F,0xF9,0x1D,0xE9, +0x21,0x4A,0x69,0xBF,0x79,0x9F,0x1D,0xF9,0x10,0x4A,0x39,0xE9,0x10,0x0B,0x00,0x0B, +0x3B,0x0B,0xE3,0x3D,0x1D,0xF9,0x1C,0x4A,0x1D,0xE9,0x10,0x4A,0x10,0x0B,0x00,0x0B, +0x78,0x0B,0x1B,0x3D,0x79,0x99,0xFF,0x29,0x14,0x0C,0x10,0x0B,0x00,0x0B,0x78,0x0B, +0xF5,0x3D,0x0F,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x77,0x0B,0x49,0x3D,0x79,0x99, +0x01,0x29,0x07,0x0C,0x09,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x3E,0x0B,0x39,0x3D, +0x17,0x0C,0x29,0xF9,0xFF,0x1A,0xFF,0x78,0x07,0x7C,0x09,0xF9,0x19,0xE9,0x10,0x0B, +0x00,0x0B,0x38,0x0B,0x70,0x3D,0x0B,0x0C,0x29,0xF9,0xFF,0x1A,0x08,0x4C,0x07,0x1C, +0x09,0xF9,0x19,0xE9,0x29,0xD9,0x10,0x0B,0x00,0x0B,0x44,0x0B,0xEC,0x3D,0x01,0x79, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x06,0x6D,0x0D,0xA8,0xFE,0x4D,0x0D,0x8C, +0x39,0x8D,0x79,0xB9,0x00,0x79,0x10,0x0B,0x00,0x0B,0x33,0x0B,0x6F,0x69,0x10,0x0B, +0x00,0x0B,0x33,0x0B,0xAD,0x59,0x10,0x0B,0x00,0x0B,0x33,0x0B,0xFA,0x49,0x10,0x0B, +0x00,0x0B,0x15,0x0B,0x35,0x3D,0x10,0x0B,0x00,0x0B,0x34,0x0B,0x61,0x79,0x10,0x0B, +0x00,0x0B,0x15,0x0B,0x73,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x4C,0x79,0x00,0x69, +0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x4C,0x3F,0x39,0x9F,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x79,0x00,0x69,0x34,0x59, +0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x10,0x0B,0x00,0x0B,0x46,0x0B,0x8A,0x79, +0x10,0x0B,0x00,0x0B,0x6E,0x0B,0xC1,0x3D,0x10,0x0B,0x00,0x0B,0x34,0x0B,0x74,0x3D, +0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xD8,0x3F,0x79,0xEF,0x0D,0x8C, +0x10,0x0B,0x00,0x0B,0x4A,0x0B,0xE6,0x79,0x10,0x0B,0x00,0x0B,0x4B,0x0B,0x74,0x69, +0x10,0x0B,0x00,0x0B,0x7E,0x0B,0xB5,0x3D,0x10,0x0B,0x00,0x0B,0x45,0x0B,0x1C,0x79, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xAC,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B,0x42,0x0B, +0xE1,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x74,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B, +0x4B,0x0B,0x63,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x6C,0x3F,0x79,0xEF,0x0D,0x8C, +0x10,0x0B,0x00,0x0B,0x40,0x0B,0xC6,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xB4,0x3F, +0x79,0xEF,0x10,0x0B,0x00,0x0B,0x4C,0x0B,0xB2,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x7C,0x3F,0x79,0xEF,0x0D,0x8C,0x10,0x0B,0x00,0x0B,0x41,0x0B,0xB7,0x79,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0xB8,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B,0x4E,0x0B,0x75,0x79, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x80,0x3F,0x79,0xEF,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x03,0x59,0x79,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xF9,0x49,0xBF,0x01,0x1F, +0x69,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9, +0x39,0xBF,0x49,0x9F,0x69,0xC9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0xA9, +0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x59,0xF9,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D, +0x79,0x89,0x00,0x39,0x00,0x2B,0x01,0x79,0x00,0x29,0x29,0xF9,0x3A,0x8A,0x20,0x0B, +0x02,0x0B,0xC7,0x0B,0x70,0x4A,0x79,0xBF,0x6F,0xF9,0x0F,0x1C,0x29,0xF9,0x3A,0x8A, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x70,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B,0x79,0xE9, +0x09,0xF9,0xE9,0xBD,0x07,0x08,0x01,0x1C,0x05,0x0C,0x02,0x08,0x01,0x4A,0x29,0xF9, +0x0E,0x5A,0xE3,0x2C,0x02,0x08,0x0E,0x78,0x3E,0x7C,0x09,0x8E,0x02,0x3E,0x1E,0xF9, +0x00,0x78,0x1D,0x3C,0x01,0x78,0x01,0x3C,0x2B,0x0C,0x10,0x0B,0x00,0x0B,0x34,0x0B, +0x74,0x3D,0x0E,0x79,0x04,0x69,0x54,0x3D,0x79,0xB9,0x07,0x08,0x0F,0x1C,0x39,0x99, +0x19,0xF9,0x0C,0x0B,0x03,0x69,0x9A,0x3D,0x01,0x08,0x79,0xCA,0x19,0xF9,0x09,0x8E, +0x03,0x3E,0x1E,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x12,0x0C,0x10,0x79, +0x01,0x69,0x3E,0x3D,0x79,0xB9,0x07,0x08,0x0A,0x1C,0x09,0x8E,0x04,0x3E,0x1E,0xF9, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x01,0x0C, +0x00,0x0C,0x03,0x08,0x06,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D, +0x02,0x0C,0x00,0x2B,0x00,0x79,0xF9,0xF9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x03,0x08, +0x0A,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x60,0x79,0x00,0x69,0x39,0xD9,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0xC3,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x68,0x3F,0x1F,0xF9, +0x05,0x5C,0x00,0x79,0x10,0x0B,0x00,0x0B,0x15,0x0B,0x79,0x3D,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x69,0xA9,0x29,0xF9,0xFF,0x1A,0x02,0x4A, +0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x09,0x1C, +0x39,0xF9,0x19,0xE9,0x29,0xD9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0x95,0x3D,0x03,0x08, +0x79,0xCA,0x39,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9,0xFF,0x1A,0x05,0x4A,0x4A,0xCA,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x14,0x1C,0x39,0xF9,0x0E,0x69, +0x29,0xD9,0xFF,0x1A,0x03,0x4A,0xFF,0x1A,0x10,0x0B,0x00,0x0B,0x34,0x0B,0x95,0x3D, +0x03,0x08,0x79,0xCA,0x39,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xD7,0x3D, +0x03,0x08,0x79,0xCA,0x39,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x05,0x39,0x59,0xA9,0xFF,0x1A,0x4A,0xCA,0x29,0xC9, +0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x01,0x1F,0x69,0xA9, +0x4A,0xCA,0xFF,0x1A,0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF, +0x29,0x9F,0x69,0xA9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x89,0x09,0x99, +0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F,0x49,0xA9,0x4A,0xCA,0xFF,0x1A, +0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A,0x09,0xF9,0x19,0xBF,0x29,0x9F,0x49,0xA9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x89,0x09,0x99,0x00,0x08,0x01,0x4A, +0x09,0xF9,0x19,0xBF,0x29,0x9F,0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x13,0x19,0x39,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x01,0x1F,0x29,0x8E,0x04,0x3E, +0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x29,0x8E,0x03,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x03,0x3E,0x4E,0xF9,0x4A,0xCA, +0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x29,0x8E,0x08,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x09,0x3E,0x1E,0xF9,0x00,0x78, +0x07,0x3C,0x01,0x78,0x05,0x3C,0x02,0x78,0x17,0x3C,0x03,0x78,0x15,0x3C,0x00,0x0C, +0x29,0x8E,0x09,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0xE9,0x0A,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B, +0xDB,0x3D,0x03,0x08,0x06,0x4A,0x11,0x0C,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A, +0x69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x04,0x3E,0x1E,0xC9, +0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E, +0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xBA,0x8A, +0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF, +0x49,0x9F,0x69,0x8E,0x08,0x3E,0x1E,0xC9,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x59,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x0A,0x59,0x79,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xF9,0x49,0xBF, +0x03,0x1F,0x69,0x8E,0x04,0x3E,0x1E,0xC9,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A, +0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E, +0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9, +0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x04,0x3E,0x4E,0xC9, +0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF, +0x49,0x9F,0x69,0x8E,0x04,0x3E,0x4E,0xC9,0x4A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0x08, +0x01,0x4A,0x69,0xB9,0x79,0xBF,0x04,0x1F,0x29,0x8E,0x04,0x3E,0x1E,0xF9,0x39,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x03,0x3E, +0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x29,0x8E,0x03,0x3E,0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A, +0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x39,0xF9,0x29,0xE9,0x08,0x4A,0x08,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D, +0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x08,0x59, +0x69,0x8E,0x04,0x3E,0x1E,0xC9,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9, +0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9, +0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x03,0x3E, +0x4E,0xC9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08, +0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x08,0x3E,0x1E,0xC9,0x79,0xA9, +0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x05,0x3E, +0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,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08,0x02,0x5C,0x39,0xF9, +0x01,0x0C,0x00,0x79,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x32,0x3F,0x1F,0xF9,0x0A,0x1C,0x10,0x0B,0x00,0x0B,0x82,0x0B,0xDE,0x3D,0x79,0xB9, +0x07,0x08,0x03,0x1C,0x39,0xF9,0xA7,0x3D,0x05,0x0C,0x00,0x79,0x10,0x0B,0x00,0x0B, +0x15,0x0B,0x79,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x00,0x39, +0x29,0x8E,0x02,0x3E,0x1E,0xF9,0x05,0x78,0x19,0x3C,0x06,0x78,0x44,0x3C,0x07,0x78, +0x5B,0x3C,0x09,0x78,0x10,0x0B,0x00,0x0B,0x4C,0x0B,0x75,0x3C,0x0A,0x78,0x10,0x0B, +0x00,0x0B,0x4C,0x0B,0x4B,0x3C,0x10,0x78,0x7C,0x3C,0x12,0x78,0x10,0x0B,0x00,0x0B, +0x4C,0x0B,0x8E,0x3C,0x10,0x0B,0x00,0x0B,0x4C,0x0B,0xA4,0x0C,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x28,0x3F,0x9F,0x87,0x23,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F, +0x6F,0xE9,0x6F,0xF9,0x06,0x08,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x07,0x08, +0xDF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x0F,0x1C, +0x3E,0x79,0x13,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08, +0x06,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B,0xA1,0x3D,0x10,0x0B, +0x00,0x0B,0x4C,0x0B,0xA5,0x0C,0x20,0x0B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,0x3D,0x5A,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x28,0x3F,0x9F,0xB7, +0x23,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08, +0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x07,0x08,0xDF,0x0B,0xFF,0x0B,0xFF,0x2B, +0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x0F,0x1C,0x3E,0x79,0x0C,0x69,0x10,0x0B, +0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x06,0x1C,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0x49,0x0B,0xAF,0x3D,0x30,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0xBA,0xEA,0x0F,0x6C,0x0C,0x79,0x08,0x69, +0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x06,0x1C,0x39,0xF9, +0x29,0xE9,0x10,0x0B,0x00,0x0B,0x49,0x0B,0xED,0x3D,0x17,0x0C,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0x28,0x3F,0x9F,0xE7,0x0F,0x6C,0x3E,0x79,0x0B,0x69,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x06,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0x4A,0x0B,0x56,0x3D,0x01,0x0C,0x00,0x0C,0x03,0x08,0x07,0x1C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x43,0x0B, +0xED,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x02,0x49,0x79,0xA9, +0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x69,0x9F,0x59,0xB9,0x4A,0xCA, +0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F, +0x59,0xB9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08, +0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x49,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x89, +0x69,0x99,0x00,0x2B,0x59,0xF9,0xF9,0xF9,0x09,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B, +0x47,0x0B,0x36,0x3D,0x79,0xA9,0x07,0x08,0x01,0x5C,0x3B,0x0C,0x29,0xB9,0x09,0xBF, +0x4F,0xF9,0x4A,0xCA,0x20,0x0B,0x27,0x78,0x13,0x3C,0x20,0x0B,0x28,0x78,0x10,0x3C, +0x20,0x0B,0x29,0x78,0x0D,0x3C,0x20,0x0B,0x2A,0x78,0x11,0x3C,0x20,0x0B,0x2D,0x78, +0x07,0x3C,0x20,0x0B,0x2E,0x78,0x04,0x3C,0x20,0x0B,0x4E,0x78,0x01,0x3C,0x1B,0x0C, +0x39,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x15,0x0C,0x1D,0xF9, +0x14,0x4A,0x79,0xBF,0x00,0x1F,0x1D,0xF9,0x14,0x4A,0x10,0x0B,0x00,0x0B,0x85,0x0B, +0x2A,0x3D,0x79,0x99,0x39,0xF9,0x19,0xE9,0x1D,0xD9,0x14,0x4A,0x59,0xBF,0x1F,0xD9, +0x4A,0xCA,0x91,0x3D,0x01,0x0C,0x00,0x0C,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B, +0x11,0x3D,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0xA8, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x00,0x2B,0x79,0xF9, +0x69,0xB9,0x00,0x19,0x00,0x29,0xF9,0xBF,0x4F,0xF9,0x4A,0xCA,0x20,0x0B,0x27,0x78, +0x13,0x3C,0x20,0x0B,0x28,0x78,0x1F,0x3C,0x20,0x0B,0x29,0x78,0x27,0x3C,0x20,0x0B, +0x2A,0x78,0x2B,0x3C,0x20,0x0B,0x2D,0x78,0x2A,0x3C,0x20,0x0B,0x2E,0x78,0x30,0x3C, +0x20,0x0B,0x4E,0x78,0x45,0x3C,0x52,0x0C,0x39,0xBF,0x1F,0xF9,0x39,0xE9,0x01,0x4A, +0x39,0xD9,0x07,0x4A,0x39,0xC9,0x17,0x4A,0x10,0x0B,0x00,0x0B,0x84,0x0B,0x67,0x3D, +0x79,0x99,0x01,0x29,0x45,0x0C,0x39,0xBF,0x1F,0xF9,0x39,0xE9,0x01,0x4A,0x10,0x0B, +0x00,0x0B,0x84,0x0B,0xBC,0x3D,0x79,0x99,0x01,0x29,0x3A,0x0C,0x10,0x0B,0x00,0x0B, +0x85,0x0B,0x04,0x3D,0x79,0x99,0x01,0x29,0x33,0x0C,0x02,0x29,0x31,0x0C,0x39,0xBF, +0x1F,0xF9,0x10,0x0B,0x00,0x0B,0x85,0x0B,0xB5,0x3D,0x79,0x99,0x01,0x29,0x28,0x0C, +0x39,0xBF,0x1F,0xF9,0x4A,0xCA,0x4A,0xCA,0x39,0x8E,0x01,0x3E,0x1E,0xE9,0x4A,0xCA, +0x4A,0xCA,0x6A,0x8A,0x6A,0x8A,0x79,0xCA,0x4A,0xCA,0x69,0x89,0x03,0x08,0x02,0x4A, +0x09,0xF9,0x10,0x0B,0x00,0x0B,0x85,0x0B,0xDF,0x3D,0x79,0x99,0x01,0x29,0x10,0x0C, +0x39,0xBF,0x1F,0xF9,0x39,0xE9,0x01,0x4A,0x39,0x8E,0x07,0x3E,0x1E,0xD9,0x10,0x0B, +0x00,0x0B,0x86,0x0B,0x07,0x3D,0x79,0x99,0x01,0x29,0x02,0x0C,0x00,0x79,0x08,0x0C, +0xF9,0xF9,0x19,0xE9,0x29,0xD9,0x10,0x0B,0x00,0x0B,0x4C,0x0B,0xE1,0x3D,0x01,0x79, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x29,0x8E,0x08,0x3E,0x1E,0xF9,0x0C,0x4A, +0xFF,0x1A,0x79,0x99,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF, +0x02,0x1F,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x01,0x1F, +0x29,0x8E,0x0A,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x29,0x8E,0x0B,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0xE9,0x0C,0x4A,0x10,0x0B, +0x00,0x0B,0x06,0x0B,0xDB,0x3D,0x03,0x08,0x06,0x4A,0x29,0x8E,0x08,0x3E,0x1E,0xF9, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9, +0x29,0x8E,0x01,0x3E,0x6E,0xE9,0x29,0x8E,0x08,0x3E,0x1E,0xD9,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x32,0x3D,0x29,0x8E,0x08,0x3E,0x1E,0xF9,0x03,0x08,0x79,0xCA,0x29,0x8E, +0x09,0x3E,0x1E,0xF9,0x6A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x12,0x19,0x39,0xE9,0x69,0xF9, +0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x0B,0x1F,0x39,0xE9,0x69,0xF9,0x06,0x08, +0x01,0x4A,0x69,0xB9,0x79,0xBF,0x01,0x1F,0x29,0x8E,0x0A,0x3E,0x1E,0xF9,0x39,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x0B,0x3E, +0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x39,0xF9,0x29,0xE9,0x0C,0x4A,0x10,0x0B,0x00,0x0B,0x06,0x0B,0xDB,0x3D,0x03,0x08, +0x06,0x4A,0x29,0x8E,0x12,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0xE9,0x13,0x4A,0x10,0x0B,0x00,0x0B, +0x06,0x0B,0xDB,0x3D,0x03,0x08,0x06,0x4A,0x29,0x8E,0x09,0x3E,0x1E,0xF9,0x6A,0xCA, +0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F, +0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9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0x0B,0x28,0x3F,0x9F,0x97,0x42,0x6C,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0x18,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A, +0x07,0x08,0xDF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08, +0x2E,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x48,0x3F,0x1F,0xF9,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x0D,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7, +0x48,0x8A,0x2A,0xBA,0x1C,0x6C,0x3E,0x79,0x29,0x8E,0x08,0x3E,0x1E,0xE9,0x0C,0x4A, +0xFF,0x1A,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08,0x0F,0x1C, +0x00,0x2B,0x39,0xE9,0xE9,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x4D,0x0B,0xBF,0x3D, +0x20,0x0B,0x02,0x0B,0xC7,0x0B,0x48,0x3F,0x0F,0xF9,0x01,0x4A,0x79,0xAF,0x1D,0x0C, +0x0E,0x79,0x04,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x18,0x3D,0x79,0xB9,0x07,0x08, +0x12,0x1C,0x39,0x99,0x19,0xF9,0x20,0x0B,0x0C,0x69,0x10,0x0B,0x00,0x0B,0x34,0x0B, +0xD7,0x3D,0x01,0x08,0x79,0xCA,0x19,0xF9,0x29,0x8E,0x03,0x3E,0x1E,0xE9,0x10,0x0B, +0x00,0x0B,0x34,0x0B,0xFB,0x3D,0x01,0x0C,0x00,0x0C,0x03,0x08,0x07,0x1C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B, +0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0x99,0x59,0x89,0x07,0x29, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x19,0x9F,0x39,0xF9, +0x09,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0xDB,0x3D,0x03,0x08,0x06,0x4A,0x29,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B,0x59,0xF9,0x00,0x2B, +0x49,0xE9,0xF9,0xF9,0x19,0xBF,0x4F,0xE9,0x10,0x0B,0x00,0x0B,0x47,0x0B,0x36,0x3D, +0x79,0xB9,0x07,0x08,0x01,0x5C,0x16,0x0C,0x39,0xA9,0x19,0xBF,0x4F,0xF9,0x4A,0xCA, +0x20,0x0B,0x2B,0x78,0x04,0x3C,0x20,0x0B,0x2C,0x78,0x01,0x3C,0x05,0x0C,0x29,0xF9, +0x09,0xE9,0xE9,0xD9,0xBD,0x3D,0x01,0x0C,0x00,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x35,0x0B,0x11,0x3D,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0xF9,0x8D,0x00,0x2B,0x79,0xF9,0x69,0xB9,0x00,0x29,0x00,0x19,0x00,0x09, +0x1D,0xF9,0x14,0x4A,0x79,0xBF,0x20,0x0B,0x02,0x0B,0x9B,0x2B,0x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x8E,0x04,0x3E,0x1E,0xF9,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0x8E,0x02,0x3E, +0x6E,0xD9,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A, +0x39,0xF9,0x29,0x8E,0x04,0x3E,0x6E,0xD9,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B, +0x99,0x3D,0x03,0x08,0x06,0x4A,0x19,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x00,0x39,0x19,0x8E,0x02,0x3E,0x1E,0xF9, +0x15,0x78,0x01,0x3C,0x14,0x0C,0xFF,0x79,0x0F,0x69,0x10,0x0B,0x00,0x0B,0x47,0x0B, +0x18,0x3D,0x79,0xB9,0x07,0x08,0x0A,0x1C,0x39,0xA9,0x29,0xF9,0xFF,0x0B,0xF1,0x69, +0x9F,0x3D,0x02,0x08,0x79,0xCA,0x29,0xF9,0x19,0xE9,0xB7,0x3D,0x01,0x0C,0x00,0x0C, +0x03,0x08,0x07,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x35,0x0B,0x07,0x3D,0x01,0x79, +0x01,0x0C,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x00,0x0B, +0x4A,0x0B,0xE6,0x79,0x10,0x0B,0x00,0x0B,0x4B,0x0B,0x74,0x69,0x10,0x0B,0x00,0x0B, +0x7E,0x0B,0xB5,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xAC,0x3F,0x6F,0xF9,0x12,0x5C, +0x10,0x0B,0x00,0x0B,0x3E,0x0B,0x39,0x79,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xAC,0x3F, +0x79,0xEF,0x10,0x0B,0x00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x63,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0x00,0x2B,0x79,0xF9,0x00,0x2B,0x69,0xE9, +0x00,0x2B,0x59,0xD9,0x00,0x2B,0x49,0xC9,0x1D,0x8E,0x09,0x3E,0x6E,0x99,0x0A,0x3E, +0x6E,0x89,0x00,0x29,0xF9,0xF9,0x10,0x0B,0x00,0x0B,0x24,0x0B,0x2A,0x3D,0xE9,0xF9, +0x19,0xE9,0x09,0xD9,0x10,0x0B,0x00,0x0B,0x17,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA, +0x79,0xB9,0x01,0x08,0x39,0xCA,0x00,0x08,0x39,0xDA,0x02,0x08,0x39,0xCA,0xC9,0xF9, +0x19,0xE9,0x09,0xD9,0x10,0x0B,0x00,0x0B,0x17,0x0B,0x66,0x3D,0x07,0x08,0x4A,0xCA, +0x79,0xB9,0x01,0x08,0x39,0xCA,0x00,0x08,0x39,0xDA,0x02,0x08,0x39,0xCA,0xD9,0xF9, +0x19,0xE9,0x09,0xD9,0x10,0x0B,0x00,0x0B,0x1D,0x0B,0x17,0x3D,0x07,0x08,0x4A,0xCA, +0x79,0xB9,0x02,0x08,0x39,0xCA,0x29,0xF9,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9, +0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x99,0x69,0x89, +0x00,0x2B,0x59,0xF9,0x00,0x39,0x19,0xF9,0x10,0x0B,0x00,0x0B,0x6D,0x0B,0x6C,0x3D, +0x09,0xF9,0xF9,0xE9,0x10,0x0B,0x00,0x0B,0x7E,0x0B,0xA3,0x3D,0x07,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x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x10,0x0B, +0x00,0x0B,0x46,0x0B,0x53,0x3D,0x10,0x0B,0x00,0x0B,0x46,0x0B,0x40,0x3D,0x10,0x0B, +0x00,0x0B,0x46,0x0B,0x18,0x3D,0x10,0x0B,0x00,0x0B,0x42,0x0B,0x17,0x3D,0x10,0x0B, +0x00,0x0B,0x41,0x0B,0xFE,0x3D,0x10,0x0B,0x00,0x0B,0x50,0x0B,0x7E,0x3D,0x10,0x0B, +0x00,0x0B,0x41,0x0B,0x2C,0x3D,0x10,0x0B,0x00,0x0B,0x30,0x0B,0xE3,0x3D,0x10,0x0B, +0x00,0x0B,0x44,0x0B,0x9A,0x3D,0x10,0x0B,0x00,0x0B,0x32,0x0B,0x65,0x79,0x10,0x0B, +0x00,0x0B,0x0B,0x0B,0x03,0x3D,0x79,0xB9,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x45,0x0B, +0xD0,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x29,0xF9,0x10,0x0B, +0x00,0x0B,0x51,0x0B,0x83,0x3D,0x79,0xB9,0xB0,0x3D,0xC0,0x3D,0x10,0x0B,0x00,0x0B, +0x24,0x0B,0x28,0x79,0x10,0x0B,0x00,0x0B,0x46,0x0B,0x12,0x3D,0x39,0xF9,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0x79,0x99,0x69,0xB9,0x00,0x2B,0x59,0xF9,0x49,0x89,0x19,0x8E, +0x09,0x3E,0x6E,0xF9,0x79,0xA9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x86,0x3D,0x07,0x08, +0x05,0x1C,0x01,0x79,0x10,0x0B,0x00,0x0B,0x53,0x0B,0x52,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0xB5,0x3F,0x1F,0xF9,0x07,0x4C,0x03,0x5A,0x05,0x2C,0x01,0x79,0x10,0x0B, +0x00,0x0B,0x53,0x0B,0x52,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xB5,0x3F,0x1F,0xF9, +0x25,0x4A,0xFF,0x1A,0x29,0x8E,0x01,0x3E,0x79,0x9E,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xB5,0x3F,0x0F,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0x8F,0x07,0x08,0xFF,0x1A, +0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0x8E, +0x1A,0x3E,0x1E,0xF9,0x69,0x9A,0xD2,0x1C,0x09,0xF9,0xFF,0x1A,0x0D,0x5C,0xF9,0xF9, +0xFF,0x1A,0x00,0x78,0x03,0x3C,0x04,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B,0x01,0x0B, +0x45,0x0B,0x88,0x3D,0x01,0x0C,0x00,0x0C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x42,0x0B, +0x38,0x3D,0x00,0x08,0x09,0x1C,0x19,0x8E,0x02,0x3E,0x6E,0xF9,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0xC4,0x3F,0x79,0xEF,0x78,0x0C,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x2B,0x1C, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x79,0xE9,0x69,0xF9, +0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x00,0x2B,0x69,0xE9,0x10,0x0B, +0x01,0x0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B,0x01,0x0B,0x42,0x0B, +0x43,0x3D,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x05,0x1C,0x10,0x0B,0x00,0x0B,0x60,0x0B, +0x27,0x3D,0x04,0x0C,0x10,0x0B,0x00,0x0B,0x60,0x0B,0x19,0x3D,0x39,0xBF,0x6F,0xF9, +0x1D,0x8E,0x07,0x3E,0x79,0xEE,0x39,0x8E,0x18,0x3E,0x1E,0xF9,0x4A,0xCA,0x1D,0x8E, +0x0C,0x3E,0x79,0xCE,0x1D,0xF9,0x18,0x4A,0x01,0x69,0x10,0x0B,0x01,0x0B,0x42,0x0B, +0x5D,0x3D,0x00,0x79,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0x89,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x79,0x99,0x19,0x8E, +0x09,0x3E,0x6E,0xF9,0x68,0x4A,0x79,0xB9,0x00,0x29,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x79,0xEF,0x10,0x0B,0x00,0x0B, +0x25,0x0B,0x74,0x3D,0x00,0x08,0x0C,0x1C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xF4,0x3F, +0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x01,0x29,0x10,0x0B,0x00,0x0B,0x54,0x0B,0x1F,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xB4,0x3F,0x0F,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A, +0x69,0x8F,0x07,0x08,0xFF,0x1A,0x00,0x78,0x06,0x3C,0x02,0x78,0x76,0x3C,0x10,0x0B, +0x00,0x0B,0x54,0x0B,0x1E,0x0C,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x5D,0x1C,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08, +0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xF8,0x3F,0x4F,0xF9, +0x4A,0xCA,0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79, +0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D, +0x69,0xF9,0x06,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xF8,0x3F,0x4F,0xF9,0x4A,0xCA, +0x07,0x08,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xF8,0x3F,0x79,0xCF,0x10,0x0B, +0x00,0x0B,0x60,0x0B,0x27,0x3D,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x24,0x69,0x10,0x0B, +0x01,0x0B,0x44,0x0B,0xC3,0x3D,0x09,0x0C,0x19,0xF9,0x39,0xE9,0x09,0xD9,0x00,0x49, +0x10,0x0B,0x00,0x0B,0x52,0x0B,0x32,0x3D,0x79,0xA9,0x20,0x0B,0x02,0x0B,0xC7,0x0B, +0xE0,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x12,0x0C,0x19,0xF9,0x39,0xE9,0x09,0xD9, +0x00,0x49,0x10,0x0B,0x00,0x0B,0x52,0x0B,0x32,0x3D,0x79,0xA9,0x20,0x0B,0x02,0x0B, +0xC7,0x0B,0xF0,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x01,0x0C,0x00,0x0C,0x02,0x08, +0x0F,0x1C,0x09,0xF9,0xFF,0x1A,0x00,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B,0x01,0x0B, +0x45,0x0B,0x88,0x3D,0x01,0x0C,0x00,0x0C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D, +0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F, +0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xFE,0x3F, +0x4F,0xF9,0x4A,0xCA,0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9, +0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xF0,0x3D,0x69,0xF9,0x06,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xFE,0x3F,0x4F,0xF9, +0x4A,0xCA,0x07,0x08,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xFE,0x3F,0x79,0xCF, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0x79,0x99, +0x00,0x2B,0x49,0xD9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x79,0xA9,0x29,0x8E, +0x09,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xF9,0xF9,0xF9,0x68,0x4A,0x79,0xB9,0x00,0x09, +0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F, +0x79,0xEF,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xB4,0x3F,0x0F,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0x8F,0x07,0x08,0xFF,0x1A, +0x01,0x78,0x04,0x3C,0x10,0x0B,0x00,0x0B,0x55,0x0B,0xAC,0x0C,0x19,0xF9,0xFF,0x1A, +0x00,0x78,0x13,0x3C,0x01,0x78,0x10,0x0B,0x00,0x0B,0x55,0x0B,0x76,0x3C,0x03,0x78, +0x10,0x0B,0x00,0x0B,0x55,0x0B,0x76,0x3C,0x04,0x78,0x10,0x0B,0x00,0x0B,0x55,0x0B, +0x76,0x3C,0x10,0x0B,0x00,0x0B,0x55,0x0B,0x76,0x0C,0x39,0x8E,0x07,0x3E,0xD9,0xEE, +0x39,0x8E,0x01,0x3E,0x6E,0xF9,0xF9,0xE9,0x50,0x4A,0x00,0x59,0x39,0xC9,0x20,0x4A, +0x10,0x0B,0x00,0x0B,0x1A,0x0B,0x92,0x3D,0x00,0x2B,0x79,0xE9,0x75,0x1C,0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F9,0x20,0x4A,0x01,0x69,0x10,0x0B, +0x01,0x0B,0x43,0x0B,0x24,0x3D,0x09,0x0C,0x29,0xF9,0x39,0xE9,0x19,0xD9,0x00,0x49, +0x10,0x0B,0x00,0x0B,0x52,0x0B,0x32,0x3D,0x79,0x89,0x0E,0x08,0x0E,0x1C,0x39,0x8E, +0x05,0x3E,0x6E,0xF9,0x0A,0x1C,0x39,0x8E,0x05,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xC9, +0x29,0xF9,0x39,0x8E,0x01,0x3E,0x6E,0xE9,0xC9,0xBD,0x0A,0x0C,0x29,0xF9,0x39,0xE9, +0x19,0xD9,0x00,0x49,0x10,0x0B,0x00,0x0B,0x52,0x0B,0x32,0x3D,0x79,0x89,0x00,0x0C, +0x19,0xF9,0xFF,0x1A,0x00,0x78,0x07,0x3C,0x01,0x78,0x1D,0x3C,0x03,0x78,0x0B,0x3C, +0x04,0x78,0x11,0x3C,0x18,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xE4,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x18,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xEC,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x10,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xE8,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B,0x02,0x0B,0xC7,0x0B,0xF4,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x00,0x0C,0x01,0x0C,0x00,0x0C,0x00,0x08,0x11,0x1C,0x19,0xF9, +0xFF,0x1A,0x00,0x78,0x03,0x3C,0x04,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B,0x01,0x0B, +0x45,0x0B,0x88,0x3D,0x01,0x0C,0x00,0x0C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D, +0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,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0x00,0x0B,0x25,0x0B, +0x74,0x3D,0x79,0xA9,0x29,0x8E,0x09,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xF9,0xF9,0xF9, +0x68,0x4A,0x79,0xB9,0x00,0x19,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x09,0xF9, +0xFF,0x1A,0x00,0x78,0x03,0x3C,0x01,0x78,0x11,0x3C,0x10,0x0C,0x39,0xBF,0x6F,0xF9, +0x00,0x2B,0x79,0xB9,0x29,0xF9,0x09,0xE9,0xB9,0xBD,0x07,0x08,0x02,0x1C,0x00,0x79, +0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x79,0x99,0x09,0x0C,0x39,0xBF,0x6F,0xF9, +0x00,0x2B,0x79,0xB9,0x29,0xF9,0x09,0xE9,0xB9,0xBD,0x01,0x19,0x00,0x0C,0x01,0x08, +0x05,0x1C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D,0x7E,0x0C,0x39,0x8E,0x05,0x3E, +0x4E,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xCC,0x3F,0x4F,0xE9,0x4A,0xCA, +0x79,0xCA,0x00,0x2B,0x69,0xE9,0xE9,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x00,0x2B,0x69,0xD9, +0xE9,0xF9,0x00,0x2B,0x79,0xB9,0xD9,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0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8,0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0x79,0x89,0x10,0x0B,0x00,0x0B, +0x25,0x0B,0x74,0x3D,0x79,0xA9,0x29,0x8E,0x09,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xF9, +0xF9,0xF9,0x68,0x4A,0x79,0xB9,0x00,0x19,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D, +0x09,0xF9,0xFF,0x1A,0x00,0x78,0x07,0x3C,0x01,0x78,0x16,0x3C,0x03,0x78,0x14,0x3C, +0x04,0x78,0x01,0x3C,0x11,0x0C,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xB9, +0x29,0xF9,0x09,0xE9,0xB9,0xBD,0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79, +0x07,0x08,0xFF,0x1A,0x79,0x99,0x0A,0x0C,0x39,0x8E,0x01,0x3E,0x6E,0xF9,0x00,0x2B, +0x79,0xB9,0x29,0xF9,0x09,0xE9,0xB9,0xBD,0x01,0x19,0x00,0x0C,0x01,0x08,0x05,0x1C, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D,0x78,0x0C,0x10,0x0B,0x01,0x0B,0x45,0x0B, +0x88,0x3D,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x28,0x3F,0x9F,0x8E,0x02,0x3E,0x1E,0xF9, +0x00,0x2B,0x79,0xE9,0xE9,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x00,0x2B,0x69,0xD9,0xE9,0xF9, +0x00,0x2B,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10,0x0B, +0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA,0x79,0xC9,0x09,0xF9,0x29,0xE9, +0x39,0xD9,0x10,0x0B,0x00,0x0B,0x5A,0x0B,0x1A,0x3D,0x79,0x99,0x07,0x08,0x02,0x5C, +0x01,0x79,0x54,0x0C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08,0x4A,0xCA, +0x79,0xE9,0x69,0xF9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x18,0x0B,0x6A,0x0B, +0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0xB8,0x3F,0x06,0x08,0x9F,0xCA,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xC4,0x3F,0x69,0xEF,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xCC,0x3F,0x00,0x4F,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0xC8,0x3F,0x19,0xEF,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xBC,0x79, +0x10,0x0B,0x01,0x0B,0x42,0x0B,0x43,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xB4,0x3F, +0x00,0x1F,0x29,0x8E,0x01,0x3E,0x6E,0xF9,0x05,0x1C,0x10,0x0B,0x00,0x0B,0x60,0x0B, +0x27,0x3D,0x04,0x0C,0x10,0x0B,0x00,0x0B,0x60,0x0B,0x19,0x3D,0x29,0xBF,0x6F,0xF9, +0x27,0x69,0x10,0x0B,0x01,0x0B,0x43,0x0B,0xC1,0x3D,0x00,0x79,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D, +0xE9,0x8D,0x00,0x2B,0x79,0xF9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x79,0xA9, +0x29,0x8E,0x09,0x3E,0x6E,0xF9,0x68,0x4A,0x79,0xB9,0x00,0x19,0x00,0x09,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x79,0xEF, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xB4,0x3F, +0x0F,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0x8F,0x07,0x08,0xFF,0x1A,0x01,0x78, +0x04,0x3C,0x10,0x0B,0x00,0x0B,0x5C,0x0B,0x0F,0x0C,0xF9,0xF9,0xFF,0x1A,0x00,0x78, +0x03,0x3C,0x01,0x78,0x6C,0x3C,0x6B,0x0C,0x39,0x8E,0x06,0x3E,0x6E,0xF9,0x00,0x2B, +0x79,0xE9,0x29,0xF9,0x39,0x8E,0x01,0x3E,0x6E,0xE9,0xE9,0xBD,0x07,0x08,0x5D,0x1C, +0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F, +0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x5C,0x3F, +0x4F,0xF9,0x4A,0xCA,0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9, +0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xF0,0x3D,0x69,0xF9,0x06,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x5C,0x3F,0x4F,0xF9, +0x4A,0xCA,0x07,0x08,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x5C,0x3F,0x79,0xCF, +0x10,0x0B,0x00,0x0B,0x60,0x0B,0x19,0x3D,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0x27,0x69, +0x10,0x0B,0x01,0x0B,0x44,0x0B,0xC3,0x3D,0x01,0x0C,0x01,0x09,0x02,0x0C,0x01,0x19, +0x00,0x0C,0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x01,0x3C,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x48,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x58,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C,0x01,0x0C,0x00,0x0C, +0x00,0x08,0x12,0x1C,0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B, +0x01,0x0B,0x45,0x0B,0x88,0x3D,0x01,0x0C,0x00,0x0C,0x29,0xF9,0x39,0xE9,0x10,0x0B, +0x00,0x0B,0x5A,0x0B,0xAF,0x3D,0x79,0x99,0x01,0x08,0x04,0x1C,0x10,0x0B,0x00,0x0B, +0x25,0x0B,0x8C,0x3D,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x00,0x3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xF9, +0x00,0x2B,0x79,0xE9,0xE9,0xF9,0x68,0x4A,0x79,0xB9,0x00,0x09,0x00,0x19,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x79,0xEF, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xB4,0x3F, +0x0F,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0x8F,0x07,0x08,0xFF,0x1A,0x00,0x78, +0x09,0x3C,0x02,0x78,0x10,0x0B,0x00,0x0B,0x5D,0x0B,0xB4,0x3C,0x10,0x0B,0x00,0x0B, +0x5E,0x0B,0x11,0x0C,0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x13,0x3C,0x01,0x78,0x10,0x0B, +0x00,0x0B,0x5D,0x0B,0x86,0x3C,0x03,0x78,0x10,0x0B,0x00,0x0B,0x5D,0x0B,0x84,0x3C, +0x04,0x78,0x10,0x0B,0x00,0x0B,0x5D,0x0B,0x84,0x3C,0x10,0x0B,0x00,0x0B,0x5D,0x0B, +0x86,0x0C,0x39,0x8E,0x22,0x3E,0xC9,0x9E,0x39,0x8E,0x09,0x3E,0xB9,0xEE,0x39,0x8E, +0x0A,0x3E,0xA9,0xEE,0x1D,0xF9,0x38,0x4A,0x79,0xBF,0x1F,0xF9,0x39,0x8E,0x23,0x3E, +0x79,0x9E,0x39,0xBF,0x6F,0xF9,0xE9,0xE9,0x50,0x4A,0x00,0x59,0x39,0xC9,0x30,0x4A, +0x10,0x0B,0x00,0x0B,0x1A,0x0B,0x92,0x3D,0x00,0x2B,0x79,0xD9,0x74,0x1C,0x39,0x8E, +0x04,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0x99,0x29,0xF9,0x39,0xBF,0x6F,0xE9,0x99,0xBD, +0x07,0x08,0x69,0x1C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0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E,0x6E,0xF9,0x00,0x2B,0x79,0x99,0x29,0xF9, +0x39,0xBF,0x6F,0xE9,0x99,0xBD,0x04,0x0C,0x01,0x19,0x02,0x0C,0x01,0x09,0x00,0x0C, +0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x07,0x3C,0x01,0x78,0x1D,0x3C,0x03,0x78,0x0B,0x3C, +0x04,0x78,0x11,0x3C,0x18,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x3C,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x18,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x44,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x10,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x40,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x58,0x3F,0x9F,0xF9, +0x01,0x4A,0x79,0xFF,0x00,0x0C,0x5E,0x0C,0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x07,0x3C, +0x01,0x78,0x29,0x3C,0x03,0x78,0x1D,0x3C,0x04,0x78,0x1B,0x3C,0x24,0x0C,0x39,0x8E, +0x02,0x3E,0x6E,0xF9,0xE9,0xE9,0x50,0x4A,0x00,0x59,0x39,0xC9,0x30,0x4A,0x10,0x0B, +0x00,0x0B,0x1A,0x0B,0x92,0x3D,0x07,0x08,0x0A,0x1C,0x39,0x8E,0x07,0x3E,0x6E,0xF9, +0x00,0x2B,0x79,0x99,0x29,0xF9,0x39,0x8E,0x02,0x3E,0x6E,0xE9,0x99,0xBD,0x01,0x19, +0x0C,0x0C,0x39,0x8E,0x07,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0x99,0x29,0xF9,0x00,0x69, +0x99,0xBD,0x01,0x19,0x02,0x0C,0x01,0x09,0x00,0x0C,0xF9,0xF9,0xFF,0x1A,0x00,0x78, +0x07,0x3C,0x01,0x78,0x1D,0x3C,0x03,0x78,0x0B,0x3C,0x04,0x78,0x11,0x3C,0x18,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x4C,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x18,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x54,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x10,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x50,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x58,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C, +0x01,0x0C,0x00,0x0C,0x01,0x08,0x14,0x1C,0xF9,0xF9,0xFF,0x1A,0x00,0x78,0x03,0x3C, +0x04,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B,0x01,0x0B,0x45,0x0B,0x88,0x3D,0x01,0x0C, +0x00,0x0C,0x29,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x5A,0x0B,0xAF,0x3D,0x79,0x89, +0x00,0x08,0x04,0x1C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA, +0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x60,0x3F,0x4F,0xF9,0x4A,0xCA, +0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B, +0x02,0x0B,0xC8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xBF,0x1F,0xF9,0x3A,0x8A,0x2A,0x8A,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0x68,0x4A,0x79,0xBF,0x6F,0xF9,0x79,0x99,0x29,0xF9,0x39,0xE9,0x19,0xBD,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x42,0x0B,0x00,0x3D,0x10,0x0B, +0x00,0x0B,0x5F,0x0B,0x41,0x79,0x79,0x8D,0x01,0x79,0x10,0x0B,0x00,0x0B,0x5F,0x0B, +0x69,0x69,0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x8E,0x59,0x10,0x0B,0x00,0x0B,0x5F,0x0B, +0x37,0x49,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xAB,0x3D,0x0D,0xA8,0x10,0x0B,0x00,0x0B, +0x5F,0x0B,0x41,0x79,0x79,0x8D,0x02,0x79,0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x69,0x69, +0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x8E,0x59,0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x46,0x49, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0xAB,0x3D,0x0D,0xA8,0x10,0x0B,0x00,0x0B,0x5F,0x0B, +0x5F,0x79,0x79,0x8D,0x03,0x79,0x00,0x69,0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x8E,0x59, +0x10,0x0B,0x00,0x0B,0x5F,0x0B,0x50,0x49,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xAB,0x3D, +0x0D,0xA8,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x64,0x79,0x00,0x69,0x74,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x0D,0x8C,0x79,0xC9,0xFF,0x1A,0x3A,0x8A,0x2A,0x8A, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x64,0x4A,0x49,0xBF,0x69,0xEF,0x79,0xC9,0xFF,0x1A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x59,0xF9,0xBD,0x00,0x0C,0x10,0x0B,0x00,0x0B,0x25,0x0B, +0x8C,0x3D,0x29,0xF9,0xFF,0x1A,0x00,0x78,0x03,0x3C,0x01,0x78,0x09,0x3C,0x08,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x2C,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x30,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C, +0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F, +0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x3A,0x3F, +0x4F,0xF9,0x4A,0xCA,0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9, +0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xF0,0x3D,0x69,0xF9,0x06,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x3A,0x3F,0x4F,0xF9, +0x4A,0xCA,0x07,0x08,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x3A,0x3F,0x79,0xCF, +0x00,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x07,0x3C,0x01,0x78, +0x1D,0x3C,0x03,0x78,0x0B,0x3C,0x04,0x78,0x11,0x3C,0x18,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x20,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x18,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x28,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x10,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x24,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x30,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA, +0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x38,0x3F,0x4F,0xF9,0x4A,0xCA, +0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B, +0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x69,0xF9, +0x06,0x0C,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x38,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x20,0x0B,0x02,0x0B,0xC8,0x0B,0xD4,0x3F,0x6F,0xF9,0x79,0x99,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0xD4,0x3F,0x00,0x6F,0x39,0x8E,0x1D,0x3E,0x6E,0xF9,0x79,0x89, +0x29,0xF9,0x19,0xE9,0x02,0x59,0x09,0xBD,0x39,0x8E,0x1B,0x3E,0x6E,0xF9,0x79,0x89, +0x29,0xF9,0x09,0xBD,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x04,0x79, +0x10,0x0B,0x00,0x0B,0x62,0x0B,0x49,0x69,0x10,0x0B,0x00,0x0B,0x62,0x0B,0x91,0x59, +0x10,0x0B,0x00,0x0B,0x60,0x0B,0x04,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x20,0x79, +0x00,0x69,0x1C,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x99,0x10,0x0B,0x00,0x0B,0x25,0x0B, +0x74,0x3D,0x79,0xB9,0x39,0x8E,0x09,0x3E,0x6E,0xF9,0x68,0x4A,0x79,0xA9,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x79,0xEF, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0x74,0x3D,0x29,0x8E,0x03,0x3E,0x6E,0xF9,0x00,0x2B, +0x79,0xF9,0x39,0xF9,0x19,0xE9,0xF9,0xBD,0x19,0xF9,0xFF,0x1A,0x72,0x5C,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0xD4,0x3F,0x6F,0xF9,0x63,0x1C,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0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0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xD4,0x3F,0x00,0x6F,0x29,0x8E,0x04,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xF9,0x39,0xF9, +0x09,0xE9,0x02,0x59,0xF9,0xBD,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D,0x19,0xF9, +0xFF,0x1A,0x00,0x78,0x03,0x3C,0x01,0x78,0x09,0x3C,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x2C,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0x30,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA, +0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x3A,0x3F,0x4F,0xF9,0x4A,0xCA, +0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B, +0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x69,0xF9, +0x06,0x0C,0x20,0x0B,0x02,0x0B,0x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x0B, +0x86,0x3D,0x07,0x08,0x11,0x1C,0x29,0xF9,0xFF,0x1A,0x00,0x78,0x03,0x3C,0x04,0x78, +0x01,0x3C,0x05,0x0C,0x10,0x0B,0x01,0x0B,0x45,0x0B,0x88,0x3D,0x01,0x0C,0x00,0x0C, +0x10,0x0B,0x00,0x0B,0x25,0x0B,0x8C,0x3D,0x29,0xF9,0xFF,0x1A,0x00,0x78,0x07,0x3C, +0x01,0x78,0x1D,0x3C,0x03,0x78,0x0B,0x3C,0x04,0x78,0x11,0x3C,0x18,0x0C,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x20,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x18,0x0C,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x28,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x10,0x0C,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x24,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x08,0x0C,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0x30,0x3F,0x9F,0xF9,0x01,0x4A,0x79,0xFF,0x00,0x0C,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0xDF,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08, +0x9F,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x38,0x3F,0x4F,0xF9, +0x4A,0xCA,0x06,0x08,0x79,0xDA,0x1E,0x2C,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xDF,0x3D, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x00,0x3F,0x07,0x08,0x9F,0xDA,0x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0x0B,0x43,0x3D,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xB4,0x3F,0x00,0x1F,0x19,0x8E,0x1B,0x3E,0x6E,0xF9,0x79,0x89,0x29,0xF9,0x09,0xBD, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0xA9,0x69,0xB9,0x10,0x0B,0x01,0x0B,0x45,0x0B,0xA2,0x3D,0x20,0x0B, +0x02,0x0B,0xC8,0x0B,0xD4,0x3F,0x6F,0xF9,0x13,0x1C,0x20,0x0B,0x02,0x0B,0xC8,0x0B, +0xD4,0x3F,0x6F,0xF9,0x79,0x99,0x20,0x0B,0x02,0x0B,0xC8,0x0B,0xD4,0x3F,0x00,0x6F, +0x39,0x8E,0x1E,0x3E,0x6E,0xF9,0x79,0x89,0x29,0xF9,0x19,0xE9,0x02,0x59,0x09,0xBD, +0x39,0x8E,0x1C,0x3E,0x6E,0xF9,0x79,0x89,0x29,0xF9,0x09,0xBD,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x05,0x79,0x10,0x0B,0x00,0x0B,0x64,0x0B,0xF4,0x69, +0x10,0x0B,0x00,0x0B,0x65,0x0B,0x45,0x59,0x10,0x0B,0x00,0x0B,0x60,0x0B,0x04,0x3D, +0x20,0x0B,0x02,0x0B,0xC8,0x0B,0x20,0x79,0x00,0x69,0x1C,0x59,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x24,0x3D,0x0D,0x8C,0x96,0x59,0x79,0xC9,0xFF,0x1A,0x01,0x78,0x05,0x3C, +0x02,0x78,0x0B,0x3C,0x03,0x78,0x10,0x3C,0x18,0x0C,0x69,0xC9,0x4A,0xCA,0x3A,0x8A, +0x2A,0x8A,0x70,0x4A,0x05,0x08,0x49,0xCA,0x10,0x0C,0x69,0xC9,0x4A,0xCA,0x3A,0x8A, +0x3C,0x4A,0x05,0x08,0x49,0xCA,0x09,0x0C,0x69,0xC9,0x4A,0xCA,0x6A,0x8A,0x3A,0x8A, +0x03,0x0B,0xD0,0x4A,0x05,0x08,0x49,0xCA,0x00,0x0C,0x59,0xF9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x69,0x89,0x59,0xA9,0x19,0xF9,0xFF,0x1A, +0x01,0x78,0x05,0x3C,0x02,0x78,0x0A,0x3C,0x03,0x78,0x0E,0x3C,0x00,0x0C,0x29,0xF9, +0x4A,0xCA,0x3A,0x8A,0x2A,0x8A,0x40,0x4A,0x79,0xB9,0x1B,0x0C,0x29,0xF9,0x4A,0xCA, +0x3A,0x8A,0x24,0x4A,0x79,0xB9,0x15,0x0C,0x01,0x0B,0x78,0x39,0x09,0xF9,0xFF,0x1A, +0x01,0x78,0x02,0x3C,0x08,0x79,0x01,0x0C,0x02,0x79,0x29,0xE9,0x4A,0xCA,0x3A,0x8A, +0x2A,0x8A,0x1B,0x4A,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x03,0x08,0x79,0xCA, +0x00,0x0C,0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x59,0x99,0x39,0xF9,0x29,0xE9,0x19,0xD9, +0xBE,0x3D,0x07,0x08,0x01,0x0B,0x2C,0x4A,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D, +0x00,0x2B,0x79,0xC9,0xC9,0x8E,0x09,0x3E,0x6E,0xF9,0x79,0xA9,0x29,0xBF,0x1F,0xF9, +0x02,0x78,0x1A,0x3C,0x03,0x78,0x58,0x3C,0x06,0x78,0x10,0x0B,0x00,0x0B,0x66,0x0B, +0xD7,0x3C,0x07,0x78,0x10,0x0B,0x00,0x0B,0x67,0x0B,0x66,0x3C,0x08,0x78,0x10,0x0B, +0x00,0x0B,0x67,0x0B,0xC1,0x3C,0x09,0x78,0x10,0x0B,0x00,0x0B,0x67,0x0B,0xD5,0x3C, +0x10,0x0B,0x00,0x0B,0x67,0x0B,0xE9,0x0C,0x29,0xF9,0x68,0x4A,0x00,0x2B,0x79,0xD9, +0x29,0x8E,0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x03,0x3C,0x03,0x78,0x04,0x3C,0x00,0x0C, +0x01,0x0B,0x78,0x39,0x03,0x0C,0x0C,0x0B,0x10,0x39,0x00,0x0C,0xD9,0x8E,0x01,0x3E, +0x6E,0xF9,0x26,0x1C,0x03,0x08,0x96,0x4A,0x29,0x8E,0x0C,0x3E,0x1E,0xF9,0x00,0x69, +0x29,0x8E,0x88,0x3E,0x1E,0xD9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x65,0x0B,0xAF,0x3D, +0x03,0x08,0x79,0xCA,0xD9,0x8E,0x02,0x3E,0x6E,0xF9,0x12,0x1C,0x03,0x08,0x96,0x4A, +0x29,0x8E,0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x03,0x3C,0x03,0x78,0x05,0x3C,0x00,0x0C, +0x03,0x08,0x01,0x0B,0x78,0x4A,0x04,0x0C,0x03,0x08,0x0C,0x0B,0x10,0x4A,0x00,0x0C, +0x10,0x0B,0x00,0x0B,0x67,0x0B,0xEB,0x0C,0x29,0xF9,0x68,0x4A,0x79,0x89,0x09,0x8E, +0x1A,0x3E,0x8E,0x87,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A, +0x79,0x99,0x09,0x8E,0x1A,0x3E,0x8E,0x97,0x02,0x2C,0x00,0x79,0x01,0x0C,0x01,0x79, +0x07,0x08,0xFF,0x1A,0x01,0x08,0x79,0xCA,0x09,0x8E,0x1A,0x3E,0x8E,0xA7,0x02,0x2C, +0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x01,0x08,0x79,0xCA,0x29,0x8E, +0x0C,0x3E,0x1E,0xF9,0x29,0x8E,0x0E,0x3E,0x1E,0xE9,0x29,0x8E,0x80,0x3E,0x1E,0xD9, +0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x65,0x0B,0xAF,0x3D,0x19,0xE9,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x8E,0x3D,0x79,0xB9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08, +0x4A,0xCA,0x19,0xE9,0x01,0x5A,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x03,0x08, +0x79,0xCA,0x09,0x8E,0x01,0x3E,0x6E,0xF9,0x26,0x1C,0x03,0x08,0x96,0x4A,0x29,0x8E, +0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x03,0x3C,0x03,0x78,0x05,0x3C,0x00,0x0C,0x03,0x08, +0x01,0x0B,0x78,0x4A,0x04,0x0C,0x03,0x08,0x0C,0x0B,0x10,0x4A,0x00,0x0C,0x09,0x8E, +0x02,0x3E,0x6E,0xF9,0x10,0x1C,0x03,0x08,0x96,0x4A,0x29,0x8E,0x0C,0x3E,0x1E,0xF9, +0x00,0x69,0x29,0x8E,0x88,0x3E,0x1E,0xD9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x65,0x0B, +0xAF,0x3D,0x03,0x08,0x79,0xCA,0x10,0x0B,0x00,0x0B,0x67,0x0B,0xEB,0x0C,0x29,0xF9, +0x68,0x4A,0x00,0x2B,0x79,0xE9,0xE9,0x8E,0x1C,0x3E,0x1E,0xF9,0x49,0x5C,0x29,0x8E, +0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x05,0x3C,0x02,0x78,0x06,0x3C,0x03,0x78,0x07,0x3C, +0x00,0x0C,0x08,0x0B,0x48,0x39,0x06,0x0C,0x04,0x0B,0x28,0x39,0x03,0x0C,0x42,0x0B, +0x90,0x39,0x00,0x0C,0xE9,0xBF,0x6F,0xF9,0x32,0x1C,0x03,0x08,0x96,0x4A,0x29,0x8E, +0x0F,0x3E,0x1E,0xF9,0x02,0x5C,0x02,0x79,0x03,0x0C,0x29,0x8E,0x0F,0x3E,0x1E,0xF9, +0x07,0x08,0xFF,0x1A,0x79,0xE9,0x29,0x8E,0x0C,0x3E,0x1E,0xF9,0xE9,0x8E,0x14,0x3E, +0x1E,0xD9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x65,0x0B,0xAF,0x3D,0x03,0x08,0x79,0xCA, +0x96,0x4A,0x29,0x8E,0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x05,0x3C,0x02,0x78,0x07,0x3C, +0x03,0x78,0x09,0x3C,0x00,0x0C,0x03,0x08,0x08,0x0B,0x48,0x4A,0x08,0x0C,0x03,0x08, +0x04,0x0B,0x28,0x4A,0x04,0x0C,0x03,0x08,0x42,0x0B,0x90,0x4A,0x00,0x0C,0x3A,0x0C, +0x29,0x8E,0x0D,0x3E,0x1E,0xF9,0x01,0x78,0x05,0x3C,0x02,0x78,0x06,0x3C,0x03,0x78, +0x07,0x3C,0x00,0x0C,0x08,0x0B,0x48,0x39,0x06,0x0C,0x04,0x0B,0x28,0x39,0x03,0x0C, +0x42,0x0B,0x90,0x39,0x00,0x0C,0xE9,0xBF,0x6F,0xF9,0x24,0x1C,0x03,0x08,0x96,0x4A, +0x29,0x8E,0x0F,0x3E,0x1E,0xF9,0x02,0x5C,0x02,0x79,0x03,0x0C,0x29,0x8E,0x0F,0x3E, +0x1E,0xF9,0x07,0x08,0xFF,0x1A,0x79,0xE9,0x29,0x8E,0x0C,0x3E,0x1E,0xF9,0x24,0x59, +0x10,0x0B,0x00,0x0B,0x65,0x0B,0xAF,0x3D,0x03,0x08,0x79,0xCA,0x96,0x4A,0x29,0x8E, +0x0D,0x3E,0x1E,0xF9,0x02,0x69,0x10,0x59,0x10,0x0B,0x00,0x0B,0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0x0B,0x48,0x39,0x06,0x0C,0x04,0x0B,0x28,0x39, +0x03,0x0C,0x42,0x0B,0x90,0x39,0x00,0x0C,0x16,0x0C,0x29,0x8E,0x0D,0x3E,0x1E,0xF9, +0x01,0x78,0x05,0x3C,0x02,0x78,0x06,0x3C,0x03,0x78,0x07,0x3C,0x00,0x0C,0x08,0x0B, +0x48,0x39,0x06,0x0C,0x04,0x0B,0x28,0x39,0x03,0x0C,0x42,0x0B,0x90,0x39,0x00,0x0C, +0x02,0x0C,0x00,0x39,0x00,0x0C,0xC9,0x8E,0x03,0x3E,0x39,0xEE,0x00,0x2B,0x0D,0xC9, +0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x0A,0x6D,0x00,0x0D,0xFE,0x4D,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x00,0x2B,0x79,0xE9,0x00,0x2B, +0x69,0xF9,0x00,0x2B,0x59,0xD9,0xE9,0xE9,0x00,0x79,0x1A,0x0B,0x36,0x0B,0xE3,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x22,0x6D,0x07,0x08,0xAA,0x8A, +0x06,0x08,0xDA,0x8A,0xFB,0x4D,0x69,0x89,0x09,0xF9,0x9C,0x0B,0x40,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x79,0xA9,0x00,0x19,0x29,0xF9,0xE9,0xDA,0x0B,0x6C, +0x09,0xF9,0x9C,0x0B,0x40,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08, +0x9C,0x0B,0x40,0x4A,0x79,0xA9,0x00,0x39,0xD9,0xF9,0xFF,0x1A,0x39,0xF8,0x1F,0x3C, +0x39,0xF9,0x3A,0x8A,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,0x00,0x2B,0x79,0xC9, +0x00,0x2B,0x69,0xB9,0x00,0x29,0x1D,0xF9,0x24,0x4A,0x79,0xBF,0x20,0x0B,0x02,0x0B, +0x9B,0x2B,0x3E,0x5F,0xBF,0x9F,0xBF,0x9F,0xBF,0x9F,0xBF,0x9F,0xBF,0x9F,0x00,0x39, +0xC9,0xF9,0xFF,0x1A,0x39,0xF8,0x0B,0x3C,0x39,0xF9,0x3A,0x8A,0x20,0x0B,0x02,0x0B, +0xC8,0x0B,0xDC,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B,0x79,0xE9,0x02,0x0C,0x00,0x2B, +0xB9,0xE9,0x0E,0x08,0x01,0x5C,0x24,0x0C,0xE9,0xF9,0x01,0x5A,0x79,0xE9,0x00,0x79, +0x1A,0x0B,0x36,0x0B,0xE3,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x22,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0x69,0x99,0x19,0xF9, +0x05,0x5A,0x0E,0x6C,0x1D,0xF9,0x24,0x4A,0x19,0xCA,0x79,0xBF,0x0F,0xF9,0x01,0x4A, +0x79,0xAF,0x29,0xF9,0x19,0xDA,0x02,0x2C,0x29,0xF9,0x01,0x0C,0x19,0xF9,0x79,0xA9, +0x03,0x08,0x01,0x4A,0x39,0xF9,0x0A,0x5A,0xC3,0x2C,0x00,0x09,0x00,0x2B,0x00,0x79, +0x00,0x2B,0x00,0x59,0x00,0x39,0x21,0x0C,0xD9,0xF9,0xFF,0x1A,0x14,0x5C,0x00,0x08, +0x02,0x4A,0x1D,0xF9,0x24,0x4A,0x39,0xCA,0x79,0xBF,0x1F,0xF9,0x0F,0x08,0x79,0xCA, +0x09,0xF9,0xF9,0xDA,0x02,0x6C,0x00,0x79,0x17,0x0C,0x00,0x08,0xF9,0xF8,0x02,0x7C, +0x00,0x2B,0x01,0x59,0x08,0x0C,0x1D,0xF9,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0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x79,0x89,0x00,0x2B,0x69,0xF9,0x00,0x2B,0x59,0xE9, +0x01,0x29,0x09,0x8E,0x02,0x3E,0x6E,0xF9,0x79,0x99,0x01,0x39,0x36,0x0C,0x39,0xF9, +0x0C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x09,0xCA,0x79,0x8E, +0x02,0x3E,0x6E,0xF9,0x19,0xDA,0x01,0x6C,0x26,0x0C,0x19,0xF9,0x00,0x2B,0x79,0xD9, +0x39,0xF9,0x0C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x09,0xCA, +0x79,0x8E,0x02,0x3E,0x0D,0x08,0xAE,0xDA,0x0D,0x6C,0x00,0x29,0x39,0xF9,0x0C,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x09,0xCA,0x79,0x8E,0x02,0x3E, +0x6E,0xF9,0x79,0x99,0x01,0x79,0x03,0x08,0x04,0x1C,0x39,0xED,0x07,0x08,0x2A,0x8A, +0xFD,0x4D,0x02,0x08,0x79,0xAA,0x03,0x08,0x01,0x4A,0x39,0xF9,0xF9,0xE9,0xFF,0x1A, +0x07,0x08,0x69,0xDA,0xC4,0x2C,0xE9,0xBF,0x29,0xEF,0x00,0x2B,0x0D,0xD9,0x00,0x2B, +0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D, +0xC9,0x8D,0xB9,0x8D,0xA9,0x8D,0x99,0x8D,0x00,0x2B,0x79,0xF9,0x00,0x2B,0x69,0x99, +0x1D,0x8E,0x0B,0x3E,0x59,0xEE,0x00,0x19,0x00,0x29,0x00,0x2B,0x00,0x69,0x00,0x09, +0x00,0x2B,0x00,0x59,0x00,0x39,0x56,0x0C,0x01,0x79,0x03,0x08,0x04,0x1C,0x39,0xED, +0x07,0x08,0x2A,0x8A,0xFD,0x4D,0x1D,0x8E,0x0B,0x3E,0x07,0x08,0xAE,0x9A,0x01,0x5C, +0x47,0x0C,0x01,0x08,0x09,0x5C,0x39,0xF9,0x0C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x79,0x99,0x02,0x08,0x0C,0x5C,0x39,0xF9,0x0C,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x79,0x8E,0x01,0x3E, +0x6E,0xF9,0x0E,0x0C,0x39,0xF9,0x0C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x07,0x08,0xF9,0xCA,0x79,0x8E,0x01,0x3E,0x6E,0xF9,0x29,0x8E,0x01,0x3E,0xAE,0xDA, +0x00,0x2B,0x79,0xB9,0xB9,0xF9,0x09,0xDA,0x12,0x2C,0xB9,0x89,0x0E,0x08,0x05,0x1C, +0xE9,0x8E,0x01,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xD9,0x39,0xF9,0x0C,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x00,0x2B,0x79,0xE9,0x39,0xF9, +0x0C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x79,0xA9, +0x03,0x08,0x01,0x4A,0x39,0xF9,0x99,0xE9,0xFF,0x1A,0x07,0x08,0x69,0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,0x28,0x3D,0x0D,0xB9,0x0D,0x8C,0x00,0x0D, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x89,0x00,0x2B, +0x69,0xF9,0x1D,0xF9,0x18,0x4A,0x10,0x0B,0x01,0x0B,0x41,0x0B,0xE4,0x3D,0x79,0x99, +0x00,0x08,0x18,0x1C,0x00,0x39,0x09,0xF9,0x4A,0xCA,0x01,0x69,0x03,0x08,0x04,0x1C, +0x39,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x06,0x08,0x79,0x9A,0x06,0x1C,0x39,0xF9, +0xFF,0x1A,0x10,0x0B,0x00,0x0B,0xF2,0x0B,0x7E,0x3D,0x03,0x08,0x01,0x4A,0x39,0xF9, +0x08,0x5A,0xE9,0x2C,0x0F,0x08,0x05,0x1C,0xF9,0xF9,0x10,0x0B,0x00,0x0B,0xF1,0x0B, +0xE3,0x3D,0x01,0x08,0x30,0x1C,0x1D,0xF9,0x14,0x4A,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xE4,0x3D,0x07,0x08,0x28,0x1C,0x1D,0x8E,0x05,0x3E,0x6E,0xF9,0x1D,0x8E,0x06,0x3E, +0xAE,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x69,0xA9,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x48,0x3F, +0x4F,0xF9,0x4A,0xCA,0x29,0xDA,0x07,0x6C,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0x48,0x3F,0x79,0xCF,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0xA8,0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x04,0x79,0x10,0x0B,0x00,0x0B, +0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x12,0x1C,0x39,0x8E,0x02,0x3E,0xFF,0x1E, +0x39,0x8E,0x03,0x3E,0x00,0x1E,0x39,0xBF,0xFF,0x4F,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x0D,0xB9, +0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x98,0x3F,0x79,0xEF,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0x99,0x59,0x89,0x19,0xF9,0xFF,0x1A, +0x01,0x78,0x25,0x3C,0x02,0x78,0x1D,0x3C,0x03,0x78,0x01,0x3C,0x20,0x0C,0x01,0x0B, +0x78,0x39,0x09,0xF9,0xFF,0x1A,0x01,0x78,0x03,0x3C,0x02,0x78,0x08,0x3C,0x07,0x0C, +0x29,0xF9,0xFF,0x1A,0x6A,0x8A,0x56,0x4A,0x03,0x08,0x79,0xCA,0x09,0x0C,0x29,0xF9, +0xFF,0x1A,0x6A,0x8A,0x3A,0x8A,0x01,0x0B,0x58,0x4A,0x03,0x08,0x79,0xCA,0x00,0x0C, +0x0D,0x0C,0x29,0xF9,0xFF,0x1A,0x3A,0x8A,0x2C,0x4A,0x79,0xB9,0x07,0x0C,0x29,0xF9, +0xFF,0x1A,0x3A,0x8A,0x2A,0x8A,0x50,0x4A,0x79,0xB9,0x00,0x0C,0x39,0xF9,0x03,0x0B, +0x69,0x4A,0x79,0xE9,0x00,0x79,0x1A,0x0B,0x36,0x0B,0xE3,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x1E,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A, +0xF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,0x0D,0xE9,0x00,0x2B, +0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x79,0xA9,0x69,0x99,0x59,0xB9,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A, +0x69,0xB9,0x79,0xBF,0x19,0x9F,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9, +0x79,0xBF,0x29,0x9F,0x19,0xF9,0xFF,0x1A,0x00,0x78,0x45,0x3C,0x01,0x78,0x0D,0x3C, +0x02,0x78,0x14,0x3C,0x03,0x78,0x46,0x3C,0x04,0x78,0x19,0x3C,0x05,0x78,0x20,0x3C, +0x06,0x78,0x27,0x3C,0x07,0x78,0x2E,0x3C,0x3D,0x0C,0x39,0xF9,0x0F,0x69,0x29,0xD9, +0xFF,0x1A,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x35,0x0C,0x39,0xF9,0x55,0x69, +0x29,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x2C,0x0C,0x39,0xF9, +0xFF,0x69,0x29,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x23,0x0C, +0x39,0xF9,0x00,0x69,0x29,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D, +0x1A,0x0C,0x39,0xF9,0xF0,0x69,0x29,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B,0x4D,0x0B, +0x24,0x3D,0x11,0x0C,0x39,0xF9,0xAA,0x69,0x29,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x24,0x3D,0x08,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x6F,0x0B, +0x44,0x3D,0x01,0x0C,0x00,0x0C,0x0D,0x99,0x0D,0xA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00,0x0B,0x09,0x0B, +0x4C,0x3D,0x09,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x4C,0x3D,0x02,0x79,0x10,0x0B, +0x00,0x0B,0x24,0x0B,0x98,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x1F,0xF9, +0x04,0x78,0x19,0x7C,0x04,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0x99, +0x07,0x08,0x10,0x1C,0x19,0x8E,0x02,0x3E,0x05,0x1E,0x19,0x8E,0x03,0x3E,0x01,0x1E, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B, +0x09,0x0B,0xAE,0x3D,0x0E,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x00,0x1F, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x6C,0x3F,0x00,0x1F,0x10,0x0B,0x00,0x0B,0x88,0x0B, +0x4E,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x79,0x8E,0x09,0x3E,0x6E,0xA9,0x29,0xD9,0x59,0xA9,0x68,0x4A,0x29,0xC9, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x08,0x3F,0x8F,0xA9,0x01,0x4A,0x29,0xDF,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x06,0x3F,0x4F,0xA9,0x4A,0xCA,0x12,0x4C,0x11,0x1C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x06,0x3F,0x4F,0xA9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x08,0x3F,0x4F,0x99,0x4A,0xCA,0x02,0x08,0x19,0xF8,0x02,0x7C,0x00,0x79,0x79,0x0C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x1F,0xA9,0x01,0x78,0x6F,0x7C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x12,0x3F,0x1F,0xA9,0x59,0x8E,0x01,0x3E,0x1E,0x99,0x02,0x08, +0x19,0xF8,0x24,0x7C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x11,0x3F,0x1F,0xA9,0x49,0x8E, +0x01,0x3E,0xAE,0xBF,0x1F,0x99,0x02,0x08,0x19,0xF8,0x18,0x7C,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x10,0x3F,0x1F,0xA9,0x49,0x8E,0x01,0x3E,0xAE,0x8E,0x01,0x3E,0x1E,0x99, +0x02,0x08,0x19,0xF8,0x0B,0x7C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x13,0x3F,0x1F,0xA9, +0x59,0x8E,0x0C,0x3E,0x1E,0x99,0x02,0x08,0x19,0xF8,0x02,0x3C,0x00,0x79,0x41,0x0C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x20,0x3F,0x6F,0xA9,0x01,0x19,0x02,0x08,0x04,0x1C, +0x29,0xED,0x01,0x08,0x2A,0x8A,0xFD,0x4D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x1C,0x3F, +0x01,0x08,0x9F,0x9A,0x02,0x5C,0x01,0x29,0x01,0x0C,0x00,0x29,0x02,0x08,0xFF,0x1A, +0x29,0xB9,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x20,0x3F,0x6F,0xA9,0x01,0x4A,0x1F,0x1A, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x20,0x3F,0x29,0xEF,0x03,0x08,0x04,0x5C,0x55,0x0B, +0x55,0x0B,0x55,0x29,0x03,0x0C,0xAA,0x0B,0xAA,0x0B,0xAA,0x29,0x59,0x8E,0x02,0x3E, +0x29,0xEE,0x20,0x0B,0x02,0x0B,0xC5,0x0B,0xAC,0x3F,0x6F,0xA9,0x59,0x8E,0x02,0x3E, +0x6E,0x99,0x29,0xBA,0x59,0x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,0x02,0x4F,0x00,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x1C,0x3F,0xFF,0x0B,0xFF,0x0B,0xFF,0x0B,0xFF,0x6F,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x20,0x3F,0x00,0x6F,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x04,0x3F,0x1F,0xF9,0x01,0x78,0x05,0x7C,0x00,0x79,0x10,0x0B,0x00,0x0B, +0x73,0x0B,0xFC,0x0C,0x28,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x02,0x3D,0x79,0xA9, +0x07,0x08,0x05,0x5C,0x1F,0x79,0x10,0x0B,0x00,0x0B,0x73,0x0B,0xFC,0x0C,0xC8,0x79, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x02,0x3D,0x79,0xB9,0x07,0x08,0x0A,0x5C,0x29,0xF9, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x4C,0x3D,0x1F,0x79,0x10,0x0B,0x00,0x0B,0x73,0x0B, +0xFC,0x0C,0x39,0xF9,0x68,0x4A,0x79,0x99,0x29,0xF9,0x00,0x69,0x28,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x39,0xF9,0x00,0x69,0xC8,0x59,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x24,0x3D,0x29,0x8E,0x09,0x3E,0x39,0xEE,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x06,0x3F,0xC9,0xCF,0x29,0x8E,0x17,0x3E,0x02,0x1E,0x10,0x0B,0x00,0x0B,0x6F,0x0B, +0xEF,0x79,0x29,0x8E,0x06,0x3E,0x79,0xEE,0x29,0x8E,0x0A,0x3E,0x00,0x4E,0x39,0xBF, +0x00,0x1F,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x12,0x3F,0x1F,0xF9,0x39,0x8E,0x01,0x3E, +0x79,0x9E,0x39,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,0x2C,0x11,0x79,0x10,0x0B,0x00,0x0B,0x76,0x0B, +0x72,0x0C,0x00,0x0C,0x28,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x02,0x3D,0x79,0xA9, +0x07,0x08,0x05,0x5C,0x1F,0x79,0x10,0x0B,0x00,0x0B,0x76,0x0B,0x72,0x0C,0xC8,0x79, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x02,0x3D,0x79,0xB9,0x07,0x08,0x0A,0x5C,0x29,0xF9, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x4C,0x3D,0x1F,0x79,0x10,0x0B,0x00,0x0B,0x76,0x0B, +0x72,0x0C,0x39,0xF9,0x68,0x4A,0x79,0x99,0x29,0xF9,0x00,0x69,0x28,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x39,0xF9,0x00,0x69,0xC8,0x59,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x24,0x3D,0x29,0x8E,0x09,0x3E,0x39,0xEE,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x06,0x3F,0xC9,0xCF,0x29,0x8E,0x17,0x3E,0x02,0x1E,0x10,0x0B,0x00,0x0B,0x74,0x0B, +0x20,0x79,0x29,0x8E,0x06,0x3E,0x79,0xEE,0x29,0x8E,0x0A,0x3E,0x00,0x4E,0x39,0xBF, +0x01,0x1F,0xE9,0xF9,0x10,0x0B,0x00,0x0B,0x6F,0x0B,0x1D,0x3D,0x39,0x8E,0x01,0x3E, +0x79,0x9E,0x39,0x8E,0x01,0x3E,0x71,0x0B,0x76,0x0B,0x41,0x0B,0x29,0x6E,0x39,0x8E, +0x02,0x3E,0x55,0x0B,0x55,0x0B,0x55,0x6E,0x09,0xF9,0xFF,0x1A,0x01,0x78,0x05,0x3C, +0x02,0x78,0x07,0x3C,0x03,0x78,0x09,0x3C,0x0C,0x0C,0x39,0x8E,0x0D,0x3E,0x01,0x1E, +0x08,0x0C,0x39,0x8E,0x0D,0x3E,0x02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F,0x10,0x0B,0x00,0x0B,0x88,0x0B,0x46,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x08,0x79,0x00,0x69,0x08,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x02,0x79, +0x10,0x0B,0x00,0x0B,0x24,0x0B,0x61,0x3D,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x28,0x0B, +0x2E,0x3D,0x00,0x79,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x01,0x69,0x00,0x59,0x29,0xC9,0x10,0x0B, +0x00,0x0B,0x75,0x0B,0x09,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x1F,0xF9,0x01,0x78,0x1C,0x7C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x11,0x3F,0x1F,0xF9,0x03,0x78,0x15,0x7C,0x03,0x79,0x10,0x0B, +0x00,0x0B,0x24,0x0B,0x98,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x00,0x1F, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x6C,0x3F,0x00,0x1F,0x10,0x0B,0x00,0x0B,0x88,0x0B, +0x4E,0x3D,0x00,0x79,0x30,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x1F,0xF9, +0x01,0x78,0x07,0x3C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x1F,0xF9,0x02,0x78, +0x0A,0x7C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x04,0x3F,0x03,0x1F,0x10,0x0B,0x00,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x59,0xEA,0x00,0x2B,0x69,0xF9,0x79,0x89,0x01,0x08,0x05,0x4A, +0x09,0xF9,0xF9,0xE9,0x10,0x0B,0x00,0x0B,0x86,0x0B,0xB7,0x3D,0x07,0x08,0x0F,0x4C, +0x02,0x5A,0x0D,0x2C,0x09,0xF9,0xF9,0xE9,0xFF,0x0B,0xFF,0x0B,0xFF,0x2B,0xFF,0x0A, +0x07,0x08,0x00,0x2B,0x1F,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x02,0x1C,0x12,0x79, +0x53,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x34,0x3F,0xF9,0xEF,0x09,0xEF,0x00,0x29, +0x3B,0x0C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x31,0x1C, +0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xC9,0x3D,0x07,0x08,0x2A,0x5C,0x29,0xF9, +0x16,0x69,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0xD2,0x3D,0x07,0x08,0x01,0x78,0x02,0x7C, +0x0C,0x79,0x32,0x0C,0x0C,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9, +0x07,0x08,0x17,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E, +0x03,0x3E,0x16,0x1E,0x39,0xF9,0x04,0x4A,0x79,0xBF,0xF9,0xEF,0x09,0xEF,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0xAE,0x3D,0x02,0x08,0x01,0x4A,0x4A,0xCA,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7, +0x48,0x8A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2C,0x19,0xF9, +0xFF,0x1A,0x39,0x8E,0x05,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x07,0x2C,0x09,0xF9,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x80,0x3D,0x07,0x08, +0x02,0x1C,0x12,0x79,0x57,0x0C,0x39,0x8E,0x05,0x3E,0x1E,0xF9,0x10,0x0B,0x00,0x0B, +0x88,0x0B,0x66,0x3D,0x07,0x08,0x02,0x5C,0x12,0x79,0x4C,0x0C,0x24,0x79,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xA9,0x07,0x08,0x43,0x1C,0x29,0x8E,0x02,0x3E, +0x03,0x1E,0x29,0x8E,0x03,0x3E,0x01,0x1E,0x29,0xF9,0x04,0x4A,0x79,0xBF,0x00,0x2B, +0x09,0xDF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0x39,0xBF, +0x4F,0xF9,0x29,0x8E,0x08,0x3E,0x79,0xCE,0x39,0x8E,0x01,0x3E,0x4E,0xF9,0x29,0x8E, +0x09,0x3E,0x79,0xCE,0x39,0x8E,0x05,0x3E,0x1E,0xF9,0x29,0x8E,0x15,0x3E,0x79,0x9E, +0x39,0x8E,0x04,0x3E,0x1E,0xF9,0x29,0x8E,0x16,0x3E,0x79,0x9E,0x39,0x8E,0x06,0x3E, +0x1E,0xF9,0x29,0x8E,0x20,0x3E,0x79,0x9E,0x39,0x8E,0x02,0x3E,0x6E,0xF9,0x10,0x0B, +0x00,0x0B,0x06,0x0B,0x2D,0x3D,0x29,0x8E,0x06,0x3E,0x69,0xEE,0x79,0xEE,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0xAE,0x3D,0x00,0x79,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x04,0x79,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x1A,0x1C,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x8F,0x3F,0x1F,0xF9,0x04,0x1C,0x39,0x8E,0x02,0x3E,0x09,0x1E,0x03,0x0C, +0x39,0x8E,0x02,0x3E,0x03,0x1E,0x39,0x8E,0x03,0x3E,0x02,0x1E,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D, +0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x00,0x0B,0x87,0x0B,0x71,0x3D,0x10,0x0B,0x01,0x0B, +0x0F,0x0B,0x86,0x3D,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x69,0xB9,0x29,0xF9, +0x39,0xE9,0x39,0xD9,0x10,0x0B,0x00,0x0B,0x0B,0x0B,0xB1,0x3D,0x00,0x79,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9, +0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9, +0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B, +0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79,0x35,0x0C,0x29,0xF9, +0x10,0x0B,0x01,0x0B,0x04,0x0B,0xC9,0x3D,0x07,0x08,0x01,0x78,0x08,0x7C,0x29,0xF9, +0x02,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x53,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79, +0x23,0x0C,0x14,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08, +0x1A,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E,0x03,0x3E, +0x19,0x1E,0x39,0xF9,0x04,0x4A,0x19,0xE9,0x10,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B, +0x32,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x79,0xA9,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B, +0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08, +0x02,0x5C,0x02,0x79,0x2D,0x0C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xC9,0x3D, +0x07,0x08,0x01,0x78,0x08,0x7C,0x29,0xF9,0x02,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B, +0x53,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79,0x1B,0x0C,0x04,0x79,0x10,0x0B,0x00,0x0B, +0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x12,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E, +0x02,0x3E,0x01,0x1E,0x39,0x8E,0x03,0x3E,0x1A,0x1E,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99, +0x39,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E, +0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x39,0xF9, +0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79,0x1A,0x0C, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0x91,0x0B,0x52,0x3D,0x79,0xA9,0x29,0xE9,0x00,0x79, +0x06,0x0B,0x66,0x0B,0x67,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x16,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0x4A,0xCA,0x19,0xBF, +0x69,0xCF,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0x89,0x01,0x19,0x39,0xF9,0x4A,0xCA,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA, +0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B, +0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79,0x1E,0x0C,0x09,0xF9,0x4A,0xCA,0x19,0xE9, +0x4A,0xCA,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x6C,0x12,0x79, +0x12,0x0C,0x09,0xF9,0x4A,0xCA,0x79,0xE9,0x3A,0x8A,0x79,0xCA,0x2A,0x8A,0x69,0xA9, +0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x91,0x0B,0x6A,0x3D,0x07,0x08,0x02,0x5C, +0x1E,0x79,0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x8C,0x3F,0x79,0x9F,0x0D,0x8C,0x39,0x8D,0x79,0xB9, +0x10,0x0B,0x00,0x0B,0x88,0x0B,0x80,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79,0x0D,0x0C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x8C,0x3F,0x1F,0xF9,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0x60,0x3D,0x39,0xBF,0x79,0x9F,0x00,0x79,0x0D,0xB9,0x0D,0x8C,0x00,0x0D, +0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D, +0xC9,0x8D,0xB9,0x8D,0xA9,0x8D,0x99,0x8D,0x79,0x99,0x69,0x89,0x59,0xA9,0x00,0x2B, +0x49,0xF9,0x1D,0x8E,0x0F,0x3E,0x00,0x2B,0x6E,0xE9,0x10,0x3E,0x00,0x2B,0x6E,0xD9, +0x00,0x2B,0x20,0x49,0x40,0x2B,0x00,0x39,0x00,0x2B,0x04,0x29,0x00,0x2B,0x01,0x19, +0x1D,0xF9,0x30,0x4A,0x79,0xBF,0x03,0x1F,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F, +0x9F,0xE7,0x02,0x2C,0x01,0x79,0x01,0x0C,0x03,0x79,0x07,0x08,0xFF,0x1A,0x1D,0xE9, +0x2C,0x4A,0x69,0xBF,0x79,0x9F,0x10,0x0B,0x00,0x0B,0x88,0x0B,0x80,0x3D,0x07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,0xFF,0x1A,0x04,0x78,0x13,0x3C,0x1D,0xF9, +0x30,0x4A,0x79,0xBF,0x1F,0xF9,0x1D,0xE9,0x44,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x08, +0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x05,0x6C,0x12,0x79,0x10,0x0B,0x00,0x0B, +0x7B,0x0B,0xA9,0x0C,0x1C,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9, +0x07,0x08,0x76,0x1C,0x39,0x8E,0x02,0x3E,0x04,0x1E,0x39,0x8E,0x03,0x3E,0x05,0x1E, +0x19,0xF9,0x4A,0xCA,0x02,0x0B,0x71,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x79,0xE9,0x69,0xF9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x18,0x0B,0x6A,0x0B, +0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E, +0x01,0x3E,0x69,0xEE,0x09,0xF9,0x4A,0xCA,0x02,0x0B,0x71,0x69,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x8E,0x3D,0x79,0xE9,0x69,0xF9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA, +0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9, +0x00,0x79,0x39,0x8E,0x02,0x3E,0x69,0xEE,0x39,0x8E,0x0C,0x3E,0x29,0x9E,0x39,0x8E, +0x0D,0x3E,0xF9,0x9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9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x10,0x0B,0x00,0x0B,0x88,0x0B, +0x80,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79,0x24,0x0C,0x39,0xF9,0xFF,0x1A,0x20,0x5A, +0x02,0x2C,0x12,0x79,0x1E,0x0C,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xAA,0x3D,0x20,0x0B, +0x02,0x0B,0xCA,0x0B,0x39,0x79,0x29,0xE9,0x39,0xD9,0xFF,0x1A,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x32,0x3D,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x58,0x3F,0x39,0x9F,0x20,0x0B, +0x02,0x0B,0xCA,0x0B,0x59,0x3F,0x01,0x1F,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D, +0x00,0x79,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x10,0x0B, +0x00,0x0B,0x88,0x0B,0x80,0x3D,0x07,0x08,0x06,0x5C,0x0C,0x79,0x10,0x0B,0x00,0x0B, +0x87,0x0B,0xBA,0x3D,0x53,0x0C,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x08,0x3F,0x1F,0xF9, +0x00,0x78,0x05,0x3C,0x01,0x78,0x03,0x3C,0x04,0x78,0x01,0x3C,0x16,0x0C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x64,0x3F,0x1F,0xF9,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F, +0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x06,0x7C,0x0C,0x79,0x10,0x0B, +0x00,0x0B,0x87,0x0B,0xBA,0x3D,0x32,0x0C,0x01,0x0C,0x00,0x0C,0x20,0x0B,0x02,0x0B, +0xCA,0x0B,0x09,0x3F,0x1F,0xF9,0x10,0x0B,0x00,0x0B,0x88,0x0B,0x66,0x3D,0x07,0x08, +0x06,0x5C,0x12,0x79,0x10,0x0B,0x00,0x0B,0x87,0x0B,0xBA,0x3D,0x1F,0x0C,0x04,0x79, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x17,0x1C,0x39,0x8E, +0x02,0x3E,0x04,0x1E,0x02,0x08,0x02,0x5C,0x02,0x79,0x01,0x0C,0x01,0x79,0x07,0x08, +0xFF,0x1A,0x39,0x8E,0x03,0x3E,0x79,0x9E,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F, +0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x10,0x0B,0x00,0x0B,0x88,0x0B,0xCC,0x3D,0x10,0x0B,0x00,0x0B,0xE2,0x0B, +0x3F,0x3D,0x0D,0x8C,0x10,0x0B,0x00,0x0B,0xA6,0x0B,0x80,0x3D,0x0D,0x8C,0x09,0xBE, +0x1D,0x89,0x60,0x5A,0x09,0x9D,0x3E,0x89,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9, +0x1D,0xF9,0x08,0x4A,0x39,0xE9,0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D, +0x1D,0xF9,0x28,0x4A,0x29,0xE9,0x20,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D, +0x1D,0xF9,0x48,0x4A,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x40,0x69,0x20,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x1D,0xF9,0x08,0x4A,0x1D,0xE9,0x48,0x4A,0x10,0x0B, +0x00,0x0B,0xA6,0x0B,0xA2,0x3D,0x0D,0xA9,0x0D,0xB9,0x09,0xBE,0x1D,0x89,0x60,0x4A, +0x09,0x9D,0x3E,0x89,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x06,0x0B,0x2D,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xB4,0x3F,0x69,0xEF,0x79,0xEF, +0x03,0x08,0x06,0x4A,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0xB4,0x3F,0x6F,0xD9,0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B, +0x99,0x3D,0x03,0x08,0x06,0x4A,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0x99,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x65,0x3F,0x1F,0xF9,0x0C,0x5C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x67,0x3F,0x1F,0xF9,0x06,0x5C,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x68,0x3F,0x1F,0xF9,0x02,0x1C,0x0C,0x79,0x4E,0x0C,0x19,0xF9,0x10,0x0B,0x00,0x0B, +0x06,0x0B,0x2D,0x3D,0x69,0xA9,0x79,0xB9,0x01,0x08,0x06,0x4A,0x39,0xF9,0x29,0xE9, +0x00,0x1A,0x07,0x08,0xC0,0x0B,0x00,0x1A,0x06,0x08,0x00,0x78,0x04,0x7C,0x07,0x08, +0xC0,0x0B,0x00,0x78,0x19,0x3C,0x39,0xF9,0x29,0xE9,0x00,0x1A,0x07,0x08,0xC0,0x0B, +0x00,0x1A,0x06,0x08,0x00,0x78,0x04,0x7C,0x07,0x08,0x40,0x0B,0x00,0x78,0x0C,0x3C, +0x39,0xF9,0x29,0xE9,0x00,0x1A,0x07,0x08,0xC0,0x0B,0x00,0x1A,0x06,0x08,0x02,0x5C, +0x07,0x08,0x02,0x1C,0x12,0x79,0x1F,0x0C,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xAA,0x3D, +0x20,0x0B,0x02,0x0B,0x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0x2B, +0x00,0x0A,0x06,0x08,0x02,0x5C,0x07,0x08,0x02,0x1C,0x12,0x79,0x07,0x0C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x29,0xEF,0x39,0xEF,0x00,0x79,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x00,0x0B,0x18,0x0B,0x1A,0x3D,0x0D,0x8C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x6A,0x3F,0x1F,0xF9,0x02,0x1C,0x0C,0x79,0x05,0x0C,0x10,0x0B, +0x00,0x0B,0x18,0x0B,0x20,0x3D,0x00,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0xB9,0x69,0x89,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E, +0x04,0x3E,0x1E,0xF9,0x02,0x4C,0x09,0x5A,0x05,0x6C,0x39,0xF9,0xFF,0x1A,0x02,0x4C, +0x02,0x5A,0x15,0x6C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x04,0x3E, +0x1E,0xF9,0x0F,0x4C,0x09,0x5A,0x0D,0x2C,0x39,0xF9,0xFF,0x1A,0x02,0x5A,0x48,0xE7, +0x48,0x8A,0x2A,0xBA,0x06,0x2C,0x39,0xF9,0xFF,0x1A,0xFF,0x78,0x02,0x3C,0x12,0x79, +0x24,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x6A,0x3F,0x1F,0xF9,0x02,0x1C,0x0C,0x79, +0x1C,0x0C,0x39,0xF9,0xFF,0x1A,0xFF,0x78,0x05,0x7C,0x10,0x0B,0x00,0x0B,0x18,0x0B, +0xD6,0x3D,0x12,0x0C,0x09,0xF9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x2D,0x3D,0x69,0x99, +0x79,0xA9,0x39,0xF9,0x29,0xE9,0x19,0xD9,0x10,0x0B,0x00,0x0B,0x18,0x0B,0x2B,0x3D, +0x07,0x08,0x02,0x5C,0x07,0x79,0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0x89, +0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x04,0x3E,0x1E,0xF9,0x02,0x4C, +0x09,0x5A,0x05,0x6C,0x39,0xF9,0xFF,0x1A,0x02,0x4C,0x02,0x5A,0x15,0x6C,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x04,0x3E,0x1E,0xF9,0x0F,0x4C,0x09,0x5A, +0x0D,0x2C,0x39,0xF9,0xFF,0x1A,0x02,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x06,0x2C, +0x39,0xF9,0xFF,0x1A,0xFF,0x78,0x02,0x3C,0x12,0x79,0x24,0x0C,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x6A,0x3F,0x1F,0xF9,0x02,0x1C,0x0C,0x79,0x1C,0x0C,0x39,0xF9,0xFF,0x1A, +0xFF,0x78,0x05,0x7C,0x10,0x0B,0x00,0x0B,0x18,0x0B,0xDC,0x3D,0x12,0x0C,0x09,0xF9, +0x10,0x0B,0x00,0x0B,0x06,0x0B,0x2D,0x3D,0x69,0x99,0x79,0xA9,0x39,0xF9,0x29,0xE9, +0x19,0xD9,0x10,0x0B,0x00,0x0B,0x18,0x0B,0x69,0x3D,0x07,0x08,0x02,0x5C,0x12,0x79, +0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0x62,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9, +0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x41,0x0B,0x67,0x3D,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x01,0x0B,0x41,0x0B,0x6C,0x3D,0x07,0x08,0x02,0x5C,0x12,0x79,0x01,0x0C,0x00,0x79, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99, +0x00,0x39,0x29,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x33,0x3D,0x79,0xB9, +0x39,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0x9C,0x3F,0x79,0xEF,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA0,0x3F,0x69,0xEF,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x00,0x39,0x10,0x0B,0x00,0x0B, +0x0A,0x0B,0xAA,0x3D,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F, +0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA, +0x07,0x6C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x04,0x5C, +0x19,0xBF,0x7F,0x1F,0x02,0x39,0x07,0x0C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B, +0xDE,0x3D,0x19,0xBF,0x79,0x9F,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x39,0xF9, +0x0D,0x99,0x0D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0x07,0x6C, +0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x39, +0x06,0x0C,0x29,0xF9,0x19,0xE9,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x0B,0x3D,0x10,0x0B, +0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x39,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x00,0x2B,0x79,0xF9,0x69,0x99, +0x00,0x09,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xAA,0x3D,0xF9,0xF9,0x4A,0xCA,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA, +0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0xF9,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B, +0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x09,0x4E,0x0C,0xF9,0xF9,0x10,0x0B,0x01,0x0B, +0x05,0x0B,0x23,0x3D,0x69,0xA9,0x79,0xB9,0x39,0xF9,0x29,0xE9,0xFF,0x1A,0x19,0xD9, +0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0x99,0x79,0xBF,0x69,0x9F,0x39,0xF9,0x29,0xE9, +0x08,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x19,0xD9, +0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0x99,0x79,0xBF,0x69,0x9F,0x39,0xF9,0x29,0xE9, +0x10,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x19,0xD9, +0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0x99,0x79,0xBF,0x69,0x9F,0x39,0xF9,0x29,0xE9, +0x18,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x19,0xD9, +0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0x99,0x79,0xBF,0x69,0x9F,0x39,0xF9,0x29,0xE9, +0x79,0xE9,0x00,0x79,0x06,0x08,0xFF,0x1A,0x19,0xD9,0x59,0xF9,0x05,0x08,0x01,0x4A, +0x59,0x99,0x79,0xBF,0x69,0x9F,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x09,0xF9, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7, +0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D, +0x07,0x08,0x02,0x5C,0x02,0x79,0x1E,0x0C,0x06,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0x94,0x3D,0x79,0xB9,0x07,0x08,0x15,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E, +0x01,0x1E,0x39,0x8E,0x03,0x3E,0x17,0x1E,0x39,0x8E,0x04,0x3E,0x19,0x9E,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0xAE,0x3D,0x00,0x79,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9,0x15,0x69,0x10,0x0B,0x00,0x0B, +0xFD,0x0B,0xD2,0x3D,0x07,0x08,0x01,0x78,0x02,0x7C,0x0C,0x79,0x59,0x0C,0x29,0xF9, +0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9, +0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B, +0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79,0x41,0x0C,0x29,0xF9, +0x10,0x0B,0x01,0x0B,0x04,0x0B,0xC9,0x3D,0x07,0x08,0x01,0x78,0x09,0x7C,0x29,0xF9, +0x10,0x0B,0x01,0x0B,0x05,0x0B,0x3A,0x3D,0x79,0x97,0x02,0x2C,0x0C,0x79,0x30,0x0C, +0x19,0xF9,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x80,0x3D,0x79,0x89,0x07,0x08,0x02,0x1C, +0x09,0xF9,0x26,0x0C,0x10,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9, +0x07,0x08,0x1D,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E, +0x03,0x3E,0x15,0x1E,0x39,0xF9,0x04,0x4A,0x79,0xBF,0x00,0x2B,0x19,0xDF,0xEF,0xCF, +0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B, +0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08, +0x02,0x5C,0x02,0x79,0x3A,0x0C,0x29,0xF9,0x01,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B, +0x53,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79,0x30,0x0C,0x19,0xF9,0x10,0x0B,0x00,0x0B, +0xFD,0x0B,0x80,0x3D,0x79,0x89,0x07,0x08,0x02,0x1C,0x09,0xF9,0x26,0x0C,0x10,0x79, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08,0x1D,0x1C,0x39,0xBF, +0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E,0x03,0x3E,0x1D,0x1E,0x39,0xF9, +0x04,0x4A,0x79,0xBF,0x00,0x2B,0x19,0xDF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF,0xEF,0xCF, +0xEF,0xCF,0xEF,0xCF,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x29,0xF9, +0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xE9, +0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C,0x29,0xF9,0x10,0x0B, +0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79,0x28,0x0C,0x29,0xF9, +0x01,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x53,0x3D,0x07,0x08,0x02,0x5C,0x0C,0x79, +0x1E,0x0C,0x06,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08, +0x15,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E,0x03,0x3E, +0x1E,0x1E,0x39,0x8E,0x04,0x3E,0x19,0x9E,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F, +0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x29,0xF9,0x1C,0x69, +0x10,0x0B,0x00,0x0B,0xFD,0x0B,0xD2,0x3D,0x07,0x08,0x01,0x78,0x02,0x7C,0x0C,0x79, +0x33,0x0C,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E, +0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C, +0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79, +0x1B,0x0C,0x04,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08, +0x12,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E,0x03,0x3E, +0x1C,0x1E,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B, +0x00,0x0B,0x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x1F,0xF9, +0x06,0x5C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xA7,0x3D,0x05,0x0C,0x39,0xF9, +0x10,0x0B,0x01,0x0B,0x03,0x0B,0x77,0x3D,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B, +0x04,0x0B,0x6A,0x3D,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x10,0x0B,0x01,0x0B, +0x04,0x0B,0xAC,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0x79,0xA9,0x69,0x99,0x59,0x89,0x00,0x2B,0x49,0xF9,0x29,0xF9,0x18,0x69, +0x10,0x0B,0x00,0x0B,0xFD,0x0B,0xD2,0x3D,0x07,0x08,0x01,0x78,0x02,0x7C,0x0C,0x79, +0x4F,0x0C,0x29,0xF9,0x4A,0xCA,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E, +0x1C,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x07,0x6C, +0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xB5,0x3D,0x07,0x08,0x02,0x5C,0x02,0x79, +0x37,0x0C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x04,0x0B,0xC9,0x3D,0x07,0x08,0x02,0x1C, +0x0C,0x79,0x2E,0x0C,0x1E,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9, +0x07,0x08,0x25,0x1C,0x39,0xBF,0x29,0xCF,0x39,0x8E,0x02,0x3E,0x01,0x1E,0x39,0x8E, +0x03,0x3E,0x18,0x1E,0x39,0xF9,0x04,0x4A,0x19,0xE9,0x08,0x59,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x32,0x3D,0x39,0x8E,0x06,0x3E,0x09,0xCE,0x39,0xF9,0x0E,0x4A,0xF9,0xE9, +0x10,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x20,0x0B,0x02,0x0B,0xC9,0x0B, +0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x00,0x79, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x79,0xB9,0x04,0x19, +0x40,0x0B,0x00,0x09,0x00,0x2B,0x01,0x79,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F, +0x9F,0xF7,0x02,0x2C,0x01,0x79,0x01,0x0C,0x03,0x79,0x07,0x08,0xFF,0x1A,0x00,0x2B, +0x79,0xE9,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x9F,0xE7,0x02,0x2C,0x01,0x79, +0x01,0x0C,0x03,0x79,0x07,0x08,0xFF,0x1A,0x00,0x2B,0x79,0xD9,0x10,0x0B,0x00,0x0B, +0x88,0x0B,0x80,0x3D,0x07,0x08,0x05,0x5C,0x0C,0x79,0x10,0x0B,0x00,0x0B,0x84,0x0B, +0x14,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x67,0x3F,0x1F,0xF9,0x06,0x5C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x68,0x3F,0x1F,0xF9,0x02,0x1C,0x0C,0x79,0x7D,0x0C,0x09,0xF9, +0x4A,0xCA,0x39,0xBF,0x4F,0xE9,0x4A,0xCA,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x3A,0x2C,0x39,0xBF,0x4F,0xF9,0x4A,0xCA,0x39,0x8E,0x01,0x3E,0x4E,0xE9, +0x4A,0xCA,0x07,0x08,0x69,0xDA,0x48,0xE7,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,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x10,0x0B,0x00,0x0B,0x88,0x0B,0x80,0x3D, +0x07,0x08,0x06,0x5C,0x0C,0x79,0x10,0x0B,0x00,0x0B,0x87,0x0B,0xCB,0x3D,0x33,0x0C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x31,0x3F,0x1F,0xF9,0x10,0x0B,0x00,0x0B,0x88,0x0B, +0x66,0x3D,0x07,0x08,0x06,0x5C,0x12,0x79,0x10,0x0B,0x00,0x0B,0x87,0x0B,0xCB,0x3D, +0x22,0x0C,0x06,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,0x07,0x08, +0x1A,0x1C,0x39,0x8E,0x02,0x3E,0x02,0x1E,0x02,0x08,0x02,0x5C,0x02,0x79,0x01,0x0C, +0x01,0x79,0x07,0x08,0xFF,0x1A,0x39,0x8E,0x03,0x3E,0x79,0x9E,0x39,0x8E,0x04,0x3E, +0x19,0x9E,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x39,0xE9,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0xAE,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B, +0x59,0xF9,0x00,0x2B,0x49,0xE9,0x19,0xF9,0xFF,0x1A,0x02,0x5A,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x02,0x2C,0x12,0x79,0x37,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x65,0x3F, +0x1F,0xF9,0x12,0x5C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x66,0x3F,0x1F,0xF9,0x0C,0x5C, +0x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08,0xAA,0x8A, +0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x69,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x01,0x39,0x00,0x09, +0x00,0x2B,0x79,0xE9,0x00,0x2B,0x00,0x79,0xF9,0xA9,0xE9,0x99,0x00,0x2B,0x69,0xE9, +0x00,0x2B,0x00,0x79,0xF9,0xD9,0xE9,0xC9,0x06,0x0C,0x04,0x08,0x2A,0x8A,0x05,0x08, +0x5A,0x8A,0x03,0x08,0x2A,0x8A,0x00,0x2B,0x19,0xE9,0x00,0x2B,0x29,0xF9,0x0E,0x08, +0x49,0xDA,0x0F,0x08,0x59,0xFA,0xF1,0x6C,0x15,0x0C,0x05,0x08,0xAA,0x8A,0x04,0x08, +0xDA,0x8A,0x03,0x08,0xAA,0x8A,0x00,0x2B,0x19,0xE9,0x00,0x2B,0x29,0xF9,0x0E,0x08, +0x49,0xDA,0x0F,0x08,0x59,0xFA,0x06,0x2C,0x01,0x08,0x49,0xDA,0x02,0x08,0x59,0xFA, +0x00,0x08,0x39,0xCA,0x00,0x2B,0x39,0xF9,0x02,0x5A,0xE7,0x6C,0x09,0xF9,0x00,0x2B, +0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x10,0x0B,0x00,0x0B,0x88,0x0B,0x8F,0x3D,0x10,0x0B,0x00,0x0B,0x90,0x0B,0xF3,0x3D, +0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x28,0x3F,0x00,0x1F,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x24,0x3F,0x10,0x4F,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x26,0x3F,0x10,0x4F, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x29,0x3F,0x00,0x1F,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,0x0B,0x4E,0x69, +0x04,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x39,0xF9,0x01,0x0B,0xAF,0x4A, +0x04,0x69,0x10,0x0B,0x01,0x0B,0x45,0x0B,0xFA,0x3D,0x39,0xF9,0x01,0x0B,0xA3,0x4A, +0x08,0x69,0x10,0x0B,0x01,0x0B,0x45,0x0B,0xFA,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x79,0xB9,0x39,0xF9,0x01,0x0B,0x8B,0x4A,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x30,0x3F, +0x6F,0xE9,0x04,0x4A,0x10,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x0D,0xB9, +0x0D,0x8C,0x79,0x8E,0x08,0x3E,0x06,0x1E,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0xA9,0x29,0xF9,0x48,0x4A,0x79,0xB9,0x29,0xF9,0x01,0x0B,0x8B,0x4A, +0x39,0xE9,0x29,0xD9,0x01,0x0B,0x9B,0x4A,0x10,0x0B,0x00,0x0B,0x0B,0x0B,0xB1,0x3D, +0x39,0xF9,0x10,0x4A,0x29,0xE9,0x01,0x0B,0xAB,0x4A,0x08,0x59,0x10,0x0B,0x01,0x0B, +0x4D,0x0B,0x32,0x3D,0x29,0x8E,0x02,0x3E,0x1E,0xF9,0x02,0x1C,0x00,0x79,0x01,0x0C, +0x01,0x79,0x07,0x08,0xFF,0x1A,0x79,0x99,0x39,0x8E,0x20,0x3E,0x19,0x9E,0x20,0x0B, +0x02,0x0B,0xA0,0x0B,0xD0,0x3F,0x6F,0xF9,0x79,0x89,0x29,0xF9,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x54,0x3F,0x6F,0xE9,0x07,0x08,0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x9C,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xE9,0x39,0xF9,0x19,0xD9, +0x09,0xBD,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9, +0x39,0xF9,0x3E,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x0D,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B, +0xB3,0x3D,0x79,0xA9,0x07,0x08,0x22,0x1C,0x29,0xB9,0x39,0xE9,0x69,0xF9,0x06,0x08, +0x01,0x4A,0x69,0xB9,0x79,0xBF,0x04,0x1F,0x39,0xF9,0x19,0xE9,0x01,0x0B,0xA3,0x4A, +0x08,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x08,0x4A,0x39,0xF9, +0x19,0xE9,0x01,0x0B,0xAF,0x4A,0x04,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D, +0x19,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x01,0x79,0x10,0x0B, +0x00,0x0B,0xC9,0x0B,0xB3,0x3D,0x79,0xB9,0x07,0x08,0x0E,0x1C,0x39,0xA9,0x29,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9,0x79,0xBF,0x05,0x1F,0x19,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x01,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B, +0xB3,0x3D,0x79,0xB9,0x07,0x08,0x0E,0x1C,0x39,0xA9,0x29,0xE9,0x69,0xF9,0x06,0x08, +0x01,0x4A,0x69,0xA9,0x79,0xBF,0x06,0x1F,0x19,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B, +0xC8,0x0B,0xDE,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x79,0x99,0x01,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B,0xB3,0x3D,0x79,0xB9, +0x07,0x08,0x0E,0x1C,0x39,0xA9,0x29,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9, +0x79,0xBF,0x0A,0x1F,0x19,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99, +0x01,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B,0xB3,0x3D,0x79,0xB9,0x07,0x08,0x0E,0x1C, +0x39,0xA9,0x29,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9,0x79,0xBF,0x0B,0x1F, +0x19,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x01,0x79,0x10,0x0B, +0x00,0x0B,0xC9,0x0B,0xB3,0x3D,0x79,0xB9,0x07,0x08,0x0E,0x1C,0x39,0xA9,0x29,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9,0x79,0xBF,0x12,0x1F,0x19,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0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B,0x8F,0x0B,0xAF,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xAC,0x0B,0xF6,0x3D, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0xD9,0x0B,0x44,0x3D,0x39,0xF9,0x02,0x0B,0x00,0x69, +0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x47,0x1C,0x39,0xF9,0x01,0x69, +0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x07,0x1C,0x39,0xF9,0x02,0x0B, +0x3C,0x4A,0x79,0xBF,0x8F,0xF9,0x08,0x2A,0x79,0xDF,0x39,0xF9,0x01,0x0B,0x00,0x69, +0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x07,0x1C,0x39,0xF9,0x02,0x0B, +0x3C,0x4A,0x79,0xBF,0x8F,0xF9,0x04,0x2A,0x79,0xDF,0x39,0xF9,0x40,0x69,0x10,0x0B, +0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x1C,0x1C,0x39,0xF9,0x02,0x0B,0x14,0x4A, +0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x02,0x4C,0x1C,0x5A,0x0C,0x6C,0x39,0xF9,0x02,0x0B, +0x16,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x01,0x0B,0x49,0x5A,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x07,0x2C,0x39,0xF9,0x02,0x0B,0x3C,0x4A,0x79,0xBF,0x8F,0xF9,0x10,0x2A, +0x79,0xDF,0x39,0x8E,0x01,0x3E,0x01,0x1E,0x43,0x0C,0x39,0xF9,0x01,0x69,0x10,0x0B, +0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x06,0x1C,0x39,0xF9,0x34,0x69,0x10,0x0B, +0x00,0x0B,0x9B,0x0B,0x28,0x3D,0x39,0xF9,0x01,0x0B,0x00,0x69,0x10,0x0B,0x01,0x0B, +0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0x10,0x4A,0x10,0x0B,0x00,0x0B,0xC6,0x0B,0x43,0x3D,0x39,0xE9,0x02,0x0B, +0x20,0x4A,0x69,0xBF,0x79,0xCF,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x19,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0xB9, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x07,0x0B,0xD0,0x3D,0x07,0x08,0x05,0x1C,0x10,0x0B, +0x00,0x0B,0x25,0x0B,0x7A,0x3D,0x71,0x0C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4,0x3F, +0x6F,0xF9,0x21,0x1C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4,0x3F,0x9F,0x8E,0x06,0x3E, +0x6E,0xF9,0x19,0x1C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4,0x3F,0x9F,0x8E,0x06,0x3E, +0x6E,0xF9,0x79,0x89,0x39,0xF9,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x6F,0xE9, +0x07,0x08,0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x9C,0x3D, +0x07,0x08,0x4A,0xCA,0x09,0xBD,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x68,0x3F,0x00,0x1F, +0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x69,0x3F,0x00,0x1F,0x39,0xF9,0x01,0x0B,0x54,0x4A, +0x79,0xBF,0x00,0x1F,0x39,0xF9,0x01,0x0B,0x55,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9, +0x01,0x0B,0x51,0x4A,0x79,0xBF,0x01,0x1F,0x39,0xF9,0x00,0x69,0x01,0x59,0x10,0x0B, +0x00,0x0B,0xB7,0x0B,0x92,0x3D,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x86,0x3D,0x07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,0x1F,0xF9,0x17,0x4C,0x16,0x1C, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x08,0x0B,0xC3,0x3D,0x39,0xF9,0x01,0x0B,0x78,0x4A, +0x39,0x8E,0xBA,0x3E,0x4E,0xE9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D, +0x39,0xF9,0x01,0x0B,0x88,0x4A,0x79,0xBF,0x01,0x1F,0x11,0x0C,0x20,0x0B,0x02,0x0B, +0xCA,0x0B,0x69,0x3F,0x1F,0xF9,0x0B,0x1C,0x39,0xF9,0x01,0x0B,0x78,0x4A,0x39,0x8E, +0xBA,0x3E,0x4E,0xE9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D,0xE9,0x8E, +0x10,0x3E,0x1E,0xF9,0x39,0xE9,0x01,0x0B,0x16,0x4A,0x69,0xBF,0x79,0x9F,0x39,0xF9, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x6F,0xE9,0x07,0x08,0x69,0xDA,0x02,0x0B, +0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x9C,0x3D,0x07,0x08,0xFF,0x1A,0x10,0x0B, +0x00,0x0B,0x6C,0x0B,0xAB,0x3D,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x07,0x0B,0xD0,0x3D, +0x07,0x08,0x11,0x1C,0x39,0xF9,0x40,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D, +0x39,0xF9,0x01,0x0B,0x78,0x4A,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x95,0x3D,0x10,0x0B, +0x00,0x0B,0x96,0x0B,0x4F,0x0C,0x39,0x8E,0xFC,0x3E,0x1E,0xF9,0x10,0x0B,0x00,0x0B, +0x94,0x0B,0xF4,0x1C,0x0C,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B,0xB3,0x3D,0x00,0x2B, +0x79,0xB9,0x07,0x08,0x10,0x0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B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x1D,0x8E,0x2E,0x3E, +0x4E,0xE9,0x4A,0xCA,0x79,0xCA,0x1D,0x8E,0x15,0x3E,0x69,0xEE,0x1D,0x8E,0x15,0x3E, +0x6E,0xF9,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x69,0x89,0x1D,0x8E,0x15,0x3E,0x6E,0xF9, +0x00,0x2B,0x79,0x99,0x09,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x09,0x08,0x69,0xDA,0x7A,0xCA,0x00,0x2B, +0x99,0xF9,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x14,0x3F,0x6F,0xF9,0x37,0x1C,0x20,0x0B, +0x02,0x0B,0xC6,0x0B,0x14,0x3F,0x6F,0xF9,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B, +0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x69,0x89, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x14,0x3F,0x6F,0xF9,0x00,0x2B,0x79,0x99,0x09,0xE9, +0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xF0,0x3D,0x09,0x08,0x69,0xDA,0x7A,0xCA,0x00,0x2B,0x99,0xF9,0xD9,0xF9,0x09,0xCA, +0x29,0x8E,0x02,0x3E,0x79,0xEE,0xF9,0xF9,0x7A,0xCA,0x01,0x4C,0x02,0x5C,0x00,0x79, +0x02,0x0C,0xF9,0xF9,0x7A,0xCA,0x07,0x08,0x4A,0xCA,0x29,0x8E,0x0A,0x3E,0x79,0xCE, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x14,0x3F,0x6F,0xF9,0x20,0x1C,0x20,0x0B,0x02,0x0B, +0xC6,0x0B,0x14,0x3F,0x6F,0xF9,0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x06,0x08,0xD9,0xCA, +0x29,0x8E,0x02,0x3E,0x69,0xEE,0x29,0x8E,0x0A,0x3E,0x00,0x4E,0x39,0xF9,0x02,0x0B, +0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x07,0x78,0x13,0x7C,0x39,0x8E,0x89,0x3E,0x4E,0xF9, +0x4A,0xCA,0x39,0xE9,0x02,0x0B,0x56,0x4A,0x69,0xBF,0x4F,0xE9,0x4A,0xCA,0x07,0x08, +0x69,0xF8,0x06,0x7C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x91,0x0B,0xAF,0x3D,0x33,0x0C, +0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x78,0x13,0x7C,0x39,0x8E, +0x89,0x3E,0x4E,0xF9,0x4A,0xCA,0x39,0xE9,0x02,0x0B,0x78,0x4A,0x69,0xBF,0x4F,0xE9, +0x4A,0xCA,0x07,0x08,0x69,0xF8,0x06,0x7C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x92,0x0B, +0x80,0x3D,0x19,0x0C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x0B,0x78, +0x12,0x7C,0x39,0x8E,0x89,0x3E,0x4E,0xF9,0x4A,0xCA,0x39,0xE9,0x02,0x0B,0x80,0x4A, +0x69,0xBF,0x4F,0xE9,0x4A,0xCA,0x07,0x08,0x69,0xF8,0x05,0x7C,0x39,0xF9,0x10,0x0B, +0x00,0x0B,0x92,0x0B,0x98,0x3D,0x39,0xF9,0x01,0x0B,0x49,0x4A,0x79,0xBF,0x1F,0xF9, +0x3A,0x8A,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xEC,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B, +0x79,0x99,0x39,0xF9,0x00,0x69,0x99,0xBD,0x19,0x8E,0x01,0x3E,0x79,0x9E,0x29,0xF9, +0x10,0x0B,0x01,0x0B,0x05,0x0B,0xFA,0x69,0x10,0x0B,0x00,0x0B,0x29,0x0B,0x4E,0x3D, +0x07,0x08,0x01,0x1C,0x04,0x0C,0x10,0x0B,0x00,0x0B,0x95,0x0B,0x16,0x0C,0x00,0x2B, +0x0D,0x99,0x00,0x2B,0x0D,0xA9,0x00,0x2B,0x0D,0xB9,0x00,0x2B,0x0D,0xC9,0x00,0x2B, +0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x09,0xBE,0x1D,0x89,0x34,0x4A,0x09,0x9D,0x3E,0x89,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x79,0xA9,0x29,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0xB9,0x39,0xF9,0x01,0x0B, +0x72,0x4A,0x79,0xBF,0x1F,0xF9,0x0B,0x1C,0x39,0xF9,0x01,0x0B,0x73,0x4A,0x79,0xBF, +0x1F,0xF9,0x05,0x1C,0x39,0xF9,0x01,0x0B,0x72,0x4A,0x79,0xBF,0x00,0x1F,0x39,0x8E, +0x01,0x3E,0x1E,0xF9,0x01,0x5C,0x05,0x0C,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x93,0x0B, +0xB8,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9, +0x69,0x99,0x19,0xF9,0xFF,0x1A,0x09,0x5C,0x29,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0xB9, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x07,0x0B,0xCA,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D, +0x00,0x2B,0x79,0xF9,0x69,0x99,0x59,0xA9,0xF9,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0xB9, +0x1D,0x8E,0x05,0x3E,0x00,0x6E,0x00,0x09,0x1D,0xF9,0x18,0x4A,0x79,0xBF,0x00,0x1F, +0x39,0xF9,0x02,0x0B,0x32,0x4A,0x79,0xBF,0x1F,0xF9,0x0B,0x1C,0x39,0xF9,0x02,0x0B, +0x32,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9,0x38,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B, +0x75,0x3D,0x29,0xF9,0xFF,0x1A,0x02,0x78,0x09,0x7C,0x19,0xF9,0x10,0x0B,0x00,0x0B, +0xCB,0x0B,0x75,0x3D,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xB3,0x0C,0x39,0xF9,0x10,0x0B, +0x01,0x0B,0x07,0x0B,0xD0,0x3D,0x07,0x08,0x08,0x5C,0x29,0xF9,0xFF,0x1A,0x01,0x78, +0x04,0x3C,0x29,0xF9,0xFF,0x1A,0x03,0x78,0x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A,0x69,0xBF,0x79,0x9F,0x39,0xF9,0xF9,0x8E,0x02,0x3E,0x6E,0xE9,0x39,0xD9, +0x02,0x0B,0x22,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0xB9,0x0B, +0x34,0x3D,0x07,0x08,0x05,0x1C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x7A,0x3D,0x37,0x0C, +0x1D,0xF9,0x18,0x4A,0x79,0xBF,0x1F,0xF9,0x0A,0x5C,0x39,0xF9,0x08,0x69,0x10,0x0B, +0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79, +0x07,0x08,0xFF,0x1A,0x1D,0xE9,0x18,0x4A,0x69,0xBF,0x79,0x9F,0x1D,0xF9,0x18,0x4A, +0x79,0xBF,0x1F,0xF9,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A, +0x79,0xD9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xB7,0x0B,0x92,0x3D,0x07,0x08, +0x4A,0xCA,0x05,0x5C,0x10,0x0B,0x00,0x0B,0x25,0x0B,0x7A,0x3D,0x08,0x0C,0x10,0x0B, +0x00,0x0B,0x25,0x0B,0x86,0x3D,0x07,0x08,0x01,0x1C,0x01,0x0C,0x01,0x09,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0xB7,0x0B,0x89,0x3D,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x07,0x0B, +0xBD,0x3D,0x39,0xF9,0x19,0xE9,0x1D,0x8E,0x05,0x3E,0x6E,0xD9,0x09,0xC9,0x10,0x0B, +0x00,0x0B,0xB8,0x0B,0xEF,0x3D,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0xA8,0x0D,0xA8,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xA9,0x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79,0x10,0x0B,0x00,0x0B,0x98,0x0B, +0xD3,0x0C,0x79,0xD9,0x02,0x0B,0x3E,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0x59,0x87, +0x0D,0x6C,0x79,0xD9,0x02,0x0B,0x3E,0x4A,0x59,0xBF,0x8F,0xD9,0x00,0x2B,0x01,0x0A, +0x59,0xDF,0x00,0x79,0x10,0x0B,0x00,0x0B,0x98,0x0B,0xD3,0x0C,0x79,0xD9,0x02,0x0B, +0x3C,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0x59,0x87,0x0A,0x6C,0x79,0xD9,0x02,0x0B, +0x3C,0x4A,0x59,0xBF,0x8F,0xD9,0x00,0x2B,0x01,0x0A,0x59,0xDF,0x00,0x79,0x7B,0x0C, +0x00,0x69,0x79,0xD9,0x02,0x0B,0x3E,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0x69,0xC9, +0xFF,0x1A,0x01,0x39,0x04,0x08,0x04,0x1C,0x49,0xED,0x03,0x08,0x2A,0x8A,0xFD,0x4D, +0x03,0x08,0x59,0x9A,0x14,0x1C,0x69,0xD9,0xFF,0x1A,0x01,0x49,0x05,0x08,0x04,0x1C, +0x59,0xED,0x04,0x08,0x2A,0x8A,0xFD,0x4D,0x04,0x08,0x1A,0x8A,0x79,0xD9,0x02,0x0B, +0x3E,0x4A,0x59,0xBF,0x8F,0xD9,0x49,0x9A,0x59,0xDF,0x69,0xF9,0x54,0x0C,0x06,0x08, +0x01,0x4A,0xFF,0x1A,0x69,0xD9,0xFF,0x1A,0xD4,0x4C,0x06,0x5A,0xD2,0x2C,0x00,0x69, +0x79,0xD9,0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0x69,0xC9,0xFF,0x1A, +0x01,0x39,0x04,0x08,0x04,0x1C,0x49,0xED,0x03,0x08,0x2A,0x8A,0xFD,0x4D,0x03,0x08, +0x59,0x9A,0x30,0x1C,0x69,0xD9,0xFF,0x1A,0x01,0x49,0x05,0x08,0x04,0x1C,0x59,0xED, +0x04,0x08,0x2A,0x8A,0xFD,0x4D,0x04,0x08,0x1A,0x8A,0x79,0xD9,0x02,0x0B,0x3C,0x4A, +0x59,0xBF,0x8F,0xD9,0x49,0x9A,0x59,0xDF,0x79,0xD9,0x02,0x0B,0x35,0x4A,0x59,0xBF, +0x1F,0xD9,0x01,0x78,0x15,0x7C,0x79,0xD9,0x02,0x0B,0x35,0x4A,0x59,0xBF,0x00,0x1F, +0x79,0xD9,0x02,0x0B,0x30,0x4A,0x59,0xBF,0x1F,0xD9,0x05,0x1C,0x79,0xD9,0x02,0x0B, +0x2B,0x4A,0x59,0xBF,0x01,0x1F,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x69,0x9F, +0x69,0xF9,0x09,0x0C,0x06,0x08,0x01,0x4A,0xFF,0x1A,0x69,0xD9,0xFF,0x1A,0xB8,0x4C, +0x06,0x5A,0xB6,0x2C,0xFF,0x79,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9, +0x69,0xA9,0x29,0xF9,0xFF,0x1A,0x0C,0x78,0x2B,0x3C,0x16,0x78,0x17,0x3C,0x17,0x78, +0x1D,0x3C,0x1B,0x78,0x15,0x3C,0x1C,0x78,0x17,0x3C,0x1F,0x78,0x19,0x3C,0x21,0x78, +0x11,0x3C,0x34,0x78,0x11,0x3C,0x35,0x78,0x0B,0x3C,0x36,0x78,0x11,0x3C,0x37,0x78, +0x0D,0x3C,0x38,0x78,0x0F,0x3C,0x39,0x78,0x67,0x3C,0x6C,0x0C,0x01,0x79,0x6C,0x0C, +0x02,0x79,0x6A,0x0C,0x05,0x79,0x68,0x0C,0x03,0x79,0x66,0x0C,0x00,0x79,0x64,0x0C, +0x04,0x79,0x62,0x0C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x5C,0x0C, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xF9,0x01,0x78,0x17,0x3C,0x02,0x78, +0x1B,0x3C,0x07,0x78,0x1F,0x3C,0x08,0x78,0x13,0x3C,0x09,0x78,0x11,0x3C,0x0C,0x78, +0x11,0x3C,0x0D,0x78,0x39,0x3C,0x0E,0x78,0x0B,0x3C,0x11,0x78,0x35,0x3C,0x14,0x78, +0x0D,0x3C,0x15,0x78,0x0B,0x3C,0x19,0x78,0x0B,0x3C,0x34,0x0C,0x01,0x79,0x3C,0x0C, +0x02,0x79,0x3A,0x0C,0x03,0x79,0x38,0x0C,0x00,0x79,0x36,0x0C,0x04,0x79,0x34,0x0C, +0x05,0x79,0x32,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xF9,0x01,0x78, +0x0F,0x3C,0x02,0x78,0x13,0x3C,0x08,0x78,0x0D,0x3C,0x09,0x78,0x0B,0x3C,0x0C,0x78, +0x0B,0x3C,0x0E,0x78,0x07,0x3C,0x14,0x78,0x0B,0x3C,0x15,0x78,0x09,0x3C,0x0A,0x0C, +0x01,0x79,0x1A,0x0C,0x02,0x79,0x18,0x0C,0x03,0x79,0x16,0x0C,0x00,0x79,0x14,0x0C, +0x04,0x79,0x12,0x0C,0x00,0x0C,0x07,0x0C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF, +0x1F,0xF9,0x0A,0x0C,0x00,0x0C,0x07,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x98,0x0B, +0x26,0x3D,0x02,0x0C,0x00,0x0C,0xFF,0x79,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x69,0xD9, +0xFF,0x1A,0x0C,0x78,0x23,0x3C,0x0D,0x78,0x1F,0x3C,0x16,0x78,0x17,0x3C,0x17,0x78, +0x15,0x3C,0x1B,0x78,0x13,0x3C,0x1C,0x78,0x11,0x3C,0x1F,0x78,0x0F,0x3C,0x21,0x78, +0x0D,0x3C,0x34,0x78,0x0D,0x3C,0x35,0x78,0x0B,0x3C,0x36,0x78,0x09,0x3C,0x37,0x78, +0x07,0x3C,0x38,0x78,0x07,0x3C,0x39,0x78,0x33,0x3C,0x3D,0x0C,0x00,0x79,0x3D,0x0C, +0x01,0x79,0x3B,0x0C,0x06,0x79,0x39,0x0C,0x04,0x79,0x37,0x0C,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x39,0x3F,0x1F,0xD9,0x01,0x78,0x17,0x3C,0x02,0x78,0x19,0x3C,0x07,0x78, +0x1B,0x3C,0x08,0x78,0x11,0x3C,0x09,0x78,0x15,0x3C,0x0C,0x78,0x11,0x3C,0x0D,0x78, +0x13,0x3C,0x0E,0x78,0x09,0x3C,0x11,0x78,0x0F,0x3C,0x14,0x78,0x05,0x3C,0x15,0x78, +0x09,0x3C,0x19,0x78,0x03,0x3C,0x0A,0x0C,0x04,0x79,0x17,0x0C,0x03,0x79,0x15,0x0C, +0x03,0x79,0x13,0x0C,0x05,0x79,0x11,0x0C,0x07,0x79,0x0F,0x0C,0xFF,0x79,0x0D,0x0C, +0x79,0xD9,0x02,0x0B,0x3E,0x4A,0x59,0xBF,0x4F,0xD9,0x03,0x1C,0x02,0x79,0x05,0x0C, +0x02,0x0C,0x01,0x79,0x02,0x0C,0x00,0x0C,0xFF,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x01,0x49,0x69,0xB9,0xFF,0x1A,0x00,0x78,0x69,0x3C,0x01,0x78,0x3B,0x3C,0x02,0x78, +0x25,0x3C,0x03,0x78,0x05,0x3C,0x04,0x78,0x2F,0x3C,0x05,0x78,0x43,0x3C,0x5E,0x0C, +0x59,0xB9,0xFF,0x1A,0x02,0x78,0x0D,0x7C,0x79,0xB9,0x01,0x0B,0xFC,0x4A,0x39,0xBF, +0x1F,0xB9,0x02,0x1C,0x00,0x39,0x01,0x0C,0x01,0x39,0x03,0x08,0xFF,0x1A,0x39,0xC9, +0x0C,0x0C,0x79,0xB9,0x01,0x0B,0xFD,0x4A,0x39,0xBF,0x1F,0xB9,0x02,0x1C,0x00,0x39, +0x01,0x0C,0x01,0x39,0x03,0x08,0xFF,0x1A,0x39,0xC9,0x41,0x0C,0x79,0x8E,0x02,0x3E, +0x1E,0xB9,0x01,0x78,0x08,0x7C,0x59,0xB9,0xFF,0x1A,0x05,0x5C,0x79,0x8E,0x82,0x3E, +0xAE,0xB7,0x01,0x2C,0x00,0x49,0x33,0x0C,0x79,0x8E,0x82,0x3E,0xAE,0xD7,0x01,0x2C, +0x00,0x49,0x2D,0x0C,0x79,0x8E,0x02,0x3E,0x1E,0xB9,0x01,0x78,0x05,0x7C,0x59,0xB9, +0xFF,0x1A,0x01,0x5C,0x00,0x49,0x05,0x0C,0x59,0xB9,0xFF,0x1A,0x04,0x78,0x01,0x7C, +0x00,0x49,0x1D,0x0C,0x79,0x8E,0x02,0x3E,0x1E,0xB9,0x05,0x5C,0x59,0xB9,0xFF,0x1A, +0x01,0x5C,0x00,0x49,0x12,0x0C,0x59,0xB9,0xFF,0x1A,0x04,0x78,0x02,0x7C,0x00,0x49, +0x0C,0x0C,0x59,0xB9,0xFF,0x1A,0x09,0x5C,0x79,0x8E,0x82,0x3E,0x6E,0xA9,0x6E,0xB9, +0x02,0x08,0x8A,0xCA,0x0A,0xEA,0x01,0x2C,0x00,0x49,0x01,0x0C,0x00,0x0C,0x49,0xF9, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x69,0x89,0x19,0xF9,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x54,0x3F,0x6F,0xE9,0x07,0x08,0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x9C,0x3D,0x07,0x08,0x4A,0xCA,0x79,0xA9,0x1D,0x8E,0x08,0x3E, +0x29,0xCE,0x1D,0xF9,0x12,0x4A,0x79,0xBF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B9,0x69,0xA9,0x39,0xF9,0x02,0x0B,0x3A,0x4A,0x79,0xBF,0x4F,0xF9, +0x4A,0xCA,0x29,0xE9,0xFF,0x1A,0x01,0x59,0x06,0x08,0x04,0x1C,0x69,0xED,0x05,0x08, +0x2A,0x8A,0xFD,0x4D,0x05,0x08,0x79,0x9A,0x01,0x5C,0x46,0x0C,0x29,0xF9,0xFF,0x1A, +0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x06,0x08, +0x1A,0x8A,0x39,0xF9,0x02,0x0B,0x3A,0x4A,0x79,0xBF,0x8F,0xF9,0x69,0x9A,0x79,0xDF, +0x1A,0x19,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xF9,0x07,0x78,0x0C,0x3C, +0x0D,0x78,0x03,0x3C,0x11,0x78,0x01,0x3C,0x16,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x3D,0x3F,0x1F,0xF9,0x79,0x99,0x10,0x0C,0x29,0xF9,0xFF,0x1A,0x04,0x78,0x0A,0x7C, +0x39,0x8E,0x82,0x3E,0x6E,0xE9,0x00,0x2B,0x20,0x0A,0xAE,0xF9,0x00,0x2B,0x00,0x0A, +0x79,0xFE,0x69,0xFE,0x01,0x0C,0x00,0x0C,0x29,0xF9,0xFF,0x1A,0x02,0x78,0x03,0x3C, +0x04,0x78,0x08,0x3C,0x08,0x0C,0x39,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B, +0x3B,0x3D,0x02,0x0C,0x01,0x0C,0x00,0x0C,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0xB9,0x69,0x99,0x19,0x89, +0x39,0xF9,0x19,0xE9,0x10,0x0B,0x00,0x0B,0x99,0x0B,0x67,0x3D,0x79,0x99,0x07,0x08, +0xFF,0x1A,0xFF,0x78,0x05,0x7C,0x00,0x79,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xCC,0x0C, +0x39,0xF9,0x09,0xE9,0x10,0x0B,0x00,0x0B,0x98,0x0B,0xD5,0x3D,0x79,0xA9,0x07,0x08, +0xFF,0x1A,0xFF,0x78,0x05,0x7C,0x00,0x79,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xCC,0x0C, +0x39,0xF9,0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x09,0x3C,0x01,0x78, +0x10,0x0B,0x00,0x0B,0x9C,0x0B,0x1A,0x3C,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xB6,0x0C, +0x19,0xF9,0xFF,0x1A,0x00,0x78,0x1B,0x3C,0x01,0x78,0x30,0x3C,0x02,0x78,0x5A,0x3C, +0x03,0x78,0x58,0x3C,0x04,0x78,0x56,0x3C,0x05,0x78,0x10,0x0B,0x00,0x0B,0x9C,0x0B, +0x15,0x3C,0x06,0x78,0x10,0x0B,0x00,0x0B,0x9C,0x0B,0x15,0x3C,0x07,0x78,0x10,0x0B, +0x00,0x0B,0x9C,0x0B,0x15,0x3C,0x10,0x0B,0x00,0x0B,0x9C,0x0B,0x15,0x0C,0x29,0xF9, +0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D, +0x39,0xF9,0x02,0x0B,0x3A,0x4A,0x79,0xBF,0x8F,0xF9,0x69,0xAA,0x79,0xDF,0x39,0xF9, +0x29,0xE9,0x00,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x39,0xF9,0x29,0xE9, +0x19,0xD9,0x10,0x0B,0x00,0x0B,0x99,0x0B,0xC6,0x3D,0x07,0x08,0x1C,0x1C,0x39,0xF9, +0x29,0xE9,0x01,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x39,0xF9,0x10,0x0B, +0x00,0x0B,0xE0,0x0B,0xAD,0x3D,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x29,0x9F, +0x39,0xF9,0x02,0x0B,0x30,0x4A,0x79,0xBF,0x01,0x1F,0x39,0xF9,0x02,0x0B,0x2B,0x4A, +0x79,0xBF,0x01,0x1F,0x06,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B, +0xC6,0x3D,0x54,0x0C,0x39,0xF9,0x29,0xE9,0x19,0xD9,0x10,0x0B,0x00,0x0B,0x99,0x0B, +0xC6,0x3D,0x07,0x08,0x42,0x1C,0x19,0xF9,0xFF,0x1A,0x02,0x78,0x07,0x3C,0x39,0xF9, +0x29,0xE9,0x02,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x29,0xF9,0xFF,0x1A, +0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x20,0x0B,0x02,0x0B, +0x9B,0x0B,0xCC,0x4A,0x79,0xBF,0x6F,0xF9,0x13,0x1C,0x29,0xF9,0xFF,0x1A,0x14,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x20,0x0B,0x02,0x0B,0x9B,0x0B, +0xCC,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B,0x79,0xF9,0x39,0xF9,0xF9,0xBD,0x14,0x0C, +0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x29,0x9F,0x39,0xF9,0x02,0x0B,0x32,0x4A, +0x79,0xBF,0x00,0x1F,0x39,0xF9,0x02,0x0B,0x30,0x4A,0x79,0xBF,0x01,0x1F,0x39,0xF9, +0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x01,0x1F,0x07,0x0C,0x39,0xF9,0x1A,0x69,0x00,0x59, +0x10,0x0B,0x00,0x0B,0xE0,0x0B,0x3B,0x3D,0x01,0x0C,0x00,0x0C,0x10,0x0B,0x00,0x0B, +0x9D,0x0B,0xB7,0x0C,0x19,0xF9,0xFF,0x1A,0x00,0x78,0x1F,0x3C,0x01,0x78,0x1D,0x3C, +0x03,0x78,0x10,0x0B,0x00,0x0B,0x9C,0x0B,0xB4,0x3C,0x04,0x78,0x10,0x0B,0x00,0x0B, +0x9D,0x0B,0x62,0x3C,0x05,0x78,0x10,0x0B,0x00,0x0B,0x9C,0x0B,0xE2,0x3C,0x06,0x78, +0x10,0x0B,0x00,0x0B,0x9D,0x0B,0x37,0x3C,0x07,0x78,0x10,0x0B,0x00,0x0B,0x9D,0x0B, +0x37,0x3C,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xB4,0x0C,0x39,0xF9,0x29,0xE9,0x19,0xD9, +0x10,0x0B,0x00,0x0B,0x99,0x0B,0xC6,0x3D,0x07,0x08,0x64,0x1C,0x19,0xF9,0xFF,0x1A, +0x10,0x5C,0x29,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08, +0x2A,0x8A,0xFD,0x4D,0x39,0xF9,0x02,0x0B,0x3A,0x4A,0x79,0xBF,0x8F,0xF9,0x69,0xAA, +0x79,0xDF,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x29,0xE9,0xFF,0x1A, +0x07,0x08,0x69,0xF8,0x10,0x3C,0x29,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C, +0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0xF9,0x02,0x0B,0x3C,0x4A,0x79,0xBF, +0x8F,0xF9,0x69,0xAA,0x79,0xDF,0x19,0xF9,0xFF,0x1A,0x07,0x5C,0x39,0xF9,0x29,0xE9, +0x00,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x29,0xF9,0xFF,0x1A,0x29,0x5C, +0x29,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A, +0xFD,0x4D,0x06,0x08,0x1A,0x8A,0x39,0xF9,0x02,0x0B,0x3C,0x4A,0x79,0xBF,0x8F,0xF9, +0x69,0x9A,0x79,0xDF,0x29,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED, +0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0xF9,0x02,0x0B,0x3E,0x4A,0x79,0xBF,0x8F,0xF9, +0x69,0xAA,0x79,0xDF,0x39,0xF9,0x29,0xE9,0x01,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B, +0xF2,0x3D,0x06,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B,0xC6,0x3D, +0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xB5,0x0C,0x29,0xF9,0xFF,0x1A,0x39,0xE9,0x02,0x0B, +0x39,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x08,0x69,0xF8,0x24,0x3C,0x39,0xF9,0x29,0xE9, +0x19,0xD9,0x10,0x0B,0x00,0x0B,0x99,0x0B,0xC6,0x3D,0x07,0x08,0x17,0x1C,0x39,0xF9, +0x29,0xE9,0x02,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x29,0xF9,0xFF,0x1A, +0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0xF9, +0x02,0x0B,0x3E,0x4A,0x79,0xBF,0x8F,0xF9,0x69,0xAA,0x79,0xDF,0x10,0x0B,0x00,0x0B, +0x9D,0x0B,0xB5,0x0C,0x29,0xF9,0xFF,0x1A,0x39,0xE9,0x02,0x0B,0x39,0x4A,0x69,0xBF, +0x1F,0xE9,0x07,0x08,0x69,0xF8,0x08,0x7C,0x39,0xF9,0x29,0xE9,0x04,0x59,0x10,0x0B, +0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x43,0x0C,0x39,0xF9,0x02,0x0B,0x3C,0x4A,0x79,0xBF, +0x4F,0xF9,0x4A,0xCA,0x29,0xE9,0xFF,0x1A,0x01,0x59,0x06,0x08,0x04,0x1C,0x69,0xED, +0x05,0x08,0x2A,0x8A,0xFD,0x4D,0x05,0x08,0x79,0x9A,0x30,0x1C,0x29,0xF9,0xFF,0x1A, +0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x06,0x08, +0x1A,0x8A,0x39,0xF9,0x02,0x0B,0x3C,0x4A,0x79,0xBF,0x8F,0xF9,0x69,0x9A,0x79,0xDF, +0x39,0xF9,0x02,0x0B,0x35,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x78,0x05,0x7C,0x39,0xF9, +0x02,0x0B,0x35,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9,0x29,0xE9,0x04,0x59,0x10,0x0B, +0x00,0x0B,0x97,0x0B,0xF2,0x3D,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B, +0x85,0x3D,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xB5,0x0C,0x01,0x0C,0x7E,0x0C,0x19,0xF9, +0xFF,0x1A,0x07,0x78,0x07,0x7C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B, +0xC6,0x3D,0x06,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0x9A,0x0B,0x85,0x3D, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0xE0,0x0B,0xD7,0x3D,0x39,0xF9,0x02,0x0B,0x39,0x4A, +0x79,0xBF,0xFF,0x1F,0x39,0xF9,0x02,0x0B,0x30,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9, +0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xE0,0x0B, +0xEC,0x3D,0x53,0x0C,0x39,0xF9,0x29,0xE9,0x02,0x59,0x10,0x0B,0x00,0x0B,0x97,0x0B, +0xF2,0x3D,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x09,0x78,0x33,0x3C, +0x29,0xF9,0xFF,0x1A,0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08, +0x20,0x0B,0x02,0x0B,0x9B,0x0B,0xCC,0x4A,0x79,0xBF,0x6F,0xF9,0x24,0x1C,0x39,0xF9, +0x29,0xE9,0x19,0xD9,0x10,0x0B,0x00,0x0B,0x99,0x0B,0xC6,0x3D,0x07,0x08,0x13,0x1C, +0x29,0xF9,0xFF,0x1A,0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08, +0x20,0x0B,0x02,0x0B,0x9B,0x0B,0xCC,0x4A,0x79,0xBF,0x6F,0xF9,0x00,0x2B,0x79,0xF9, +0x39,0xF9,0xF9,0xBD,0x07,0x0C,0x39,0xF9,0x1A,0x69,0x00,0x59,0x10,0x0B,0x00,0x0B, +0xE0,0x0B,0x3B,0x3D,0x10,0x0C,0x29,0xF9,0xFF,0x1A,0x01,0x69,0x07,0x08,0x04,0x1C, +0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0xF9,0x02,0x0B,0x3E,0x4A,0x79,0xBF, +0x8F,0xF9,0x69,0xAA,0x79,0xDF,0x01,0x0C,0x00,0x0C,0x01,0x0C,0x00,0x0C,0x29,0xF9, +0xFF,0x1A,0x11,0x5C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x08,0x1C, +0x39,0xF9,0x02,0x0B,0x3E,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x79,0x87,0x03,0x6C, +0x39,0x8E,0x01,0x3E,0x03,0x1E,0x01,0x79,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x69,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF, +0x1F,0xD9,0x02,0x78,0x05,0x3C,0x03,0x78,0x03,0x3C,0x04,0x78,0x01,0x3C,0x02,0x0C, +0x01,0x69,0x01,0x0C,0x00,0x0C,0x69,0xF9,0x0D,0x8C,0x39,0x8D,0x79,0x8E,0x09,0x3E, +0x6E,0xB9,0x39,0xD9,0x59,0xB9,0x68,0x4A,0x39,0xC9,0x49,0x8E,0x02,0x3E,0x6E,0xB9, +0x06,0x1C,0x69,0xB9,0xFF,0x1A,0x0C,0x78,0x02,0x7C,0x01,0x79,0x01,0x0C,0x00,0x79, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x69,0xB9,0x59,0xA9,0x20,0x0B,0x02,0x0B, +0xCD,0x0B,0xB8,0x3F,0x6F,0xF9,0x21,0x1C,0x39,0xF9,0xFF,0x1A,0x22,0x78,0x1D,0x7C, +0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x50,0x3F,0x01,0x1F,0x10,0x0B,0x00,0x0B,0x25,0x0B, +0x7A,0x3D,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x28,0x3F,0x0F,0xD7,0x09,0x6C,0x29,0xBF, +0x0F,0xD7,0x06,0x6C,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x52,0x3F,0x01,0x1F,0x05,0x0C, +0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x52,0x3F,0x00,0x1F,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x79,0x89, +0x00,0x2B,0x69,0xD9,0x09,0x8E,0x09,0x3E,0x6E,0xF9,0x00,0x2B,0x79,0xF9,0xF9,0xF9, +0x68,0x4A,0x79,0xB9,0x00,0x29,0x39,0x8E,0x31,0x3E,0x1E,0xF9,0x79,0x99,0x39,0x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,0x1F,0xF9,0x29,0x8E,0x19,0x3E,0x79,0x9E,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x65,0x0B,0xF8,0x3D,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x08,0x3F,0x1F,0xF9,0x00,0x78, +0x0C,0x3C,0x01,0x78,0x7B,0x3C,0x02,0x78,0x08,0x3C,0x03,0x78,0x06,0x3C,0x04,0x78, +0x04,0x3C,0x10,0x0B,0x00,0x0B,0xA1,0x0B,0x70,0x0C,0x01,0x0B,0x00,0x0B,0x00,0x79, +0x10,0x0B,0x00,0x0B,0xF2,0x0B,0xB2,0x3D,0x07,0x08,0x22,0x1C,0x10,0x0B,0x00,0x0B, +0xA1,0x0B,0x87,0x3D,0x02,0x0B,0x71,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x79,0xE9,0x00,0x79,0x39,0x8E,0x02,0x3E,0xAE,0xF9,0x69,0xCA,0x79,0xFE, +0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x04,0x3F,0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xCA,0x0B, +0x00,0x3F,0x9F,0xF8,0x13,0x7C,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x00,0x3F,0x6F,0xF9, +0x39,0x8E,0x02,0x3E,0xAE,0xE9,0x79,0xCA,0x69,0xFE,0x39,0xF9,0x00,0x69,0x10,0x0B, +0x00,0x0B,0x29,0x0B,0x4E,0x3D,0x00,0x2B,0x79,0xD9,0x1E,0x0C,0x39,0xF9,0x20,0x0B, +0x02,0x0B,0xCA,0x0B,0x00,0x3F,0x6F,0xE9,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x04,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x3D,0x02,0x08, +0x08,0x4A,0x29,0xBF,0x1F,0xF9,0x4A,0xCA,0x4A,0xCA,0x29,0x8E,0x01,0x3E,0x1E,0xE9, +0x4A,0xCA,0x4A,0xCA,0x6A,0x8A,0x6A,0x8A,0x79,0xCA,0x4A,0xCA,0x39,0x8E,0x04,0x3E, +0x69,0xCE,0x02,0x08,0x02,0x4A,0x39,0xF9,0x0A,0x4A,0x29,0xE9,0x08,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x02,0x08,0x08,0x4A,0x39,0xF9,0x12,0x4A,0x29,0xE9, +0x04,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x19,0xF9,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x0D,0x39, +0x01,0x08,0x01,0x4A,0x29,0xF9,0x19,0xE9,0x0C,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B, +0x32,0x3D,0x39,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0xA9,0x59,0x99,0x00,0x09,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0xF7,0x0B,0xF1,0x3D,0x02,0x08,0x79,0xCA,0x29,0xBF,0x1F,0xF9, +0x39,0x8E,0x05,0x3E,0x79,0x9E,0x39,0x8E,0x05,0x3E,0x1E,0xF9,0x03,0x78,0x0F,0x3C, +0x04,0x78,0x1F,0x3C,0x05,0x78,0x30,0x3C,0x06,0x78,0x49,0x3C,0x0A,0x78,0x3A,0x3C, +0x0B,0x78,0x4D,0x3C,0x12,0x78,0x53,0x3C,0x13,0x78,0x51,0x3C,0x60,0x0C,0x19,0xF9, +0xFF,0x1A,0x02,0x5C,0x19,0x79,0x5E,0x0C,0x39,0xF9,0x08,0x4A,0x29,0xE9,0x80,0x3D, +0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x02,0x3C,0x1E,0x79,0x52,0x0C, +0x50,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78,0x02,0x7C,0x19,0x79,0x4B,0x0C,0x39,0xF9, +0x08,0x4A,0x29,0xE9,0xA7,0x3D,0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8, +0x02,0x3C,0x1E,0x79,0x3F,0x0C,0x3D,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78,0x02,0x7C, +0x19,0x79,0x38,0x0C,0x39,0x8E,0x04,0x3E,0x1E,0xF9,0x01,0x78,0x02,0x3C,0x1E,0x79, +0x31,0x0C,0x2F,0x0C,0x19,0xF9,0xFF,0x1A,0x02,0x5C,0x19,0x79,0x2B,0x0C,0x39,0x8E, +0x04,0x3E,0x1E,0xF9,0x01,0x78,0x02,0x3C,0x1E,0x79,0x24,0x0C,0x22,0x0C,0x39,0x8E, +0x04,0x3E,0x1E,0xF9,0x01,0x78,0x02,0x3C,0x1E,0x79,0x1C,0x0C,0x1A,0x0C,0x39,0x8E, +0x04,0x3E,0x1E,0xF9,0x01,0x78,0x02,0x3C,0x1E,0x79,0x14,0x0C,0x12,0x0C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x9F,0xC7,0x02,0x2C,0x19,0x79,0x0B,0x0C,0x39,0x8E, +0x04,0x3E,0x1E,0xF9,0x01,0x78,0x02,0x3C,0x1E,0x79,0x04,0x0C,0x02,0x0C,0x19,0x09, +0x00,0x0C,0x09,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x01,0x09, +0x20,0x0B,0x02,0x0B,0xCD,0x0B,0x90,0x3F,0x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B,0xFA,0x3D,0x39,0xF9,0x01,0x0B,0x9B,0x4A,0x08,0x69,0x10,0x0B, +0x01,0x0B,0x45,0x0B,0xFA,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9, +0x01,0x0B,0xA3,0x4A,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x69,0x08,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x39,0xF9,0x01,0x0B,0xAF,0x4A,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x44,0x69,0x04,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x17,0x79,0x10,0x0B,0x00,0x0B, +0xC9,0x0B,0xB3,0x3D,0x79,0x99,0x07,0x08,0x47,0x1C,0x19,0xB9,0x39,0xE9,0x69,0xF9, +0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x03,0x1F,0x39,0xF9,0x29,0xE9,0x01,0x0B, +0xB3,0x4A,0x08,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x08,0x4A, +0x29,0x8E,0xDE,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0xDE,0x3E,0x4E,0xF9,0x4A,0xCA, +0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x69,0xBF,0x79,0x9F,0x39,0xF9,0x29,0xE9,0x01,0x0B,0x9B,0x4A,0x08,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x03,0x08,0x08,0x4A,0x39,0xF9,0x29,0xE9,0x01,0x0B, +0xA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,0x00,0x0B, +0xA6,0x0B,0x45,0x79,0x20,0x0B,0x02,0x0B,0xCD,0x0B,0xB0,0x3F,0x79,0xEF,0x10,0x0B, +0x00,0x0B,0xA6,0x0B,0x5E,0x79,0x10,0x0B,0x00,0x0B,0x23,0x0B,0x37,0x3D,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99,0x39,0xBF,0x1F,0xF9,0x5E,0x1C, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x34,0x79,0x19,0xE9,0x39,0x8E,0x02,0x3E,0x1E,0xD9, +0x10,0x0B,0x00,0x0B,0xFA,0x0B,0xFB,0x3D,0x79,0xA9,0x29,0xF9,0xFF,0x1A,0x00,0x78, +0x03,0x3C,0x1E,0x78,0x27,0x3C,0x38,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F, +0x1F,0xF9,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D, +0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x20,0x3F,0x06,0x08,0x9F,0x9A,0x01,0x1C,0x36,0x0C, +0x39,0x8E,0x02,0x3E,0x1E,0xF9,0x07,0x5C,0x39,0xF9,0x0C,0x69,0x10,0x0B,0x00,0x0B, +0xB0,0x0B,0xED,0x3D,0x06,0x0C,0x39,0xF9,0x0C,0x69,0x10,0x0B,0x00,0x0B,0x8E,0x0B, +0x8D,0x3D,0x24,0x0C,0x39,0x8E,0x02,0x3E,0x1E,0xF9,0x07,0x5C,0x39,0xF9,0x0E,0x69, +0x10,0x0B,0x00,0x0B,0xB0,0x0B,0xED,0x3D,0x06,0x0C,0x39,0xF9,0x0E,0x69,0x10,0x0B, +0x00,0x0B,0x8E,0x0B,0x8D,0x3D,0x12,0x0C,0x39,0x8E,0x02,0x3E,0x1E,0xF9,0x07,0x5C, +0x39,0xF9,0x0D,0x69,0x10,0x0B,0x00,0x0B,0xB0,0x0B,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0x3E,0x01,0x1E,0x09,0x8E,0x17,0x3E,0x01,0x1E,0x09,0x8E, +0x09,0x3E,0x29,0xEE,0x10,0x0B,0x00,0x0B,0x93,0x0B,0xB8,0x79,0x09,0x8E,0x06,0x3E, +0x79,0xEE,0x10,0x0B,0x00,0x0B,0x96,0x0B,0x67,0x79,0x09,0x8E,0x07,0x3E,0x79,0xEE, +0x09,0x8E,0x08,0x3E,0x39,0xEE,0x10,0x0B,0x00,0x0B,0x93,0x0B,0x17,0x79,0xF9,0xBF, +0x79,0xEF,0x10,0x0B,0x00,0x0B,0x93,0x0B,0xA2,0x79,0xF9,0x8E,0x01,0x3E,0x79,0xEE, +0x10,0x0B,0x00,0x0B,0x96,0x0B,0x8C,0x79,0xF9,0x8E,0x02,0x3E,0x79,0xEE,0x10,0x0B, +0x00,0x0B,0x96,0x0B,0xA1,0x79,0xF9,0x8E,0x03,0x3E,0x79,0xEE,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0xF9,0x8D,0x79,0xB9,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x30,0x3F,0x6F,0xF9, +0x04,0x4A,0x79,0xA9,0x29,0x8E,0x14,0x3E,0x4E,0xF9,0x4A,0xCA,0x01,0x4A,0x4A,0xCA, +0x79,0x89,0x09,0xF9,0x4A,0xCA,0x29,0x8E,0x26,0x3E,0x1E,0xE9,0x79,0xCA,0x00,0x2B, +0x69,0xF9,0x29,0x8E,0x10,0x3E,0x4E,0xF9,0x4A,0xCA,0x06,0x69,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x79,0x99,0x19,0xF9,0xAA,0x8A,0xFA,0x8A, +0x19,0xCA,0x00,0x2B,0x79,0xF9,0x19,0xF9,0x03,0x1A,0x02,0x5C,0x00,0x79,0x01,0x0C, +0x01,0x79,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0x8E,0x8A,0x3E,0x4E,0xE9,0x4A,0xCA, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x04,0x0B,0xE2,0x69,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x8E,0x3D,0x79,0x99,0x19,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x69,0x89,0x19,0xF9, +0x00,0x2B,0x79,0x99,0x09,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x09,0x08,0x69,0xDA,0x4A,0xCA,0x00,0x2B, +0x99,0xE9,0xB9,0xF9,0x09,0xCA,0x39,0x8E,0x02,0x3E,0x79,0xEE,0xE9,0xF9,0x4A,0xCA, +0x01,0x4C,0x02,0x5C,0x00,0x79,0x02,0x0C,0xE9,0xF9,0x4A,0xCA,0x07,0x08,0x4A,0xCA, +0x39,0x8E,0x0A,0x3E,0x79,0xCE,0x9A,0x0C,0xC9,0xF9,0x00,0x2B,0x0D,0x99,0x00,0x2B, +0x0D,0xA9,0x00,0x2B,0x0D,0xB9,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B, +0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x09,0xBE, +0x1D,0x89,0x2C,0x4A,0x09,0x9D,0x3E,0x89,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0x99,0x19,0xB9,0x10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0x39,0xF9,0x75,0x0B,0x30,0x69,0x10,0x0B, +0x01,0x0B,0x05,0x0B,0xA8,0x3D,0x39,0x8E,0x74,0x3E,0x79,0xEE,0x39,0xF9,0x02,0x0B, +0x39,0x4A,0x79,0xBF,0xFF,0x1F,0x1D,0x8E,0x28,0x3E,0x4E,0xF9,0x4A,0xCA,0x29,0x8E, +0x26,0x3E,0x1E,0xE9,0x79,0xCA,0x00,0x2B,0x69,0x99,0x29,0x8E,0x10,0x3E,0x4E,0xF9, +0x4A,0xCA,0x06,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x99,0xCA, +0x00,0x2B,0x79,0xA9,0xA9,0xF9,0xAA,0x8A,0xFA,0x8A,0xA9,0xCA,0x00,0x2B,0x79,0x99, +0xA9,0xF9,0x03,0x1A,0x02,0x5C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0x99,0xCA, +0x79,0xE9,0x39,0xF9,0x01,0x0B,0x78,0x4A,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x01,0x0B,0x19,0x3D,0x29,0x8E,0x04,0x3E,0x6E,0xF9, +0x5A,0xCA,0x29,0x8E,0x04,0x3E,0x6E,0xE9,0x79,0xBA,0x4A,0xCA,0x39,0x8E,0xA5,0x3E, +0x69,0xCE,0x09,0xBF,0x05,0x1F,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E, +0x22,0x3E,0x1E,0xF9,0x09,0x8E,0x02,0x3E,0x79,0x9E,0x29,0x8E,0x04,0x3E,0x6E,0xF9, +0x09,0x8E,0x01,0x3E,0x79,0xEE,0x29,0x8E,0x05,0x3E,0x6E,0xF9,0x09,0x8E,0x02,0x3E, +0x79,0xEE,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x30,0x3F,0x9F,0x8E,0x36,0x3E,0x1E,0xF9, +0x09,0x8E,0x0D,0x3E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,0x1A,0x29,0x78,0x07,0x3C,0x2B,0x78,0x0B,0x3C,0x3D,0x78, +0x09,0x3C,0x3E,0x78,0x07,0x3C,0x07,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xE4,0x0B, +0x4F,0x3D,0x08,0x0C,0x07,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xF5,0x0B, +0x64,0x3D,0x00,0x0C,0x10,0x0B,0x00,0x0B,0xB1,0x0B,0xDF,0x0C,0x29,0xF9,0xFF,0x1A, +0x2B,0x78,0x04,0x3C,0x10,0x0B,0x00,0x0B,0xB1,0x0B,0xC2,0x0C,0x39,0xF9,0x10,0x0B, +0x00,0x0B,0xA9,0x0B,0x25,0x3D,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xD9,0x0B,0x44,0x3D, +0x39,0xF9,0x01,0x69,0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x06,0x1C, +0x39,0xF9,0x34,0x69,0x10,0x0B,0x00,0x0B,0x9B,0x0B,0x28,0x3D,0x39,0xF9,0x01,0x0B, +0x00,0x69,0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x06,0x1C,0x39,0xF9, +0x35,0x69,0x10,0x0B,0x00,0x0B,0x9B,0x0B,0x28,0x3D,0x39,0xF9,0x40,0x69,0x10,0x0B, +0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08,0x1B,0x1C,0x39,0xF9,0x02,0x0B,0x14,0x4A, +0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x02,0x4C,0x1C,0x5A,0x0C,0x6C,0x39,0xF9,0x02,0x0B, +0x16,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x01,0x0B,0x49,0x5A,0x48,0xE7,0x48,0x8A, +0x2A,0xBA,0x06,0x2C,0x39,0xF9,0x36,0x69,0x10,0x0B,0x00,0x0B,0x9B,0x0B,0x28,0x3D, +0x39,0xF9,0x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0B, +0xCC,0x0B,0x54,0x79,0x10,0x0B,0x00,0x0B,0x2D,0x0B,0x4F,0x3D,0x00,0x0C,0x0D,0x8C, +0x00,0x79,0x10,0x0B,0x00,0x0B,0x87,0x0B,0xBA,0x3D,0x0D,0x8C,0x0C,0x79,0x10,0x0B, +0x00,0x0B,0x87,0x0B,0xBA,0x3D,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x65,0x3F,0x1F,0xF9,0x10,0x0B, +0x00,0x0B,0xB3,0x0B,0x93,0x1C,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x50,0x3F,0x1F,0xF9, +0x10,0x0B,0x00,0x0B,0xB3,0x0B,0x7A,0x1C,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x7C,0x79, +0x00,0x2B,0x79,0xF9,0xF9,0xF9,0x68,0x4A,0x79,0x99,0x19,0x8E,0x01,0x3E,0x6E,0xF9, +0x79,0xA9,0x10,0x0B,0x00,0x0B,0xB3,0x0B,0x79,0x1C,0x00,0x2B,0x00,0x69,0x29,0xF9, +0xF9,0xE9,0x50,0x4A,0x01,0x59,0x19,0xC9,0x20,0x4A,0x10,0x0B,0x00,0x0B,0x1A,0x0B, +0x92,0x3D,0x07,0x08,0x02,0x5C,0x00,0x2B,0x01,0x69,0x0E,0x08,0x19,0x1C,0x29,0xF9, +0x04,0x5A,0x79,0x89,0x09,0x8E,0x02,0x3E,0x04,0x1E,0x09,0x8E,0x03,0x3E,0x03,0x1E, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xA4,0x3F,0x1F,0xF9,0x09,0xE9,0x10,0x0B,0x00,0x0B, +0x09,0x0B,0xAE,0x3D,0x01,0x79,0x10,0x0B,0x00,0x0B,0x24,0x0B,0x98,0x3D,0x59,0x0C, +0x54,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0xB9,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, +0x02,0x0B,0xCA,0x0B,0xB0,0x59,0x10,0x0B,0x00,0x0B,0xAA,0x0B,0x5E,0x3D,0x20,0x0B, +0x02,0x0B,0xCA,0x0B,0xE8,0x3F,0x79,0xEF,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0xEC,0x3F, +0x01,0x1F,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D, +0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0x00,0x2B,0x79,0xE9,0x00,0x2B,0x69,0xD9, +0x00,0x2B,0x49,0xB9,0x00,0x2B,0x59,0xC9,0x20,0x0B,0x02,0x0B,0xCB,0x0B,0x04,0x79, +0x79,0x89,0x20,0x0B,0x02,0x0B,0xCB,0x0B,0x2C,0x79,0x79,0xB9,0x39,0xF9,0x68,0x4A, +0x79,0x99,0x09,0xF9,0x00,0x69,0x28,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D, +0x39,0xF9,0x00,0x69,0xC8,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x09,0x8E, +0x16,0x3E,0x03,0x1E,0x09,0x8E,0x17,0x3E,0x01,0x1E,0x09,0x8E,0x09,0x3E,0x39,0xEE, +0x10,0x0B,0x00,0x0B,0x89,0x0B,0xAC,0x79,0x09,0x8E,0x06,0x3E,0x79,0xEE,0x10,0x0B, +0x00,0x0B,0x89,0x0B,0xAC,0x79,0x09,0x8E,0x07,0x3E,0x79,0xEE,0x39,0xBF,0x02,0x1F, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x3C,0x3F,0x1F,0xF9,0x10,0x0B,0x01,0x0B,0x0D,0x0B, +0xA9,0x3D,0x39,0x8E,0x01,0x3E,0x79,0x9E,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x8C,0x3F, +0x1F,0xF9,0x39,0x8E,0x02,0x3E,0x79,0x9E,0x39,0x8E,0x01,0x3E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,0xB9,0x00,0x29,0x39,0xF9, +0x01,0x0B,0x51,0x4A,0x79,0xBF,0x1F,0xF9,0x41,0x5C,0x20,0x0B,0x02,0x0B,0xA0,0x0B, +0xE4,0x3F,0x6F,0xF9,0x39,0x1C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4,0x3F,0x9F,0x8E, +0x04,0x3E,0x6E,0xF9,0x31,0x1C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4,0x3F,0x9F,0x8E, +0x04,0x3E,0x6E,0xF9,0x79,0x99,0x39,0xF9,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F, +0x6F,0xE9,0x07,0x08,0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x9C,0x3D,0x07,0x08,0x4A,0xCA,0x19,0xBD,0x07,0x08,0x05,0x1C,0x00,0x79,0x10,0x0B, +0x00,0x0B,0xB7,0x0B,0x47,0x0C,0x39,0xF9,0x02,0x0B,0x10,0x4A,0x79,0xBF,0x4F,0xF9, +0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x52,0x3D,0x79,0xA9,0x07,0x08,0x02,0x5C,0x00,0x79, +0x76,0x0C,0x29,0xF9,0x74,0x0C,0x02,0x0C,0x00,0x79,0x71,0x0C,0x39,0xF9,0x01,0x0B, +0x53,0x4A,0x79,0xBF,0x1F,0xF9,0x39,0xE9,0x01,0x0B,0x4D,0x4A,0x69,0xBF,0x1F,0xE9, +0x79,0xBA,0x69,0x87,0x63,0x2C,0x39,0xF9,0x02,0x0B,0x10,0x4A,0x79,0xBF,0x4F,0xF9, +0x4A,0xCA,0x04,0x4A,0x39,0xE9,0x01,0x0B,0x55,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x08, +0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x0A,0x6C,0x39,0xF9,0x01,0x0B,0x4D,0x4A, +0x79,0xBF,0x0F,0xF9,0x01,0x4A,0x79,0xAF,0x00,0x79,0x49,0x0C,0x3E,0x0C,0x39,0xF9, +0x01,0x0B,0x55,0x4A,0x79,0xBF,0x1F,0xF9,0x38,0x1C,0x39,0xF9,0x01,0x0B,0x51,0x4A, +0x79,0xBF,0x1F,0xF9,0x01,0x78,0x05,0x3C,0x02,0x78,0x03,0x3C,0x03,0x78,0x01,0x3C, +0x1E,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xC5,0x3F,0x1F,0xF9,0x02,0x5C,0x00,0x79, +0x2E,0x0C,0x39,0xF9,0x02,0x0B,0x10,0x4A,0x79,0xBF,0x4F,0xF9,0x10,0x0B,0x00,0x0B, +0xCB,0x0B,0x52,0x3D,0x79,0xA9,0x07,0x08,0x02,0x5C,0x00,0x79,0x20,0x0C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0xC5,0x3F,0x0F,0xF9,0x01,0x5A,0x79,0xAF,0x09,0x0C,0x39,0xF9, +0x01,0x0B,0x4D,0x4A,0x79,0xBF,0x0F,0xF9,0x01,0x4A,0x79,0xAF,0x00,0x79,0x0F,0x0C, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x08,0x0B,0x0C,0x3D,0x39,0xF9,0x01,0x0B,0x4D,0x4A, +0x79,0xBF,0x0F,0xF9,0x01,0x4A,0x79,0xAF,0x29,0xF9,0x01,0x0C,0x00,0x79,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x01,0x0B,0x50,0x4A, +0x79,0xBF,0x00,0x1F,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xCA,0x0B,0x6E,0x3D,0x07,0x08, +0x05,0x1C,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x07,0x0B,0xF2,0x3D,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x79,0xB9,0x39,0xF9,0x01,0x0B,0x52,0x4A,0x79,0xBF,0x1F,0xF9,0x39,0xE9, +0x01,0x0B,0x4E,0x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,0xBF, +0x79,0x9F,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xB6,0x0B,0x44,0x3D,0x20,0x0B,0x02,0x0B, +0xCC,0x0B,0x00,0x79,0x1D,0x8E,0x0E,0x3E,0x79,0xEE,0x1D,0x8E,0x1A,0x3E,0x02,0x4E, +0x1D,0xF9,0x34,0x4A,0x01,0x69,0x10,0x0B,0x00,0x0B,0x59,0x0B,0x5F,0x3D,0x1D,0x8E, +0x1A,0x3E,0x4E,0xF9,0x79,0xA9,0x39,0xF9,0x01,0x0B,0x72,0x4A,0x79,0xBF,0x1F,0xF9, +0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x39,0xE9,0x01,0x0B, +0x73,0x4A,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x01,0x0B,0x72,0x4A,0x79,0xBF,0x01,0x1F, +0x29,0xF9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x09,0x6D,0x0D,0xA8,0xFE,0x4D,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0xB9,0x59,0x99,0x49,0x89,0x01,0x08, +0x1A,0x1C,0x29,0xF9,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x6F,0xE9,0x07,0x08, +0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x9C,0x3D,0x07,0x08, +0x4A,0xCA,0x79,0xD9,0x39,0xF9,0x29,0x8E,0x89,0x3E,0x4E,0xE9,0x10,0x0B,0x00,0x0B, +0xCB,0x0B,0x83,0x3D,0x19,0xB9,0x00,0x08,0x13,0x1C,0x29,0xF9,0x10,0x0B,0x01,0x0B, +0x08,0x0B,0x65,0x3D,0x39,0xF9,0x29,0xE9,0x02,0x0B,0x10,0x4A,0x69,0xBF,0x4F,0xE9, +0x4A,0xCA,0x06,0x4A,0x4A,0xCA,0x10,0x0B,0x00,0x0B,0x59,0x0B,0xDB,0x3D,0x07,0x0C, +0x03,0x08,0x05,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x75,0x3D,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B,0x59,0xD9, +0x19,0xF9,0x0C,0x4A,0x79,0xA9,0x19,0xF9,0x04,0x69,0x10,0x0B,0x01,0x0B,0x09,0x0B, +0x01,0x3D,0x07,0x08,0x02,0x1C,0x00,0x79,0x78,0x0C,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0xDF,0x3D,0x00,0x2B,0x79,0xF9,0x10,0x0B,0x00,0x0B,0x25,0x0B,0xA3,0x3D,0x07,0x08, +0x4A,0xCA,0x00,0x2B,0x79,0xE9,0x19,0x8E,0x8A,0x3E,0x4E,0xF9,0x4A,0xCA,0x04,0x0B, +0xE2,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x79,0xB9,0x29,0x8E,0x01,0x3E, +0x6E,0xF9,0x3A,0x1C,0x39,0xF9,0x00,0x2B,0x79,0xC9,0x29,0x8E,0x01,0x3E,0xAE,0x8E, +0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x0C,0x08,0x69,0xDA,0x1A,0x2C, +0x29,0x8E,0x01,0x3E,0xAE,0x8E,0x02,0x3E,0x6E,0xF9,0x09,0xDA,0x79,0xE9,0x00,0x79, +0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D, +0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xF0,0x3D, +0x69,0xF9,0x01,0x0C,0x39,0xF9,0x79,0xB9,0x39,0xF9,0x00,0x2B,0x79,0xC9,0xF9,0xF9, +0x09,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xF0,0x3D,0x06,0x08,0x96,0x4A,0xD9,0xCA,0xE9,0xCA,0x0C,0x08, +0x69,0xDA,0x02,0x6C,0x01,0x79,0x01,0x0C,0x00,0x79,0x00,0x2B,0x0D,0xC9,0x00,0x2B, +0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D, +0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0xA9,0x8D,0x99,0x8D,0x79,0xA9,0x29,0x8E,0x08,0x3E, +0x6E,0xF9,0x79,0xB9,0x39,0xF9,0xC0,0x4A,0x00,0x2B,0x79,0xF9,0xF9,0xF9,0x68,0x4A, +0x79,0x99,0x39,0x8E,0x95,0x3E,0x1E,0xF9,0x04,0x5C,0x39,0x8E,0x94,0x3E,0x1E,0xF9, +0x2A,0x1C,0x04,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x79,0x89,0x07,0x08, +0x1E,0x1C,0x20,0x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07,0x78,0x0F,0x3C, +0x0B,0x78,0x0B,0x3C,0x0D,0x78,0x15,0x3C,0x11,0x78,0x1D,0x3C,0x26,0x0C,0x01,0x79, +0x47,0x0C,0x02,0x79,0x45,0x0C,0x03,0x79,0x43,0x0C,0x04,0x79,0x41,0x0C,0x20,0x0B, +0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9,0x03,0x78,0x02,0x7C,0x06,0x79,0x38,0x0C, +0x15,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x09,0x78,0x02,0x7C, +0x06,0x79,0x2E,0x0C,0x0B,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9, +0x03,0x78,0x02,0x7C,0x06,0x79,0x24,0x0C,0x01,0x0C,0x00,0x0C,0x20,0x0C,0x00,0x79, +0x1F,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x09,0x78,0x02,0x7C, +0x05,0x79,0x16,0x0C,0x14,0x0C,0x79,0xD9,0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x4F,0xD9, +0x4A,0xCA,0x9A,0xEA,0x0A,0x6C,0x79,0xD9,0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x8F,0xD9, +0x02,0x2B,0x00,0x0A,0x59,0xDF,0x00,0x79,0x03,0x0C,0x01,0x0C,0x00,0x0C,0xFF,0x79, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0x99,0x39,0xF9, +0x02,0x0B,0x2C,0x4A,0x79,0xBF,0x1F,0xF9,0x1C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x07,0x08,0x20,0x0B,0x02,0x0B,0x9C,0x0B,0xA0,0x4A,0x19,0xE9,0xFF,0x1A, +0x3A,0x8A,0x79,0xCA,0x69,0xBF,0x6F,0xF9,0x18,0x1C,0x39,0xF9,0x02,0x0B,0x2C,0x4A, +0x79,0xBF,0x1F,0xF9,0x1C,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08, +0x20,0x0B,0x02,0x0B,0x9C,0x0B,0xA0,0x4A,0x19,0xE9,0xFF,0x1A,0x3A,0x8A,0x79,0xCA, +0x69,0xBF,0x6F,0xF9,0x79,0x89,0x39,0xF9,0x09,0xBD,0x39,0xF9,0x02,0x0B,0x2C,0x4A, +0x79,0xBF,0x1F,0xF9,0x79,0xE9,0x3A,0x8A,0x2A,0x8A,0x79,0xDA,0x20,0x0B,0x02,0x0B, +0x9D,0x0B,0x80,0x4A,0x19,0xF9,0xFF,0x1A,0x69,0xCA,0x79,0xBF,0x1F,0xF9,0x39,0xE9, +0x02,0x0B,0x2C,0x4A,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x02,0x0B,0x2C,0x4A,0x79,0xBF, +0x1F,0xF9,0x00,0x78,0x03,0x3C,0x05,0x78,0x01,0x3C,0x02,0x0C,0x00,0x29,0x02,0x0C, +0x01,0x29,0x00,0x0C,0x29,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x01,0x0B,0x89,0x4A,0x79,0xBF, +0x1F,0xF9,0x01,0x78,0x36,0x7C,0x29,0xF9,0xFF,0x1A,0x0C,0x78,0x05,0x3C,0x0D,0x78, +0x25,0x3C,0x0E,0x78,0x23,0x3C,0x2C,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F, +0x1F,0xF9,0x02,0x78,0x0F,0x3C,0x04,0x78,0x0D,0x3C,0x05,0x78,0x0B,0x3C,0x06,0x78, +0x09,0x3C,0x07,0x78,0x07,0x3C,0x0B,0x78,0x05,0x3C,0x0D,0x78,0x03,0x3C,0x11,0x78, +0x01,0x3C,0x01,0x0C,0x0A,0x0C,0x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,0x3A,0x8A,0x79,0xCA, +0x69,0xBF,0x6F,0xF9,0x79,0x99,0x39,0xF9,0x19,0xBD,0x39,0xF9,0x02,0x0B,0x2E,0x4A, +0x79,0xBF,0x1F,0xF9,0x3A,0x8A,0x2A,0x8A,0x20,0x0B,0x02,0x0B,0x9E,0x0B,0x38,0x4A, +0x29,0xE9,0xFF,0x1A,0x79,0xCA,0x69,0xBF,0x1F,0xF9,0x39,0xE9,0x02,0x0B,0x2E,0x4A, +0x69,0xBF,0x79,0x9F,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x69,0xD9,0xFF,0x1A, +0x0C,0x78,0x0B,0x3C,0x15,0x78,0x3D,0x3C,0x1D,0x78,0x3D,0x3C,0x1E,0x78,0x3D,0x3C, +0x38,0x78,0x3D,0x3C,0x39,0x78,0x45,0x3C,0x57,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x39,0x3F,0x1F,0xD9,0x00,0x78,0x09,0x3C,0x07,0x78,0x0B,0x3C,0x0D,0x78,0x13,0x3C, +0x0F,0x78,0x05,0x3C,0x11,0x78,0x19,0x3C,0x22,0x0C,0x04,0x79,0x47,0x0C,0x01,0x79, +0x45,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9,0x0F,0x78,0x02,0x7C, +0x05,0x79,0x3C,0x0C,0x15,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9, +0x07,0x78,0x02,0x7C,0x05,0x79,0x32,0x0C,0x0B,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x3C,0x3F,0x1F,0xD9,0x0F,0x78,0x02,0x7C,0x05,0x79,0x28,0x0C,0x01,0x0C,0x00,0x0C, +0x24,0x0C,0x00,0x79,0x23,0x0C,0x02,0x79,0x21,0x0C,0x03,0x79,0x1F,0x0C,0x79,0xD9, +0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x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,0x01,0x3C,0x47,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF, +0x1F,0xD9,0x02,0x78,0x07,0x3C,0x03,0x78,0x05,0x3C,0x04,0x78,0x03,0x3C,0x0B,0x78, +0x1F,0x3C,0x37,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x01,0x49, +0x05,0x08,0x04,0x1C,0x59,0xED,0x04,0x08,0x2A,0x8A,0xFD,0x4D,0x79,0xD9,0x02,0x0B, +0x3C,0x4A,0x59,0xBF,0x8F,0xD9,0x49,0xAA,0x59,0xDF,0x79,0xD9,0x02,0x0B,0x39,0x4A, +0x59,0xBF,0x07,0x1F,0x79,0xD9,0x02,0x0B,0x35,0x4A,0x59,0xBF,0x01,0x1F,0x1A,0x0C, +0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x01,0x49,0x05,0x08,0x04,0x1C, +0x59,0xED,0x04,0x08,0x2A,0x8A,0xFD,0x4D,0x79,0xD9,0x02,0x0B,0x3C,0x4A,0x59,0xBF, +0x8F,0xD9,0x49,0xAA,0x59,0xDF,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x07,0x1F, +0x01,0x0C,0x00,0x0C,0x01,0x0C,0x00,0x0C,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9, +0x69,0xA9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xC2,0x0B,0x2E,0x3D,0x79,0xA9, +0x07,0x08,0xFF,0x1A,0xFF,0x78,0x02,0x7C,0x00,0x79,0x63,0x0C,0x39,0xF9,0x02,0x0B, +0x2B,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x03,0x3C,0x01,0x78,0x1D,0x3C,0x57,0x0C, +0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xC1,0x0B,0xEA,0x3D,0x39,0xF9,0x02,0x0B, +0x2E,0x4A,0x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0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x10,0x3F, +0x6F,0xF9,0x0B,0x1C,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x10,0x3F,0x6F,0xF9,0x79,0x99, +0x39,0xF9,0x29,0xE9,0x19,0xBD,0x07,0x08,0x17,0x5C,0x20,0x0B,0x02,0x0B,0xCC,0x0B, +0x14,0x3F,0x6F,0xF9,0x0B,0x1C,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x14,0x3F,0x6F,0xF9, +0x79,0x99,0x39,0xF9,0x29,0xE9,0x19,0xBD,0x07,0x08,0x06,0x5C,0x39,0xF9,0x29,0xE9, +0x10,0x0B,0x00,0x0B,0xC3,0x0B,0xAC,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x79,0xE9,0x02,0x0B,0x39,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x78,0x09,0x7C,0x79,0xE9, +0x02,0x0B,0x2E,0x4A,0x69,0xBF,0x1F,0xE9,0x02,0x78,0x02,0x7C,0x01,0x79,0x01,0x0C, +0x00,0x79,0x0D,0x8C,0x79,0xE9,0x02,0x0B,0x2E,0x4A,0x69,0xBF,0x1F,0xE9,0x03,0x78, +0x02,0x3C,0x00,0x69,0x01,0x0C,0x01,0x69,0x06,0x08,0xFF,0x1A,0x69,0xF9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x39,0x8E,0x02,0x3E,0x1E,0xF9, +0x04,0x5C,0x10,0x0B,0x00,0x0B,0xC5,0x0B,0x19,0x0C,0x39,0xF9,0x02,0x0B,0x39,0x4A, +0x79,0xBF,0x1F,0xF9,0x07,0x78,0x0B,0x7C,0x39,0xF9,0xDC,0x3D,0x07,0x08,0x07,0x1C, +0x39,0xF9,0x02,0x0B,0x32,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x78,0x2A,0x3C,0x39,0xF9, +0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x0B,0x78,0x0E,0x7C,0x39,0xF9,0x02,0x0B, +0x38,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x78,0x07,0x7C,0x39,0xF9,0x02,0x0B,0x32,0x4A, +0x79,0xBF,0x1F,0xF9,0x01,0x78,0x15,0x3C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF, +0x1F,0xF9,0x01,0x78,0x0F,0x7C,0x39,0xF9,0x02,0x0B,0x30,0x4A,0x79,0xBF,0x1F,0xF9, +0x01,0x78,0x08,0x7C,0x39,0xF9,0x02,0x0B,0x32,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x78, +0x01,0x7C,0x4F,0x0C,0x39,0x8E,0x88,0x3E,0x4E,0xF9,0x4B,0x1C,0x10,0x0B,0x01,0x0B, +0x41,0x0B,0xDF,0x3D,0x79,0x99,0x39,0x8E,0x8A,0x3E,0x4E,0xF9,0x4A,0xCA,0x04,0x0B, +0xE2,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x79,0xE9,0x69,0xF9,0x8A,0xCA, +0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79,0x69,0x89,0x39,0xF9,0x0C,0x4A,0x79,0xA9, +0x29,0x8E,0x02,0x3E,0x6E,0xF9,0x19,0xDA,0x80,0x0B,0x00,0x0B,0x00,0x0B,0x00,0x5A, +0x06,0x2C,0x39,0xF9,0x01,0x0B,0x0D,0x4A,0x79,0xBF,0x01,0x1F,0x12,0x0C,0x09,0xF9, +0x29,0x8E,0x02,0x3E,0x6E,0xE9,0x19,0xDA,0x07,0x08,0x69,0xDA,0x0A,0x6C,0x39,0xF9, +0x01,0x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0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0x79,0xB9,0x00,0x2B,0x59,0xF9,0x69,0x89,0x49,0xA9,0x29,0x8E,0x1F,0x3E, +0x1E,0xF9,0x06,0x4A,0xFF,0x1A,0x79,0x99,0x39,0xF9,0x09,0xE9,0xF9,0xD9,0x10,0x0B, +0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A,0x39,0xF9,0x29,0xE9,0x29,0x8E, +0x1F,0x3E,0x1E,0xD9,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x32,0x3D,0x19,0xF9,0x00,0x2B, +0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x79,0xB9,0x59,0x89,0x69,0x99,0x1D,0x8E, +0x07,0x3E,0x00,0x2B,0x6E,0xE9,0x00,0x2B,0x6E,0xF9,0x0C,0x29,0x39,0xF9,0x19,0xE9, +0x09,0xD9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A,0x39,0xF9, +0xF9,0xE9,0xE9,0xD9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A, +0x29,0xF9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99,0x0C,0x29, +0x39,0xF9,0x19,0xBF,0x6F,0xD9,0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D, +0x03,0x08,0x06,0x4A,0x39,0xF9,0x19,0x8E,0x02,0x3E,0x6E,0xD9,0x6E,0xE9,0x10,0x0B, +0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A,0x29,0xF9,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x59,0x99, +0x69,0xA9,0x49,0x89,0x39,0xF9,0x29,0xE9,0x19,0xD9,0x09,0xC9,0x10,0x0B,0x00,0x0B, +0xCC,0x0B,0xB4,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99,0x0C,0x29,0x39,0xF9,0x19,0xBF,0x6F,0xD9, +0x6F,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D,0x03,0x08,0x06,0x4A,0x39,0xF9, +0x19,0x8E,0x02,0x3E,0x6E,0xD9,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x06,0x0B,0x99,0x3D, +0x03,0x08,0x06,0x4A,0x29,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0xA9,0x22,0x19,0x39,0xF9,0x29,0xE9, +0xD6,0x3D,0x03,0x08,0x79,0xCA,0x29,0x8E,0x04,0x3E,0x6E,0xF9,0xFF,0x1A,0x39,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x04,0x3E, +0x6E,0xF9,0xAA,0x8A,0xBA,0x8A,0xEA,0x8A,0xFA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x04,0x3E,0x6E,0xF9, +0x5A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF, +0x79,0x9F,0x29,0x8E,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, +0x79,0x9F,0x29,0x8E,0x11,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x11,0x3E,0x4E,0xF9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x12,0x3E,0x4E,0xF9,0x4A,0xCA,0xFF,0x1A, +0x39,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E, +0x12,0x3E,0x4E,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x39,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xB9,0x69,0xBF,0x79,0x9F,0x29,0x8E,0x06,0x3E,0x6E,0xE9, +0x6E,0xF9,0x06,0x08,0xFF,0x1A,0x39,0xD9,0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0xB9, +0x79,0xBF,0x69,0x9F,0x29,0x8E,0x06,0x3E,0x6E,0xE9,0x6E,0xF9,0x08,0x6D,0x07,0x08, +0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x39,0xD9,0x59,0xF9,0x05,0x08, +0x01,0x4A,0x59,0xB9,0x79,0xBF,0x69,0x9F,0x29,0x8E,0x06,0x3E,0x6E,0xE9,0x6E,0xF9, +0x10,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08,0xDA,0x8A,0xFB,0x4D,0xFF,0x1A,0x39,0xD9, +0x59,0xF9,0x05,0x08,0x01,0x4A,0x59,0xB9,0x79,0xBF,0x69,0x9F,0x29,0x8E,0x06,0x3E, +0x6E,0xE9,0x6E,0xF9,0x18,0x6D,0x07,0x08,0xAA,0x8A,0x06,0x08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5C,0x1D,0xF9, +0x31,0x4A,0x79,0xBF,0x01,0x1F,0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x54,0x79,0x79,0x89, +0x20,0x0B,0x02,0x0B,0xCC,0x0B,0x7C,0x79,0x79,0xB9,0x39,0xF9,0x68,0x4A,0x79,0xA9, +0x09,0xF9,0x00,0x69,0x28,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x39,0xF9, +0x00,0x69,0xC8,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x09,0x8E,0x16,0x3E, +0x03,0x1E,0x09,0x8E,0x17,0x3E,0x01,0x1E,0x09,0x8E,0x09,0x3E,0x39,0xEE,0x10,0x0B, +0x00,0x0B,0x9E,0x0B,0xEA,0x79,0x09,0x8E,0x06,0x3E,0x79,0xEE,0x10,0x0B,0x00,0x0B, +0x9E,0x0B,0xEA,0x79,0x09,0x8E,0x07,0x3E,0x79,0xEE,0x39,0xBF,0x03,0x1F,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x8C,0x3F,0x1F,0xF9,0x39,0x8E,0x02,0x3E,0x79,0x9E,0x39,0x8E, +0x01,0x3E,0x8E,0x0B,0x89,0x0B,0xBE,0x0B,0xD6,0x6E,0x39,0x8E,0x02,0x3E,0x55,0x0B, +0x55,0x0B,0x55,0x6E,0x39,0x8E,0x0D,0x3E,0x01,0x1E,0x39,0x8E,0x0C,0x3E,0x01,0x1E, +0x20,0x0B,0x02,0x0B,0xC4,0x0B,0xE4,0x3F,0x6F,0xF9,0x39,0x8E,0x01,0x3E,0x6E,0xE9, +0x79,0xBA,0x39,0x8E,0x10,0x3E,0x69,0xEE,0x20,0x0B,0x02,0x0B,0xC4,0x0B,0xE8,0x3F, +0x6F,0xF9,0x39,0x8E,0x01,0x3E,0x6E,0xE9,0x79,0xBA,0x39,0x8E,0x11,0x3E,0x69,0xEE, +0x20,0x0B,0x02,0x0B,0xC5,0x0B,0x18,0x3F,0x6F,0x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,0x0B,0xCC,0x0B,0x28,0x79,0x29,0xBF,0x79,0xEF, +0x20,0x0B,0x02,0x0B,0xC5,0x0B,0x4B,0x3F,0x1F,0xF9,0x0E,0x1C,0x20,0x0B,0x02,0x0B, +0xC5,0x0B,0x4B,0x3F,0x1F,0xF9,0x29,0x8E,0x18,0x3E,0x79,0x9E,0x20,0x0B,0x02,0x0B, +0xC4,0x0B,0xB8,0x79,0x29,0xBF,0x79,0xEF,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x08,0x3F, +0x1F,0xF9,0x00,0x78,0x09,0x3C,0x01,0x78,0x07,0x3C,0x02,0x78,0x05,0x3C,0x03,0x78, +0x21,0x3C,0x04,0x78,0x01,0x3C,0x1E,0x0C,0x28,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0x94,0x3D,0x00,0x2B,0x79,0xC9,0x07,0x08,0x14,0x1C,0xC9,0xF9,0x04,0x4A,0x29,0x8E, +0x01,0x3E,0x79,0xEE,0x10,0x0B,0x00,0x0B,0x9E,0x0B,0x28,0x79,0x29,0x8E,0x04,0x3E, +0x79,0xEE,0x10,0x0B,0x00,0x0B,0x9E,0x0B,0x70,0x79,0x29,0x8E,0x05,0x3E,0x79,0xEE, +0x00,0x0C,0x04,0x0C,0x29,0x8E,0x01,0x3E,0x00,0x6E,0x00,0x0C,0x20,0x0B,0x02,0x0B, +0xCA,0x0B,0x08,0x3F,0x1F,0xF9,0x00,0x78,0x09,0x3C,0x01,0x78,0x60,0x3C,0x02,0x78, +0x05,0x3C,0x03,0x78,0x5C,0x3C,0x04,0x78,0x5A,0x3C,0x59,0x0C,0x1D,0xF9,0x30,0x4A, +0x79,0xBF,0x04,0x1F,0x20,0x0B,0x02,0x0B,0xCA,0x0B,0x58,0x3F,0x1F,0xF9,0x06,0x4A, +0xFF,0x1A,0x1D,0xE9,0x34,0x4A,0x69,0xBF,0x79,0x9F,0x20,0x0B,0x02,0x0B,0xCD,0x0B, +0x48,0x79,0x79,0x99,0x19,0x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3E,0x4E,0xE9,0x4A,0xCA,0x07,0x08,0x69,0xDA, +0x4A,0xCA,0x4A,0xCA,0x7F,0x0B,0xFF,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x08,0x6C, +0x39,0x8E,0x9C,0x3E,0x6E,0xE9,0x6E,0xF9,0x06,0x08,0x08,0x5C,0x07,0x08,0x06,0x5C, +0x39,0xF9,0x3F,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x89,0x09,0x79,0x10,0x0B,0x00,0x0B, +0xC9,0x0B,0xB3,0x3D,0x79,0xA9,0x07,0x08,0x2A,0x1C,0x29,0xB9,0x09,0x8E,0x02,0x3E, +0x1E,0xF9,0x02,0x1C,0x0E,0x79,0x01,0x0C,0x08,0x79,0x07,0x08,0xFF,0x1A,0x79,0x99, +0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xB9,0x79,0xBF,0x19,0x9F,0x39,0xF9, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x6F,0xD9,0x6F,0xE9,0x05,0x08,0xCF,0x0B, +0x2F,0x1A,0x06,0x08,0x00,0x1A,0x10,0x0B,0x00,0x0B,0x05,0x0B,0xD3,0x3D,0x03,0x08, +0x08,0x4A,0x09,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0x00,0x2B,0x79,0xF9,0x09,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B,0xB3,0x3D, +0x79,0xA9,0x07,0x08,0x35,0x1C,0x29,0xB9,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A, +0x69,0xB9,0x79,0xBF,0x09,0x1F,0xF9,0x8E,0x82,0x3E,0x6E,0xE9,0x6E,0xF9,0x06,0x08, +0xFF,0x1A,0x07,0x08,0x00,0x1A,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x6F,0xC9, +0x6F,0xD9,0x04,0x08,0x00,0x2B,0xFF,0x0A,0x05,0x08,0x00,0x2B,0x00,0x0A,0x04,0x08, +0x69,0xAA,0x05,0x08,0x79,0xAA,0x49,0x89,0x59,0x99,0x39,0xF9,0x19,0xE9,0x09,0xD9, +0xCF,0x0B,0x2F,0x1A,0x06,0x08,0x00,0x1A,0x10,0x0B,0x00,0x0B,0x05,0x0B,0xD3,0x3D, +0x03,0x08,0x08,0x4A,0xF9,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D, +0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x6F,0xD9,0x6F,0xE9,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0x84,0x3F,0x6F,0xB9,0x6F,0xC9,0x03,0x08,0x59,0x9A,0x04,0x08,0x69,0x9A, +0x79,0x8E,0x82,0x3E,0x39,0xEE,0x49,0xEE,0x79,0xE9,0x02,0x0B,0x04,0x4A,0x69,0xBF, +0x01,0x1F,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x6F,0xD9,0x6F,0xE9,0x05,0x08, +0x9A,0xEA,0x02,0x2C,0x00,0x69,0x01,0x0C,0x01,0x69,0x79,0x8E,0x44,0x3E,0x69,0x9E, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x6F,0xD9,0x6F,0xE9,0x05,0x08,0xAA,0xEA, +0x02,0x2C,0x00,0x69,0x01,0x0C,0x01,0x69,0x79,0x8E,0x45,0x3E,0x69,0x9E,0x0D,0xB9, +0x0D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,0xE9,0x9F,0x39,0xF9, +0x02,0x0B,0x12,0x4A,0x79,0xBF,0x4F,0xF9,0x79,0x99,0x39,0xF9,0x02,0x0B,0x16,0x4A, +0x79,0xBF,0x4F,0xF9,0x79,0x89,0x39,0x8E,0x82,0x3E,0x6E,0xE9,0x6E,0xF9,0x06,0x08, +0xBA,0xEA,0x2C,0x2C,0x39,0xF9,0x02,0x0B,0x12,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA, +0x06,0x4C,0x08,0x0B,0x48,0x5A,0x03,0x2C,0x08,0x0B,0x48,0x79,0x06,0x0C,0x39,0xF9, +0x02,0x0B,0x12,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x07,0x08,0x4A,0xCA,0x79,0x99, +0x39,0xF9,0x02,0x0B,0x16,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x06,0x4C,0x08,0x0B, +0x48,0x5A,0x03,0x2C,0x08,0x0B,0x48,0x79,0x06,0x0C,0x39,0xF9,0x02,0x0B,0x16,0x4A, +0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x07,0x08,0x4A,0xCA,0x79,0x89,0x39,0xF9,0x02,0x0B, +0x10,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0xFF,0x1A,0x29,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xA9,0x69,0xBF,0x79,0x9F,0x39,0xF9,0x02,0x0B,0x10,0x4A,0x79,0xBF, +0x4F,0xF9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x29,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xA9,0x69,0xBF,0x79,0x9F,0x19,0xF9,0x4A,0xCA,0xFF,0x1A,0x29,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x69,0xBF,0x79,0x9F,0x19,0xF9,0x4A,0xCA, +0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x29,0xD9,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x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0xC2,0x3D,0x39,0xF9,0x02,0x0B, +0x3A,0x4A,0x79,0xBF,0x8F,0xF9,0x00,0x2B,0x20,0x0A,0x79,0xDF,0x39,0xF9,0x38,0x69, +0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x79,0xA9,0x00,0x39,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xF9,0x01,0x69, +0x03,0x08,0x04,0x1C,0x39,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x06,0x08,0x79,0x9A, +0x01,0x79,0x03,0x08,0x04,0x1C,0x39,0xED,0x07,0x08,0x2A,0x8A,0xFD,0x4D,0x06,0x08, +0x79,0xF8,0x0B,0x7C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3D,0x3F,0x1F,0xF9,0x39,0xE9, +0x29,0xCA,0x02,0x0B,0x28,0x4A,0x69,0xBF,0x79,0x9F,0x03,0x08,0x01,0x4A,0x39,0xF9, +0x03,0x5A,0xD8,0x2C,0x29,0xF9,0x38,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0x99,0x39,0xF9,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x54,0x3F,0x6F,0xE9,0x07,0x08,0x69,0xDA,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x9C,0x3D,0x07,0x08,0x4A,0xCA,0x79,0xA9,0x1D,0x8E,0x06,0x3E,0x29,0xCE, +0x1D,0xF9,0x0E,0x4A,0x79,0xBF,0x12,0x1F,0x1D,0xF9,0x0F,0x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82,0x3E,0xAE,0xA7,0x06,0x6C,0x19,0xF9,0x02,0x0B,0x04,0x4A, +0x79,0xBF,0x1F,0xF9,0x02,0x5C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A, +0x00,0x2B,0x79,0xF9,0x2A,0x1C,0x03,0x79,0x10,0x0B,0x00,0x0B,0xC9,0x0B,0xB3,0x3D, +0x79,0xB9,0x07,0x08,0x21,0x1C,0x39,0xA9,0x29,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A, +0x69,0xA9,0x79,0xBF,0x11,0x1F,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xF9, +0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x69,0xBF,0x79,0x9F,0x29,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9,0x79,0xBF,0xE9,0x9F,0x19,0xF9,0x39,0xE9, +0x10,0x0B,0x00,0x0B,0xC8,0x0B,0xDE,0x3D,0x1D,0x0C,0x02,0x79,0x10,0x0B,0x00,0x0B, +0xC9,0x0B,0xB3,0x3D,0x79,0xB9,0x07,0x08,0x15,0x1C,0x39,0x89,0x09,0xE9,0x69,0xF9, +0x06,0x08,0x01,0x4A,0x69,0x89,0x79,0xBF,0x0D,0x1F,0x09,0xE9,0x69,0xF9,0x06,0x08, +0x01,0x4A,0x69,0x89,0x79,0xBF,0xE9,0x9F,0x19,0xF9,0x39,0xE9,0x10,0x0B,0x00,0x0B, +0xC8,0x0B,0xDE,0x3D,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x00,0x69,0x10,0x0B,0x01,0x0B,0x09,0x0B,0x01,0x3D,0x07,0x08, +0x1C,0x1C,0x39,0xF9,0x02,0x0B,0x3A,0x4A,0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x79,0x87, +0x0C,0x6C,0x39,0xF9,0x02,0x0B,0x84,0x4A,0x39,0x8E,0xBA,0x3E,0x4E,0xE9,0x4A,0xCA, +0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D,0x08,0x0C,0x39,0xF9,0x02,0x0B,0x84,0x4A, +0x28,0x69,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x72,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x79,0xB9,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x00,0x69,0x10,0x0B,0x01,0x0B,0x09,0x0B, +0x01,0x3D,0x07,0x08,0x07,0x1C,0x39,0xF9,0x02,0x0B,0x84,0x4A,0x10,0x0B,0x00,0x0B, +0x07,0x0B,0x95,0x3D,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x39,0x69, +0x10,0x0B,0x01,0x0B,0x05,0x0B,0x75,0x3D,0x0D,0xB9,0x0D,0x8C,0x79,0xE9,0x01,0x0B, +0x8A,0x4A,0x69,0xBF,0x01,0x1F,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x00,0x0D,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0xB9,0x39,0xF9,0x01,0x0B,0x8A,0x4A,0x79,0xBF,0x00,0x1F, +0x39,0xF9,0x01,0x0B,0x58,0x4A,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0x98,0x3D,0x07,0x08, +0x2D,0x5C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xC6,0x0B,0x6E,0x3D,0x79,0x99,0x10,0x0C, +0x1D,0xF9,0x0C,0x4A,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xF7,0x0B,0xB5,0x3D,0x39,0xF9, +0x19,0xE9,0x1D,0xD9,0x0C,0x4A,0x29,0xC9,0x10,0x0B,0x00,0x0B,0xC7,0x0B,0x54,0x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0x0B,0x54,0x3D,0x20,0x0B, +0x02,0x0B,0xCD,0x0B,0x7C,0x79,0x79,0xB9,0x39,0x8E,0x02,0x3E,0x06,0x1E,0x39,0x8E, +0x03,0x3E,0x00,0x1E,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x39,0x8D,0x29,0x8D,0x79,0xB9, +0x10,0x0B,0x00,0x0B,0x88,0x0B,0x4E,0x3D,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x58,0x79, +0x03,0x08,0x79,0xF8,0x06,0x7C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x67,0x3F,0x00,0x1F, +0x05,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x68,0x3F,0x00,0x1F,0x39,0x8E,0x42,0x3E, +0x1E,0xF9,0x01,0x78,0x03,0x3C,0x03,0x78,0x01,0x3C,0x05,0x0C,0x10,0x0B,0x00,0x0B, +0x88,0x0B,0x5E,0x3D,0x01,0x0C,0x00,0x0C,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x0D,0x0B, +0x89,0x3D,0x05,0x0C,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xA7,0x3D,0x39,0xF9, +0x28,0x4A,0x1D,0xE9,0x08,0x4A,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xD8,0x3D,0x79,0xA9, +0x07,0x08,0xF0,0x5C,0x05,0x0C,0x29,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xA7,0x3D, +0x39,0xF9,0x30,0x4A,0x1D,0xE9,0x08,0x4A,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xD8,0x3D, +0x79,0xA9,0x07,0x08,0xF0,0x5C,0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0x8C,0x39,0x8D, +0x20,0x0B,0x02,0x0B,0xCD,0x0B,0x90,0x3F,0x6F,0xF9,0x79,0xB9,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x94,0x3F,0x20,0x0B,0x02,0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0B,0x01,0x0B,0x07,0x0B,0xCA,0x3D, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0x00,0x2B,0x79,0xC9, +0x69,0x99,0x59,0xA9,0xC9,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0xB9,0x39,0xF9,0x34,0x4A, +0x00,0x2B,0x79,0xD9,0xD9,0xF9,0x68,0x4A,0x79,0x89,0x00,0x2B,0x00,0x79,0x1D,0xF9, +0x24,0x4A,0x79,0xBF,0x00,0x1F,0x1D,0x8E,0x08,0x3E,0x00,0x6E,0x00,0x2B,0x00,0x69, +0x39,0xF9,0x02,0x0B,0x32,0x4A,0x79,0xBF,0x1F,0xF9,0x0B,0x1C,0x39,0xF9,0x02,0x0B, +0x32,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xF9,0x38,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B, +0x75,0x3D,0x29,0xF9,0xFF,0x1A,0x02,0x78,0x09,0x7C,0x19,0xF9,0x10,0x0B,0x00,0x0B, +0xCB,0x0B,0x75,0x3D,0x10,0x0B,0x00,0x0B,0xED,0x0B,0x6C,0x0C,0x39,0xF9,0x10,0x0B, +0x01,0x0B,0x07,0x0B,0xD0,0x3D,0x07,0x08,0x08,0x5C,0x29,0xF9,0xFF,0x1A,0x01,0x78, +0x04,0x3C,0x29,0xF9,0xFF,0x1A,0x03,0x78,0x15,0x7C,0x29,0xF9,0xFF,0x1A,0x03,0x78, +0x00,0x7C,0x29,0xF9,0xFF,0x1A,0x01,0x78,0x00,0x7C,0x10,0x0B,0x00,0x0B,0x25,0x0B, +0x7A,0x3D,0x19,0xF9,0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x75,0x3D,0x10,0x0B,0x00,0x0B, +0xED,0x0B,0x6C,0x0C,0x20,0x0B,0x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,0x10,0x0B,0x00,0x0B,0xE1,0x0B, +0x45,0x3D,0x39,0xF9,0x01,0x0B,0xFB,0x4A,0x79,0xBF,0x01,0x1F,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x79,0xB9,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x8D,0x0B,0x3C,0x3D,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0xE0,0x0B,0xAD,0x3D,0x0D,0xB9,0x0D,0x8C,0x69,0xD9,0xFF,0x1A, +0x0C,0x78,0x07,0x3C,0x19,0x78,0x1D,0x3C,0x1A,0x78,0x1D,0x3C,0x2A,0x78,0x1D,0x3C, +0x26,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xD9,0x03,0x78,0x07,0x3C, +0x06,0x78,0x07,0x3C,0x0A,0x78,0x07,0x3C,0x0B,0x78,0x07,0x3C,0x08,0x0C,0x00,0x79, +0x18,0x0C,0x01,0x79,0x16,0x0C,0x02,0x79,0x14,0x0C,0x03,0x79,0x12,0x0C,0x00,0x0C, +0x0F,0x0C,0x04,0x79,0x0E,0x0C,0x05,0x79,0x0C,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A, +0x59,0xBF,0x1F,0xD9,0x09,0x78,0x02,0x7C,0x06,0x79,0x03,0x0C,0x01,0x0C,0x00,0x0C, +0xFF,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x29,0xF9,0xFF,0x1A, +0x00,0x78,0x01,0x3C,0x27,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xC4,0x0B,0x60,0x3D, +0x07,0x08,0x07,0x5C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x9D,0x0B,0xD3,0x3D,0x07,0x08, +0x18,0x1C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x69,0x07,0x08, +0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A,0xFD,0x4D,0x39,0xF9,0x02,0x0B,0x3C,0x4A, +0x79,0xBF,0x8F,0xF9,0x69,0xAA,0x79,0xDF,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF, +0x09,0x1F,0x01,0x0C,0x00,0x0C,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x69,0xD9,0xFF,0x1A, +0x0C,0x78,0x07,0x3C,0x39,0x78,0x23,0x3C,0x48,0x78,0x1D,0x3C,0x49,0x78,0x1D,0x3C, +0x31,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xD9,0x07,0x78,0x07,0x3C, +0x12,0x78,0x03,0x3C,0x13,0x78,0x0B,0x3C,0x0C,0x0C,0x01,0x79,0x25,0x0C,0x20,0x0B, +0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9,0x12,0x78,0x01,0x3C,0x03,0x0C,0x02,0x79, +0x1B,0x0C,0x00,0x0C,0x18,0x0C,0x03,0x79,0x17,0x0C,0x04,0x79,0x15,0x0C,0x79,0xD9, +0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x4F,0xD9,0x4A,0xCA,0xAA,0xEA,0x0A,0x6C,0x79,0xD9, +0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x8F,0xD9,0x04,0x2B,0x00,0x0A,0x59,0xDF,0x00,0x79, +0x03,0x0C,0x01,0x0C,0x00,0x0C,0xFF,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0xB9,0x69,0xA9,0x39,0xF9,0x02,0x0B,0x2C,0x4A,0x79,0xBF,0x1F,0xF9,0x1C,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x20,0x0B,0x02,0x0B,0x9E,0x0B, +0xFC,0x4A,0x29,0xE9,0xFF,0x1A,0x3A,0x8A,0x79,0xCA,0x69,0xBF,0x6F,0xF9,0x18,0x1C, +0x39,0xF9,0x02,0x0B,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0x3F, +0x9F,0x87,0x0B,0x6C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xEE,0x0B,0x76,0x3D, +0x79,0xA9,0x07,0x08,0xFF,0x1A,0xFF,0x78,0x02,0x7C,0x00,0x79,0x62,0x0C,0x39,0xF9, +0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x03,0x3C,0x01,0x78,0x1F,0x3C, +0x56,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xEF,0x0B,0x1D,0x3D,0x39,0xF9, +0x02,0x0B,0x2C,0x4A,0x79,0xBF,0x1F,0xF9,0x11,0x1C,0x39,0xF9,0x02,0x0B,0x2C,0x4A, +0x79,0xBF,0x1F,0xF9,0x04,0x78,0x0A,0x3C,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF, +0x09,0x1F,0x39,0xF9,0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x01,0x1F,0x39,0x0C,0x39,0xF9, +0x29,0xE9,0x10,0x0B,0x00,0x0B,0xEE,0x0B,0xAA,0x3D,0x39,0xF9,0x09,0x69,0x10,0x0B, +0x01,0x0B,0x08,0x0B,0xA4,0x3D,0x07,0x08,0x29,0x1C,0x39,0xF9,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0xEF,0x0B,0x1D,0x3D,0x39,0xF9,0x02,0x0B,0x2C,0x4A,0x79,0xBF,0x1F,0xF9, +0x04,0x78,0x06,0x3C,0x39,0xF9,0x02,0x0B,0x2C,0x4A,0x79,0xBF,0x1F,0xF9,0x15,0x5C, +0x39,0x8E,0x09,0x3E,0x8E,0xF9,0x00,0x2B,0x02,0x0A,0x79,0xAE,0x39,0xF9,0x02,0x0B, +0x39,0x4A,0x79,0xBF,0xFF,0x1F,0x39,0xF9,0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x00,0x1F, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0xE0,0x0B,0xEC,0x3D,0x00,0x0C,0x01,0x0C,0x00,0x0C, +0x01,0x79,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9, +0x39,0xF9,0x02,0x0B,0x2D,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x03,0x3C,0x01,0x78, +0x31,0x3C,0x56,0x0C,0x29,0xF9,0xFF,0x1A,0x00,0x78,0x09,0x3C,0x01,0x78,0x17,0x3C, +0x02,0x78,0x26,0x3C,0x03,0x78,0x03,0x3C,0x04,0x78,0x17,0x3C,0x21,0x0C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x8D,0x0B,0x5A,0x3D,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xE0,0x0B, +0xAD,0x3D,0x39,0xF9,0x02,0x0B,0x2D,0x4A,0x79,0xBF,0x01,0x1F,0x12,0x0C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0x8D,0x0B,0x78,0x3D,0x0C,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B, +0x8E,0x0B,0x50,0x3D,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x8E,0x0B,0x7F,0x3D,0x01,0x0C, +0x00,0x0C,0x27,0x0C,0x29,0xF9,0xFF,0x1A,0x00,0x78,0x20,0x3C,0x01,0x78,0x12,0x3C, +0x02,0x78,0x05,0x3C,0x03,0x78,0x1A,0x3C,0x04,0x78,0x12,0x3C,0x17,0x0C,0x39,0xF9, +0x10,0x0B,0x00,0x0B,0xE0,0x0B,0xD7,0x3D,0x39,0xF9,0x02,0x0B,0x2D,0x4A,0x79,0xBF, +0x00,0x1F,0x0D,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x8D,0x0B,0x78,0x3D,0x07,0x0C, +0x39,0xF9,0x10,0x0B,0x00,0x0B,0x8E,0x0B,0x50,0x3D,0x01,0x0C,0x00,0x0C,0x01,0x0C, +0x00,0x0C,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0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,0xA4,0x4A,0x29,0xE9,0xFF,0x1A,0x79,0xCA,0x69,0xBF,0x1F,0xF9,0x39,0xE9, +0x02,0x0B,0x2E,0x4A,0x69,0xBF,0x79,0x9F,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x69,0xD9,0xFF,0x1A,0x0C,0x78,0x0F,0x3C,0x15,0x78,0x41,0x3C,0x1D,0x78,0x41,0x3C, +0x1E,0x78,0x41,0x3C,0x38,0x78,0x41,0x3C,0x39,0x78,0x53,0x3C,0x3A,0x78,0x47,0x3C, +0x3B,0x78,0x75,0x3C,0x76,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x39,0x3F,0x1F,0xD9, +0x07,0x78,0x0D,0x3C,0x0D,0x78,0x15,0x3C,0x0F,0x78,0x05,0x3C,0x10,0x78,0x05,0x3C, +0x11,0x78,0x19,0x3C,0x22,0x0C,0x03,0x79,0x66,0x0C,0x04,0x79,0x64,0x0C,0x20,0x0B, +0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9,0x0F,0x78,0x02,0x7C,0x07,0x79,0x5B,0x0C, +0x15,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x07,0x78,0x02,0x7C, +0x07,0x79,0x51,0x0C,0x0B,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x3C,0x3F,0x1F,0xD9, +0x0F,0x78,0x02,0x7C,0x07,0x79,0x47,0x0C,0x01,0x0C,0x00,0x0C,0x43,0x0C,0x00,0x79, +0x42,0x0C,0x01,0x79,0x40,0x0C,0x02,0x79,0x3E,0x0C,0x79,0xD9,0x02,0x0B,0x39,0x4A, +0x59,0xBF,0x1F,0xD9,0x07,0x78,0x02,0x7C,0x06,0x79,0x35,0x0C,0x33,0x0C,0x79,0xD9, +0x02,0x0B,0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x07,0x78,0x02,0x7C,0x07,0x79,0x2B,0x0C, +0x29,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1F,0xD9,0x02,0x78, +0x05,0x3C,0x03,0x78,0x03,0x3C,0x04,0x78,0x01,0x3C,0x1E,0x0C,0x79,0xD9,0x02,0x0B, +0x39,0x4A,0x59,0xBF,0x1F,0xD9,0x01,0x49,0x05,0x08,0x04,0x1C,0x59,0xED,0x04,0x08, +0x2A,0x8A,0xFD,0x4D,0x79,0xD9,0x02,0x0B,0x3C,0x4A,0x59,0xBF,0x8F,0xD9,0x49,0xAA, +0x59,0xDF,0x79,0xD9,0x02,0x0B,0x39,0x4A,0x59,0xBF,0x07,0x1F,0x79,0xD9,0x02,0x0B, +0x35,0x4A,0x59,0xBF,0x01,0x1F,0x01,0x0C,0x00,0x0C,0x01,0x0C,0x00,0x0C,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B, +0xF3,0x0B,0xF8,0x3D,0x79,0xA9,0x07,0x08,0xFF,0x1A,0xFF,0x78,0x02,0x7C,0x00,0x79, +0x60,0x0C,0x39,0xF9,0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x03,0x3C, +0x01,0x78,0x1D,0x3C,0x54,0x0C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xF3,0x0B, +0xA8,0x3D,0x39,0xF9,0x02,0x0B,0x2E,0x4A,0x79,0xBF,0x1F,0xF9,0x0F,0x1C,0x39,0xF9, +0x02,0x0B,0x2B,0x4A,0x79,0xBF,0x01,0x1F,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF, +0x07,0x1F,0x39,0xF9,0x02,0x0B,0x32,0x4A,0x79,0xBF,0x00,0x1F,0x39,0x0C,0x39,0xF9, +0x29,0xE9,0x93,0x3D,0x39,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9,0x07,0x78, +0x27,0x7C,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xF3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,0x02,0x5C,0x00,0x79,0x11,0x0C, +0x79,0x8E,0x01,0x3E,0x1E,0xE9,0x0A,0x4C,0x02,0x5A,0x08,0x2C,0x79,0x8E,0x01,0x3E, +0x1E,0xE9,0x26,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x2C,0x00,0x79,0x01,0x0C, +0x01,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x04,0x49,0x00,0x59,0x69,0xBF, +0x8F,0xAA,0x4A,0xCA,0x69,0x8E,0x02,0x3E,0x1E,0xB9,0x6A,0x8A,0x6A,0x8A,0x6A,0x8A, +0x05,0x08,0x39,0xAA,0x4A,0xCA,0x59,0xB9,0x4A,0xCA,0xFF,0x1A,0x79,0x99,0x19,0xA9, +0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x59,0xB9,0x4A,0xCA,0xBA,0x8A, +0xBA,0x8A,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF, +0x39,0x9F,0x69,0x8E,0x02,0x3E,0x4E,0xB9,0x4A,0xCA,0xFF,0x1A,0x79,0x99,0x19,0xA9, +0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x69,0x8E,0x02,0x3E,0x4E,0xB9, +0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A, +0x19,0xF9,0x29,0xBF,0x39,0x9F,0x49,0xF9,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x02,0x49,0x00,0x59,0x69,0xBF,0x0F,0xAA,0x4A,0xCA, +0x69,0x8E,0x01,0x3E,0x1E,0xB9,0x01,0x1A,0x3A,0x8A,0x05,0x08,0x39,0xAA,0x4A,0xCA, +0x69,0x8E,0x02,0x3E,0x1E,0xB9,0x01,0x1A,0x3A,0x8A,0x2A,0x8A,0x05,0x08,0x39,0xAA, +0x4A,0xCA,0x69,0x8E,0x03,0x3E,0x1E,0xB9,0x01,0x1A,0x6A,0x8A,0x05,0x08,0x39,0xAA, +0x4A,0xCA,0x69,0x8E,0x04,0x3E,0x1E,0xB9,0x6A,0x8A,0x6A,0x8A,0x05,0x08,0x39,0xAA, +0x4A,0xCA,0x59,0xB9,0x4A,0xCA,0xFF,0x1A,0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A, +0x19,0xF9,0x29,0xBF,0x39,0x9F,0x59,0xB9,0x4A,0xCA,0xBA,0x8A,0xBA,0x8A,0xFF,0x1A, +0x79,0x99,0x19,0xA9,0x01,0x08,0x01,0x4A,0x19,0xF9,0x29,0xBF,0x39,0x9F,0x49,0xF9, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x0C,0x59,0x79,0xB9, +0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xF9,0x49,0xBF,0x00,0x1F,0x69,0xBF,0x1F,0xC9, +0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E, +0x01,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A, +0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x01,0x3E,0x4E,0xC9,0x4A,0xCA,0xBA,0x8A, +0xBA,0x8A,0xFF,0x1A,0x79,0xA9,0x29,0xB9,0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF, +0x49,0x9F,0x69,0x8E,0x02,0x3E,0x4E,0xC9,0x4A,0xCA,0xFF,0x1A,0x79,0xA9,0x29,0xB9, +0x02,0x08,0x01,0x4A,0x29,0xF9,0x39,0xBF,0x49,0x9F,0x69,0x8E,0x02,0x3E,0x4E,0xC9, +0x4A,0xCA,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xCA,0x4A,0xCA,0x79,0x8E,0x05,0x3E,0x39,0xCE, +0x06,0x08,0x02,0x4A,0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x08,0x59,0x06,0x08,0x01,0x4A,0x69,0xBF,0x1F,0xC9,0x49,0xB9,0x39,0xC9,0x8A,0xCA, +0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x69,0x8E,0x01,0x3E,0x1E,0xA9,0x29,0x99,0x19,0xA9, +0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x08,0x6D,0x01,0x08,0x2A,0x8A,0x02,0x08, +0x5A,0x8A,0xFB,0x4D,0x01,0x08,0x39,0xCA,0x02,0x08,0x49,0xEA,0x69,0x8E,0x02,0x3E, +0x1E,0xC9,0x49,0xB9,0x39,0xC9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x10,0x6D, +0x03,0x08,0x2A,0x8A,0x04,0x08,0x5A,0x8A,0xFB,0x4D,0x03,0x08,0x19,0xCA,0x04,0x08, +0x29,0xEA,0x69,0x8E,0x03,0x3E,0x1E,0xA9,0x29,0x99,0x19,0xA9,0x8A,0xCA,0x7A,0xCA, +0x8A,0xCA,0x7A,0xCA,0x18,0x6D,0x01,0x08,0x2A,0x8A,0x02,0x08,0x5A,0x8A,0xFB,0x4D, +0x01,0x08,0x39,0xCA,0x02,0x08,0x49,0xEA,0x69,0x8E,0x04,0x3E,0x1E,0xC9,0x49,0xB9, +0x39,0xC9,0x8A,0xCA,0x7A,0xCA,0x8A,0xCA,0x7A,0xCA,0x20,0x6D,0x03,0x08,0x2A,0x8A, +0x04,0x08,0x5A,0x8A,0xFB,0x4D,0x03,0x08,0x19,0xCA,0x04,0x08,0x29,0xEA,0x79,0xBF, +0x39,0xEF,0x49,0xEF,0x06,0x08,0x05,0x4A,0x69,0xBF,0x1F,0xC9,0x4A,0xCA,0x4A,0xCA, +0x69,0x8E,0x01,0x3E,0x1E,0xB9,0x4A,0xCA,0x4A,0xCA,0x6A,0x8A,0x6A,0x8A,0x49,0xCA, +0x4A,0xCA,0x79,0x8E,0x04,0x3E,0x39,0xCE,0x06,0x08,0x02,0x4A,0x59,0xF9,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x02,0x59,0x06,0x08,0x01,0x4A,0x69,0xB9, +0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0xBF,0x49,0x9F, +0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x02,0x59,0x06,0x08,0x01,0x4A,0x69,0xB9, +0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0xBF,0x49,0x9F, +0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0x99,0x69,0xB9, +0x09,0x29,0x03,0x08,0x01,0x4A,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x05,0x0B,0x41,0x3D, +0x19,0xBF,0x69,0xEF,0x79,0xEF,0x03,0x08,0x08,0x4A,0x29,0xF9,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x02,0x59,0x06,0x08,0x01,0x4A,0x69,0xB9,0x39,0xC9, +0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0xBF,0x49,0x9F,0x59,0xF9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x06,0x59,0x06,0x08,0x01,0x4A,0x69,0xB9,0x39,0xC9, +0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0xBF,0x49,0x9F,0x69,0xBF, +0x1F,0xC9,0x4A,0xCA,0x4A,0xCA,0x69,0x8E,0x01,0x3E,0x1E,0xB9,0x4A,0xCA,0x4A,0xCA, +0x6A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9,0x79,0x8E,0x08,0x3E,0x39,0x9E,0x69,0xBF,0x1F,0xB9,0x4A,0xCA,0x4A,0xCA, +0x69,0x8E,0x01,0x3E,0x1E,0xA9,0x4A,0xCA,0x4A,0xCA,0x6A,0x8A,0x6A,0x8A,0x39,0xCA, +0x4A,0xCA,0x79,0x8E,0x05,0x3E,0x29,0xCE,0x06,0x08,0x02,0x4A,0x00,0x59,0x69,0xBF, +0x1F,0xB9,0x4A,0xCA,0x4A,0xCA,0x69,0x8E,0x01,0x3E,0x1E,0xA9,0x4A,0xCA,0x4A,0xCA, +0x6A,0x8A,0x6A,0x8A,0x39,0xCA,0x4A,0xCA,0x59,0xB9,0x2A,0x8A,0x79,0xCA,0x39,0x8E, +0x06,0x3E,0x29,0xCE,0x06,0x08,0x02,0x4A,0x05,0x08,0x01,0x4A,0x59,0xB9,0x06,0x5A, +0xE6,0x2C,0x49,0xF9,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x03,0x59,0x06,0x08, +0x01,0x4A,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9, +0x79,0xBF,0x49,0x9F,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF, +0x1F,0xC9,0x79,0x8E,0x01,0x3E,0x49,0x9E,0x79,0xBF,0x0F,0xC9,0x07,0x1A,0x49,0xAF, +0x79,0x8E,0x01,0x3E,0x8E,0xC9,0x07,0x1A,0x49,0xAE,0x59,0xF9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x05,0x59,0x06,0x08,0x01,0x4A,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A, +0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0xBF,0x49,0x9F,0x69,0xB9,0x39,0xC9,0x03,0x08, +0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9,0x79,0x8E,0x01,0x3E,0x49,0x9E,0x69,0xBF, +0x1F,0xC9,0x4A,0xCA,0x4A,0xCA,0x69,0x8E,0x01,0x3E,0x1E,0xB9,0x4A,0xCA,0x4A,0xCA, +0x6A,0x8A,0x6A,0x8A,0x49,0xCA,0x4A,0xCA,0x79,0x8E,0x01,0x3E,0x39,0xCE,0x06,0x08, +0x02,0x4A,0x79,0xBF,0x0F,0xC9,0x07,0x1A,0x49,0xAF,0x79,0x8E,0x01,0x3E,0x8E,0xC9, +0x07,0x1A,0x49,0xAE,0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x03,0x59,0x06,0x08, +0x01,0x4A,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF,0x1F,0xC9, +0x79,0xBF,0x49,0x9F,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x49,0xBF, +0x1F,0xC9,0x79,0x8E,0x01,0x3E,0x49,0x9E,0x79,0xBF,0x0F,0xC9,0x07,0x1A,0x49,0xAF, +0x59,0xF9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9, +0x69,0xA9,0x59,0x99,0x00,0x09,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xF7,0x0B, +0xF1,0x3D,0x02,0x08,0x79,0xCA,0x29,0xBF,0x1F,0xF9,0x39,0x8E,0x05,0x3E,0x79,0x9E, +0x39,0x8E,0x05,0x3E,0x1E,0xF9,0x00,0x78,0x53,0x3C,0x01,0x78,0x10,0x0B,0x00,0x0B, +0xFB,0x0B,0xB8,0x3C,0x02,0x78,0x10,0x0B,0x00,0x0B,0xFB,0x0B,0xF6,0x3C,0x07,0x78, +0x10,0x0B,0x00,0x0B,0xFC,0x0B,0x0C,0x3C,0x08,0x78,0x10,0x0B,0x00,0x0B,0xFC,0x0B, +0x22,0x3C,0x09,0x78,0x10,0x0B,0x00,0x0B,0xFC,0x0B,0x2A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xF8,0x05,0x3C,0x1E,0x79, +0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x2E,0x0C,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x2D,0x0C, +0x39,0x8E,0x08,0x3E,0xFF,0x1E,0x39,0xF9,0x09,0x4A,0x29,0xE9,0x10,0x0B,0x00,0x0B, +0xF9,0x0B,0x52,0x3D,0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x05,0x3C, +0x1E,0x79,0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x2E,0x0C,0x10,0x0B,0x00,0x0B,0xFD,0x0B, +0x2D,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x9F,0xA7,0x05,0x2C,0x19,0x79, +0x10,0x0B,0x00,0x0B,0xFD,0x0B,0x2E,0x0C,0x39,0xF9,0x08,0x4A,0x29,0xE9,0x10,0x0B, +0x00,0x0B,0xF9,0x0B,0x96,0x3D,0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8, +0x02,0x3C,0x1E,0x79,0x7B,0x0C,0x79,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78,0x02,0x7C, +0x19,0x79,0x74,0x0C,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x6F,0xE9,0x6F,0xF9, +0x06,0x08,0x09,0x0B,0x00,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08,0x04,0x5C,0x07,0x08, +0x02,0x5C,0x19,0x79,0x63,0x0C,0x39,0xF9,0x08,0x4A,0x29,0xE9,0x10,0x0B,0x00,0x0B, +0xFA,0x0B,0x85,0x3D,0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x02,0x3C, +0x1E,0x79,0x54,0x0C,0x52,0x0C,0x19,0xF9,0xFF,0x1A,0x02,0x5C,0x19,0x79,0x4E,0x0C, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0x09,0x0B, +0x00,0x1A,0x07,0x08,0x00,0x1A,0x06,0x08,0x04,0x5C,0x07,0x08,0x02,0x5C,0x19,0x79, +0x3D,0x0C,0x39,0xF9,0x08,0x4A,0x29,0xE9,0x10,0x0B,0x00,0x0B,0xFA,0x0B,0xA8,0x3D, +0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x02,0x3C,0x1E,0x79,0x2E,0x0C, +0x2C,0x0C,0x19,0xF9,0xFF,0x1A,0x01,0x78,0x02,0x7C,0x19,0x79,0x27,0x0C,0x20,0x0B, +0x02,0x0B,0xC9,0x0B,0x84,0x3F,0x6F,0xE9,0x6F,0xF9,0x06,0x08,0x8A,0xCA,0x0A,0xEA, +0x02,0x2C,0x19,0x79,0x1B,0x0C,0x39,0xF9,0x08,0x4A,0x29,0xE9,0x10,0x0B,0x00,0x0B, +0xFA,0x0B,0xDD,0x3D,0x39,0x8E,0x04,0x3E,0x1E,0xE9,0x07,0x08,0x69,0xF8,0x08,0x7C, +0x39,0xF9,0x08,0x4A,0x10,0x0B,0x00,0x0B,0xF6,0x0B,0x7B,0x3D,0x07,0x08,0x02,0x5C, +0x1E,0x79,0x04,0x0C,0x02,0x0C,0x19,0x09,0x00,0x0C,0x09,0xF9,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9, +0x69,0x89,0x29,0xB9,0x39,0xF9,0x03,0x1A,0x05,0x1C,0x39,0xF9,0x00,0x2B,0x03,0x0A, +0x04,0x4A,0x79,0xB9,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x39,0xEF,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xF9,0x02,0x0B,0x94,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0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B, +0x8E,0x3D,0x07,0x08,0xEA,0x8A,0x39,0x8E,0x03,0x3E,0x4E,0xE9,0x4A,0xCA,0x07,0x08, +0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x2C,0x12,0x79,0x01,0x0C,0x00,0x79, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x69,0x89, +0x19,0xF9,0x4A,0xCA,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x07,0x08,0x9F,0xCA,0x79,0xA9,0x09,0xF9, +0x10,0x0B,0x01,0x0B,0x09,0x0B,0x2B,0x3D,0x79,0xB9,0x07,0x08,0xFF,0x1A,0xFF,0x78, +0x02,0x7C,0x00,0x79,0x1F,0x0C,0x29,0xF9,0x02,0x0B,0x39,0x4A,0x79,0xBF,0x1F,0xF9, +0x39,0xE9,0xFF,0x1A,0x07,0x08,0x69,0xF8,0x12,0x3C,0x29,0xF9,0x02,0x0B,0x3C,0x4A, +0x79,0xBF,0x4F,0xF9,0x4A,0xCA,0x39,0xE9,0xFF,0x1A,0x01,0x59,0x06,0x08,0x04,0x1C, +0x69,0xED,0x05,0x08,0x2A,0x8A,0xFD,0x4D,0x05,0x08,0x79,0x9A,0x02,0x1C,0x01,0x79, +0x01,0x0C,0x00,0x79,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x00,0x19,0x10,0x0B,0x00,0x0B,0xFF,0x0B, +0xAF,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x6F,0xF9,0x00,0x2B,0x79,0xF9, +0x19,0xF9,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0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6A,0x8A,0x3A,0x8A,0x03,0x0B,0xD0,0x4A,0x4A,0xCA,0x39,0xE9,0x02,0x0B, +0x12,0x4A,0x69,0xBF,0x79,0xCF,0x39,0xF9,0x02,0x0B,0x1C,0x4A,0x79,0xBF,0x1B,0x4F, +0x39,0xF9,0x02,0x0B,0x18,0x4A,0x79,0xBF,0x1B,0x4F,0x39,0xF9,0x02,0x0B,0x1E,0x4A, +0x79,0xBF,0x01,0x0B,0x48,0x4F,0x39,0xF9,0x02,0x0B,0x1A,0x4A,0x79,0xBF,0x01,0x0B, +0x48,0x4F,0x39,0x8E,0x41,0x3E,0x01,0x1E,0x01,0x79,0x39,0x8E,0x40,0x3E,0x79,0x9E, +0x39,0xF9,0x39,0xE9,0x02,0x0B,0x18,0x4A,0x10,0x0B,0x00,0x0B,0xC6,0x0B,0x43,0x3D, +0x39,0xE9,0x02,0x0B,0x22,0x4A,0x69,0xBF,0x79,0xCF,0x39,0xF9,0x39,0xE9,0x02,0x0B, +0x10,0x4A,0x10,0x0B,0x00,0x0B,0xC6,0x0B,0x43,0x3D,0x39,0xE9,0x02,0x0B,0x20,0x4A, +0x69,0xBF,0x79,0xCF,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xD8,0x3F,0x1F,0xF9,0x39,0xE9, +0x02,0x0B,0x24,0x4A,0x69,0xBF,0x79,0x9F,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xD9,0x3F, +0x1F,0xF9,0x39,0xE9,0x02,0x0B,0x25,0x4A,0x69,0xBF,0x79,0x9F,0x20,0x0B,0x02,0x0B, +0xC9,0x0B,0xDA,0x3F,0x1F,0xF9,0x39,0xE9,0x02,0x0B,0x26,0x4A,0x69,0xBF,0x79,0x9F, +0x00,0x09,0x09,0xF9,0x39,0xCA,0x02,0x0B,0x28,0x4A,0x79,0xBF,0x02,0x1F,0x00,0x08, +0x01,0x4A,0x09,0xF9,0x03,0x5A,0xF5,0x2C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xE4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x0E,0x08, +0x4C,0x5C,0x0F,0x08,0x4A,0x5C,0x39,0xF9,0x4A,0xCA,0x29,0xE9,0x01,0x0B,0x19,0x4A, +0x69,0xBF,0x1F,0xE9,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x05,0x6C, +0x39,0xF9,0x4A,0xCA,0xFF,0x1A,0x79,0x99,0x30,0x0C,0x29,0xF9,0x01,0x0B,0x19,0x4A, +0x79,0xBF,0x1F,0xF9,0x13,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x0C,0x2C,0x39,0xF9, +0x4A,0xCA,0x29,0xE9,0x01,0x0B,0x19,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x08,0x69,0xDA, +0xFF,0x1A,0x79,0x99,0x1A,0x0C,0x39,0xF9,0x4A,0xCA,0xFF,0x1A,0x79,0x99,0x08,0x0C, +0x29,0xF9,0x01,0x0B,0x19,0x4A,0x79,0xBF,0x1F,0xF9,0x01,0x08,0x79,0xDA,0xFF,0x1A, +0x19,0xF9,0xFF,0x1A,0x29,0xE9,0x01,0x0B,0x19,0x4A,0x69,0xBF,0x1F,0xE9,0x07,0x08, +0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0xEB,0x6C,0x19,0xF9,0xFF,0x1A,0x29,0xCA, +0x01,0x0B,0x24,0x4A,0x79,0xBF,0x1F,0xF9,0x03,0x0C,0x39,0xF9,0x4A,0xCA,0xFF,0x1A, +0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x00,0x59,0x00,0x69,0x01,0x39,0x00,0x49,0x06,0x08, +0x06,0x1C,0x69,0xED,0x03,0x08,0x2A,0x8A,0x04,0x08,0x5A,0x8A,0xFB,0x4D,0x79,0xA9, +0x01,0x0B,0x1C,0x4A,0x29,0xBF,0x03,0x08,0x6F,0x9A,0x04,0x08,0x9F,0x9A,0x03,0x08, +0x02,0x5C,0x04,0x08,0x0D,0x1C,0x69,0xC9,0xFF,0x1A,0x59,0xA9,0x29,0xB9,0x02,0x08, +0x01,0x4A,0x29,0xD9,0x03,0x08,0x79,0xCA,0x01,0x0B,0x24,0x4A,0x39,0xBF,0x49,0x9F, +0x06,0x08,0x01,0x4A,0x69,0xC9,0x25,0x5A,0xD8,0x2C,0x59,0xC9,0xFF,0x1A,0x79,0xB9, +0x01,0x0B,0x19,0x4A,0x39,0xBF,0x49,0x9F,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x1D,0xF9,0x10,0x4A,0x79,0xBF,0x20,0x0B, +0x02,0x0B,0xA0,0x2B,0xF4,0x5F,0xBF,0x9F,0xBF,0x9F,0xBF,0x9F,0xBF,0x9F,0x20,0x0B, +0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xF9,0x01,0x5A,0x79,0xB9, +0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xAA,0x3D,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F, +0x6F,0xF9,0x79,0x89,0x39,0xF9,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x07,0x08,0x09,0xCA,0x79,0xA9,0x29,0xBF,0x1F,0xF9,0x0F,0x1C,0x29,0xF9, +0x01,0x0B,0x70,0x4A,0x79,0xBF,0x1F,0xF9,0x1D,0xE9,0x10,0x4A,0x39,0xCA,0x69,0xBF, +0x79,0x9F,0x29,0xF9,0x01,0x0B,0x70,0x4A,0x79,0xBF,0x00,0x1F,0x39,0xE9,0x69,0xF9, +0x06,0x08,0x01,0x5A,0x69,0xB9,0x07,0x08,0xD7,0x5C,0x10,0x0B,0x00,0x0B,0x0A,0x0B, +0xBC,0x3D,0x20,0x0B,0x02,0x0B,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0x02,0x0B,0xCE,0x0B,0x54,0x3F,0x07,0x08,0x9F,0xCA,0x79,0xA9,0x29,0xBF,0x1F,0xF9, +0x0E,0x5C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x75,0x3D,0x01,0x79,0x10,0x0B, +0x01,0x0B,0x08,0x0B,0xEC,0x3D,0x10,0x0B,0x01,0x0B,0x02,0x0B,0xF5,0x0C,0x1D,0xF9, +0x10,0x4A,0x39,0xE9,0x10,0x0B,0x00,0x0B,0xF7,0x0B,0xF1,0x3D,0x20,0x0B,0x02,0x0B, +0xA0,0x0B,0xD8,0x3F,0x6F,0xF9,0x39,0x1C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xD8,0x3F, +0x6F,0xF9,0x79,0x89,0x29,0xF9,0x48,0x4A,0x39,0xE9,0x09,0xBD,0x07,0x08,0x19,0x1C, +0x29,0x8E,0x61,0x3E,0x1E,0xF9,0x14,0x1C,0x29,0xF9,0x01,0x0B,0xE8,0x4A,0x29,0x8E, +0x79,0x3E,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D,0x29,0xF9,0x01,0x0B, +0xD4,0x4A,0x29,0x8E,0x74,0x3E,0x6E,0xE9,0x10,0x0B,0x00,0x0B,0x07,0x0B,0x85,0x3D, +0x14,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x75,0x3D,0x01,0x79,0x10,0x0B, +0x01,0x0B,0x08,0x0B,0xEC,0x3D,0x29,0xF9,0x3E,0x69,0x10,0x0B,0x01,0x0B,0x05,0x0B, +0x75,0x3D,0x10,0x0B,0x01,0x0B,0x02,0x0B,0xF5,0x0C,0x1D,0xF9,0x10,0x4A,0x79,0xBF, +0x1F,0xF9,0x00,0x78,0x63,0x3C,0x01,0x78,0x43,0x3C,0x02,0x78,0x41,0x3C,0x03,0x78, +0x01,0x3C,0x5C,0x0C,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x2D,0x3F,0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0xF9,0x79,0x89,0x1D,0x8E,0x0E,0x3E,0x4E,0xF9,0x39,0xE9, +0x09,0xBD,0x0A,0x0C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0xCB,0x0B,0x75,0x3D,0x01,0x79, +0x10,0x0B,0x01,0x0B,0x08,0x0B,0xEC,0x3D,0x00,0x0C,0x1D,0xF9,0x1C,0x4A,0x10,0x0B, +0x00,0x0B,0xCB,0x0B,0xB5,0x3D,0x79,0xB9,0x07,0x08,0x10,0x0B,0x01,0x0B,0x01,0x0B, +0xFD,0x5C,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F,0x9F,0x8E,0x1C,0x3E,0x1E,0xF9, +0x01,0x5A,0x79,0x99,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xAA,0x3D,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x54,0x3F,0x6F,0xF9,0x79,0x89,0x19,0xF9,0x02,0x0B,0x94,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x09,0xCA,0x01,0x0B,0x71,0x4A,0x79,0xBF, +0x1F,0xF9,0x1D,0xE9,0x18,0x4A,0x19,0xCA,0x69,0xBF,0x79,0x9F,0x20,0x0B,0x02,0x0B, +0xCE,0x0B,0x54,0x3F,0x6F,0xF9,0x79,0x89,0x19,0xF9,0x02,0x0B,0x94,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x09,0xCA,0x01,0x0B,0x71,0x4A,0x79,0xBF, +0x00,0x1F,0x19,0xE9,0x69,0xF9,0x06,0x08,0x01,0x5A,0x69,0x99,0x07,0x08,0xCE,0x5C, +0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x20,0x0B,0x02,0x0B,0x9B,0x0B,0x44,0x3F, +0x9F,0x8E,0x1C,0x3E,0x1E,0xF9,0x01,0x5A,0x79,0x99,0x1D,0xF9,0x18,0x4A,0x19,0xCA, +0x79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,0x1A,0x02,0x5C, +0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xF9,0xCA,0x79,0x89,0x19,0xA9,0x09,0xF9, +0x19,0xDA,0x08,0x6C,0x19,0xF9,0x02,0x5A,0x05,0x2C,0x19,0xF9,0x09,0xDA,0x79,0xA9, +0x01,0x5C,0x01,0x29,0x29,0xF9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0xA9, +0x69,0xB9,0x29,0x8E,0x08,0x3E,0x6E,0xF9,0x79,0x99,0x39,0x8E,0x08,0x3E,0x6E,0xF9, +0x79,0x89,0x39,0x8E,0x17,0x3E,0x1E,0xF9,0x01,0x78,0x0C,0x7C,0x39,0x8E,0x09,0x3E, +0xAE,0xBF,0x1F,0xF9,0x05,0x78,0x0B,0x3C,0x39,0x8E,0x09,0x3E,0xAE,0xBF,0x1F,0xF9, +0x04,0x78,0x05,0x3C,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x06,0x0B,0xAB,0x0C,0x19,0x8E, +0x01,0x3E,0x1E,0xF9,0x05,0x5C,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x06,0x0B,0xAB,0x0C, +0x09,0x8E,0x60,0x3E,0x6E,0xF9,0x03,0x0B,0xE8,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x00,0x2B,0x79,0xF9,0x09,0x8E,0x8A,0x3E,0x4E,0xF9,0x4A,0xCA,0x04,0x0B, +0xE2,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x2A,0x8A,0x0F,0x08, +0x79,0xDA,0x02,0x6C,0x39,0xF9,0x67,0x0C,0x19,0x8E,0x60,0x3E,0x6E,0xF9,0x03,0x0B, +0xE8,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,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0xCA,0x02,0x4C,0x15,0x5A,0x03,0x6C,0x07,0x79,0x32,0x0C,0x31,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0x1F,0x5A,0x03,0x6C,0x06,0x79,0x2A,0x0C,0x29,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0x33,0x5A,0x03,0x6C,0x05,0x79,0x22,0x0C,0x21,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0x4C,0x5A,0x03,0x6C,0x04,0x79,0x1A,0x0C,0x19,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0x65,0x5A,0x03,0x6C,0x03,0x79,0x12,0x0C,0x11,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0x97,0x5A,0x03,0x6C,0x02,0x79,0x0A,0x0C,0x09,0x0C, +0x39,0xF9,0x4A,0xCA,0x02,0x4C,0xFB,0x5A,0x03,0x6C,0x01,0x79,0x02,0x0C,0x01,0x0C, +0x00,0x79,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D, +0x79,0x89,0x69,0x99,0x00,0x29,0x7C,0x0C,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x54,0x3F, +0x6F,0xF9,0x00,0x2B,0x79,0xF9,0x29,0xF9,0x02,0x0B,0x94,0x69,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0x8E,0x3D,0x07,0x08,0xF9,0xCA,0x79,0xB9,0x39,0xBF,0x1F,0xF9,0x66,0x1C, +0x39,0x8E,0x34,0x3E,0x1E,0xF9,0x04,0x78,0x61,0x7C,0x39,0x8E,0x05,0x3E,0x6E,0xF9, +0x19,0xDA,0x80,0x0B,0x00,0x0B,0x00,0x0B,0x00,0x5A,0x1C,0x6C,0x39,0x8E,0x05,0x3E, +0x6E,0xF9,0x19,0xDA,0x79,0xE9,0x00,0x79,0x0F,0x0B,0x42,0x0B,0x40,0x49,0x00,0x59, +0x10,0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01,0x0C,0x01,0x69, +0x06,0x08,0xFF,0x1A,0x69,0xF9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x39,0x8E, +0x01,0x3E,0x1E,0xF9,0x02,0x78,0x02,0x3C,0x00,0x79,0x01,0x0C,0x01,0x79,0x07,0x08, +0xFF,0x1A,0x79,0xA9,0x39,0x8E,0x01,0x3E,0x03,0x1E,0x39,0xF9,0x02,0x0B,0x2B,0x4A, +0x79,0xBF,0x00,0x1F,0x02,0x08,0x06,0x1C,0x39,0xF9,0x0C,0x4A,0x10,0x0B,0x00,0x0B, +0x2D,0x0B,0x4F,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x79,0xE9,0x01,0x0B,0x51,0x4A, +0x69,0xBF,0x1F,0xE9,0x03,0x78,0x05,0x7C,0x79,0xE9,0x02,0x0B,0x34,0x4A,0x69,0xBF, +0x00,0x1F,0x0D,0x8C,0x79,0xE9,0x02,0x0B,0x34,0x4A,0x69,0xBF,0x01,0x1F,0x0D,0x8C, +0x79,0x8E,0x01,0x3E,0x1E,0xE9,0x03,0x78,0x1B,0x7C,0x79,0xE9,0x02,0x0B,0x33,0x4A, +0x69,0xBF,0x1F,0xE9,0x09,0x1C,0x79,0xE9,0x02,0x0B,0x34,0x4A,0x69,0xBF,0x1F,0xE9, +0x02,0x1C,0x01,0x79,0x0E,0x0C,0x0C,0x0C,0x79,0xE9,0x02,0x0B,0x2B,0x4A,0x69,0xBF, +0x1F,0xE9,0x04,0x1C,0x79,0x8E,0x58,0x3E,0x6E,0xE9,0x02,0x5C,0x01,0x79,0x01,0x0C, +0x00,0x79,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xA0,0x0B,0xDC,0x3F,0x6F,0xD9,0x13,0x1C, +0x79,0xD9,0x48,0x4A,0x59,0xE9,0x69,0x8E,0x18,0x3E,0x1E,0xD9,0x0C,0x1C,0x69,0x8E, +0x1B,0x3E,0x1E,0xD9,0x08,0x5C,0x79,0x8E,0x70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B,0x0A,0x0B,0xAA,0x3D, +0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xC4,0x3F,0x0F,0xF9,0x01,0x5A,0x79,0xAF,0x10,0x0B, +0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x10,0x0B,0x00,0x0B, +0x0A,0x0B,0xAA,0x3D,0x39,0xF9,0xFF,0x1A,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0xC5,0x3F, +0x0F,0xE9,0x79,0xCA,0x69,0xAF,0x10,0x0B,0x00,0x0B,0x0A,0x0B,0xBC,0x3D,0x0D,0xB9, +0x0D,0x8C,0x79,0x8E,0x01,0x3E,0x6E,0xD9,0x69,0x9A,0x02,0x5C,0x00,0x59,0x01,0x0C, +0x01,0x59,0x05,0x08,0xFF,0x1A,0x59,0xF9,0x0D,0x8C,0x79,0xE9,0xFF,0x1A,0x01,0x78, +0x05,0x3C,0x02,0x78,0x05,0x3C,0x04,0x78,0x05,0x3C,0x00,0x0C,0x01,0x79,0x03,0x0C, +0x02,0x79,0x01,0x0C,0x03,0x79,0x0D,0x8C,0x79,0xE9,0xFF,0x1A,0x01,0x78,0x05,0x3C, +0x02,0x78,0x05,0x3C,0x03,0x78,0x05,0x3C,0x00,0x0C,0x01,0x79,0x03,0x0C,0x02,0x79, +0x01,0x0C,0x04,0x79,0x0D,0x8C,0x79,0xE9,0xFF,0x1A,0x15,0x78,0x1D,0x3C,0x16,0x78, +0x0F,0x3C,0x17,0x78,0x15,0x3C,0x18,0x78,0x1B,0x3C,0x1B,0x78,0x0B,0x3C,0x1C,0x78, +0x0D,0x3C,0x1F,0x78,0x0F,0x3C,0x20,0x78,0x11,0x3C,0x21,0x78,0x05,0x3C,0x12,0x0C, +0x01,0x79,0x11,0x0C,0x02,0x79,0x0F,0x0C,0x05,0x79,0x0D,0x0C,0x03,0x79,0x0B,0x0C, +0x00,0x79,0x09,0x0C,0x04,0x79,0x07,0x0C,0x07,0x79,0x05,0x0C,0x0B,0x79,0x03,0x0C, +0x09,0x79,0x01,0x0C,0xFF,0x79,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0x79,0xB9,0x69,0x89,0x39,0xBF,0x1F,0xF9,0x71,0x1C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x34,0x79,0x09,0xE9,0x39,0x8E,0x02,0x3E,0x1E,0xD9,0x10,0x0B,0x00,0x0B,0xFA,0x0B, +0xFB,0x3D,0x79,0xA9,0x07,0x08,0xFF,0x1A,0x10,0x1C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x34,0x79,0x09,0xE9,0x39,0x8E,0x02,0x3E,0x1E,0xD9,0x10,0x0B,0x00,0x0B,0xA1,0x0B, +0xE6,0x3D,0x79,0x99,0x07,0x08,0xFF,0x1A,0x26,0x5C,0x20,0x0B,0x02,0x0B,0xCE,0x0B, +0x39,0x3F,0x1F,0xF9,0x01,0x69,0x07,0x08,0x04,0x1C,0x79,0xED,0x06,0x08,0x2A,0x8A, +0xFD,0x4D,0x20,0x0B,0x02,0x0B,0xC6,0x0B,0x20,0x3F,0x06,0x08,0x9F,0x9A,0x01,0x1C, +0x3D,0x0C,0x39,0x8E,0x02,0x3E,0x1E,0xF9,0x07,0x5C,0x39,0xF9,0x0C,0x69,0x10,0x0B, +0x00,0x0B,0xB0,0x0B,0xED,0x3D,0x06,0x0C,0x39,0xF9,0x0C,0x69,0x10,0x0B,0x00,0x0B, +0x8E,0x0B,0x8D,0x3D,0x2B,0x0C,0x29,0xF9,0xFF,0x1A,0x1E,0x78,0x04,0x3C,0x19,0xF9, +0xFF,0x1A,0x1E,0x78,0x12,0x7C,0x39,0x8E,0x02,0x3E,0x1E,0xF9,0x07,0x5C,0x39,0xF9, +0x0E,0x69,0x10,0x0B,0x00,0x0B,0xB0,0x0B,0xED,0x3D,0x06,0x0C,0x39,0xF9,0x0E,0x69, +0x10,0x0B,0x00,0x0B,0x8E,0x0B,0x8D,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0x9D,0x3E,0x89,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0x79,0xA9,0x69,0xB9,0x00,0x2B,0x59,0xE9, +0x20,0x0B,0x02,0x0B,0xCF,0x0B,0x68,0x79,0x00,0x2B,0x79,0xF9,0x1D,0xF9,0x38,0x4A, +0x29,0xE9,0x10,0x0B,0x00,0x0B,0xCE,0x0B,0x9F,0x3D,0x1D,0xF9,0x3C,0x4A,0x79,0xBF, +0x1F,0xF9,0x0B,0x4C,0x06,0x5A,0x09,0x2C,0x1D,0xF9,0x3C,0x4A,0x79,0xBF,0x1F,0xF9, +0x26,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x2C,0x00,0x79,0x73,0x0C,0x29,0xF9, +0x08,0x4A,0x79,0x89,0x1D,0xF9,0x3C,0x4A,0x79,0xBF,0x1F,0xF9,0x06,0x5A,0xFF,0x1A, +0x79,0x99,0x1D,0xF9,0x38,0x4A,0x79,0xBF,0x1F,0xF9,0x00,0x78,0x09,0x3C,0x01,0x78, +0x0B,0x3C,0x02,0x78,0x0E,0x3C,0x04,0x78,0x10,0x3C,0x06,0x78,0x12,0x3C,0x15,0x0C, +0x39,0x8E,0x0A,0x3E,0x00,0x1E,0x13,0x0C,0x39,0x8E,0x0A,0x3E,0x01,0x1E,0x00,0x19, +0x0E,0x0C,0x39,0x8E,0x0A,0x3E,0x03,0x1E,0x0A,0x0C,0x39,0x8E,0x0A,0x3E,0x04,0x1E, +0x06,0x0C,0x39,0x8E,0x0A,0x3E,0x02,0x1E,0x02,0x0C,0x00,0x79,0x43,0x0C,0x39,0x8E, +0x01,0x3E,0x09,0xEE,0x39,0x8E,0x08,0x3E,0x19,0x9E,0x29,0x8E,0x27,0x3E,0x1E,0xF9, +0x39,0x8E,0x09,0x3E,0x79,0x9E,0x29,0xF9,0xF9,0xE9,0x01,0x59,0x1D,0xC9,0x18,0x4A, +0x10,0x0B,0x00,0x0B,0x1A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,0x39,0x8E,0x12,0x3E,0x69,0xEE,0x20,0x0B,0x02,0x0B,0xC5,0x0B,0x1C,0x3F, +0x6F,0xF9,0x39,0x8E,0x02,0x3E,0x6E,0xE9,0x79,0xBA,0x39,0x8E,0x13,0x3E,0x69,0xEE, +0x39,0x8E,0x28,0x3E,0x57,0x4E,0x20,0x0B,0x02,0x0B,0xCE,0x0B,0x9A,0x3F,0x0F,0x87, +0x06,0x6C,0x39,0x8E,0x28,0x3E,0x4E,0xF9,0x39,0x8E,0x29,0x3E,0x79,0xCE,0x20,0x0B, +0x02,0x0B,0xCE,0x0B,0x9A,0x3F,0x0F,0x97,0x05,0x6C,0x39,0x8E,0x15,0x3E,0xAE,0xF9, +0x20,0x2A,0x79,0xFE,0x20,0x0B,0x02,0x0B,0xC9,0x0B,0x3C,0x3F,0x1F,0xF9,0x29,0x8E, +0x21,0x3E,0x79,0x9E,0x10,0x0B,0x00,0x0B,0xBB,0x0B,0x7F,0x79,0x29,0x8E,0x04,0x3E, +0x79,0xEE,0x10,0x0B,0x00,0x0B,0xBC,0x0B,0x44,0x79,0x29,0x8E,0x05,0x3E,0x79,0xEE, +0x10,0x0B,0x00,0x0B,0xBD,0x0B,0x0C,0x79,0x29,0x8E,0x06,0x3E,0x79,0xEE,0x10,0x0B, +0x00,0x0B,0xBD,0x0B,0x1C,0x79,0x29,0x8E,0x07,0x3E,0x79,0xEE,0x2D,0x79,0x10,0x0B, +0x00,0x0B,0x09,0x0B,0x94,0x3D,0x29,0xBF,0x79,0xEF,0x07,0x08,0x00,0x5C,0x20,0x0B, +0x02,0x0B,0xCE,0x0B,0x98,0x3F,0x1F,0xF9,0x00,0x78,0x0E,0x3C,0x01,0x78,0x01,0x3C, +0x0B,0x0C,0x2D,0x79,0x10,0x0B,0x00,0x0B,0x09,0x0B,0x94,0x3D,0x29,0x8E,0x02,0x3E, +0x79,0xEE,0x07,0x08,0x00,0x5C,0x01,0x0C,0x00,0x0C,0x20,0x0B,0x02,0x0B,0xCE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0x8E,0x4A,0x3E,0x00,0x6E,0x05,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B, +0xA7,0x3D,0x29,0x8E,0x4C,0x3E,0x6E,0xF9,0x79,0xB9,0x29,0x8E,0x4C,0x3E,0x00,0x6E, +0x05,0x1C,0x39,0xF9,0x10,0x0B,0x00,0x0B,0x09,0x0B,0xA7,0x3D,0x0D,0xA9,0x0D,0xB9, +0x0D,0x8C,0x25,0x69,0x0C,0x0C,0x06,0x08,0x01,0x4A,0xFF,0x1A,0x69,0xD9,0xFF,0x1A, +0x28,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x02,0x2C,0x25,0x79,0x0F,0x0C,0x69,0xD9, +0xFF,0x1A,0x25,0x5A,0x01,0x49,0x05,0x08,0x04,0x1C,0x59,0xED,0x04,0x08,0x2A,0x8A, +0xFD,0x4D,0x79,0xD9,0xFF,0x1A,0x49,0x9A,0xE6,0x1C,0x69,0xF9,0x0D,0x8C,0x69,0xD9, +0xFF,0x1A,0x02,0x5C,0x25,0x79,0x19,0x0C,0x07,0x08,0x01,0x4A,0xFF,0x1A,0x79,0xD9, +0xFF,0x1A,0x28,0x5A,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x01,0x2C,0x25,0x79,0x79,0xD9, +0xFF,0x1A,0x25,0x5A,0x01,0x49,0x05,0x08,0x04,0x1C,0x59,0xED,0x04,0x08,0x2A,0x8A, +0xFD,0x4D,0x69,0xD9,0xFF,0x1A,0x49,0x9A,0xE7,0x1C,0x0D,0x8C,0x09,0x6D,0x00,0x0D, +0xFE,0x4D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0xA9,0x49,0x89, +0x59,0x99,0x1D,0xF9,0x12,0x4A,0x79,0xBF,0x05,0x1F,0x1D,0xF9,0x13,0x4A,0x79,0xBF, +0x39,0x9F,0x1D,0xF9,0x14,0x4A,0x79,0xBF,0x39,0x9F,0x1D,0xF9,0x19,0x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,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0x79,0x8E,0x42,0x3E,0x00,0x2B,0x1E,0xF9,0xF9,0xC9, +0x79,0x8E,0x11,0x3E,0x00,0x2B,0x6E,0xF9,0xF9,0x89,0x79,0x8E,0x40,0x3E,0x00,0x2B, +0x1E,0xF9,0x05,0x5C,0x00,0x79,0x10,0x0B,0x01,0x0B,0x0F,0x0B,0x40,0x0C,0x00,0x29, +0x10,0x0B,0x01,0x0B,0x0F,0x0B,0x30,0x0C,0x00,0x2B,0x29,0xF9,0xFF,0x1A,0x00,0x2B, +0x01,0x69,0x0F,0x08,0x04,0x1C,0xF9,0xED,0x0E,0x08,0x2A,0x8A,0xFD,0x4D,0x0E,0x08, +0x09,0x9A,0x10,0x0B,0x01,0x0B,0x0F,0x0B,0x2D,0x1C,0x00,0x2B,0x29,0xF9,0xFF,0x1A, +0x3A,0x8A,0x2A,0x8A,0x79,0xCA,0xF9,0xBF,0x00,0x2B,0x6F,0xE9,0x00,0x2B,0x6F,0xF9, +0x0E,0x08,0x59,0xF8,0x10,0x0B,0x01,0x0B,0x0F,0x0B,0x2D,0x7C,0x0F,0x08,0x69,0xF8, +0x7C,0x7C,0x00,0x2B,0x29,0xF9,0xFF,0x1A,0x00,0x2B,0x49,0xE9,0xFF,0x1A,0x0F,0x08, +0xE9,0xF8,0x71,0x3C,0x00,0x2B,0x29,0xF9,0xFF,0x1A,0xF9,0xB9,0x07,0x78,0x04,0x3C, +0x00,0x2B,0x39,0xF9,0x01,0x4A,0x02,0x0C,0x00,0x2B,0x00,0x79,0xF9,0x99,0x34,0x0C, +0x00,0x2B,0x01,0x79,0x01,0x08,0x04,0x1C,0x19,0xED,0x0F,0x08,0x2A,0x8A,0xFD,0x4D, +0x0F,0x08,0x09,0x9A,0x0D,0x5C,0x00,0x2B,0x01,0x79,0x03,0x08,0x04,0x1C,0x39,0xED, +0x0F,0x08,0x2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0x49,0x99, +0x3A,0x8A,0x69,0xCA,0x19,0xBF,0x6F,0x99,0x49,0x89,0x3A,0x8A,0x59,0xCA,0x09,0xBF, +0x6F,0x89,0x19,0xCA,0x39,0xCA,0x09,0xA9,0x49,0x99,0x3A,0x8A,0x69,0xCA,0x19,0xBF, +0x6F,0x99,0x29,0xF8,0x0C,0x3C,0x29,0x99,0x49,0x89,0x3A,0x8A,0x69,0xCA,0x09,0xBF, +0x01,0x08,0x9F,0xDA,0x02,0x2C,0x00,0x19,0x01,0x0C,0x01,0x19,0x19,0xB9,0x49,0x99, +0x3A,0x8A,0x79,0xCA,0x19,0xBF,0x29,0xEF,0x04,0x08,0x01,0x4A,0x49,0x99,0x08,0x5A, +0xD6,0x2C,0x39,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x09,0x8D,0x00,0x39,0x00,0x49,0x49,0x99,0x3A,0x8A,0x69,0xCA, +0x19,0xBF,0x6F,0x99,0x49,0x89,0x3A,0x8A,0x59,0xCA,0x09,0xBF,0x01,0x08,0x9F,0xDA, +0x39,0xDA,0x19,0xA9,0x49,0x99,0x3A,0x8A,0x69,0xCA,0x19,0xBF,0x6F,0x99,0x29,0xF8, +0x0B,0x3C,0x49,0x99,0x3A,0x8A,0x69,0xCA,0x19,0xBF,0x6F,0x99,0x29,0xDA,0x02,0x2C, +0x00,0x19,0x01,0x0C,0x01,0x19,0x19,0xB9,0x49,0x99,0x3A,0x8A,0x79,0xCA,0x19,0xBF, +0x29,0xEF,0x04,0x08,0x01,0x4A,0x49,0x99,0x08,0x5A,0xD7,0x2C,0x39,0xF9,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D,0xB9,0x8D,0x00,0x2B,0x79,0xD9,0x00,0x2B, +0x69,0xC9,0x00,0x2B,0x59,0xF9,0x00,0x2B,0x49,0xE9,0x1D,0x8E,0x0A,0x3E,0x00,0x2B, +0x6E,0xB9,0xD9,0xF9,0xC9,0xE9,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x0E,0x3D,0x69,0x89, +0x79,0x99,0xE9,0xBF,0x6F,0xF9,0x79,0xE9,0x00,0x79,0x20,0x6D,0x06,0x08,0x2A,0x8A, +0x07,0x08,0x5A,0x8A,0xFB,0x4D,0xF9,0xBF,0x6F,0xD9,0x59,0xC9,0x00,0x59,0x04,0x08, +0x69,0xAA,0x05,0x08,0x79,0xAA,0x49,0xA9,0x59,0xB9,0x02,0x08,0x09,0xCA,0x03,0x08, +0x19,0xEA,0x39,0xF9,0x29,0xE9,0x09,0xDA,0x07,0x08,0x19,0xFA,0x02,0x2C,0x00,0x79, +0x01,0x0C,0x01,0x79,0xB9,0xBF,0x9F,0xE9,0x79,0xCA,0x69,0xFF,0x39,0xF9,0x29,0xE9, +0x79,0xE9,0x00,0x79,0xE9,0xBF,0x69,0xEF,0xF9,0xBF,0x29,0xEF,0x00,0x2B,0x0D,0xB9, +0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x00,0x0D,0x00,0x0D,0x00,0x0D, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0x99,0x69,0x89,0x00,0x2B, +0x59,0xF9,0x1D,0x8E,0x07,0x3E,0x00,0x6E,0x1D,0x8E,0x06,0x3E,0x00,0x6E,0x1D,0x8E, +0x05,0x3E,0x00,0x6E,0x00,0x39,0x00,0x29,0x19,0x0C,0x1D,0xF9,0x14,0x4A,0x79,0x8D, +0x29,0xF9,0x3A,0x8A,0x09,0xCA,0x79,0xBF,0x6F,0xF9,0x39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0x1C,0x1D,0x8E,0x0C,0x3E, +0xAE,0xF9,0x80,0x0B,0x00,0x0B,0x00,0x0B,0x00,0x2A,0x79,0xFE,0x1D,0xF9,0x74,0x4A, +0x1D,0xE9,0x54,0x4A,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x39,0x3D,0x79,0x99,0x07,0x08, +0x10,0x0B,0x01,0x0B,0x15,0x0B,0x99,0x5C,0x09,0xF9,0x1D,0xE9,0x34,0x4A,0x10,0x0B, +0x01,0x0B,0x10,0x0B,0x26,0x3D,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x09,0xBE,0x1D,0x89,0x80,0x4A,0x09,0x9D,0x3E,0x89,0x0D,0x8C,0x39,0x8D, +0x79,0xB9,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x00,0x3D,0x07,0x08,0x08,0x1C, +0x39,0xF9,0x20,0x4A,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x00,0x3D,0x07,0x08,0x02,0x5C, +0x00,0x79,0x01,0x0C,0x01,0x79,0x0D,0xB9,0x0D,0x8C,0x09,0xBE,0x1D,0x89,0x40,0x5A, +0x09,0x9D,0x3E,0x89,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xB9,0x69,0x99, +0x59,0xA9,0x29,0xF9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x00,0x3D,0x07,0x08,0x04,0x1C, +0x10,0x0B,0x01,0x0B,0x17,0x0B,0xBD,0x0C,0x1D,0xF9,0x30,0x4A,0x19,0xE9,0x10,0x0B, +0x01,0x0B,0x15,0x0B,0x3B,0x3D,0x1D,0xF9,0x10,0x4A,0x39,0xE9,0x1D,0xD9,0x30,0x4A, +0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D,0x1D,0xF9,0x30,0x4A,0x1D,0xE9,0x30,0x4A, +0x10,0x0B,0x01,0x0B,0x15,0x0B,0x3B,0x3D,0x19,0xF9,0x19,0xE9,0x29,0xD9,0x10,0x0B, +0x01,0x0B,0x15,0x0B,0x18,0x3D,0x29,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x15,0x0B, +0x3B,0x3D,0x39,0xF9,0x39,0xE9,0x29,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x12,0x0B,0xE1,0x3D,0x29,0xF9,0x29,0xE9,0x29,0xD9,0x20,0x0B, +0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x12,0x0B,0xE1,0x3D,0x29,0xF9, +0x39,0xE9,0x29,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B, +0x13,0x0B,0x0A,0x3D,0x39,0xF9,0x39,0xE9,0x29,0xD9,0x10,0x0B,0x01,0x0B,0x15,0x0B, +0x18,0x3D,0x29,0xF9,0x39,0xE9,0x39,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x12,0x0B,0xE1,0x3D,0x39,0xF9,0x39,0xE9,0x29,0xD9,0x20,0x0B, +0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x12,0x0B,0xE1,0x3D,0x39,0xF9, +0x00,0x69,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x10,0x3D,0x07,0x08,0x1E,0x1C,0x39,0xF9, +0x39,0xE9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x59,0x10,0x0B,0x01,0x0B,0x10,0x0B, +0x89,0x3D,0x79,0x89,0x39,0xF9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x60,0x3D,0x09,0xF9, +0x4A,0xCA,0x8A,0xCA,0x6A,0x8A,0x6A,0x8A,0x6A,0x8A,0x3A,0x8A,0x2A,0x8A,0x39,0x8E, +0x07,0x3E,0xAE,0xE9,0x79,0xAA,0x69,0xFE,0x05,0x0C,0x39,0xF9,0x10,0x0B,0x01,0x0B, +0x10,0x0B,0x60,0x3D,0x29,0xF9,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x3B,0x3D, +0x29,0xF9,0x29,0xE9,0x1D,0xD9,0x10,0x4A,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x29,0xF9,0x29,0xE9,0x1D,0xD9,0x10,0x4A, +0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D, +0x1D,0xF9,0x10,0x4A,0x1D,0xE9,0x10,0x4A,0x29,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x39,0xF9,0x39,0xE9,0x1D,0xD9, +0x10,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D,0x1D,0xF9,0x30,0x4A,0x39,0xE9, +0x1D,0xD9,0x30,0x4A,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B, +0x13,0x0B,0x0A,0x3D,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x26,0x3D, +0x29,0xF9,0x19,0xE9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x26,0x3D,0x19,0xF9,0x1D,0xE9, +0x30,0x4A,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x26,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x09,0xBE,0x1D,0x89,0x40,0x4A,0x09,0x9D,0x3E,0x89,0x0D,0x8C,0x08,0x6D, +0x00,0x0D,0xFE,0x4D,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xB9,0x69,0xA9,0x59,0x99, +0x1D,0xF9,0x0C,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08,0x6D,0x0D,0xA8, +0xFE,0x4D,0x0D,0x8C,0x08,0x6D,0x00,0x0D,0xFE,0x4D,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0x99,0x69,0x89,0x59,0xB9,0x49,0xA9,0x1D,0xF9,0x10,0x4A,0x39,0xE9, +0x19,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B, +0x0A,0x3D,0x1D,0xF9,0x10,0x4A,0x1D,0xE9,0x10,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B, +0x3B,0x3D,0x19,0xF9,0x19,0xE9,0x1D,0xD9,0x10,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B, +0x18,0x3D,0x39,0xF9,0x39,0xE9,0x1D,0xD9,0x10,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B, +0x18,0x3D,0x29,0xF9,0x29,0xE9,0x09,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x10,0x4A,0x29,0xE9,0x10,0x0B, +0x01,0x0B,0x15,0x0B,0x3B,0x3D,0x1D,0xF9,0x10,0x4A,0x1D,0xE9,0x10,0x4A,0x19,0xD9, +0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D, +0x1D,0xF9,0x10,0x4A,0x1D,0xE9,0x10,0x4A,0x39,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x39,0xF9,0x39,0xE9,0x19,0xD9, +0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D, +0x09,0xF9,0x09,0xE9,0x39,0xD9,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D,0x39,0xF9, +0x19,0xE9,0x1D,0xD9,0x10,0x4A,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B, +0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x29,0xF9,0x29,0xE9,0x39,0xD9,0x10,0x0B,0x01,0x0B, +0x15,0x0B,0x18,0x3D,0x29,0xF9,0x29,0xE9,0x09,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x39,0xF9,0x1D,0xE9,0x10,0x4A, +0x10,0x0B,0x01,0x0B,0x10,0x0B,0x26,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9, +0x08,0x6D,0x0D,0xA8,0xFE,0x4D,0x0D,0x8C,0x09,0xBE,0x1D,0x89,0x60,0x5A,0x09,0x9D, +0x3E,0x89,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0x89,0x59,0xB9, +0x49,0x99,0x1D,0xF9,0x50,0x4A,0x39,0xE9,0x29,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x50,0x4A,0x1D,0xE9, +0x50,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x3B,0x3D,0x29,0xF9,0x29,0xE9,0x1D,0xD9, +0x50,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D,0x39,0xF9,0x39,0xE9,0x1D,0xD9, +0x50,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D,0x1D,0xF9,0x50,0x4A,0x19,0xE9, +0x09,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x12,0x0B, +0xE1,0x3D,0x19,0xF9,0x19,0xE9,0x09,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x30,0x4A,0x39,0xE9,0x29,0xD9, +0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D, +0x09,0xF9,0x09,0xE9,0x1D,0xD9,0x30,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x18,0x3D, +0x1D,0xF9,0x30,0x4A,0x29,0xE9,0x39,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49, +0x10,0x0B,0x01,0x0B,0x12,0x0B,0xE1,0x3D,0x39,0xF9,0x19,0xE9,0x10,0x0B,0x01,0x0B, +0x15,0x0B,0x3B,0x3D,0x39,0xF9,0x39,0xE9,0x1D,0xD9,0x30,0x4A,0x20,0x0B,0x02,0x0B, +0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x10,0x4A, +0x29,0xE9,0x39,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B,0x01,0x0B, +0x13,0x0B,0x0A,0x3D,0x19,0xF9,0x19,0xE9,0x1D,0xD9,0x10,0x4A,0x10,0x0B,0x01,0x0B, +0x15,0x0B,0x18,0x3D,0x19,0xF9,0x19,0xE9,0x09,0xD9,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x10,0x4A,0x1D,0xE9, +0x50,0x4A,0x10,0x0B,0x01,0x0B,0x15,0x0B,0x3B,0x3D,0x1D,0xF9,0x10,0x4A,0x1D,0xE9, +0x10,0x4A,0x1D,0xD9,0x30,0x4A,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x08,0x49,0x10,0x0B, +0x01,0x0B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D,0x39,0xF9, +0x64,0x4A,0x19,0xE9,0x20,0x4A,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x26,0x3D,0xE9,0x8D, +0x39,0xF9,0x24,0x4A,0x39,0xE9,0x64,0x4A,0x39,0xD9,0x04,0x4A,0x39,0xC9,0x44,0x4A, +0x10,0x0B,0x01,0x0B,0x17,0x0B,0xF7,0x3D,0x0D,0xA8,0xD9,0xF9,0x02,0x5A,0x39,0x8E, +0x21,0x3E,0x79,0xEE,0x39,0xBF,0x01,0x1F,0x00,0x79,0x10,0x0B,0x01,0x0B,0x1B,0x0B, +0x40,0x0C,0x09,0xF9,0x39,0x8E,0x21,0x3E,0x6E,0xE9,0x10,0x0B,0x01,0x0B,0x10,0x0B, +0x10,0x3D,0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0xA9,0x01,0x79, +0x29,0xDA,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x04,0x4A,0x01,0x69,0x29,0xDA,0x6A,0x8A, +0x2A,0x8A,0x39,0xCA,0x44,0x4A,0x29,0xD9,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x04,0x4A, +0x29,0xC9,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x44,0x4A,0x10,0x0B,0x01,0x0B,0x18,0x0B, +0xDC,0x3D,0x39,0xBF,0x02,0x1F,0x00,0x79,0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x40,0x0C, +0x09,0xF9,0x39,0x8E,0x21,0x3E,0x6E,0xE9,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x10,0x3D, +0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0xA9,0x29,0xF9,0x6A,0x8A, +0x2A,0x8A,0x39,0xCA,0x04,0x4A,0x29,0xE9,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x44,0x4A, +0x01,0x59,0x29,0xDA,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x04,0x4A,0x01,0x49,0x29,0xDA, +0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x44,0x4A,0x10,0x0B,0x01,0x0B,0x18,0x0B,0x42,0x3D, +0x39,0x8E,0x21,0x3E,0xAE,0xF9,0x01,0x5A,0x79,0xFE,0x39,0x8E,0x21,0x3E,0x6E,0xF9, +0x01,0x4C,0x02,0x5C,0x03,0x79,0x01,0x0C,0x01,0x79,0x07,0x08,0xFF,0x1A,0x39,0xBF, +0x79,0x9F,0x00,0x79,0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x40,0x0C,0x09,0xF9,0x00,0x69, +0x10,0x0B,0x01,0x0B,0x10,0x0B,0x10,0x3D,0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C, +0x01,0x79,0x79,0xA9,0x01,0x79,0x29,0xDA,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x04,0x4A, +0x01,0x69,0x29,0xDA,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x44,0x4A,0x29,0xD9,0x6A,0x8A, +0x2A,0x8A,0x39,0xCA,0x04,0x4A,0x29,0xC9,0x6A,0x8A,0x2A,0x8A,0x39,0xCA,0x44,0x4A, +0x10,0x0B,0x01,0x0B,0x18,0x0B,0xDC,0x3D,0x39,0xBF,0x04,0x1F,0x00,0x79,0x10,0x0B, +0x01,0x0B,0x1B,0x0B,0x40,0x0C,0x09,0xF9,0x00,0x69,0x10,0x0B,0x01,0x0B,0x10,0x0B, +0x10,0x3D,0x07,0x08,0x02,0x1C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0xA9,0x1D,0xF9, +0x1C,0x4A,0x39,0xE9,0x24,0x4A,0x39,0xD9,0x04,0x4A,0x20,0x0B,0x02,0x0B,0xA1,0x0B, +0x08,0x49,0x10,0x0B,0x01,0x0B,0x13,0x0B,0x0A,0x3D,0x1D,0xF9,0x1C,0x4A,0x1D,0xE9, +0x1C,0x4A,0x01,0x59,0x29,0xDA,0x6A,0x8A,0x2A,0x8A,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x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x79,0xB9,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xEC,0x79,0x00,0x69,0x01,0x0B, +0x78,0x59,0x10,0x0B,0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x20,0x0B,0x02,0x0B,0xCF,0x0B, +0xEC,0x3F,0x00,0x1F,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xF0,0x79,0x39,0xE9,0xBD,0x3D, +0x0D,0xB9,0x0D,0x8C,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xEC,0x3F,0x1F,0xF9,0x00,0x78, +0x10,0x3C,0x01,0x78,0x72,0x3C,0x02,0x78,0x10,0x0B,0x01,0x0B,0x1C,0x0B,0x75,0x3C, +0x03,0x78,0x10,0x0B,0x01,0x0B,0x1C,0x0B,0x8D,0x3C,0x10,0x0B,0x01,0x0B,0x1C,0x0B, +0x8D,0x0C,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xF0,0x79,0x10,0x0B,0x01,0x0B,0x10,0x0B, +0x00,0x3D,0x07,0x08,0x05,0x1C,0x00,0x79,0x10,0x0B,0x01,0x0B,0x1C,0x0B,0x8E,0x0C, +0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x68,0x79,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xF0,0x69, +0x10,0x0B,0x01,0x0B,0x10,0x0B,0x39,0x3D,0x07,0x08,0x01,0x78,0x05,0x3C,0x00,0x79, +0x10,0x0B,0x01,0x0B,0x1C,0x0B,0x8E,0x0C,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x90,0x3F, +0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x50,0x6F,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x94,0x3F, +0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x70,0x6F,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x50,0x79, +0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xF0,0x69,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x68,0x59, +0x10,0x0B,0x01,0x0B,0x10,0x0B,0x89,0x3D,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x98,0x3F, +0x79,0xEF,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x70,0x79,0x20,0x0B,0x02,0x0B,0xD0,0x0B, +0x50,0x69,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x68,0x59,0x10,0x0B,0x01,0x0B,0x10,0x0B, +0x89,0x3D,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x9C,0x3F,0x00,0x1F,0x20,0x0B,0x02,0x0B, +0xCF,0x0B,0xEC,0x3F,0x01,0x1F,0x00,0x79,0x49,0x0C,0x01,0x0B,0x01,0x0D,0x00,0x0D, +0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x98,0x3F,0x6F,0xF9,0x02,0x1C,0x00,0x79,0x01,0x0C, +0x01,0x79,0x07,0x08,0x3A,0x8A,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x90,0x4A,0x79,0xBF, +0x6F,0xF9,0x79,0xC9,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x9C,0x79,0x20,0x0B,0x02,0x0B, +0xD0,0x0B,0x10,0x69,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x28,0x59,0x10,0x0B,0x01,0x0B, +0x19,0x0B,0xBF,0x3D,0x0D,0xA8,0x0D,0xA8,0x07,0x08,0x05,0x1C,0x20,0x0B,0x02,0x0B, +0xCF,0x0B,0xEC,0x3F,0x02,0x1F,0x00,0x79,0x19,0x0C,0x20,0x0B,0x02,0x0B,0xD0,0x0B, +0x10,0x79,0x10,0x0B,0x01,0x0B,0x16,0x0B,0xAF,0x3D,0x07,0x08,0x07,0x1C,0x20,0x0B, +0x02,0x0B,0xCF,0x0B,0xEC,0x3F,0x00,0x1F,0x00,0x79,0x08,0x0C,0x20,0x0B,0x02,0x0B, +0xCF,0x0B,0xEC,0x3F,0x03,0x1F,0x01,0x79,0x01,0x0C,0x01,0x79,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x79,0xB9,0x69,0xA9,0x29,0xF9,0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xF0,0x69, +0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x4E,0x3D,0x39,0xF9,0x20,0x0B,0x02,0x0B,0xD0,0x0B, +0x10,0x69,0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x4E,0x3D,0x39,0xF9,0x20,0x4A,0x20,0x0B, +0x02,0x0B,0xD0,0x0B,0x30,0x69,0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x4E,0x3D,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0xA9,0x69,0x99, +0x20,0x0B,0x02,0x0B,0xCF,0x0B,0xEC,0x79,0x00,0x69,0x01,0x0B,0x78,0x59,0x10,0x0B, +0x01,0x0B,0x4D,0x0B,0x24,0x3D,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x0C,0x3F,0x00,0x6F, +0x00,0x39,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x88,0x3F,0x6F,0xF9,0x79,0x89,0x20,0x0B, +0x02,0x0B,0xCF,0x0B,0xEC,0x79,0x20,0x69,0x09,0xBD,0x07,0x08,0x13,0x1C,0x20,0x0B, +0x02,0x0B,0xCF,0x0B,0xEC,0x79,0x10,0x0B,0x01,0x0B,0x10,0x0B,0x00,0x3D,0x07,0x08, +0x09,0x5C,0x20,0x0B,0x02,0x0B,0xD0,0x0B,0x0C,0x3F,0x20,0x0B,0x02,0x0B,0xCF,0x0B, +0xEC,0x6F,0x05,0x0C,0x03,0x08,0x01,0x4A,0x39,0xF9,0x40,0x5A,0xDA,0x2C,0x20,0x0B, +0x02,0x0B,0xD0,0x0B,0x90,0x79,0x19,0xE9,0x10,0x0B,0x01,0x0B,0x1B,0x0B,0x85,0x3D, +0x20,0x0B,0x02,0x0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0B,0x05,0x0B,0x30,0x0B,0x54,0x3F, +0x0C,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x56,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B, +0x30,0x0B,0x58,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x5A,0x3F,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x30,0x0B,0x5C,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B, +0x66,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x68,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0x6A,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x6C,0x3F, +0x00,0x4F,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xDE,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0xE0,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xE2,0x3F,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0xE4,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0xEE,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xF0,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x80,0x0B,0xF2,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xF4,0x3F, +0x00,0x4F,0x0D,0x8C,0x39,0x8D,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x04,0x3F,0x03,0x4F, +0x3D,0x39,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x06,0x3F,0x39,0xCF,0x00,0x39,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0x08,0x3F,0x39,0xCF,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x0A,0x3F, +0xFF,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x0C,0x3F,0x10,0x4F,0x40,0x0B,0x05,0x0B, +0x30,0x0B,0x0E,0x3F,0x80,0x4F,0x10,0x0B,0x01,0x0B,0x1D,0x0B,0xFF,0x3D,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0x98,0x3F,0x02,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B, +0x9A,0x3F,0x40,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x94,0x3F,0x02,0x0B,0x80,0x4F, +0x40,0x0B,0x05,0x0B,0x30,0x0B,0x96,0x3F,0x40,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B, +0x90,0x3F,0x02,0x0B,0x40,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x92,0x3F,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x30,0x0B,0x8C,0x3F,0x02,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B, +0x30,0x0B,0x8E,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x7A,0x3F,0x4F,0xF9, +0x79,0xB9,0x39,0xF9,0x4A,0xCA,0x00,0x2B,0x07,0x0A,0x03,0x2A,0x4A,0xCA,0x79,0xB9, +0x39,0xF9,0x4A,0xCA,0x00,0x2B,0x38,0x0A,0x4A,0xCA,0x79,0xB9,0x39,0xF9,0x4A,0xCA, +0x01,0x2B,0xC0,0x0A,0xC0,0x2A,0x4A,0xCA,0x79,0xB9,0x40,0x0B,0x05,0x0B,0x30,0x0B, +0x7A,0x3F,0x39,0xCF,0x06,0x0B,0x06,0x39,0x40,0x0B,0x05,0x0B,0x30,0x0B,0xA0,0x3F, +0x39,0xCF,0x3F,0x39,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x9C,0x3F,0x39,0xCF,0x82,0x39, +0x40,0x0B,0x05,0x0B,0x30,0x0B,0x9E,0x3F,0x39,0xCF,0x40,0x0B,0x05,0x0B,0x30,0x0B, +0xA4,0x3F,0x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B,0x05,0x0B, +0x31,0x0B,0x1C,0x3F,0xC1,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x1E,0x3F,0xAC,0x4F, +0x40,0x0B,0x05,0x0B,0x31,0x0B,0x20,0x3F,0x7B,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B, +0x22,0x3F,0x47,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x24,0x3F,0x20,0x4F,0x40,0x0B, +0x05,0x0B,0x31,0x0B,0x26,0x3F,0x0C,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x28,0x3F, +0x03,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x2A,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B, +0x31,0x0B,0x2C,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x2E,0x3F,0x0A,0x4F, +0x40,0x0B,0x05,0x0B,0x31,0x0B,0x30,0x3F,0x29,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B, +0x32,0x3F,0x16,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x34,0x3F,0x06,0x4F,0x40,0x0B, +0x05,0x0B,0x31,0x0B,0x36,0x3F,0x3D,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x38,0x3F, +0x03,0x4F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x3C,0x3F,0x1E,0x0B,0x29,0x6F,0x40,0x0B, +0x05,0x0B,0x31,0x0B,0x54,0x3F,0x00,0x4F,0x0F,0x39,0x40,0x0B,0x05,0x0B,0x31,0x0B, +0x56,0x3F,0x39,0xCF,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x58,0x3F,0x55,0x0B,0x55,0x0B, +0x55,0x6F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x5C,0x3F,0x55,0x0B,0x55,0x0B,0x55,0x6F, +0x00,0x39,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x64,0x3F,0x39,0xCF,0x00,0x39,0x39,0xF9, +0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x68,0x3F,0x79,0xEF,0x25,0x39,0x40,0x0B, +0x05,0x0B,0x31,0x0B,0x70,0x3F,0x39,0xCF,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x72,0x3F, +0x05,0x4F,0x0D,0xB9,0x0D,0x8C,0x0D,0x8C,0x40,0x0B,0x05,0x0B,0x32,0x0B,0x8E,0x3F, +0x03,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0x8C,0x3F,0x3D,0x4F,0x40,0x0B,0x05,0x0B, +0x32,0x0B,0x90,0x3F,0x1C,0x6F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0x98,0x3F,0x40,0x4F, +0x40,0x0B,0x05,0x0B,0x32,0x0B,0x94,0x3F,0x01,0x0B,0x40,0x6F,0x40,0x0B,0x05,0x0B, +0x32,0x0B,0x9A,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0x9C,0x3F,0x02,0x0B, +0x40,0x0B,0x00,0x6F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0xA0,0x3F,0x04,0x6F,0x40,0x0B, +0x05,0x0B,0x32,0x0B,0xA4,0x3F,0x04,0x0B,0x80,0x0B,0x00,0x6F,0x40,0x0B,0x05,0x0B, +0x32,0x0B,0xA8,0x3F,0x40,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0xAA,0x3F, +0x40,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0xAC,0x3F,0x40,0x0B,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x32,0x0B,0xAE,0x3F,0x40,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B, +0x32,0x0B,0xB0,0x3F,0x40,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0xB2,0x3F, +0x38,0x0B,0x00,0x4F,0x40,0x0B,0x05,0x0B,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xE8,0x3D,0x00,0x0C,0x00,0x0C,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x19,0x8D,0x79,0x99,0x0C,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D, +0x79,0xB9,0x19,0xF9,0xFF,0x1A,0x02,0x78,0x01,0x3C,0x02,0x0C,0x08,0x29,0x02,0x0C, +0x00,0x29,0x00,0x0C,0x39,0xF9,0xFF,0x1A,0x00,0x2B,0x07,0x0A,0x05,0x2A,0xFF,0x1A, +0x79,0xB9,0x39,0xF9,0xFF,0x1A,0x00,0x2B,0x08,0x0A,0x29,0xE9,0xFF,0x1A,0x08,0x1A, +0x79,0xAA,0xFF,0x1A,0x69,0xB9,0x0C,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x27,0x79,0x10,0x69, +0x00,0x59,0x10,0x0B,0x01,0x0B,0x3A,0x0B,0x70,0x3D,0x35,0x79,0xE0,0x69,0x40,0x59, +0x10,0x0B,0x01,0x0B,0x3A,0x0B,0x70,0x3D,0x10,0x0B,0x01,0x0B,0x26,0x0B,0x78,0x3D, +0x79,0xB9,0x39,0x8E,0x05,0x3E,0x4E,0xF9,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x32,0x0B, +0x88,0x3F,0x79,0xEF,0x01,0x79,0xB3,0x3D,0x10,0x0B,0x01,0x0B,0x41,0x0B,0x1E,0x3D, +0x40,0x0B,0x05,0x0B,0x81,0x0B,0x38,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B, +0xCC,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0xEC,0x3F,0x4F,0xF9,0x4A,0xCA, +0x7F,0x2B,0x80,0x0A,0x08,0x0B,0x00,0x2A,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x30,0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x3F,0xFF,0x0B,0xFF,0x0B,0xFF,0x0B,0xF0,0x4F,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0xB8,0x3F,0x06,0x6F,0x10,0x0B,0x01,0x0B,0x33,0x0B,0xC2,0x3D, +0x40,0x0B,0x05,0x0B,0x32,0x0B,0xD6,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x21,0x0B, +0x78,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x6A,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0x06,0x3F,0x8F,0xF9,0x00,0x2B,0x40,0x0A,0x79,0xDF,0x40,0x0B, +0x05,0x0B,0x81,0x0B,0x44,0x3F,0x01,0x4F,0x10,0x0B,0x01,0x0B,0x47,0x0B,0x06,0x3D, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x06,0x3F,0x0B,0x0B,0x6D,0x4F,0x40,0x0B,0x05,0x0B, +0x30,0x0B,0x08,0x3F,0x8F,0xF9,0x00,0x2B,0x01,0x0A,0x79,0xDF,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x27,0x79,0x10,0x69,0x00,0x59,0x10,0x0B,0x01,0x0B,0x3A,0x0B,0x70,0x3D, +0x35,0x79,0xE0,0x69,0x40,0x59,0x10,0x0B,0x01,0x0B,0x3A,0x0B,0x70,0x3D,0x10,0x0B, +0x01,0x0B,0x26,0x0B,0x78,0x3D,0x79,0xB9,0x39,0x8E,0x05,0x3E,0x4E,0xF9,0x4A,0xCA, +0x40,0x0B,0x05,0x0B,0x32,0x0B,0x88,0x3F,0x79,0xEF,0x03,0x79,0x10,0x0B,0x01,0x0B, +0x22,0x0B,0x8F,0x3D,0x10,0x0B,0x01,0x0B,0x41,0x0B,0x1E,0x3D,0x40,0x0B,0x05,0x0B, +0x81,0x0B,0x38,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B,0x32,0x0B,0xCC,0x3F,0x00,0x4F, +0x40,0x0B,0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0B,0x44,0x3F,0x00,0x4F, +0x10,0x0B,0x01,0x0B,0x47,0x0B,0x06,0x3D,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x06,0x3F, +0x00,0x4F,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x08,0x3F,0x8F,0xF9,0x01,0x2A,0x79,0xDF, +0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x24,0x0B,0xE8,0x3D,0x40,0x0B,0x05,0x0B, +0x20,0x0B,0x6A,0x3F,0x8F,0xF9,0x04,0x2A,0x79,0xDF,0x0D,0x8C,0x0D,0x8C,0x39,0x8D, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x04,0x3F,0x03,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B, +0x06,0x3F,0x03,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x0C,0x3F,0x30,0x0B,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x0E,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B, +0x10,0x3F,0x08,0x0B,0x00,0x0B,0x00,0x6F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x14,0x3F, +0x05,0x4F,0x08,0x39,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x16,0x3F,0x39,0xCF,0x40,0x0B, +0x05,0x0B,0x20,0x0B,0x18,0x3F,0x40,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x1A,0x3F, +0x39,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x1C,0x3F,0x29,0x4F,0x40,0x0B,0x05,0x0B, +0x20,0x0B,0x1E,0x3F,0x18,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x20,0x3F,0x0B,0x4F, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x22,0x3F,0x04,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B, +0x24,0x3F,0x01,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x26,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x20,0x0B,0x28,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x2A,0x3F, +0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x2C,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B, +0x20,0x0B,0x2E,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x30,0x3F,0x00,0x4F, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x32,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B, +0x34,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x36,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x20,0x0B,0x38,0x3F,0x02,0x0B,0x51,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B, +0x3A,0x3F,0x08,0x4F,0x0F,0x39,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x52,0x3F,0x39,0xCF, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x54,0x3F,0x55,0x0B,0x55,0x0B,0x55,0x6F,0x40,0x0B, +0x05,0x0B,0x20,0x0B,0x58,0x3F,0x55,0x0B,0x55,0x0B,0x55,0x6F,0x40,0x0B,0x05,0x0B, +0x20,0x0B,0x5C,0x3F,0x00,0x4F,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x64,0x3F,0x8E,0x0B, +0x89,0x0B,0xBE,0x0B,0xD6,0x6F,0x25,0x39,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x68,0x3F, +0x39,0xCF,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x6C,0x3F,0x05,0x4F,0x10,0x0B,0x01,0x0B, +0x25,0x0B,0xA6,0x3D,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x20,0x3F,0x00,0x4F,0x40,0x0B, +0x05,0x0B,0x81,0x0B,0x22,0x3F,0x6D,0x4F,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x24,0x3F, +0x4B,0x4F,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x26,0x3F,0x0F,0x4F,0x40,0x0B,0x05,0x0B, +0x81,0x0B,0x28,0x3F,0xFF,0x0B,0xFF,0x0B,0xFF,0x0B,0xF0,0x4F,0x0D,0xB9,0x0D,0x8C, +0x10,0x0B,0x01,0x0B,0x22,0x0B,0x3F,0x3D,0x0E,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x07,0x08,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0x80,0x4A,0x0D,0x8C,0x39,0x8D, +0x79,0xB9,0x39,0xF9,0x28,0x5A,0x41,0x6C,0x40,0x0B,0x05,0x0B,0x20,0x0B,0x68,0x3F, +0x4F,0xF9,0x4A,0xCA,0x00,0x2B,0x3F,0x0A,0x39,0xE9,0x3F,0x1A,0x79,0xAA,0x4A,0xCA, +0x40,0x0B,0x05,0x0B,0x20,0x0B,0x68,0x3F,0x69,0xCF,0x40,0x0B,0x05,0x0B,0x31,0x0B, +0x70,0x3F,0x4F,0xF9,0x4A,0xCA,0x00,0x2B,0x3F,0x0A,0x39,0xE9,0x3F,0x1A,0x79,0xAA, +0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x70,0x3F,0x69,0xCF,0x39,0xF9,0x0B,0x5A, +0x03,0x6C,0x03,0x08,0x01,0x4A,0x14,0x0C,0x39,0xF9,0x25,0x5A,0x03,0x6C,0x03,0x08, +0x02,0x4A,0x0E,0x0C,0x03,0x08,0x25,0x78,0x02,0x7C,0x00,0x39,0x09,0x0C,0x03,0x08, +0x26,0x78,0x02,0x7C,0x0C,0x39,0x04,0x0C,0x03,0x08,0x27,0x78,0x01,0x7C,0x27,0x39, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x3A,0x0B,0x11,0x3D,0x0D,0xB9,0x0D,0x8C,0x40,0x0B, +0x05,0x0B,0x20,0x0B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A,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0x88,0x3D,0x0D,0x8C,0x39,0x8D, +0x29,0x8D,0x79,0xB9,0x69,0xA9,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x22,0x0B, +0x45,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x22,0x0B,0x3F,0x3D, +0x0D,0x8C,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F,0x01,0x6F,0x40,0x0B,0x05,0x0B, +0x81,0x0B,0x64,0x3F,0x9F,0x97,0xFA,0x6C,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F, +0x00,0x6F,0x00,0x79,0x07,0x08,0x01,0x4A,0x79,0xE9,0xFC,0x4C,0x03,0x5A,0xFA,0x2C, +0x40,0x0B,0x05,0x0B,0x81,0x0B,0x68,0x3F,0x4F,0xE9,0x69,0xF9,0x0D,0x8C,0x39,0x8D, +0x51,0x0C,0xFF,0x79,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F,0x01,0x6F,0x00,0x0C, +0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F,0x9F,0x97,0x07,0x2C,0x79,0xB9,0x39,0xC9, +0x03,0x08,0x01,0x5A,0x39,0xF9,0x04,0x08,0xF3,0x5C,0x40,0x0B,0x05,0x0B,0x81,0x0B, +0x64,0x3F,0x00,0x6F,0x07,0x08,0x01,0x5C,0x35,0x0C,0x40,0x0B,0x05,0x0B,0x81,0x0B, +0x68,0x3F,0x4F,0xC9,0x49,0xD9,0x00,0x69,0x06,0x08,0x01,0x4A,0x69,0xC9,0xFC,0x4C, +0x03,0x5A,0xFA,0x2C,0xFF,0x79,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F,0x01,0x6F, +0x00,0x0C,0x40,0x0B,0x05,0x0B,0x81,0x0B,0x64,0x3F,0x9F,0x97,0x07,0x2C,0x79,0xB9,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xCA,0x79,0x8E,0x03,0x3E, +0x29,0x9E,0x00,0x08,0x28,0x1C,0x0D,0x08,0x10,0x5C,0x29,0xF9,0xFF,0x1A,0x2A,0x8A, +0x09,0xCA,0x79,0x8E,0x01,0x3E,0x1E,0xF9,0x39,0xE9,0x3A,0x8A,0x39,0xCA,0x2A,0x8A, +0x19,0xCA,0x69,0x8E,0x04,0x3E,0x79,0x9E,0x08,0x0C,0x39,0xF9,0x3A,0x8A,0x39,0xCA, +0x2A,0x8A,0x19,0xCA,0x79,0x8E,0x04,0x3E,0x00,0x1E,0x29,0xF9,0xFF,0x1A,0x2A,0x8A, +0x09,0xCA,0x79,0xBF,0x1F,0xF9,0x39,0xE9,0x3A,0x8A,0x39,0xCA,0x2A,0x8A,0x19,0xCA, +0x69,0x8E,0x05,0x3E,0x79,0x9E,0x03,0x08,0x01,0x4A,0x39,0xF9,0x9D,0x4C,0x28,0x5A, +0x9B,0x2C,0x00,0x2B,0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B, +0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x01,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0xA9, +0x02,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0x99,0x09,0x79,0x10,0x0B, +0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0x89,0x26,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B, +0x38,0x3D,0x79,0xB9,0x02,0x08,0x60,0x2A,0xFF,0x1A,0x01,0x08,0x80,0x2A,0xFF,0x1A, +0x00,0x08,0x00,0x2B,0x40,0x0A,0xFF,0x1A,0x39,0xF9,0xFF,0x1A,0x00,0x2B,0xF0,0x0A, +0x30,0x2A,0xFF,0x1A,0x79,0xB9,0x01,0x79,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x02,0x79,0x19,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x09,0x79, +0x09,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x26,0x79,0x39,0xE9,0x10,0x0B, +0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x01,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0xB9, +0x02,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0xA9,0x03,0x08,0x00,0x2B, +0x60,0x0A,0xFF,0x1A,0x02,0x08,0x00,0x2B,0x80,0x0A,0xFF,0x1A,0x01,0x79,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x79,0x29,0xE9,0x10,0x0B,0x01,0x0B, +0x3F,0x0B,0xDA,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x79,0x99,0x0D,0x79,0x19,0xE9,0x3A,0x8A,0x01,0x2A,0x20,0x2A,0x80,0x2A,0xFF,0x1A, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x09,0x79,0x90,0x69,0x10,0x0B,0x01,0x0B, +0x3F,0x0B,0xDA,0x3D,0x23,0x0C,0x10,0x0B,0x01,0x0B,0x28,0x0B,0x31,0x3D,0x79,0xB9, +0x10,0x0B,0x01,0x0B,0x28,0x0B,0x31,0x3D,0x79,0xA9,0x39,0xF9,0x4A,0xCA,0x08,0x4A, +0x29,0xE9,0x4A,0xCA,0x07,0x08,0x69,0xDA,0x48,0xE7,0x48,0x8A,0x2A,0xBA,0x0B,0x2C, +0x29,0xF9,0x4A,0xCA,0x39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x0B,0x38,0x3D,0x00,0x2B,0x79,0xF9, +0x0E,0x08,0x01,0x78,0x07,0x7C,0x01,0x79,0x95,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x06,0x0C,0x01,0x79,0x9D,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D, +0x39,0xF9,0xFF,0x1A,0x00,0x2B,0x40,0x0A,0x10,0x2A,0xFF,0x1A,0x79,0x99,0x09,0x79, +0x19,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x0E,0x08,0x46,0x5C,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x68,0x3F,0x9F,0x8D,0x01,0x0D,0x2B,0x79,0x07,0x69,0x00,0x59, +0x80,0x49,0x10,0x0B,0x01,0x0B,0x2B,0x0B,0x2C,0x3D,0x0D,0xA8,0x0D,0xA8,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x64,0x3F,0x9F,0x8D,0x02,0x0D,0x2E,0x79,0x07,0x69,0x00,0x59, +0x80,0x49,0x10,0x0B,0x01,0x0B,0x2B,0x0B,0x2C,0x3D,0x0D,0xA8,0x0D,0xA8,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x68,0x3F,0x9F,0x8D,0x01,0x0D,0x2B,0x79,0x07,0x69,0x00,0x59, +0x80,0x49,0x10,0x0B,0x01,0x0B,0x2B,0x0B,0x2C,0x3D,0x0D,0xA8,0x0D,0xA8,0x2B,0x79, +0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x07,0x08,0x7F,0x1A,0xFF,0x1A,0x29,0xBF, +0x79,0x9F,0x2E,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x07,0x08,0x7F,0x1A, +0xFF,0x1A,0x29,0x8E,0x01,0x3E,0x79,0x9E,0x1A,0x0C,0x20,0x0B,0x02,0x0B,0xD1,0x0B, +0x68,0x3F,0x9F,0x8D,0x01,0x0D,0x2B,0x79,0x07,0x69,0x00,0x59,0x80,0x49,0x10,0x0B, +0x01,0x0B,0x2B,0x0B,0x2C,0x3D,0x0D,0xA8,0x0D,0xA8,0x2B,0x79,0x10,0x0B,0x01,0x0B, +0x40,0x0B,0x38,0x3D,0x07,0x08,0x7F,0x1A,0xFF,0x1A,0x29,0xBF,0x79,0x9F,0x01,0x79, +0x09,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x09,0x79,0x39,0xE9,0x10,0x0B, +0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x0D,0x79,0xF9,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x09,0xBE,0x1D,0x89,0x01,0x0B,0xA4,0x5A,0x09,0x9D,0x3E,0x89, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0xF9,0x8D,0xE9,0x8D,0xD9,0x8D,0xC9,0x8D, +0xB9,0x8D,0xA9,0x8D,0x99,0x8D,0x79,0x89,0x00,0x29,0x01,0x79,0x10,0x0B,0x01,0x0B, +0x40,0x0B,0x38,0x3D,0x00,0x2B,0x79,0xC9,0x03,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B, +0x38,0x3D,0x00,0x2B,0x79,0xB9,0x09,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D, +0x00,0x2B,0x79,0x99,0x32,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x00,0x2B, +0x79,0xA9,0x00,0x08,0x07,0x1C,0x00,0x2B,0x00,0x79,0x00,0x2B,0x45,0x69,0x00,0x2B, +0x01,0x59,0x12,0x0C,0x20,0x0B,0x02,0x0B,0xA1,0x0B,0xBB,0x3F,0x1F,0xF9,0x01,0x5A, +0x00,0x2B,0x79,0xF9,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0B,0x0C,0x0B, +0x00,0x3F,0x9F,0x87,0x00,0x6C,0x40,0x0B,0x00,0x0B,0x0C,0x0B,0x00,0x3F,0x29,0xEF, +0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x68,0x3F,0x01,0x0B,0x4A,0x6F,0x20,0x0B,0x02,0x0B, +0xD1,0x0B,0x64,0x3F,0x01,0x0B,0x36,0x6F,0x00,0x79,0x10,0x0B,0x01,0x0B,0x2C,0x0B, +0x92,0x3D,0x14,0x79,0x01,0x69,0x10,0x0B,0x01,0x0B,0x2D,0x0B,0xBE,0x3D,0x07,0x0B, +0xEF,0x0B,0x40,0x79,0x01,0x69,0x00,0x59,0x10,0x0B,0x01,0x0B,0x2F,0x0B,0x75,0x3D, +0x0F,0x0B,0xDE,0x0B,0x80,0x79,0x01,0x69,0x01,0x59,0x10,0x0B,0x01,0x0B,0x2F,0x0B, +0x75,0x3D,0x14,0x79,0x01,0x69,0x10,0x0B,0x01,0x0B,0x2D,0x0B,0xBE,0x3D,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x3E,0x3F,0x8F,0xF9,0x04,0x2A,0x79,0xDF,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x88,0x3F,0x01,0x4F,0x0D,0xA9,0x0D,0xB9,0x0D,0xA8,0x0D,0x8C,0x40,0x0B, +0x05,0x0B,0x30,0x0B,0x06,0x3F,0x4F,0xF9,0x4A,0xCA,0x01,0x1A,0x20,0x0B,0x02,0x0B, +0xD1,0x0B,0x6C,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x30,0x0B,0x06,0x3F,0x8F,0xF9, +0x01,0x2A,0x79,0xDF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x20,0x3F,0x6F,0xF9,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x70,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x24,0x3F, +0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x74,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x28,0x3F,0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x78,0x3F,0x79,0xEF, +0x40,0x0B,0x05,0x0B,0x10,0x0B,0x2C,0x3F,0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B, +0x7C,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x30,0x3F,0x6F,0xF9,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x80,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x34,0x3F, +0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x84,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B, +0x31,0x0B,0x00,0x3F,0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x88,0x3F,0x79,0xEF, +0x40,0x0B,0x05,0x0B,0x10,0x0B,0x04,0x3F,0x6F,0xF9,0x20,0x0B,0x02,0x0B,0xD1,0x0B, +0x8C,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x30,0x0B,0xA0,0x3F,0x4F,0xF9,0x4A,0xCA, +0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x90,0x3F,0x79,0xEF,0x40,0x0B,0x05,0x0B,0x10,0x0B, +0x20,0x3F,0xC8,0x6F,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x24,0x3F,0x50,0x6F,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x28,0x3F,0x50,0x6F,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x2C,0x3F, +0x01,0x6F,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x30,0x3F,0x01,0x6F,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x34,0x3F,0x00,0x6F,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x00,0x3F,0x00,0x6F, +0x40,0x0B,0x05,0x0B,0x10,0x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,0x3F,0xA1,0x0B,0xE3,0x0B,0x4F,0x0B,0x20,0x6F,0x40,0x0B, +0x02,0x0B,0x90,0x0B,0x40,0x3F,0x96,0x0B,0x08,0x0B,0xB2,0x0B,0xC1,0x6F,0x20,0x0B, +0x00,0x0B,0x00,0x0B,0x1D,0x79,0x00,0x69,0xFF,0x59,0xC5,0x3D,0x07,0x08,0xFF,0x78, +0x02,0x7C,0x00,0x79,0x01,0x0C,0x01,0x79,0x79,0xA9,0x97,0x39,0x01,0x79,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x3F,0x0B,0xDA,0x3D,0x03,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D, +0x08,0x39,0x04,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x05,0x79, +0x00,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x06,0x79,0x00,0x69,0x10,0x0B, +0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x07,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x40,0x39,0x08,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D, +0xA0,0x39,0x09,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x8F,0x39, +0x0A,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0xFB,0x39,0x0B,0x79, +0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x17,0x39,0x0C,0x79,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x0D,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x3F,0x0B,0xDA,0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0x79,0x00,0x69, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x29,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x3F,0x0B,0xDA,0x3D,0x02,0x08,0x02,0x5C,0xA6,0x79,0x0A,0x0C,0x20,0x0B,0x00,0x0B, +0x00,0x0B,0x1A,0x79,0x00,0x69,0xFF,0x59,0x10,0x0B,0x01,0x0B,0x33,0x0B,0xEB,0x3D, +0x07,0x08,0xFF,0x1A,0x79,0xB9,0x2A,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x02,0x08,0x02,0x5C,0x3E,0x79,0x0A,0x0C,0x20,0x0B,0x00,0x0B,0x00,0x0B, +0x1B,0x79,0x00,0x69,0xFF,0x59,0x10,0x0B,0x01,0x0B,0x33,0x0B,0xEB,0x3D,0x07,0x08, +0xFF,0x1A,0x79,0xB9,0x2B,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D, +0x02,0x08,0x02,0x5C,0x17,0x79,0x0A,0x0C,0x20,0x0B,0x00,0x0B,0x00,0x0B,0x1C,0x79, +0x00,0x69,0x1F,0x59,0x10,0x0B,0x01,0x0B,0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A, +0x79,0xB9,0x2C,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x08, +0x02,0x5C,0x66,0x79,0x0A,0x0C,0x20,0x0B,0x00,0x0B,0x00,0x0B,0x1D,0x79,0x00,0x69, +0xFF,0x59,0x10,0x0B,0x01,0x0B,0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xB9, +0x2D,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x08,0x02,0x5C, +0x30,0x79,0x0A,0x0C,0x20,0x0B,0x00,0x0B,0x00,0x0B,0x1E,0x79,0x00,0x69,0x7F,0x59, +0x10,0x0B,0x01,0x0B,0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xB9,0x2E,0x79, +0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x08,0x02,0x5C,0x70,0x79, +0x0A,0x0C,0x20,0x0B,0x00,0x0B,0x00,0x0B,0x1F,0x79,0x00,0x69,0xFF,0x59,0x10,0x0B, +0x01,0x0B,0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xB9,0x2F,0x79,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x08,0x02,0x5C,0x24,0x79,0x0A,0x0C, +0x20,0x0B,0x00,0x0B,0x00,0x0B,0x20,0x79,0x00,0x69,0xFF,0x59,0x10,0x0B,0x01,0x0B, +0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xB9,0x30,0x79,0x39,0xE9,0x10,0x0B, +0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x31,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B, +0xDA,0x3D,0x1E,0x39,0x32,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D, +0xF9,0x39,0x33,0x79,0x39,0xE9,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x34,0x79, +0x00,0x69,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x04,0x39,0x35,0x79,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x3F,0x0B,0xDA,0x3D,0x02,0x08,0x02,0x5C,0x33,0x79,0x0A,0x0C, +0x20,0x0B,0x00,0x0B,0x00,0x0B,0x26,0x79,0x00,0x69,0xFF,0x59,0x10,0x0B,0x01,0x0B, +0x33,0x0B,0xEB,0x3D,0x07,0x08,0xFF,0x1A,0x79,0xB9,0x36,0x79,0x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,0x29,0x80,0x39,0x39,0xF9,0xFF,0x1A,0x89,0x0B, +0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08, +0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x14,0x4A,0x69,0xBF,0x79,0xCF,0xC0,0x39, +0x39,0xF9,0xFF,0x1A,0x82,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08, +0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x14,0x4A, +0x69,0xBF,0x79,0xCF,0x08,0x39,0x39,0xF9,0xFF,0x1A,0xA7,0x0B,0x00,0x2A,0x4A,0xCA, +0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B, +0x05,0x0B,0x80,0x0B,0x14,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xF9,0xFF,0x1A,0x20,0x0B, +0x02,0x0B,0xD1,0x0B,0x9D,0x3F,0x79,0x9F,0x20,0x0B,0x02,0x0B,0xA4,0x0B,0x10,0x79, +0x10,0x0B,0x01,0x0B,0x35,0x0B,0xD6,0x3D,0x79,0xA9,0x09,0x39,0x39,0xF9,0xFF,0x1A, +0xAC,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9, +0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x14,0x4A,0x69,0xBF,0x79,0xCF, +0x10,0x39,0x39,0xF9,0xFF,0x1A,0xA6,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x14,0x4A,0x69,0xBF,0x79,0xCF,0xB7,0x39,0x39,0xF9,0xFF,0x1A,0x81,0x0B,0x00,0x2A, +0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x14,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xF9,0x4A,0xCA, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x12,0x3F,0x79,0xCF,0xF7,0x39,0x39,0xF9,0xFF,0x1A, +0x81,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9, +0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x14,0x4A,0x69,0xBF,0x79,0xCF, +0x44,0x39,0x39,0xF9,0xFF,0x1A,0xB5,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x14,0x4A,0x69,0xBF,0x79,0xCF,0x20,0x0B,0x02,0x0B,0xD1,0x0B,0x98,0x3F,0x29,0xEF, +0x30,0x39,0x39,0xF9,0xFF,0x1A,0xA6,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x14,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xF9,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x10,0x3F,0x79,0xCF,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x00,0x29, +0x9F,0x39,0x39,0xF9,0xFF,0x1A,0x81,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x60,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9, +0x07,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x60,0x4A,0x79,0xBF,0x82,0x0B, +0x00,0x4F,0x08,0x39,0x39,0xF9,0xFF,0x1A,0xA7,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0x60,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xF9,0xFF,0x1A,0x20,0x0B,0x02,0x0B, +0xD1,0x0B,0x9C,0x3F,0x79,0x9F,0x20,0x0B,0x02,0x0B,0xA2,0x0B,0x80,0x79,0x10,0x0B, +0x01,0x0B,0x36,0x0B,0xA9,0x3D,0x79,0xA9,0x17,0x39,0x39,0xF9,0xFF,0x1A,0xAC,0x0B, +0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08, +0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x60,0x4A,0x69,0xBF,0x79,0xCF,0x0B,0x79, +0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0xB9,0xC0,0x2A,0xFF,0x1A,0x39,0xF9, +0xFF,0x1A,0x8B,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x60,0x4A,0x69,0xBF, +0x79,0xCF,0xFF,0x39,0x39,0xF9,0xFF,0x1A,0x89,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0x60,0x4A,0x69,0xBF,0x79,0xCF,0x4F,0x39,0x39,0xF9,0xFF,0x1A,0xB5,0x0B, +0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08, +0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x60,0x4A,0x69,0xBF,0x79,0xCF,0x40,0x0B, +0x05,0x0B,0x80,0x0B,0x5E,0x3F,0x00,0x4F,0x29,0xF9,0x4A,0xCA,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0x5C,0x3F,0x79,0xCF,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x00,0x69, +0x9F,0x79,0x79,0xD9,0xFF,0x1A,0x81,0x0B,0x00,0x2A,0x4A,0xCA,0x69,0xB9,0x39,0xC9, +0x03,0x08,0x01,0x4A,0x39,0xE9,0x04,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x38,0x4A,0x49,0xBF,0x59,0xCF,0xC0,0x79,0x79,0xD9,0xFF,0x1A,0x82,0x0B,0x00,0x2A, +0x4A,0xCA,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x04,0x08,0x2A,0x8A, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x38,0x4A,0x49,0xBF,0x59,0xCF,0x08,0x79,0x79,0xD9, +0xFF,0x1A,0xA7,0x0B,0x00,0x2A,0x4A,0xCA,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A, +0x39,0xE9,0x04,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x38,0x4A,0x49,0xBF, +0x59,0xCF,0x69,0xC9,0x49,0xD9,0x04,0x08,0x01,0x4A,0x49,0xE9,0x05,0x08,0x2A,0x8A, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x38,0x4A,0x59,0xBF,0xB2,0x0B,0x00,0x4F,0x8C,0x79, +0x79,0xD9,0xFF,0x1A,0x89,0x0B,0x00,0x2A,0x4A,0xCA,0x69,0xB9,0x39,0xC9,0x03,0x08, +0x01,0x4A,0x39,0xE9,0x04,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x38,0x4A, +0x49,0xBF,0x59,0xCF,0x69,0xD9,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x36,0x3F, +0x59,0xCF,0x8C,0x79,0x79,0xD9,0xFF,0x1A,0x89,0x0B,0x00,0x2A,0x4A,0xCA,0x69,0xB9, +0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x04,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0x38,0x4A,0x49,0xBF,0x59,0xCF,0x00,0x79,0x79,0xD9,0xFF,0x1A,0xA6,0x0B, +0x00,0x2A,0x4A,0xCA,0x69,0xB9,0x39,0xC9,0x03,0x08,0x01,0x4A,0x39,0xE9,0x04,0x08, +0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x38,0x4A,0x49,0xBF,0x59,0xCF,0x69,0xD9, +0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x34,0x3F,0x59,0xCF,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x00,0x29,0x80,0x39,0x39,0xF9,0xFF,0x1A,0x89,0x0B,0x00,0x2A, +0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0x84,0x4A,0x69,0xBF,0x79,0xCF,0x97,0x39,0x39,0xF9, +0xFF,0x1A,0x81,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9,0x05,0x08,0x01,0x4A, +0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x84,0x4A,0x69,0xBF, +0x79,0xCF,0x0B,0x79,0x10,0x0B,0x01,0x0B,0x40,0x0B,0x38,0x3D,0x79,0xB9,0xC0,0x2A, +0xFF,0x1A,0x39,0xF9,0xFF,0x1A,0x8B,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9,0x59,0xE9, +0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B, +0x84,0x4A,0x69,0xBF,0x79,0xCF,0x29,0xE9,0x69,0xF9,0x06,0x08,0x01,0x4A,0x69,0xA9, +0x07,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x84,0x4A,0x79,0xBF,0x82,0x0B, +0x00,0x4F,0x08,0x39,0x39,0xF9,0xFF,0x1A,0xA7,0x0B,0x00,0x2A,0x4A,0xCA,0x29,0xD9, +0x59,0xE9,0x05,0x08,0x01,0x4A,0x59,0xA9,0x06,0x08,0x2A,0x8A,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0x84,0x4A,0x69,0xBF,0x79,0xCF,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x82,0x3F, +0x00,0x4F,0x29,0xF9,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x80,0x3F,0x79,0xCF, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x37,0x0B,0x81,0x3D,0x10,0x0B, +0x01,0x0B,0x38,0x0B,0x55,0x3D,0x10,0x0B,0x01,0x0B,0x38,0x0B,0xFE,0x3D,0x80,0x3D, +0x0D,0x8C,0x39,0x8D,0x79,0xB9,0x39,0xF9,0x3A,0x8A,0x39,0xCA,0x2A,0x8A,0x20,0x0B, +0x02,0x0B,0xA3,0x0B,0x48,0x4A,0x10,0x0B,0x01,0x0B,0x35,0x0B,0xD6,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4,0x3F, +0x6F,0xF9,0x39,0xBD,0x0D,0xB9,0x0D,0x8C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x3C,0x3F, +0x0A,0x0B,0x0A,0x4F,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x3E,0x3F,0x8F,0xF9,0x02,0x2A, +0x79,0xDF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x44,0x3F,0x0A,0x0B,0x0A,0x4F,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x46,0x3F,0x8F,0xF9,0x02,0x2A,0x79,0xDF,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x40,0x3F,0x0A,0x0B,0x0A,0x4F,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x42,0x3F, +0x8F,0xF9,0x02,0x2A,0x79,0xDF,0x0D,0x8C,0x07,0x08,0x08,0x5C,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x42,0x3F,0x8F,0xE9,0x04,0x2A,0x69,0xDF,0x07,0x0C,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x42,0x3F,0x8F,0xE9,0x02,0x2A,0x69,0xDF,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0x79,0x89,0x69,0xB9,0x00,0x08,0x00,0x78,0x2B,0x3C,0x01,0x78, +0x49,0x3C,0x02,0x78,0x5C,0x3C,0x03,0x78,0x60,0x3C,0x04,0x78,0x64,0x3C,0x05,0x78, +0x68,0x3C,0x06,0x78,0x6C,0x3C,0x07,0x78,0x70,0x3C,0x08,0x78,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0xCA,0x3C,0x09,0x78,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0xD0,0x3C,0x0A,0x78, +0x10,0x0B,0x01,0x0B,0x3E,0x0B,0xD6,0x3C,0x0B,0x78,0x10,0x0B,0x01,0x0B,0x3E,0x0B, +0xDC,0x3C,0x0C,0x78,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0xE2,0x3C,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0xE8,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x92,0x3F,0x4F,0xF9,0x4A,0xCA, +0x79,0xA9,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x94,0x3F,0x4F,0xF9,0x4A,0xCA,0x79,0x99, +0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x19,0xE9,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0xC4,0x3D,0x79,0xB9,0x40,0x0B,0x05,0x0B,0x31,0x0B,0x00,0x3F, +0x39,0xEF,0x66,0x0C,0x03,0x08,0x0D,0x1C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x20,0x3F, +0x6F,0xF9,0x07,0x5C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x38,0x3F,0x9F,0xF9,0x04,0x2A, +0x79,0xFF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x20,0x3F,0x39,0xEF,0x51,0x0C,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x24,0x3F,0x39,0xEF,0x4B,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B, +0x28,0x3F,0x39,0xEF,0x45,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x2C,0x3F,0x39,0xEF, +0x3F,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x30,0x3F,0x39,0xEF,0x39,0x0C,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x34,0x3F,0x39,0xEF,0x33,0x0C,0x03,0x08,0x0D,0x1C,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x04,0x3F,0x6F,0xF9,0x07,0x5C,0x40,0x0B,0x05,0x0B,0x10,0x0B, +0x1C,0x3F,0x8F,0xF9,0x04,0x2A,0x79,0xDF,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x04,0x3F, +0x39,0xEF,0x1E,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x08,0x3F,0x39,0xEF,0x18,0x0C, +0x40,0x0B,0x05,0x0B,0x10,0x0B,0x0C,0x3F,0x39,0xEF,0x12,0x0C,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x10,0x3F,0x39,0xEF,0x0C,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x14,0x3F, +0x39,0xEF,0x06,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x18,0x3F,0x39,0xEF,0x00,0x0C, +0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D, +0x09,0x8D,0x79,0x89,0x00,0x08,0x00,0x78,0x19,0x3C,0x01,0x78,0x39,0x3C,0x02,0x78, +0x3D,0x3C,0x03,0x78,0x41,0x3C,0x04,0x78,0x45,0x3C,0x05,0x78,0x49,0x3C,0x06,0x78, +0x4D,0x3C,0x07,0x78,0x51,0x3C,0x08,0x78,0x55,0x3C,0x09,0x78,0x59,0x3C,0x0A,0x78, +0x5D,0x3C,0x0B,0x78,0x61,0x3C,0x0C,0x78,0x65,0x3C,0x6A,0x0C,0x40,0x0B,0x05,0x0B, +0x31,0x0B,0x00,0x3F,0x6F,0xF9,0x79,0xB9,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x92,0x3F, +0x4F,0xF9,0x4A,0xCA,0x79,0xA9,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x94,0x3F,0x4F,0xF9, +0x4A,0xCA,0x79,0x99,0x39,0xF9,0x19,0xE9,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x29,0xE9,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xC4,0x3D,0x79,0xB9,0x39,0xF9,0x4B,0x0C, +0x40,0x0B,0x05,0x0B,0x10,0x0B,0x20,0x3F,0x6F,0xF9,0x45,0x0C,0x40,0x0B,0x05,0x0B, +0x10,0x0B,0x24,0x3F,0x6F,0xF9,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A,0x2A,0x8A,0x09,0xAA,0x59,0x89,0xFF,0x1A,0x6A,0x8A,0x3A,0x8A,0x19,0xAA, +0x80,0x2A,0x4A,0xCA,0x09,0xF9,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xA8,0x3F,0x79,0xCF, +0x79,0x99,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0x58,0x3F,0x19,0xEF,0x79,0x99, +0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xA4,0x3F,0x19,0xEF,0x79,0x99,0x4A,0xCA, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0xB0,0x3F,0x19,0xEF,0x00,0x69,0x06,0x08,0x01,0x4A, +0x69,0x99,0xFC,0x4C,0x0F,0x0B,0xFF,0x5A,0xF9,0x2C,0x0D,0x89,0x0D,0x99,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x99,0x69,0x89, +0x10,0x0B,0x00,0x0B,0x03,0x0B,0x6B,0x3D,0x49,0x0C,0x01,0x79,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0x1C,0x3D,0x00,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x48,0x3F,0x9F,0x97, +0xFA,0x6C,0x00,0x29,0x02,0x08,0x01,0x4A,0x29,0xF9,0xFC,0x4C,0x0F,0x5A,0xFA,0x2C, +0x01,0x08,0x80,0x2A,0xFF,0x1A,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x84,0x3F,0x8F,0xF9, +0x00,0x2B,0x20,0x0A,0x79,0xDF,0x19,0xF9,0xFF,0x1A,0x6A,0x8A,0x6A,0x8A,0x09,0xE9, +0xFF,0x1A,0x79,0xCA,0x4A,0xCA,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xAA,0x3F,0x69,0xCF, +0x40,0x0B,0x05,0x0B,0x80,0x0B,0xAC,0x3F,0x01,0x4F,0x64,0x39,0x00,0x0C,0x40,0x0B, +0x05,0x0B,0x10,0x0B,0x84,0x3F,0x4F,0xF9,0x4A,0xCA,0x79,0xD7,0x07,0x2C,0x39,0xE9, +0x69,0xF9,0x06,0x08,0x01,0x5A,0x69,0xB9,0x07,0x08,0xF1,0x5C,0x00,0x79,0x10,0x0B, +0x01,0x0B,0x3E,0x0B,0x1C,0x3D,0x03,0x08,0x01,0x1C,0x01,0x0C,0xB6,0x0C,0x10,0x0B, +0x00,0x0B,0x03,0x0B,0x6D,0x3D,0x0D,0x89,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D,0x79,0x89,0x10,0x0B,0x00,0x0B,0x03,0x0B, +0x6B,0x3D,0x47,0x0C,0x01,0x79,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x1C,0x3D,0x00,0x0C, +0x40,0x0B,0x05,0x0B,0x10,0x0B,0x48,0x3F,0x9F,0x97,0xFA,0x6C,0x00,0x29,0x02,0x08, +0x01,0x4A,0x29,0xF9,0xFC,0x4C,0x0F,0x5A,0xFA,0x2C,0x00,0x08,0x00,0x2B,0x80,0x0A, +0xFF,0x1A,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x84,0x3F,0x8F,0xF9,0x00,0x2B,0x20,0x0A, +0x79,0xDF,0x09,0xF9,0xFF,0x1A,0x6A,0x8A,0x6A,0x8A,0x4A,0xCA,0x40,0x0B,0x05,0x0B, +0x80,0x0B,0xAA,0x3F,0x79,0xCF,0x40,0x0B,0x05,0x0B,0x80,0x0B,0xAC,0x3F,0x01,0x4F, +0x64,0x39,0x00,0x0C,0x40,0x0B,0x05,0x0B,0x10,0x0B,0x84,0x3F,0x4F,0xF9,0x4A,0xCA, +0x79,0xD7,0x07,0x2C,0x39,0xE9,0x69,0xF9,0x06,0x08,0x01,0x5A,0x69,0xB9,0x07,0x08, +0xF1,0x5C,0x00,0x79,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x1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79,0x0D,0x8C,0x79,0xBF,0x00,0x1F,0x69,0xBF,0x00,0x1F,0x0D,0x8C,0x79,0xBF, +0x00,0x4F,0x69,0xBF,0x00,0x4F,0x0D,0x8C,0x01,0x79,0x0D,0x8C,0x40,0x0B,0x00,0x0B, +0x0C,0x0B,0x00,0x3F,0x01,0x6F,0x40,0x0B,0x00,0x0B,0x04,0x0B,0x10,0x3F,0x10,0x0B, +0x00,0x0B,0x10,0x6F,0x40,0x0B,0x00,0x0B,0x0C,0x0B,0x18,0x3F,0x00,0x6F,0x40,0x0B, +0x00,0x0B,0x04,0x0B,0x68,0x3F,0x0E,0x6F,0x0B,0x3D,0x10,0x0B,0x01,0x0B,0x47,0x0B, +0x8C,0x3D,0x37,0x3D,0x40,0x0B,0x00,0x0B,0x0C,0x0B,0x00,0x3F,0x00,0x6F,0x0D,0x8C, +0x40,0x0B,0x00,0x0B,0x44,0x0B,0x10,0x3F,0x50,0x6F,0x40,0x0B,0x00,0x0B,0x44,0x0B, +0x10,0x3F,0x50,0x6F,0x00,0x0C,0x40,0x0B,0x00,0x0B,0x44,0x0B,0x40,0x3F,0x9F,0x87, +0xFA,0x6C,0x40,0x0B,0x00,0x0B,0x00,0x0B,0x74,0x3F,0xD9,0x6F,0x40,0x0B,0x00,0x0B, +0x00,0x0B,0x08,0x3F,0x9F,0xF9,0x01,0x0B,0x00,0x0B,0x00,0x2A,0x79,0xFF,0x00,0x0C, +0x40,0x0B,0x00,0x0B,0x00,0x0B,0x08,0x3F,0x6F,0xF9,0x8A,0xCA,0x8A,0xEA,0xF8,0x6C, +0x40,0x0B,0x00,0x0B,0x00,0x0B,0x48,0x3F,0x9F,0xF9,0x00,0x2B,0x01,0x0A,0x79,0xFF, +0x0D,0x8C,0x40,0x0B,0x00,0x0B,0x44,0x0B,0x10,0x3F,0x00,0x6F,0x40,0x0B,0x00,0x0B, +0x44,0x0B,0x10,0x3F,0x00,0x6F,0x40,0x0B,0x00,0x0B,0x00,0x0B,0x08,0x3F,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B,0x45,0x3F, +0x1F,0xF9,0x02,0x78,0x20,0x7C,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x30,0x3F,0x6F,0xF9, +0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x79,0xE9,0x00,0x79,0x06,0x08,0x27,0x4A,0x00,0x79,0x10,0x0B,0x01,0x0B, +0x46,0x0B,0xF2,0x3D,0x1F,0x0C,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x30,0x3F,0x6F,0xF9, +0x79,0xE9,0x00,0x79,0x18,0x0B,0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B, +0x4C,0x0B,0xD4,0x3D,0x10,0x0B,0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0xD4,0x3D,0x79,0xE9,0x00,0x79,0x06,0x08,0x40,0x4A,0x00,0x79,0x10,0x0B,0x01,0x0B, +0x46,0x0B,0xF2,0x3D,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x2C,0x3F,0x6F,0xF9,0x39,0xE9, +0x10,0x0B,0x01,0x0B,0x4A,0x0B,0x6E,0x3D,0x07,0x08,0x18,0x1C,0x20,0x0B,0x02,0x0B, +0xD2,0x0B,0x28,0x3F,0x6F,0xF9,0x12,0x1C,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x28,0x3F, +0x6F,0xF9,0x79,0x89,0x00,0x79,0x79,0x8D,0x01,0x79,0x00,0x69,0x00,0x59,0x20,0x0B, +0x02,0x0B,0xD2,0x0B,0x2C,0x3F,0x6F,0xC9,0x09,0xBD,0x0D,0xA8,0x0D,0x89,0x0D,0x99, +0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x79,0xB9,0x69,0xA9,0x20,0x0B, +0x02,0x0B,0xD2,0x0B,0x28,0x3F,0x6F,0xF9,0x09,0x1C,0x20,0x0B,0x02,0x0B,0xD2,0x0B, +0x28,0x3F,0x6F,0xF9,0x10,0x0B,0x01,0x0B,0x48,0x0B,0x1A,0x3D,0x20,0x0B,0x02,0x0B, +0xD2,0x0B,0x45,0x3F,0x1F,0xF9,0x00,0x69,0x10,0x0B,0x01,0x0B,0x47,0x0B,0xCB,0x3D, +0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x39,0x3F,0x1F,0xF9,0x10,0x0B,0x01,0x0B,0x4B,0x0B, +0xD5,0x3D,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x45,0x3F,0x1F,0xF9,0x03,0x78,0x21,0x7C, +0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x30,0x3F,0x6F,0xF9,0x79,0xE9,0x00,0x79,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B, +0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79, +0x06,0x08,0x03,0x0B,0x7A,0x4A,0x00,0x79,0x10,0x0B,0x01,0x0B,0x46,0x0B,0xF2,0x3D, +0x46,0x0C,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x45,0x3F,0x1F,0xF9,0x02,0x78,0x20,0x7C, +0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x30,0x3F,0x6F,0xF9,0x79,0xE9,0x00,0x79,0x18,0x0B, +0x6A,0x0B,0x00,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x10,0x0B, +0xC7,0x49,0x00,0x59,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0xD4,0x3D,0x79,0xE9,0x00,0x79, +0x06,0x08,0x27,0x4A,0x00,0x79,0x10,0x0B,0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0x4A,0x79,0xBF, +0x29,0xEF,0x39,0xF9,0x29,0xE9,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x0D,0xA9, +0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x79,0xA9,0x69,0x99,0x02,0x08, +0x02,0x5C,0x01,0x08,0x0C,0x4A,0x19,0xF9,0x6A,0x8A,0x2A,0x8A,0x79,0xB9,0x29,0xF9, +0x39,0xE9,0xDB,0x3D,0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x10,0x0B,0x01,0x0B,0x26,0x0B,0x78,0x3D,0x79,0xB9,0x05,0x0B,0x60,0x79,0x79,0xA9, +0x39,0x8E,0x03,0x3E,0x4E,0xF9,0x4A,0xCA,0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B, +0x8E,0x3D,0x02,0x08,0x79,0xDA,0x39,0xBF,0x4F,0xF9,0x4A,0xCA,0x14,0x69,0x10,0x0B, +0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x02,0x08,0x79,0xDA,0x29,0xE9,0x07,0x79,0xB5,0x3D, +0x08,0x79,0x07,0x0B,0x00,0x69,0xB1,0x3D,0x09,0x79,0x05,0x0B,0xE0,0x69,0xAD,0x3D, +0x0A,0x79,0x20,0x69,0xAA,0x3D,0x39,0x8E,0x01,0x3E,0x4E,0xF9,0x4A,0xCA,0x14,0x69, +0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x07,0x08,0x40,0x4A,0x79,0xE9,0x0B,0x79, +0x9C,0x3D,0x0C,0x79,0x01,0x0B,0x40,0x69,0x98,0x3D,0x39,0x8E,0x01,0x3E,0x4E,0xF9, +0x4A,0xCA,0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D,0x79,0xA9,0x39,0x8E, +0x02,0x3E,0x4E,0xF9,0x4A,0xCA,0x14,0x69,0x10,0x0B,0x01,0x0B,0x4C,0x0B,0x8E,0x3D, +0x02,0x08,0x79,0xDA,0x0C,0x0B,0x80,0x4A,0x29,0xE9,0x01,0x79,0x10,0x0B,0x01,0x0B, +0x46,0x0B,0xDD,0x3D,0x02,0x79,0x01,0x0B,0x40,0x69,0x10,0x0B,0x01,0x0B,0x46,0x0B, +0xDD,0x3D,0x03,0x79,0x03,0x0B,0x80,0x69,0x10,0x0B,0x01,0x0B,0x46,0x0B,0xDD,0x3D, +0x04,0x79,0x20,0x69,0x10,0x0B,0x01,0x0B,0x46,0x0B,0xDD,0x3D,0x05,0x79,0x20,0x69, +0x10,0x0B,0x01,0x0B,0x46,0x0B,0xDD,0x3D,0x06,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x46,0x0B,0xDD,0x3D,0x00,0x79,0x7D,0x0B,0x00,0x69,0x10,0x0B,0x01,0x0B,0x46,0x0B, +0xDD,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x1D,0x0B,0x83,0x3D, +0x10,0x0B,0x01,0x0B,0x47,0x0B,0x06,0x3D,0x00,0x79,0x10,0x0B,0x01,0x0B,0x47,0x0B, +0xEE,0x69,0x10,0x0B,0x01,0x0B,0x3B,0x0B,0xFB,0x3D,0x01,0x79,0x10,0x0B,0x01,0x0B, +0x48,0x0B,0x48,0x69,0x10,0x0B,0x01,0x0B,0x3B,0x0B,0xFB,0x3D,0x02,0x79,0x10,0x0B, +0x01,0x0B,0x48,0x0B,0x20,0x69,0x10,0x0B,0x01,0x0B,0x3B,0x0B,0xFB,0x3D,0x03,0x79, +0x10,0x0B,0x01,0x0B,0x49,0x0B,0x46,0x69,0x10,0x0B,0x01,0x0B,0x3B,0x0B,0xFB,0x3D, +0x07,0x79,0x10,0x0B,0x01,0x0B,0x49,0x0B,0x79,0x69,0x10,0x0B,0x01,0x0B,0x3B,0x0B, +0xFB,0x3D,0x05,0x79,0x10,0x0B,0x01,0x0B,0x49,0x0B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, +0x01,0x0B,0x3B,0x0B,0xE3,0x3D,0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x3B,0x0B,0xEC,0x3D, +0x0D,0x8C,0x10,0x0B,0x01,0x0B,0x3F,0x0B,0x80,0x3D,0x10,0x0B,0x01,0x0B,0x41,0x0B, +0x12,0x3D,0x01,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x07,0x79, +0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x0D,0x8C,0x39,0x8D,0x29,0x8D, +0x19,0x8D,0x09,0x8D,0xF9,0x8D,0x79,0xB9,0x00,0x2B,0x69,0xF9,0x10,0x0B,0x01,0x0B, +0x26,0x0B,0x78,0x3D,0x79,0x89,0x09,0x8E,0x02,0x3E,0x4E,0xF9,0x4A,0xCA,0x3D,0x4A, +0x03,0x08,0x79,0xDA,0x10,0x0B,0x00,0x0B,0x03,0x0B,0x6B,0x3D,0x10,0x0B,0x01,0x0B, +0x40,0x0B,0x9C,0x3D,0x79,0xA9,0x0A,0x19,0x39,0xF9,0x19,0xDA,0x29,0xDA,0x01,0x4C, +0x07,0x5C,0x10,0x0B,0x00,0x0B,0x03,0x0B,0x6D,0x3D,0x00,0x79,0x1A,0x8A,0x36,0x0C, +0x39,0xF9,0x10,0x0B,0x01,0x0B,0x40,0x0B,0xEB,0x3D,0x0F,0x08,0x00,0x78,0x03,0x3C, +0x01,0x78,0x0E,0x3C,0x22,0x0C,0x01,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B, +0x2E,0x3D,0x07,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x19,0x0C, +0x01,0x79,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x9C,0x3F,0x6F,0xE9,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0x2E,0x3D,0x07,0x79,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x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0x08,0x00,0x78,0x05,0x3C,0x01,0x78,0x10,0x3C, +0x02,0x78,0x1F,0x3C,0x33,0x0C,0x01,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B, +0x2E,0x3D,0x07,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x2A,0x0C, +0x01,0x79,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x9C,0x3F,0x6F,0xE9,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0x2E,0x3D,0x07,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D, +0x19,0x0C,0x01,0x79,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0x9C,0x3F,0x6F,0xE9,0x10,0x0B, +0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x07,0x79,0x20,0x0B,0x02,0x0B,0xD2,0x0B,0xB4,0x3F, +0x6F,0xE9,0x10,0x0B,0x01,0x0B,0x3E,0x0B,0x2E,0x3D,0x04,0x0C,0x00,0x79,0x1A,0x8A, +0x06,0x0C,0x00,0x0C,0x10,0x0B,0x00,0x0B,0x03,0x0B,0x6D,0x3D,0x00,0x79,0x00,0x2B, +0x0D,0xC9,0x00,0x2B,0x0D,0xD9,0x00,0x2B,0x0D,0xE9,0x00,0x2B,0x0D,0xF9,0x0D,0x89, +0x0D,0x99,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x39,0x8D,0x29,0x8D,0x19,0x8D,0x09,0x8D, +0x79,0xB9,0x69,0xA9,0x59,0x99,0x49,0x89,0x39,0xF9,0x29,0xE9,0x19,0xD9,0x4A,0xCA, +0x10,0x0B,0x01,0x0B,0x27,0x0B,0x14,0x3D,0x00,0x08,0x00,0x78,0x05,0x3C,0x01,0x78, +0x14,0x3C,0x02,0x78,0x23,0x3C,0x23,0x0C,0x01,0x79,0x00,0x69,0x10,0x0B,0x01,0x0B, +0x3E,0x0B,0x2E,0x3D,0x07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x0B,0x10,0x3D,0x20,0x0B,0x00,0x0B,0x02,0x0B,0x40,0x3F,0x01,0x1F, +0x40,0x0B,0x03,0x0B,0xE0,0x0B,0x04,0x3F,0x00,0x6F,0x0D,0xB9,0x0D,0xC9,0x0D,0xD9, +0x0D,0xE9,0x0D,0xF9,0x00,0x2B,0x0D,0xDF,0x0D,0xBF,0x0D,0xFD,0x0D,0xED,0x0D,0xBE, +0x0D,0x8E,0x0D,0x98,0x0D,0x88,0x0D,0xC8,0x8D,0x8C,0x00,0x00,0x00,0x59,0x04,0x18, +0x07,0x08,0xAA,0x8A,0x02,0x6C,0x05,0x08,0x69,0xCA,0x06,0x08,0x2A,0x8A,0xF9,0x5C, +0x00,0x18,0x59,0xF9,0x0D,0x8C,0x00,0x00,0x79,0xD9,0x05,0x08,0x69,0xBA,0x59,0x8D, +0x06,0x08,0xFB,0xF8,0x01,0x2C,0x9A,0x8A,0x07,0x08,0xFB,0xF8,0x01,0x2C,0x9A,0x8A, +0x1B,0x3D,0x0D,0xD9,0x05,0x08,0xFB,0xF8,0x0D,0xAC,0x07,0x08,0x9A,0x8A,0x0D,0x8C, +0x39,0x8D,0x79,0xB9,0x06,0x08,0xFB,0xF8,0x01,0x2C,0x9A,0x8A,0x07,0x08,0xFB,0xF8, +0x01,0x2C,0x9A,0x8A,0x09,0x3D,0x59,0xF9,0x03,0x08,0xFB,0xF8,0x02,0x2C,0x07,0x08, +0x9A,0x8A,0x0D,0xB9,0x0D,0x8C,0x00,0x00,0x00,0x59,0x20,0x6D,0x07,0x08,0x2A,0x8A, +0x05,0x08,0x5A,0x8A,0x69,0xDA,0x03,0x6C,0x69,0xCA,0xF8,0x4D,0x0D,0x8C,0x07,0x08, +0x01,0x4A,0xF5,0x4D,0x0D,0x8C,0x00,0x00,0x29,0x8D,0x39,0x8D,0x04,0x18,0x00,0x29, +0x00,0x39,0x06,0x08,0xAA,0x8A,0x03,0x6C,0x02,0x08,0x49,0xCA,0x59,0xEA,0x07,0x08, +0xAA,0x8A,0x02,0x6C,0x03,0x08,0x49,0xCA,0x04,0x08,0x2A,0x8A,0x5A,0x8A,0xF2,0x5C, +0x07,0x08,0xEF,0x5C,0x29,0xE9,0x39,0xF9,0x0D,0xB9,0x0D,0xA9,0x00,0x18,0x0D,0x8C, +0x39,0x8D,0x29,0x8D,0x03,0x3D,0x0D,0xA9,0x0D,0xB9,0x0D,0x8C,0x01,0x18,0x00,0x29, +0x00,0x39,0x40,0x6D,0x06,0x08,0x2A,0x8A,0x5A,0x8A,0x02,0x08,0x5A,0x8A,0x5A,0x8A, +0x49,0xDA,0x59,0xFA,0x05,0x6C,0x49,0xCA,0x59,0xEA,0xF4,0x4D,0x00,0x18,0x0D,0x8C, +0x06,0x08,0x01,0x4A,0xEF,0x4D,0x00,0x18,0x0D,0x8C,0x00,0x00,0x39,0x8D,0x00,0x49, +0x00,0x39,0x69,0xD9,0x00,0x69,0x04,0x18,0x07,0x08,0xAA,0x8A,0x03,0x6C,0x03,0x08, +0x59,0xCA,0x69,0xEA,0x05,0x08,0x2A,0x8A,0x5A,0x8A,0xF7,0x5C,0x00,0x18,0x49,0xF9, +0x39,0xE9,0x0D,0xB9,0x0D,0x8C,0x00,0x00,0x05,0x08,0x0D,0x9C,0x79,0xBF,0xFF,0x0B, +0xFF,0x78,0x04,0x6C,0x59,0xED,0x69,0x9F,0xFE,0x4D,0x0D,0x8C,0x69,0x9F,0x01,0x5A, +0xFD,0x5C,0x0D,0x8C,0x05,0x08,0x0D,0x9C,0x00,0x2B,0x79,0xDF,0x69,0xBF,0xFF,0x0B, +0xFF,0x78,0x05,0x6C,0x59,0xED,0x00,0x2B,0x1F,0xBF,0xFD,0x4D,0x0D,0x8C,0x00,0x2B, +0x1F,0xBF,0x01,0x5A,0xFC,0x5C,0x0D,0x8C,0x48,0x10,0x00,0x00,0x10,0x00,0x08,0x00, +0x20,0x00,0x04,0x00,0x40,0x00,0x04,0x00,0x80,0x00,0x04,0x00,0x00,0x01,0x04,0x00, +0x00,0x02,0x04,0x00,0x5F,0x00,0x03,0x23,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x72,0x06,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x72,0x06, +0x04,0x04,0x04,0x00,0x80,0x00,0x00,0x00,0x10,0x27,0x01,0x01,0x00,0x00,0x00,0x00, +0x14,0x00,0x96,0x00,0xE8,0x03,0xF4,0x01,0xD0,0x9A,0x02,0x20,0x04,0x04,0x04,0x00, +0xA4,0x9A,0x02,0x20,0x40,0xB5,0x02,0x20,0xED,0x0E,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x13,0x49,0x05, +0x15,0xCD,0x5B,0x07,0xE5,0x55,0x9A,0x15,0xB5,0x3B,0x12,0x1F,0x00,0x00,0x00,0x00, +0xCF,0xE2,0x00,0x10,0x3A,0xE3,0x00,0x10,0x00,0x00,0x00,0x00,0x75,0xE3,0x00,0x10, +0x25,0xE3,0x00,0x10,0x88,0xE3,0x00,0x10,0x25,0xE3,0x00,0x10,0x46,0xE3,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xE3,0x00,0x10,0x40,0xE3,0x00,0x10, +0x54,0xE3,0x00,0x10,0x75,0xE3,0x00,0x10,0x00,0x00,0x00,0x00,0x40,0xE3,0x00,0x10, +0x40,0xE3,0x00,0x10,0x67,0xE3,0x00,0x10,0x75,0xE3,0x00,0x10,0x00,0x01,0x00,0x00, +0x00,0x03,0x01,0x02,0x00,0x01,0x03,0x02,0x02,0x00,0x02,0x03,0x03,0x03,0x00,0x03, +0x39,0xD9,0x00,0x10,0xB3,0xD8,0x00,0x10,0x2B,0xD9,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x0C,0xD6,0x00,0x10,0x1A,0xD6,0x00,0x10,0xD4,0xD6,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xD7,0x00,0x10, +0x8F,0xD7,0x00,0x10,0x44,0xD7,0x00,0x10,0x8F,0xD7,0x00,0x10,0x00,0x00,0x00,0x00, +0xC9,0xD7,0x00,0x10,0x4C,0xD8,0x00,0x10,0xC9,0xD7,0x00,0x10,0x4C,0xD8,0x00,0x10, +0xF2,0xDC,0x00,0x10,0x05,0xDE,0x00,0x10,0x19,0xDE,0x00,0x10,0x0F,0xDE,0x00,0x10, +0x19,0xDE,0x00,0x10,0x00,0x00,0x00,0x00,0x72,0xDF,0x00,0x10,0x86,0xDF,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0xA2,0x00,0x10, +0xCD,0xA4,0x00,0x10,0x00,0x00,0x00,0x00,0x38,0xA4,0x00,0x10,0xB8,0xA4,0x00,0x10, +0x38,0xA4,0x00,0x10,0x9C,0xA3,0x00,0x10,0x00,0x00,0x00,0x00,0xB8,0xA4,0x00,0x10, +0x00,0x00,0x00,0x00,0x6E,0xA4,0x00,0x10,0x00,0x00,0x00,0x00,0xB8,0xA4,0x00,0x10, +0xCD,0xA4,0x00,0x10,0xAA,0xA4,0x00,0x10,0x00,0x01,0x00,0x00,0x03,0x01,0x02,0x00, +0x03,0x02,0x02,0x00,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xF4,0x01,0xFA,0x00,0x96,0x00,0x64,0x00,0x4B,0x00,0x32,0x00,0x1E,0x00,0x14,0x00, +0x6F,0xBE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0xBE,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0x7D,0xBE,0x00,0x10,0x37,0xBF,0x00,0x10,0x65,0xBE,0x00,0x10,0x95,0xBE,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00, +0x37,0xBF,0x00,0x10,0x65,0xBE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xB2,0xBE,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00,0x37,0xBF,0x00,0x10, +0x65,0xBE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xCA,0xBE,0x00,0x10, +0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00,0x37,0xBF,0x00,0x10,0xF4,0xBE,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x65,0xBE,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x07,0xBF,0x00,0x10, +0x00,0x00,0x00,0x00,0x65,0xBE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0x15,0xBF,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x02,0x00,0x02,0x03, +0x02,0x02,0x02,0x02,0x00,0x03,0x03,0x04,0x03,0x03,0x03,0x00,0x04,0x04,0x04,0x05, +0x04,0x04,0x00,0x06,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x06,0x07, +0x00,0x07,0x07,0x07,0x07,0x02,0x07,0x07,0x19,0xC1,0x00,0x10,0x2B,0xC1,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xC1,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xFA,0xC0,0x00,0x10,0xD5,0xC1,0x00,0x10,0xDF,0xC1,0x00,0x10, +0x52,0xC1,0x00,0x10,0x66,0xC1,0x00,0x10,0xDF,0xC1,0x00,0x10,0xC7,0xC1,0x00,0x10, +0x00,0x00,0x00,0x00,0xFA,0xC0,0x00,0x10,0xD5,0xC1,0x00,0x10,0x3E,0xC1,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xC1,0x00,0x10,0x82,0xC1,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xC1,0x00,0x10,0xDF,0xC1,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDF,0xC1,0x00,0x10,0x00,0x00,0x00,0x00, +0xAD,0xC1,0x00,0x10,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x03,0x00,0x00,0x00, +0x01,0x01,0x02,0x00,0x01,0x01,0x01,0x01,0x02,0x01,0x02,0x02,0x03,0x00,0x00,0x02, +0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x14, +0x18,0x20,0x30,0x34,0x38,0x40,0x44,0x4C,0x5C,0x58,0x60,0x70,0x78,0xF4,0xEC,0xE8, +0xE4,0xDC,0xCC,0xC8,0xC4,0xBC,0xB8,0xB0,0xA0,0xA4,0x9C,0x8C,0x84,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xB2,0x00,0x10,0xC0,0xB2,0x00,0x10, +0x8E,0xB2,0x00,0x10,0x00,0x00,0x00,0x00,0xBD,0xB3,0x00,0x10,0xAB,0xB2,0x00,0x10, +0xC0,0xB2,0x00,0x10,0xAB,0xB2,0x00,0x10,0x00,0x00,0x00,0x00,0xCC,0xB2,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xB2,0x00,0x10,0xC6,0xB2,0x00,0x10, +0x00,0x00,0x00,0x00,0x9C,0xB3,0x00,0x10,0xBD,0xB3,0x00,0x10,0x00,0x00,0x00,0x00, +0xC6,0xB2,0x00,0x10,0xC6,0xB2,0x00,0x10,0x00,0x00,0x00,0x00,0xAF,0xB3,0x00,0x10, +0xBD,0xB3,0x00,0x10,0x00,0x01,0x00,0x01,0x00,0x00,0x03,0x01,0x02,0x01,0x00,0x01, +0x03,0x02,0x02,0x02,0x00,0x02,0x03,0x03,0x03,0x03,0x00,0x03,0x7B,0xED,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8E,0xED,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xB5,0xED,0x00,0x10,0xD8,0xED,0x00,0x10,0x00,0x00,0x00,0x00, +0xA6,0x8C,0x00,0x10,0x0F,0xEE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0x4B,0xEE,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x68,0xEE,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10,0xA6,0x8C,0x00,0x10, +0xF6,0x8B,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02, +0x02,0x02,0x03,0x00,0x02,0x03,0x04,0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x05,0x04, +0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x00,0x06,0x06, +0x06,0x00,0x00,0x00,0xEF,0xF2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0xF3,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xC0,0xF2,0x00,0x10,0x14,0xF3,0x00,0x10,0x00,0x00,0x00,0x00, +0xEF,0xF2,0x00,0x10,0x22,0xF3,0x00,0x10,0x66,0xC1,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0xF3,0x00,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xF3,0x00,0x10,0x40,0xF3,0x00,0x10, +0x82,0xC1,0x00,0x10,0x00,0x00,0x00,0x00,0x58,0xF3,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0xF3,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x70,0xF3,0x00,0x10,0x70,0xF3,0x00,0x10,0x00,0x00,0x00,0x00, +0xAD,0xC1,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x7B,0xF3,0x00,0x10,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x01, +0x03,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x00, +0x00,0x03,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x96,0xC2,0x98,0xD8,0x45,0x39,0xA1,0xF4, +0xA0,0x33,0xEB,0x2D,0x81,0x7D,0x03,0x77,0xF2,0x40,0xA4,0x63,0xE5,0xE6,0xBC,0xF8, +0x47,0x42,0x2C,0xE1,0xF2,0xD1,0x17,0x6B,0xF5,0x51,0xBF,0x37,0x68,0x40,0xB6,0xCB, +0xCE,0x5E,0x31,0x6B,0x57,0x33,0xCE,0x2B,0x16,0x9E,0x0F,0x7C,0x4A,0xEB,0xE7,0x8E, +0x9B,0x7F,0x1A,0xFE,0xE2,0x42,0xE3,0x4F,0x51,0x25,0x63,0xFC,0xC2,0xCA,0xB9,0xF3, +0x84,0x9E,0x17,0xA7,0xAD,0xFA,0xE6,0xBC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xEC,0x0F,0x01,0x10,0x01,0x00,0x1D,0x00, +0x48,0x00,0x28,0x00,0x00,0x00,0x6D,0x00,0x20,0x03,0x48,0x00,0x0D,0x00,0x1D,0x00, +0x10,0x00,0x03,0x00,0x6D,0x00,0x20,0x03,0x2B,0x00,0x06,0x00,0x48,0x00,0x03,0x00, +0x1D,0x00,0x8A,0x00,0x80,0x0C,0x22,0x02,0x33,0x03,0x0E,0x12,0x00,0x00,0x00,0x00, +0x00,0x00,0x66,0x06,0x0E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x09,0x0E,0x12, +0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0x0C,0x0E,0x12,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x10,0x0E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x13,0x0E,0x12,0x00,0x00, +0x00,0x00,0x00,0x00,0x66,0x16,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x19, +0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0x1C,0x0E,0x13,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x20,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x23,0x0E,0x13, +0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x26,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00, +0x9A,0x29,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0x2C,0x0E,0x13,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x30,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x33, +0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x36,0x0E,0x13,0x00,0x00,0x00,0x00, +0x00,0x00,0x9A,0x39,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0x3C,0x0E,0x13, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x0E,0x13,0x00,0x00,0x00,0x00,0x00,0x00, +0x33,0x43,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x46,0x0E,0x14,0x00,0x00, +0x00,0x00,0x00,0x00,0x9A,0x49,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0x4C, +0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x0E,0x14,0x00,0x00,0x00,0x00, +0x00,0x00,0x33,0x53,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x56,0x0E,0x14, +0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x59,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00, +0xCD,0x5C,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x0E,0x14,0x00,0x00, +0x00,0x00,0x00,0x00,0x33,0x63,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66, +0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x69,0x0E,0x14,0x00,0x00,0x00,0x00, +0x00,0x00,0xCD,0x6C,0x0E,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0E,0x15, +0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x73,0x0E,0x15,0x00,0x00,0x00,0x00,0x00,0x00, +0x66,0x76,0x0E,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x79,0x0E,0x15,0x00,0x00, +0x00,0x00,0x00,0x00,0xCD,0x7C,0x0E,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x0F,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x15,0x33,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x48,0x15,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0x15,0x34, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x34,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x54,0x15,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x15,0x34,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x5C,0x15,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60, +0x15,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x15,0x34,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x68,0x15,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x15,0x34, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x15,0x35,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x74,0x15,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x15,0x35,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0x15,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x16,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x16,0x35,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x08,0x16,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x16,0x35, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x16,0x35,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x14,0x16,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x16,0x36,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x1C,0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, +0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x16,0x36,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x28,0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x16,0x36, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x34,0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x16,0x36,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x3C,0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40, +0x16,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x16,0x37,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x48,0x16,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0x16,0x37, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x16,0x37,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x54,0x16,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x16,0x37,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x5C,0x16,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60, +0x16,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_cs.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_cs.c similarity index 79% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_cs.c rename to lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_cs.c index 2b685fc35294fb0bf118310897faee870310ed6c..f8137afd517beb32ed2286d938f87b4cf2b11deb 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_cs.c +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_cs.c @@ -1,25 +1,26 @@ -/*************************************************************************************************/ -/*! - * \file wsf_cs.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Software foundation OS main module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -/*************************************************************************************************/ +#ifdef __IAR_SYSTEMS_ICC__ +#include <intrinsics.h> +#endif #include "wsf_types.h" #include "wsf_cs.h" #include "wsf_assert.h" +#include "max32665.h" /************************************************************************************************** Global Variables @@ -42,14 +43,27 @@ static uint32_t wsfCsStatsStartTime = 0; /*! \brief Critical section start time valid. */ static bool_t wsfCsStatsStartTimeValid = FALSE; +/*! \brief Critical section duration watermark level. */ +uint16_t wsfCsStatsWatermarkUsec = 0; + #endif #if (WSF_CS_STATS == TRUE) /*************************************************************************************************/ /*! - * \fn WsfCsStatsRegister + * \brief Get critical section duration watermark level. * + * \return Critical section duration watermark level. + */ +/*************************************************************************************************/ +uint32_t WsfCsStatsGetCsWaterMark(void) +{ + return wsfCsStatsWatermarkUsec; +} + +/*************************************************************************************************/ +/*! * \brief Register critical section statistics hooks. * * \param timestampCback Callback for obtaining the current timestamp. @@ -121,8 +135,6 @@ static void wsfCsStatsExit(void) /*************************************************************************************************/ /*! - * \fn WsfCsEnter - * * \brief Enter a critical section. * * \return None. @@ -138,7 +150,7 @@ void WsfCsEnter(void) #ifdef __GNUC__ __asm volatile ("cpsid i"); #endif -#ifdef __CC_ARM +#if (defined(__CC_ARM) || defined(__CROSSWORKS)) __disable_irq(); #endif @@ -151,8 +163,6 @@ void WsfCsEnter(void) /*************************************************************************************************/ /*! - * \fn WsfCsExit - * * \brief Enter a critical section. * * \return None. @@ -175,7 +185,7 @@ void WsfCsExit(void) #ifdef __GNUC__ __asm volatile ("cpsie i"); #endif -#ifdef __CC_ARM +#if (defined(__CC_ARM) || defined(__CROSSWORKS)) __enable_irq(); #endif } diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os.c b/lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_os.c similarity index 88% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os.c rename to lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_os.c index 012c1c02e2a176d9bf22285326776ac83cb2074d..d4e0c647b0d4be27ee15b89e2b368ff8a72916bf 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os.c +++ b/lib/sdk/Libraries/BTLE/stack/platform/max32665/wsf_os.c @@ -1,21 +1,18 @@ -/*************************************************************************************************/ -/*! - * \file wsf_os.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Software foundation OS main module. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -/*************************************************************************************************/ #ifdef __IAR_SYSTEMS_ICC__ #include <intrinsics.h> @@ -30,6 +27,7 @@ #include "wsf_buf.h" #include "wsf_msg.h" #include "wsf_cs.h" +// #include "wsf_mbed_os_adaptation.h" /************************************************************************************************** Compile time assert checks @@ -81,9 +79,6 @@ typedef struct /*! \brief OS context. */ wsfOs_t wsfOs; -/*! \brief Critical section duration watermark level. */ -uint16_t wsfCsStatsWatermarkUsec; - #if WSF_OS_DIAG == TRUE /*! Active task handler ID. */ wsfHandlerId_t WsfActiveHandler; @@ -126,7 +121,7 @@ void WsfTaskUnlock(void) void WsfSetEvent(wsfHandlerId_t handlerId, wsfEventMask_t event) { WSF_CS_INIT(cs); - + // coverity[CONSTANT_EXPRESSION_RESULT] WSF_ASSERT(WSF_HANDLER_FROM_ID(handlerId) < WSF_MAX_HANDLERS); WSF_TRACE_INFO2("WsfSetEvent handlerId:%u event:%u", handlerId, event); @@ -137,6 +132,7 @@ void WsfSetEvent(wsfHandlerId_t handlerId, wsfEventMask_t event) WSF_CS_EXIT(cs); /* set event in OS */ + // wsf_mbed_ble_signal_event(); } /*************************************************************************************************/ @@ -151,6 +147,9 @@ void WsfSetEvent(wsfHandlerId_t handlerId, wsfEventMask_t event) /*************************************************************************************************/ void WsfTaskSetReady(wsfHandlerId_t handlerId, wsfTaskEvent_t event) { + /* Unused parameter */ + (void)handlerId; + WSF_CS_INIT(cs); WSF_CS_ENTER(cs); @@ -158,6 +157,7 @@ void WsfTaskSetReady(wsfHandlerId_t handlerId, wsfTaskEvent_t event) WSF_CS_EXIT(cs); /* set event in OS */ + // wsf_mbed_ble_signal_event(); } /*************************************************************************************************/ @@ -171,6 +171,9 @@ void WsfTaskSetReady(wsfHandlerId_t handlerId, wsfTaskEvent_t event) /*************************************************************************************************/ wsfQueue_t *WsfTaskMsgQueue(wsfHandlerId_t handlerId) { + /* Unused parameter */ + (void)handlerId; + return &(wsfOs.task.msgQueue); } @@ -200,8 +203,6 @@ wsfHandlerId_t WsfOsSetNextHandler(wsfEventHandler_t handler) * \brief Check if WSF is ready to sleep. This function should be called when interrupts * are disabled. * - * \param None. - * * \return Return TRUE if there are no pending WSF task events set, FALSE otherwise. */ /*************************************************************************************************/ @@ -210,12 +211,22 @@ bool_t wsfOsReadyToSleep(void) return (wsfOs.task.taskEventMask == 0); } +/*************************************************************************************************/ +/*! +* \brief Initialize OS control structure. +* +* \return None. +*/ +/*************************************************************************************************/ +void WsfOsInit(void) +{ + memset(&wsfOs, 0, sizeof(wsfOs)); +} + /*************************************************************************************************/ /*! * \brief Event dispatched. Designed to be called repeatedly from infinite loop. * - * \param None. - * * \return None. */ /*************************************************************************************************/ diff --git a/lib/sdk/Libraries/BTLE/wsf/include/hci_defs.h b/lib/sdk/Libraries/BTLE/wsf/include/hci_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..f9bf8d270cfc66c508bb1f1da49096f64437c5e4 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/hci_defs.h @@ -0,0 +1,1372 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief HCI constants and definitions from the Bluetooth specification. + */ +/*************************************************************************************************/ +#ifndef HCI_DEFS_H +#define HCI_DEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup STACK_HCI_API + * \{ */ + +/** \name Packet definitions + * + */ +/**@{*/ +#define HCI_CMD_HDR_LEN 3 /*!< \brief Command packet header length */ +#define HCI_ACL_HDR_LEN 4 /*!< \brief ACL packet header length */ +#define HCI_ISO_HDR_LEN 4 /*!< \brief ISO packet header length */ +#define HCI_EVT_HDR_LEN 2 /*!< \brief Event packet header length */ +#define HCI_EVT_PARAM_MAX_LEN 255 /*!< \brief Maximum length of event packet parameters */ +#define HCI_ACL_DEFAULT_LEN 27 /*!< \brief Default maximum ACL packet length */ +#define HCI_PB_FLAG_MASK 0x3000 /*!< \brief ACL packet boundary flag mask */ +#define HCI_PB_START_H2C 0x0000 /*!< \brief Packet boundary flag, start, host-to-controller */ +#define HCI_PB_CONTINUE 0x1000 /*!< \brief Packet boundary flag, continue */ +#define HCI_PB_START_C2H 0x2000 /*!< \brief Packet boundary flag, start, controller-to-host */ +#define HCI_HANDLE_MASK 0x0FFF /*!< \brief Mask for handle bits in ACL packet */ +#define HCI_HANDLE_NONE 0xFFFF /*!< \brief Value for invalid handle */ +/**@}*/ + +/** \name Packet types + * + */ +#define HCI_CMD_TYPE 1 /*!< \brief HCI command packet */ +#define HCI_ACL_TYPE 2 /*!< \brief HCI ACL data packet */ +#define HCI_EVT_TYPE 4 /*!< \brief HCI event packet */ +#define HCI_ISO_TYPE 5 /*!< \brief HCI ISO data packet */ +/**@}*/ + +/** \name Error codes + * + */ +/**@{*/ +#define HCI_SUCCESS 0x00 /*!< \brief Success */ +#define HCI_ERR_UNKNOWN_CMD 0x01 /*!< \brief Unknown HCI command */ +#define HCI_ERR_UNKNOWN_HANDLE 0x02 /*!< \brief Unknown connection identifier */ +#define HCI_ERR_HARDWARE_FAILURE 0x03 /*!< \brief Hardware failure */ +#define HCI_ERR_PAGE_TIMEOUT 0x04 /*!< \brief Page timeout */ +#define HCI_ERR_AUTH_FAILURE 0x05 /*!< \brief Authentication failure */ +#define HCI_ERR_KEY_MISSING 0x06 /*!< \brief PIN or key missing */ +#define HCI_ERR_MEMORY_EXCEEDED 0x07 /*!< \brief Memory capacity exceeded */ +#define HCI_ERR_CONN_TIMEOUT 0x08 /*!< \brief Connection timeout */ +#define HCI_ERR_CONN_LIMIT 0x09 /*!< \brief Connection limit exceeded */ +#define HCI_ERR_SYNCH_CONN_LIMIT 0x0A /*!< \brief Synchronous connection limit exceeded */ +#define HCI_ERR_ACL_CONN_EXISTS 0x0B /*!< \brief ACL connection already exists */ +#define HCI_ERR_CMD_DISALLOWED 0x0C /*!< \brief Command disallowed */ +#define HCI_ERR_REJ_RESOURCES 0x0D /*!< \brief Connection rejected limited resources */ +#define HCI_ERR_REJ_SECURITY 0x0E /*!< \brief Connection rejected security reasons */ +#define HCI_ERR_REJ_BD_ADDR 0x0F /*!< \brief Connection rejected unacceptable BD_ADDR */ +#define HCI_ERR_ACCEPT_TIMEOUT 0x10 /*!< \brief Connection accept timeout exceeded */ +#define HCI_ERR_UNSUP_FEAT 0x11 /*!< \brief Unsupported feature or parameter value */ +#define HCI_ERR_INVALID_PARAM 0x12 /*!< \brief Invalid HCI command parameters */ +#define HCI_ERR_REMOTE_TERMINATED 0x13 /*!< \brief Remote user terminated connection */ +#define HCI_ERR_REMOTE_RESOURCES 0x14 /*!< \brief Remote device low resources */ +#define HCI_ERR_REMOTE_POWER_OFF 0x15 /*!< \brief Remote device power off */ +#define HCI_ERR_LOCAL_TERMINATED 0x16 /*!< \brief Connection terminated by local host */ +#define HCI_ERR_REPEATED_ATTEMPTS 0x17 /*!< \brief Repeated attempts */ +#define HCI_ERR_PAIRING_NOT_ALLOWED 0x18 /*!< \brief Pairing not allowed */ +#define HCI_ERR_UNKNOWN_LMP_PDU 0x19 /*!< \brief Unknown LMP PDU */ +#define HCI_ERR_UNSUP_REMOTE_FEAT 0x1A /*!< \brief Unsupported remote feature */ +#define HCI_ERR_SCO_OFFSET 0x1B /*!< \brief SCO offset rejected */ +#define HCI_ERR_SCO_INTERVAL 0x1C /*!< \brief SCO interval rejected */ +#define HCI_ERR_SCO_MODE 0x1D /*!< \brief SCO air mode rejected */ +#define HCI_ERR_LMP_PARAM 0x1E /*!< \brief Invalid LMP parameters */ +#define HCI_ERR_UNSPECIFIED 0x1F /*!< \brief Unspecified error */ +#define HCI_ERR_UNSUP_LMP_PARAM 0x20 /*!< \brief Unsupported LMP parameter value */ +#define HCI_ERR_ROLE_CHANGE 0x21 /*!< \brief Role change not allowed */ +#define HCI_ERR_LL_RESP_TIMEOUT 0x22 /*!< \brief LL response timeout */ +#define HCI_ERR_LMP_COLLISION 0x23 /*!< \brief LMP error transaction collision */ +#define HCI_ERR_LMP_PDU 0x24 /*!< \brief LMP pdu not allowed */ +#define HCI_ERR_ENCRYPT_MODE 0x25 /*!< \brief Encryption mode not acceptable */ +#define HCI_ERR_LINK_KEY 0x26 /*!< \brief Link key can not be changed */ +#define HCI_ERR_UNSUP_QOS 0x27 /*!< \brief Requested qos not supported */ +#define HCI_ERR_INSTANT_PASSED 0x28 /*!< \brief Instant passed */ +#define HCI_ERR_UNSUP_UNIT_KEY 0x29 /*!< \brief Pairing with unit key not supported */ +#define HCI_ERR_TRANSACT_COLLISION 0x2A /*!< \brief Different transaction collision */ +#define HCI_ERR_CHANNEL_CLASS 0x2E /*!< \brief Channel classification not supported */ +#define HCI_ERR_MEMORY 0x2F /*!< \brief Insufficient security */ +#define HCI_ERR_PARAMETER_RANGE 0x30 /*!< \brief Parameter out of mandatory range */ +#define HCI_ERR_ROLE_SWITCH_PEND 0x32 /*!< \brief Role switch pending */ +#define HCI_ERR_RESERVED_SLOT 0x34 /*!< \brief Reserved slot violation */ +#define HCI_ERR_ROLE_SWITCH 0x35 /*!< \brief Role switch failed */ +#define HCI_ERR_INQ_TOO_LARGE 0x36 /*!< \brief Extended inquiry response too large */ +#define HCI_ERR_UNSUP_SSP 0x37 /*!< \brief Secure simple pairing not supported by host */ +#define HCI_ERR_HOST_BUSY_PAIRING 0x38 /*!< \brief Host busy - pairing */ +#define HCI_ERR_NO_CHANNEL 0x39 /*!< \brief Connection rejected no suitable channel */ +#define HCI_ERR_CONTROLLER_BUSY 0x3A /*!< \brief Controller busy */ +#define HCI_ERR_CONN_INTERVAL 0x3B /*!< \brief Unacceptable connection interval */ +#define HCI_ERR_ADV_TIMEOUT 0x3C /*!< \brief Advertising timeout */ +#define HCI_ERR_MIC_FAILURE 0x3D /*!< \brief Connection terminated due to MIC failure */ +#define HCI_ERR_CONN_FAIL 0x3E /*!< \brief Connection failed to be established */ +#define HCI_ERR_MAC_CONN_FAIL 0x3F /*!< \brief MAC connection failed */ +#define HCI_ERR_COARSE_CLK_ADJ_REJ 0x40 /*!< \brief Coarse clock adjustment rejected */ +#define HCI_ERR_TYPE0_SUBMAP_NOT_DEF 0x41 /*!< \brief Type0 submap not defined */ +#define HCI_ERR_UNKNOWN_ADV_ID 0x42 /*!< \brief Unknown advertising identifier */ +#define HCI_ERR_LIMIT_REACHED 0x43 /*!< \brief Limit reached */ +#define HCI_ERR_OP_CANCELLED_BY_HOST 0x44 /*!< \brief Operation cancelled by host */ +/*! \brief New in version 5.1 */ +#define HCI_ERR_PKT_TOO_LONG 0x45 /*!< \brief Packet too long */ +/**@}*/ + +/** \name Command groups + * + */ +/**@{*/ +#define HCI_OGF_NOP 0x00 /*!< \brief No operation */ +#define HCI_OGF_LINK_CONTROL 0x01 /*!< \brief Link control */ +#define HCI_OGF_LINK_POLICY 0x02 /*!< \brief Link policy */ +#define HCI_OGF_CONTROLLER 0x03 /*!< \brief Controller and baseband */ +#define HCI_OGF_INFORMATIONAL 0x04 /*!< \brief Informational parameters */ +#define HCI_OGF_STATUS 0x05 /*!< \brief Status parameters */ +#define HCI_OGF_TESTING 0x06 /*!< \brief Testing */ +#define HCI_OGF_LE_CONTROLLER 0x08 /*!< \brief LE controller */ +#define HCI_OGF_VENDOR_SPEC 0x3F /*!< \brief Vendor specific */ +/**@}*/ + +/** \name NOP command + * + */ +/**@{*/ +#define HCI_OCF_NOP 0x00 +/**@}*/ + +/** \name Link control commands + * + */ +/**@{*/ +#define HCI_OCF_DISCONNECT 0x06 +#define HCI_OCF_READ_REMOTE_VER_INFO 0x1D +/**@}*/ + +/*! \brief Link policy commands (none used for LE) */ + +/** \name Controller and baseband commands + * + */ +/**@{*/ +#define HCI_OCF_SET_EVENT_MASK 0x01 +#define HCI_OCF_RESET 0x03 +#define HCI_OCF_READ_TX_PWR_LVL 0x2D +#define HCI_OCF_SET_CONTROLLER_TO_HOST_FC 0x31 +#define HCI_OCF_HOST_BUFFER_SIZE 0x33 +#define HCI_OCF_HOST_NUM_CMPL_PKTS 0x35 +#define HCI_OCF_SET_EVENT_MASK_PAGE2 0x63 +#define HCI_OCF_READ_AUTH_PAYLOAD_TO 0x7B +#define HCI_OCF_WRITE_AUTH_PAYLOAD_TO 0x7C +/**@}*/ + +/** \name Informational commands + * + */ +/**@{*/ +#define HCI_OCF_READ_LOCAL_VER_INFO 0x01 +#define HCI_OCF_READ_LOCAL_SUP_CMDS 0x02 +#define HCI_OCF_READ_LOCAL_SUP_FEAT 0x03 +#define HCI_OCF_READ_BUF_SIZE 0x05 +#define HCI_OCF_READ_BD_ADDR 0x09 +/**@}*/ + +/** \name Status commands + * + */ +/**@{*/ +#define HCI_OCF_READ_RSSI 0x05 +/**@}*/ + +/** \name LE controller commands + * + */ +/**@{*/ +#define HCI_OCF_LE_SET_EVENT_MASK 0x01 +#define HCI_OCF_LE_READ_BUF_SIZE 0x02 +#define HCI_OCF_LE_READ_LOCAL_SUP_FEAT 0x03 +#define HCI_OCF_LE_SET_RAND_ADDR 0x05 +#define HCI_OCF_LE_SET_ADV_PARAM 0x06 +#define HCI_OCF_LE_READ_ADV_TX_POWER 0x07 +#define HCI_OCF_LE_SET_ADV_DATA 0x08 +#define HCI_OCF_LE_SET_SCAN_RESP_DATA 0x09 +#define HCI_OCF_LE_SET_ADV_ENABLE 0x0A +#define HCI_OCF_LE_SET_SCAN_PARAM 0x0B +#define HCI_OCF_LE_SET_SCAN_ENABLE 0x0C +#define HCI_OCF_LE_CREATE_CONN 0x0D +#define HCI_OCF_LE_CREATE_CONN_CANCEL 0x0E +#define HCI_OCF_LE_READ_WHITE_LIST_SIZE 0x0F +#define HCI_OCF_LE_CLEAR_WHITE_LIST 0x10 +#define HCI_OCF_LE_ADD_DEV_WHITE_LIST 0x11 +#define HCI_OCF_LE_REMOVE_DEV_WHITE_LIST 0x12 +#define HCI_OCF_LE_CONN_UPDATE 0x13 +#define HCI_OCF_LE_SET_HOST_CHAN_CLASS 0x14 +#define HCI_OCF_LE_READ_CHAN_MAP 0x15 +#define HCI_OCF_LE_READ_REMOTE_FEAT 0x16 +#define HCI_OCF_LE_ENCRYPT 0x17 +#define HCI_OCF_LE_RAND 0x18 +#define HCI_OCF_LE_START_ENCRYPTION 0x19 +#define HCI_OCF_LE_LTK_REQ_REPL 0x1A +#define HCI_OCF_LE_LTK_REQ_NEG_REPL 0x1B +#define HCI_OCF_LE_READ_SUP_STATES 0x1C +#define HCI_OCF_LE_RECEIVER_TEST 0x1D +#define HCI_OCF_LE_TRANSMITTER_TEST 0x1E +#define HCI_OCF_LE_TEST_END 0x1F +/*! \brief New in version 4.1 */ +#define HCI_OCF_LE_REM_CONN_PARAM_REP 0x20 +#define HCI_OCF_LE_REM_CONN_PARAM_NEG_REP 0x21 +/*! \brief New in version 4.2 */ +#define HCI_OCF_LE_SET_DATA_LEN 0x22 +#define HCI_OCF_LE_READ_DEF_DATA_LEN 0x23 +#define HCI_OCF_LE_WRITE_DEF_DATA_LEN 0x24 +#define HCI_OCF_LE_READ_LOCAL_P256_PUB_KEY 0x25 +#define HCI_OCF_LE_GENERATE_DHKEY 0x26 +#define HCI_OCF_LE_ADD_DEV_RES_LIST 0x27 +#define HCI_OCF_LE_REMOVE_DEV_RES_LIST 0x28 +#define HCI_OCF_LE_CLEAR_RES_LIST 0x29 +#define HCI_OCF_LE_READ_RES_LIST_SIZE 0x2A +#define HCI_OCF_LE_READ_PEER_RES_ADDR 0x2B +#define HCI_OCF_LE_READ_LOCAL_RES_ADDR 0x2C +#define HCI_OCF_LE_SET_ADDR_RES_ENABLE 0x2D +#define HCI_OCF_LE_SET_RES_PRIV_ADDR_TO 0x2E +#define HCI_OCF_LE_READ_MAX_DATA_LEN 0x2F +/*! \brief New in version 5.0 */ +#define HCI_OCF_LE_READ_PHY 0x30 +#define HCI_OCF_LE_SET_DEF_PHY 0x31 +#define HCI_OCF_LE_SET_PHY 0x32 +#define HCI_OCF_LE_ENHANCED_RECEIVER_TEST 0x33 +#define HCI_OCF_LE_ENHANCED_TRANSMITTER_TEST 0x34 +#define HCI_OCF_LE_SET_ADV_SET_RAND_ADDR 0x35 +#define HCI_OCF_LE_SET_EXT_ADV_PARAM 0x36 +#define HCI_OCF_LE_SET_EXT_ADV_DATA 0x37 +#define HCI_OCF_LE_SET_EXT_SCAN_RESP_DATA 0x38 +#define HCI_OCF_LE_SET_EXT_ADV_ENABLE 0x39 +#define HCI_OCF_LE_READ_MAX_ADV_DATA_LEN 0x3A +#define HCI_OCF_LE_READ_NUM_SUP_ADV_SETS 0x3B +#define HCI_OCF_LE_REMOVE_ADV_SET 0x3C +#define HCI_OCF_LE_CLEAR_ADV_SETS 0x3D +#define HCI_OCF_LE_SET_PER_ADV_PARAM 0x3E +#define HCI_OCF_LE_SET_PER_ADV_DATA 0x3F +#define HCI_OCF_LE_SET_PER_ADV_ENABLE 0x40 +#define HCI_OCF_LE_SET_EXT_SCAN_PARAM 0x41 +#define HCI_OCF_LE_SET_EXT_SCAN_ENABLE 0x42 +#define HCI_OCF_LE_EXT_CREATE_CONN 0x43 +#define HCI_OCF_LE_PER_ADV_CREATE_SYNC 0x44 +#define HCI_OCF_LE_PER_ADV_CREATE_SYNC_CANCEL 0x45 +#define HCI_OCF_LE_PER_ADV_TERM_SYNC 0x46 +#define HCI_OCF_LE_ADD_DEV_PER_ADV_LIST 0x47 +#define HCI_OCF_LE_REMOVE_DEV_PER_ADV_LIST 0x48 +#define HCI_OCF_LE_CLEAR_PER_ADV_LIST 0x49 +#define HCI_OCF_LE_READ_PER_ADV_LIST_SIZE 0x4A +#define HCI_OCF_LE_READ_TX_POWER 0x4B +#define HCI_OCF_LE_READ_RF_PATH_COMP 0x4C +#define HCI_OCF_LE_WRITE_RF_PATH_COMP 0x4D +#define HCI_OCF_LE_SET_PRIVACY_MODE 0x4E +/*! \brief New in version 5.1 */ +#define HCI_OCF_LE_RECEIVER_TEST_V3 0x4F +#define HCI_OCF_LE_TRANSMITTER_TEST_V3 0x50 +#define HCI_OCF_LE_SET_CONNLESS_CTE_TX_PARAMS 0x51 +#define HCI_OCF_LE_SET_CONNLESS_CTE_TX_ENABLE 0x52 +#define HCI_OCF_LE_SET_CONNLESS_IQ_SAMP_ENABLE 0x53 +#define HCI_OCF_LE_SET_CONN_CTE_RX_PARAMS 0x54 +#define HCI_OCF_LE_SET_CONN_CTE_TX_PARAMS 0x55 +#define HCI_OCF_LE_CONN_CTE_REQ_ENABLE 0x56 +#define HCI_OCF_LE_CONN_CTE_RSP_ENABLE 0x57 +#define HCI_OCF_LE_READ_ANTENNA_INFO 0x58 +#define HCI_OCF_LE_SET_PER_ADV_RCV_ENABLE 0x59 +#define HCI_OCF_LE_PER_ADV_SYNC_TRANSFER 0x5A +#define HCI_OCF_LE_PER_ADV_SET_INFO_TRANSFER 0x5B +#define HCI_OCF_LE_SET_PAST_PARAM 0x5C +#define HCI_OCF_LE_SET_DEFAULT_PAST_PARAM 0x5D +#define HCI_OCF_LE_GENERATE_DHKEY_V2 0x5E +#define HCI_OCF_LE_MODIFY_SLEEP_CLK_ACC 0x5F +/*! \brief New in version Milan */ +#define HCI_OCF_LE_READ_ISO_BUFFER_SIZE 0x60 +#define HCI_OCF_LE_READ_ISO_TX_SYNC 0x61 +#define HCI_OCF_LE_SET_CIG_PARAMS 0x62 +#define HCI_OCF_LE_SET_CIG_PARAMS_TEST 0x63 +#define HCI_OCF_LE_CREATE_CIS 0x64 +#define HCI_OCF_LE_REMOVE_CIG 0x65 +#define HCI_OCF_LE_ACCEPT_CIS_REQ 0x66 +#define HCI_OCF_LE_REJECT_CIS_REQ 0x67 +#define HCI_OCF_LE_CREATE_BIG 0x68 +#define HCI_OCF_LE_CREATE_BIG_TEST 0x69 +#define HCI_OCF_LE_BIG_CREATE_SYNC 0x6A +#define HCI_OCF_LE_TERMINATE_BIG 0x6B +#define HCI_OCF_LE_BIG_TERMINATE_SYNC 0x6C +#define HCI_OCF_LE_REQUEST_PEER_SCA 0x6D +#define HCI_OCF_LE_SETUP_ISO_DATA_PATH 0x6E +#define HCI_OCF_LE_REMOVE_ISO_DATA_PATH 0x6F +#define HCI_OCF_LE_ISO_TX_TEST 0x70 +#define HCI_OCF_LE_ISO_RX_TEST 0x71 +#define HCI_OCF_LE_ISO_READ_TEST_COUNTER 0x72 +#define HCI_OCF_LE_ISO_TERMINATE_TEST 0x73 +/**@}*/ + +/** \name Opcode manipulation macros + * + */ +/**@{*/ +#define HCI_OPCODE(ogf, ocf) (((ogf) << 10) + (ocf)) +#define HCI_OGF(opcode) ((opcode) >> 10) +#define HCI_OCF(opcode) ((opcode) & 0x03FF) +/**@}*/ + +/** \name Command opcodes + * + */ +/**@{*/ +#define HCI_OPCODE_NOP HCI_OPCODE(HCI_OGF_NOP, HCI_OCF_NOP) + +#define HCI_OPCODE_DISCONNECT HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_DISCONNECT) +#define HCI_OPCODE_READ_REMOTE_VER_INFO HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_READ_REMOTE_VER_INFO) + +#define HCI_OPCODE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK) +#define HCI_OPCODE_RESET HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_RESET) +#define HCI_OPCODE_READ_TX_PWR_LVL HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_TX_PWR_LVL) +#define HCI_OPCODE_SET_EVENT_MASK_PAGE2 HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK_PAGE2) +#define HCI_OPCODE_READ_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_AUTH_PAYLOAD_TO) +#define HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_WRITE_AUTH_PAYLOAD_TO) + +#define HCI_OPCODE_READ_LOCAL_VER_INFO HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_VER_INFO) +#define HCI_OPCODE_READ_LOCAL_SUP_CMDS HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_CMDS) +#define HCI_OPCODE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_FEAT) +#define HCI_OPCODE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BUF_SIZE) +#define HCI_OPCODE_READ_BD_ADDR HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BD_ADDR) + +#define HCI_OPCODE_READ_RSSI HCI_OPCODE(HCI_OGF_STATUS, HCI_OCF_READ_RSSI) + +#define HCI_OPCODE_LE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EVENT_MASK) +#define HCI_OPCODE_LE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_BUF_SIZE) +#define HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_SUP_FEAT) +#define HCI_OPCODE_LE_SET_RAND_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RAND_ADDR) +#define HCI_OPCODE_LE_SET_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_PARAM) +#define HCI_OPCODE_LE_READ_ADV_TX_POWER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ADV_TX_POWER) +#define HCI_OPCODE_LE_SET_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_DATA) +#define HCI_OPCODE_LE_SET_SCAN_RESP_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_RESP_DATA) +#define HCI_OPCODE_LE_SET_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_ENABLE) +#define HCI_OPCODE_LE_SET_SCAN_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_PARAM) +#define HCI_OPCODE_LE_SET_SCAN_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_ENABLE) +#define HCI_OPCODE_LE_CREATE_CONN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN) +#define HCI_OPCODE_LE_CREATE_CONN_CANCEL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN_CANCEL) +#define HCI_OPCODE_LE_READ_WHITE_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_WHITE_LIST_SIZE) +#define HCI_OPCODE_LE_CLEAR_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_WHITE_LIST) +#define HCI_OPCODE_LE_ADD_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_WHITE_LIST) +#define HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_WHITE_LIST) +#define HCI_OPCODE_LE_CONN_UPDATE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_UPDATE) +#define HCI_OPCODE_LE_SET_HOST_CHAN_CLASS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_HOST_CHAN_CLASS) +#define HCI_OPCODE_LE_READ_CHAN_MAP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_CHAN_MAP) +#define HCI_OPCODE_LE_READ_REMOTE_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_REMOTE_FEAT) +#define HCI_OPCODE_LE_ENCRYPT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENCRYPT) +#define HCI_OPCODE_LE_RAND HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RAND) +#define HCI_OPCODE_LE_START_ENCRYPTION HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_START_ENCRYPTION) +#define HCI_OPCODE_LE_LTK_REQ_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_REPL) +#define HCI_OPCODE_LE_LTK_REQ_NEG_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_NEG_REPL) +#define HCI_OPCODE_LE_READ_SUP_STATES HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_SUP_STATES) +#define HCI_OPCODE_LE_RECEIVER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST) +#define HCI_OPCODE_LE_TRANSMITTER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST) +#define HCI_OPCODE_LE_TEST_END HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TEST_END) +/*! \brief New in version 4.1 */ +#define HCI_OPCODE_LE_REM_CONN_PARAM_REP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REM_CONN_PARAM_REP) +#define HCI_OPCODE_LE_REM_CONN_PARAM_NEG_REP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REM_CONN_PARAM_NEG_REP) +/*! \brief New in version 4.2 */ +#define HCI_OPCODE_LE_SET_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_DATA_LEN) +#define HCI_OPCODE_LE_READ_DEF_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_DEF_DATA_LEN) +#define HCI_OPCODE_LE_WRITE_DEF_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_WRITE_DEF_DATA_LEN) +#define HCI_OPCODE_LE_READ_LOCAL_P256_PUB_KEY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_P256_PUB_KEY) +#define HCI_OPCODE_LE_GENERATE_DHKEY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_GENERATE_DHKEY) +#define HCI_OPCODE_LE_ADD_DEV_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_RES_LIST) +#define HCI_OPCODE_LE_REMOVE_DEV_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_RES_LIST) +#define HCI_OPCODE_LE_CLEAR_RES_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_RES_LIST) +#define HCI_OPCODE_LE_READ_RES_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_RES_LIST_SIZE) +#define HCI_OPCODE_LE_READ_PEER_RES_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_PEER_RES_ADDR) +#define HCI_OPCODE_LE_READ_LOCAL_RES_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_RES_ADDR) +#define HCI_OPCODE_LE_SET_ADDR_RES_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADDR_RES_ENABLE) +#define HCI_OPCODE_LE_SET_RES_PRIV_ADDR_TO HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RES_PRIV_ADDR_TO) +#define HCI_OPCODE_LE_READ_MAX_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_MAX_DATA_LEN) +/*! \brief New in version 5.0 */ +#define HCI_OPCODE_LE_READ_PHY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_PHY) +#define HCI_OPCODE_LE_SET_DEF_PHY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_DEF_PHY) +#define HCI_OPCODE_LE_SET_PHY HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PHY) +#define HCI_OPCODE_LE_ENHANCED_RECEIVER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENHANCED_RECEIVER_TEST) +#define HCI_OPCODE_LE_ENHANCED_TRANSMITTER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENHANCED_TRANSMITTER_TEST) +#define HCI_OPCODE_LE_SET_ADV_SET_RAND_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_SET_RAND_ADDR) +#define HCI_OPCODE_LE_SET_EXT_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_ADV_PARAM) +#define HCI_OPCODE_LE_SET_EXT_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_ADV_DATA) +#define HCI_OPCODE_LE_SET_EXT_SCAN_RESP_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_SCAN_RESP_DATA) +#define HCI_OPCODE_LE_SET_EXT_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_ADV_ENABLE) +#define HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_MAX_ADV_DATA_LEN) +#define HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_NUM_SUP_ADV_SETS) +#define HCI_OPCODE_LE_REMOVE_ADV_SET HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_ADV_SET) +#define HCI_OPCODE_LE_CLEAR_ADV_SETS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_ADV_SETS) +#define HCI_OPCODE_LE_SET_PER_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PER_ADV_PARAM) +#define HCI_OPCODE_LE_SET_PER_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PER_ADV_DATA) +#define HCI_OPCODE_LE_SET_PER_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PER_ADV_ENABLE) +#define HCI_OPCODE_LE_SET_EXT_SCAN_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_SCAN_PARAM) +#define HCI_OPCODE_LE_SET_EXT_SCAN_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EXT_SCAN_ENABLE) +#define HCI_OPCODE_LE_EXT_CREATE_CONN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_EXT_CREATE_CONN) +#define HCI_OPCODE_LE_PER_ADV_CREATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_CREATE_SYNC) +#define HCI_OPCODE_LE_PER_ADV_CREATE_SYNC_CANCEL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_CREATE_SYNC_CANCEL) +#define HCI_OPCODE_LE_PER_ADV_TERMINATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_TERM_SYNC) +#define HCI_OPCODE_LE_ADD_DEV_PER_ADV_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_PER_ADV_LIST) +#define HCI_OPCODE_LE_REMOVE_DEV_PER_ADV_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_PER_ADV_LIST) +#define HCI_OPCODE_LE_CLEAR_PER_ADV_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_PER_ADV_LIST) +#define HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_PER_ADV_LIST_SIZE) +#define HCI_OPCODE_LE_READ_TX_POWER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_TX_POWER) +#define HCI_OPCODE_LE_WRITE_RF_PATH_COMP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_WRITE_RF_PATH_COMP) +#define HCI_OPCODE_LE_READ_RF_PATH_COMP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_RF_PATH_COMP) +#define HCI_OPCODE_LE_SET_PRIVACY_MODE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PRIVACY_MODE) +/*! \brief New in version 5.1 */ +#define HCI_OPCODE_LE_RECEIVER_TEST_V3 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST_V3) +#define HCI_OPCODE_LE_TRANSMITTER_TEST_V3 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST_V3) +#define HCI_OPCODE_LE_SET_CONNLESS_CTE_TX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_CTE_TX_PARAMS) +#define HCI_OPCODE_LE_SET_CONNLESS_CTE_TX_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_CTE_TX_ENABLE) +#define HCI_OPCODE_LE_SET_CONNLESS_IQ_SAMP_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONNLESS_IQ_SAMP_ENABLE) +#define HCI_OPCODE_LE_SET_CONN_CTE_RX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONN_CTE_RX_PARAMS) +#define HCI_OPCODE_LE_SET_CONN_CTE_TX_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CONN_CTE_TX_PARAMS) +#define HCI_OPCODE_LE_CONN_CTE_REQ_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_CTE_REQ_ENABLE) +#define HCI_OPCODE_LE_CONN_CTE_RSP_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_CTE_RSP_ENABLE) +#define HCI_OPCODE_LE_READ_ANTENNA_INFO HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ANTENNA_INFO) +#define HCI_OPCODE_LE_SET_PER_ADV_RCV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PER_ADV_RCV_ENABLE) +#define HCI_OPCODE_LE_PER_ADV_SYNC_TRANSFER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_SYNC_TRANSFER) +#define HCI_OPCODE_LE_PER_ADV_SET_INFO_TRANSFER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_PER_ADV_SET_INFO_TRANSFER) +#define HCI_OPCODE_LE_SET_PAST_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_PAST_PARAM) +#define HCI_OPCODE_LE_SET_DEFAULT_PAST_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_DEFAULT_PAST_PARAM) +#define HCI_OPCODE_LE_GENERATE_DHKEY_V2 HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_GENERATE_DHKEY_V2) +#define HCI_OPCODE_LE_MODIFY_SLEEP_CLK_ACC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_MODIFY_SLEEP_CLK_ACC) +/*! \brief New in version Milan */ +#define HCI_OPCODE_LE_READ_ISO_BUFFER_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ISO_BUFFER_SIZE) +#define HCI_OPCODE_LE_READ_ISO_TX_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ISO_TX_SYNC) +#define HCI_OPCODE_LE_SET_CIG_PARAMS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CIG_PARAMS) +#define HCI_OPCODE_LE_SET_CIG_PARAMS_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_CIG_PARAMS_TEST) +#define HCI_OPCODE_LE_CREATE_CIS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CIS) +#define HCI_OPCODE_LE_REMOVE_CIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_CIG) +#define HCI_OPCODE_LE_ACCEPT_CIS_REQ HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ACCEPT_CIS_REQ) +#define HCI_OPCODE_LE_REJECT_CIS_REQ HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REJECT_CIS_REQ) +#define HCI_OPCODE_LE_CREATE_BIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_BIG) +#define HCI_OPCODE_LE_CREATE_BIG_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_BIG_TEST) +#define HCI_OPCODE_LE_BIG_CREATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_BIG_CREATE_SYNC) +#define HCI_OPCODE_LE_TERMINATE_BIG HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TERMINATE_BIG) +#define HCI_OPCODE_LE_BIG_TERMINATE_SYNC HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_BIG_TERMINATE_SYNC) +#define HCI_OPCODE_LE_REQUEST_PEER_SCA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REQUEST_PEER_SCA) +#define HCI_OPCODE_LE_SETUP_ISO_DATA_PATH HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SETUP_ISO_DATA_PATH) +#define HCI_OPCODE_LE_REMOVE_ISO_DATA_PATH HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_ISO_DATA_PATH) +#define HCI_OPCODE_LE_ISO_TX_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_TX_TEST) +#define HCI_OPCODE_LE_ISO_RX_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_RX_TEST) +#define HCI_OPCODE_LE_ISO_READ_TEST_COUNTER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_READ_TEST_COUNTER) +#define HCI_OPCODE_LE_ISO_TERMINATE_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ISO_TERMINATE_TEST) +/**@}*/ + +/** \name ARM Vendor Specific + * + */ +/**@{*/ +#define HCI_OPCODE_LE_VS_ENABLE_READ_FEAT_ON_CONN ((uint16_t)(0xfff3)) +/**@}*/ + +/** \name Command parameter lengths + * + */ +/**@{*/ +#define HCI_LEN_NOP 0 + +#define HCI_LEN_DISCONNECT 3 +#define HCI_LEN_READ_REMOTE_VER_INFO 2 + +#define HCI_LEN_SET_EVENT_MASK 8 +#define HCI_LEN_SET_EVENT_MASK_PAGE2 8 +#define HCI_LEN_RESET 0 +#define HCI_LEN_READ_TX_PWR_LVL 3 +#define HCI_LEN_SET_CONTROLLER_TO_HOST_FC 1 +#define HCI_LEN_HOST_BUFFER_SIZE 8 +#define HCI_LEN_HOST_NUM_CMPL_PKTS 1 + +#define HCI_LEN_READ_LOCAL_VER_INFO 0 +#define HCI_LEN_READ_LOCAL_SUP_CMDS 0 +#define HCI_LEN_READ_LOCAL_SUP_FEAT 0 +#define HCI_LEN_READ_BUF_SIZE 0 +#define HCI_LEN_READ_BD_ADDR 0 + +#define HCI_LEN_READ_RSSI 2 +#define HCI_LEN_READ_AUTH_PAYLOAD_TO 2 +#define HCI_LEN_WRITE_AUTH_PAYLOAD_TO 4 + +#define HCI_LEN_LE_SET_EVENT_MASK 8 +#define HCI_LEN_LE_READ_BUF_SIZE 0 +#define HCI_LEN_LE_READ_LOCAL_SUP_FEAT 0 +#define HCI_LEN_LE_SET_RAND_ADDR 6 +#define HCI_LEN_LE_SET_ADV_PARAM 15 +#define HCI_LEN_LE_READ_ADV_TX_POWER 0 +#define HCI_LEN_LE_SET_ADV_DATA 32 +#define HCI_LEN_LE_SET_SCAN_RESP_DATA 32 +#define HCI_LEN_LE_SET_ADV_ENABLE 1 +#define HCI_LEN_LE_SET_SCAN_PARAM 7 +#define HCI_LEN_LE_SET_SCAN_ENABLE 2 +#define HCI_LEN_LE_CREATE_CONN 25 +#define HCI_LEN_LE_CREATE_CONN_CANCEL 0 +#define HCI_LEN_LE_READ_WHITE_LIST_SIZE 0 +#define HCI_LEN_LE_CLEAR_WHITE_LIST 0 +#define HCI_LEN_LE_ADD_DEV_WHITE_LIST 7 +#define HCI_LEN_LE_REMOVE_DEV_WHITE_LIST 7 +#define HCI_LEN_LE_CONN_UPDATE 14 +#define HCI_LEN_LE_SET_HOST_CHAN_CLASS 5 +#define HCI_LEN_LE_READ_CHAN_MAP 2 +#define HCI_LEN_LE_READ_REMOTE_FEAT 2 +#define HCI_LEN_LE_ENCRYPT 32 +#define HCI_LEN_LE_RAND 0 +#define HCI_LEN_LE_START_ENCRYPTION 28 +#define HCI_LEN_LE_LTK_REQ_REPL 18 +#define HCI_LEN_LE_LTK_REQ_NEG_REPL 2 +#define HCI_LEN_LE_READ_SUP_STATES 0 +#define HCI_LEN_LE_RECEIVER_TEST 1 +#define HCI_LEN_LE_TRANSMITTER_TEST 3 +#define HCI_LEN_LE_TEST_END 0 +/*! \brief New in version 4.1 */ +#define HCI_LEN_LE_REM_CONN_PARAM_REP 14 +#define HCI_LEN_LE_REM_CONN_PARAM_NEG_REP 3 +/*! \brief New in version 4.2 */ +#define HCI_LEN_LE_SET_DATA_LEN 6 +#define HCI_LEN_LE_READ_DEF_DATA_LEN 0 +#define HCI_LEN_LE_WRITE_DEF_DATA_LEN 4 +#define HCI_LEN_LE_READ_LOCAL_P256_PUB_KEY 0 +#define HCI_LEN_LE_GENERATE_DHKEY 64 +#define HCI_LEN_LE_ADD_DEV_RES_LIST 39 +#define HCI_LEN_LE_REMOVE_DEV_RES_LIST 7 +#define HCI_LEN_LE_CLEAR_RES_LIST 0 +#define HCI_LEN_LE_READ_RES_LIST_SIZE 0 +#define HCI_LEN_LE_READ_PEER_RES_ADDR 7 +#define HCI_LEN_LE_READ_LOCAL_RES_ADDR 7 +#define HCI_LEN_LE_SET_ADDR_RES_ENABLE 1 +#define HCI_LEN_LE_SET_RES_PRIV_ADDR_TO 2 +#define HCI_LEN_LE_READ_MAX_DATA_LEN 0 +/*! \brief New in version 5.0 */ +#define HCI_LEN_LE_READ_PHY 2 +#define HCI_LEN_LE_SET_DEF_PHY 3 +#define HCI_LEN_LE_SET_PHY 7 +#define HCI_LEN_LE_ENHANCED_RECEIVER_TEST 3 +#define HCI_LEN_LE_ENHANCED_TRANSMITTER_TEST 4 +#define HCI_LEN_LE_SET_ADV_SET_RAND_ADDR 7 +#define HCI_LEN_LE_SET_EXT_ADV_PARAM 25 +#define HCI_LEN_LE_SET_EXT_ADV_DATA(len) (4 + (len)) +#define HCI_LEN_LE_SET_EXT_SCAN_RESP_DATA(len) (4 + (len)) +#define HCI_LEN_LE_EXT_ADV_ENABLE(numSets) (2 + (4 * (numSets))) +#define HCI_LEN_LE_READ_MAX_ADV_DATA_LEN 0 +#define HCI_LEN_LE_READ_NUM_OF_SUP_ADV_SETS 0 +#define HCI_LEN_LE_REMOVE_ADV_SET 1 +#define HCI_LEN_LE_CLEAR_ADV_SETS 0 +#define HCI_LEN_LE_SET_PER_ADV_PARAM 7 +#define HCI_LEN_LE_SET_PER_ADV_DATA(len) (3 + (len)) +#define HCI_LEN_LE_SET_PER_ADV_ENABLE 2 +#define HCI_LEN_LE_SET_EXT_SCAN_PARAM(numPhys) (3 + (5 * (numPhys))) +#define HCI_LEN_LE_SET_EXT_SCAN_ENABLE 6 +#define HCI_LEN_LE_EXT_CREATE_CONN(numPhys) (10 + (16 * (numPhys))) +#define HCI_LEN_LE_PER_ADV_CREATE_SYNC 14 +#define HCI_LEN_LE_PER_ADV_CREATE_SYNC_CANCEL 0 +#define HCI_LEN_LE_PER_ADV_TERMINATE_SYNC 2 +#define HCI_LEN_LE_ADD_DEV_PER_ADV_LIST 8 +#define HCI_LEN_LE_REMOVE_DEV_PER_ADV_LIST 8 +#define HCI_LEN_LE_CLEAR_PER_ADV_LIST 0 +#define HCI_LEN_LE_READ_PER_ADV_LIST_SIZE 0 +#define HCI_LEN_LE_READ_TX_POWER 0 +#define HCI_LEN_LE_READ_RF_PATH_COMP 0 +#define HCI_LEN_LE_WRITE_RF_PATH_COMP 4 +#define HCI_LEN_LE_SET_PRIVACY_MODE 8 +/*! \brief New in version 5.1 */ +#define HCI_LEN_LE_SET_CONN_CTE_RX_PARAMS(spLen) (5 + (spLen)) +#define HCI_LEN_LE_SET_CONN_CTE_TX_PARAMS(spLen) (4 + (spLen)) +#define HCI_LEN_LE_CONN_CTE_REQ_ENABLE 7 +#define HCI_LEN_LE_CONN_CTE_RSP_ENABLE 3 +#define HCI_LEN_LE_READ_ANTENNA_INFO 0 +#define HCI_LEN_LE_SET_PER_ADV_RCV_ENABLE 3 +#define HCI_LEN_LE_PER_ADV_SYNC_TRANSFER 6 +#define HCI_LEN_LE_PER_ADV_SET_INFO_TRANSFER 5 +#define HCI_LEN_LE_SET_PAST_PARAM 8 +#define HCI_LEN_LE_SET_DEFAULT_PAST_PARAM 6 +#define HCI_LEN_LE_GENERATE_DHKEY_V2 65 +/**@}*/ + +/** \name Events + * + */ +/**@{*/ +#define HCI_DISCONNECT_CMPL_EVT 0x05 +#define HCI_ENC_CHANGE_EVT 0x08 +#define HCI_READ_REMOTE_VER_INFO_CMPL_EVT 0x0C +#define HCI_CMD_CMPL_EVT 0x0E +#define HCI_CMD_STATUS_EVT 0x0F +#define HCI_HW_ERROR_EVT 0x10 +#define HCI_NUM_CMPL_PKTS_EVT 0x13 +#define HCI_DATA_BUF_OVERFLOW_EVT 0x1A +#define HCI_ENC_KEY_REFRESH_CMPL_EVT 0x30 +#define HCI_LE_META_EVT 0x3E +#define HCI_AUTH_PAYLOAD_TIMEOUT_EVT 0x57 +#define HCI_VENDOR_SPEC_EVT 0xFF +/**@}*/ + +/** \name LE Subevents + * + */ +/**@{*/ +#define HCI_LE_CONN_CMPL_EVT 0x01 +#define HCI_LE_ADV_REPORT_EVT 0x02 +#define HCI_LE_CONN_UPDATE_CMPL_EVT 0x03 +#define HCI_LE_READ_REMOTE_FEAT_CMPL_EVT 0x04 +#define HCI_LE_LTK_REQ_EVT 0x05 +/*! \brief New in version 4.1 */ +#define HCI_LE_REM_CONN_PARAM_REQ_EVT 0x06 +/*! \brief New in version 4.2 */ +#define HCI_LE_DATA_LEN_CHANGE_EVT 0x07 +#define HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_EVT 0x08 +#define HCI_LE_GENERATE_DHKEY_CMPL_EVT 0x09 +#define HCI_LE_ENHANCED_CONN_CMPL_EVT 0x0A +#define HCI_LE_DIRECT_ADV_REPORT_EVT 0x0B +/*! \brief New in version 5.0 */ +#define HCI_LE_PHY_UPDATE_CMPL_EVT 0x0C +#define HCI_LE_EXT_ADV_REPORT_EVT 0x0D +#define HCI_LE_PER_ADV_SYNC_EST_EVT 0x0E +#define HCI_LE_PER_ADV_REPORT_EVT 0x0F +#define HCI_LE_PER_ADV_SYNC_LOST_EVT 0x10 +#define HCI_LE_SCAN_TIMEOUT_EVT 0x11 +#define HCI_LE_ADV_SET_TERM_EVT 0x12 +#define HCI_LE_SCAN_REQ_RCVD_EVT 0x13 +#define HCI_LE_CH_SEL_ALGO_EVT 0x14 +/*! \brief New in version 5.1 */ +#define HCI_LE_CONNLESS_IQ_REPORT_EVT 0x15 +#define HCI_LE_CONN_IQ_REPORT_EVT 0x16 +#define HCI_LE_CTE_REQ_FAILED_EVT 0x17 +#define HCI_LE_PER_SYNC_TRSF_RCVD_EVT 0x18 +/*! \brief New in version Milan */ +#define HCI_LE_CIS_EST_EVT 0x19 +#define HCI_LE_CIS_REQ_EVT 0x1A +#define HCI_LE_BIG_CMPL_EVT 0x1B +#define HCI_LE_BIG_SYNC_LOST_EVT 0x1C +#define HCI_LE_REQ_PEER_SCA_CMPLT_EVT 0x1D +/**@}*/ + +/** \name Event parameter lengths + * + */ +/**@{*/ +#define HCI_LEN_DISCONNECT_CMPL 4 /*!< \brief Disconnect event length. */ +#define HCI_LEN_READ_REMOTE_VER_INFO_CMPL 8 /*!< \brief Read remove version info complete event length. */ +#define HCI_LEN_CMD_CMPL 3 /*!< \brief Command complete event length. */ +#define HCI_LEN_CMD_STATUS 4 /*!< \brief Command status event length. */ +#define HCI_LEN_HW_ERR 1 /*!< \brief Hardware error event length. */ +#define HCI_LEN_NUM_CMPL_PKTS 5 /*!< \brief Number of completed packets event length. */ +#define HCI_LEN_ENC_CHANGE 4 /*!< \brief Encryption change event length. */ +#define HCI_LEN_ENC_KEY_REFRESH_CMPL 3 /*!< \brief Encryption key refresh complete event length. */ +#define HCI_LEN_LE_CONN_CMPL 19 /*!< \brief Connection complete event length. */ +#define HCI_LEN_LE_ADV_RPT_MIN 12 /*!< \brief Advertising report event minimum length. */ +#define HCI_LEN_LE_CONN_UPDATE_CMPL 10 /*!< \brief Connection update complete event length. */ +#define HCI_LEN_LE_READ_REMOTE_FEAT_CMPL 12 /*!< \brief Read remote feature event length. */ +#define HCI_LEN_LE_LTK_REQ 13 /*!< \brief LTK request event length. */ +/*! \brief New in version 4.1 */ +#define HCI_LEN_LE_REM_CONN_PARAM_REQ 11 /*!< \brief Remote connection parameter event length. */ +#define HCI_LEN_LE_DATA_LEN_CHANGE 11 /*!< \brief Data length change event length. */ +#define HCI_LEN_LE_READ_PUB_KEY_CMPL 66 /*!< \brief Read local P256 public key compete event length. */ +#define HCI_LEN_LE_GEN_DHKEY_CMPL 34 /*!< \brief Generate DH key complete event length. */ +#define HCI_LEN_LE_ENHANCED_CONN_CMPL 31 /*!< \brief Enhanced connection complete event length. */ +#define HCI_LEN_LE_DIRECT_ADV_REPORT 18 /*!< \brief Direct advertising report event length. */ +#define HCI_LEN_AUTH_PAYLOAD_TIMEOUT 2 /*!< \brief Authenticated payload timeout event length. */ +/*! \brief New in version 5.0 */ +#define HCI_LEN_LE_PHY_UPDATE_CMPL 6 /*!< \brief PHY update complete event length. */ +#define HCI_LEN_LE_CH_SEL_ALGO 4 /*!< \brief Channel selection algorithm event length. */ +#define HCI_LEN_LE_PHY_UPDATE_CMPL 6 /*!< \brief PHY update complete event length. */ +#define HCI_LEN_LE_EXT_ADV_REPORT_MIN 26 /*!< \brief Extended advertising report minimum length. */ +#define HCI_LEN_LE_PER_ADV_SYNC_EST 16 /*!< \brief Periodic advertising sync established event length. */ +#define HCI_LEN_LE_PER_ADV_REPORT 8 /*!< \brief Periodic advertising report event length. */ +#define HCI_LEN_LE_PER_ADV_SYNC_LOST 3 /*!< \brief Periodic advertising sync lost event length. */ +#define HCI_LEN_LE_SCAN_TIMEOUT 1 /*!< \brief Scan timeout event length. */ +#define HCI_LEN_LE_ADV_SET_TERM 6 /*!< \brief Advertising set terminated event length. */ +#define HCI_LEN_LE_SCAN_REQ_RCVD 9 /*!< \brief Scan request received event length. */ +/*! \brief New in version 5.1 */ +#define HCI_LEN_LE_PER_SYNC_TRSF_RCVT 20 /*!< \brief Periodic advertising sync transfer received event length. */ +/*! \brief New in version Milan */ +#define HCI_LEN_LE_CIS_EST 12 /*!< \brief CIS established event length. */ +#define HCI_LEN_LE_CIS_REQ 7 /*!< \brief CIS request event length. */ +#define HCI_LEN_LE_PEER_SCA_CMPL 5 /*!< \brief Request peer SCA complete event length. */ +/**@}*/ + +/** \name Supported commands + * + */ +/**@{*/ +#define HCI_SUP_DISCONNECT 0x20 /*!< \brief Byte 0 */ +#define HCI_SUP_READ_REMOTE_VER_INFO 0x80 /*!< \brief Byte 2 */ +#define HCI_SUP_SET_EVENT_MASK 0x40 /*!< \brief Byte 5 */ +#define HCI_SUP_RESET 0x80 /*!< \brief Byte 5 */ +#define HCI_SUP_READ_TX_PWR_LVL 0x04 /*!< \brief Byte 10 */ +#define HCI_SUP_READ_LOCAL_VER_INFO 0x08 /*!< \brief Byte 14 */ +#define HCI_SUP_READ_LOCAL_SUP_FEAT 0x20 /*!< \brief Byte 14 */ +#define HCI_SUP_READ_BD_ADDR 0x02 /*!< \brief Byte 15 */ +#define HCI_SUP_READ_RSSI 0x20 /*!< \brief Byte 15 */ +#define HCI_SUP_SET_EVENT_MASK_PAGE2 0x04 /*!< \brief Byte 22 */ +#define HCI_SUP_LE_SET_EVENT_MASK 0x01 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_READ_BUF_SIZE 0x02 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_READ_LOCAL_SUP_FEAT 0x04 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_SET_RAND_ADDR 0x10 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_SET_ADV_PARAM 0x20 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_READ_ADV_TX_POWER 0x40 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_SET_ADV_DATA 0x80 /*!< \brief Byte 25 */ +#define HCI_SUP_LE_SET_SCAN_RESP_DATA 0x01 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_SET_ADV_ENABLE 0x02 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_SET_SCAN_PARAM 0x04 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_SET_SCAN_ENABLE 0x08 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_CREATE_CONN 0x10 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_CREATE_CONN_CANCEL 0x20 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_READ_WHITE_LIST_SIZE 0x40 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_CLEAR_WHITE_LIST 0x80 /*!< \brief Byte 26 */ +#define HCI_SUP_LE_ADD_DEV_WHITE_LIST 0x01 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_REMOVE_DEV_WHITE_LIST 0x02 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_CONN_UPDATE 0x04 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_SET_HOST_CHAN_CLASS 0x08 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_READ_CHAN_MAP 0x10 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_READ_REMOTE_FEAT 0x20 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_ENCRYPT 0x40 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_RAND 0x80 /*!< \brief Byte 27 */ +#define HCI_SUP_LE_START_ENCRYPTION 0x01 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_LTK_REQ_REPL 0x02 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_LTK_REQ_NEG_REPL 0x04 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_READ_SUP_STATES 0x08 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_RECEIVER_TEST 0x10 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_TRANSMITTER_TEST 0x20 /*!< \brief Byte 28 */ +#define HCI_SUP_LE_TEST_END 0x40 /*!< \brief Byte 28 */ +#define HCI_SUP_READ_AUTH_PAYLOAD_TO 0x10 /*!< \brief Byte 32 */ +#define HCI_SUP_WRITE_AUTH_PAYLOAD_TO 0x20 /*!< \brief Byte 32 */ +/*! \brief New in version 4.1 */ +#define HCI_SUP_LE_REM_CONN_PARAM_REQ_REPL 0x10 /*!< \brief Byte 33 */ +#define HCI_SUP_LE_REM_CONN_PARAM_REQ_NEG_REPL 0x20 /*!< \brief Byte 33 */ +/*! \brief New in version 4.2 */ +#define HCI_SUP_LE_SET_DATA_LEN 0x40 /*!< \brief Byte 33 */ +#define HCI_SUP_LE_READ_DEF_DATA_LEN 0x80 /*!< \brief Byte 33 */ +#define HCI_SUP_LE_WRITE_DEF_DATA_LEN 0x01 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_READ_LOCAL_P256_PUB_KEY 0x02 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_GENERATE_DHKEY 0x04 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_ADD_DEV_RES_LIST_EVT 0x08 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_REMOVE_DEV_RES_LIST 0x10 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_CLEAR_RES_LIST 0x20 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_READ_RES_LIST_SIZE 0x40 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_READ_PEER_RES_ADDR 0x80 /*!< \brief Byte 34 */ +#define HCI_SUP_LE_READ_LOCAL_RES_ADDR 0x01 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_SET_ADDR_RES_ENABLE 0x02 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_SET_RES_PRIV_ADDR_TO 0x04 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_READ_MAX_DATA_LEN 0x08 /*!< \brief Byte 35 */ +/*! \brief New in version 5.0 */ +#define HCI_SUP_LE_READ_PHY 0x10 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_SET_DEF_PHY 0x20 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_SET_PHY 0x40 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_ENHANCED_RECEIVER_TEST 0x80 /*!< \brief Byte 35 */ +#define HCI_SUP_LE_ENHANCED_TRANSMITTER_TEST 0x01 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_SET_ADV_SET_RAND_ADDR 0x02 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_SET_EXT_ADV_PARAM 0x04 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_SET_EXT_ADV_DATA 0x08 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_SET_EXT_SCAN_RESP_DATA 0x10 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_SET_EXT_ADV_ENABLE 0x20 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_READ_MAX_ADV_DATA_LEN 0x40 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_READ_NUM_OF_SUP_ADV_SETS 0x80 /*!< \brief Byte 36 */ +#define HCI_SUP_LE_REMOVE_ADV_SET 0x01 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_CLEAR_ADV_SETS 0x02 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_SET_PER_ADV_PARAM 0x04 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_SET_PER_ADV_DATA 0x08 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_SET_PER_ADV_ENABLE 0x10 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_SET_EXT_SCAN_PARAM 0x20 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_SET_EXT_SCAN_ENABLE 0x40 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_EXT_CREATE_CONN 0x80 /*!< \brief Byte 37 */ +#define HCI_SUP_LE_PER_ADV_CREATE_SYNC 0x01 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_PER_ADV_CREATE_SYNC_CANCEL 0x02 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_PER_ADV_TERMINATE_SYNC 0x04 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_ADD_DEV_PER_ADV_LIST 0x08 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_REMOVE_DEV_PER_ADV_LIST 0x10 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_CLEAR_PER_ADV_LIST 0x20 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_READ_PER_ADV_LIST_SIZE 0x40 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_READ_TX_POWER 0x80 /*!< \brief Byte 38 */ +#define HCI_SUP_LE_READ_RF_PATH_COMP 0x01 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_WRITE_RF_PATH_COMP 0x02 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_PRIVACY_MODE 0x04 /*!< \brief Byte 39 */ +/*! \brief New in version 5.1 */ +#define HCI_SUP_LE_RECEIVER_TEST_V3 0x08 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_TRANSMITTER_TEST_V3 0x10 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_CTE_TX_PARAMS 0x20 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_CTE_TX_ENABLE 0x40 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONNLESS_IQ_SAMP_ENABLE 0x80 /*!< \brief Byte 39 */ +#define HCI_SUP_LE_SET_CONN_CTE_RX_PARAMS 0x01 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_CONN_CTE_TX_PARAMS 0x02 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_CONN_CTE_REQ_ENABLE 0x04 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_CONN_CTE_RSP_ENABLE 0x08 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_READ_ANTENNA_INFO 0x10 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_PER_ADV_RCV_ENABLE 0x20 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_PER_ADV_SYNC_TRANSFER 0x40 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_PER_ADV_SET_INFO_TRANSFER 0x80 /*!< \brief Byte 40 */ +#define HCI_SUP_LE_SET_PAST_PARAM 0x01 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_SET_DEFAULT_PAST_PARAM 0x02 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_GENERATE_DHKEY_V2 0x04 /*!< \brief Byte 41 */ +#define HCI_SUP_LE_MODIFY_SLEEP_CLK_ACCURACY 0x10 /*!< \brief Byte 41 */ +/*! \brief New in version Milan */ +#define HCI_SUP_LE_READ_BUF_SIZE_V2 0x01 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_SET_CIG_PARAM 0x02 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_CREATE_CIS 0x04 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_REMOVE_CIG 0x08 /*!< \brief Byte 42 */ +#define HCI_SUP_LE_ACCEPT_CIS_REQ 0x01 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_REJECT_CIS_REQ 0x02 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_CREATE_BIG 0x04 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_BIG_CREATE_SYNC 0x08 /*!< \brief Byte 43 */ +#define HCI_SUP_LE_TERMINATE_BIG 0x01 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_SETUP_ISO_DATA_PATH 0x02 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_REMOVE_ISO_DATA_PATH 0x04 /*!< \brief Byte 44 */ +#define HCI_SUP_LE_REQ_PEER_SCA 0x08 /*!< \brief Byte 44 */ + +#define HCI_SUP_CMD_LEN 64 /*!< \brief Byte length of support cmd field. */ + +/**@}*/ + +/** \name Event mask + * + */ +/**@{*/ +#define HCI_EVT_MASK_DISCONNECT_CMPL 0x10 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_ENC_CHANGE 0x80 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL 0x08 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_HW_ERROR 0x80 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_DATA_BUF_OVERFLOW 0x02 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL 0x80 /*!< \brief Byte 5 */ +#define HCI_EVT_MASK_LE_META 0x20 /*!< \brief Byte 7 */ +/**@}*/ + +/** \name Event mask page 2 + * + */ +/**@{*/ +#define HCI_EVT_MASK_AUTH_PAYLOAD_TIMEOUT 0x80 /*!< \brief Byte 2 */ +/**@}*/ + +/** \name LE event mask + * + */ +/**@{*/ +#define HCI_EVT_MASK_LE_CONN_CMPL_EVT 0x01 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_ADV_REPORT_EVT 0x02 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT 0x04 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT 0x08 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_LTK_REQ_EVT 0x10 /*!< \brief Byte 0 */ +/*! \brief New in version 4.1 */ +#define HCI_EVT_MASK_LE_REMOTE_CONN_PARAM_REQ_EVT 0x20 /*!< \brief Byte 0 */ +/*! \brief New in version 4.2 */ +#define HCI_EVT_MASK_LE_DATA_LEN_CHANGE_EVT 0x40 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_READ_LOCAL_P256_PUB_KEY_CMPL 0x80 /*!< \brief Byte 0 */ +#define HCI_EVT_MASK_LE_GENERATE_DHKEY_CMPL 0x01 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_ENHANCED_CONN_CMPL_EVT 0x02 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_DIRECT_ADV_REPORT_EVT 0x04 /*!< \brief Byte 1 */ +/*! \brief New in version 5.0 */ +#define HCI_EVT_MASK_LE_PHY_UPDATE_CMPL_EVT 0x08 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_EXT_ADV_REPORT_EVT 0x10 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_PER_ADV_SYNC_EST_EVT 0x20 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_PER_ADV_REPORT_EVT 0x40 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_PER_ADV_SYNC_LOST_EVT 0x80 /*!< \brief Byte 1 */ +#define HCI_EVT_MASK_LE_SCAN_TIMEOUT_EVT 0x01 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_ADV_SET_TERM_EVT 0x02 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_SCAN_REQ_RCVD_EVT 0x04 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CH_SEL_ALGO_EVT 0x08 /*!< \brief Byte 2 (Bit 19) */ +/*! \brief New in version 5.1 */ +#define HCI_EVT_MASK_LE_CONNLESS_IQ_REPORT_EVT 0x10 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CONN_IQ_REPORT_EVT 0x20 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_CTE_REQ_FAILED_EVT 0x40 /*!< \brief Byte 2 */ +#define HCI_EVT_MASK_LE_PER_SYNC_TRSF_RCVT_EVT 0x80 /*!< \brief Byte 2 (Bit 23) */ +/*! \brief New in version Milan */ +#define HCI_EVT_MASK_LE_CIS_EST_EVT 0x01 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_CIS_REQ_EVT 0x02 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_BIG_CMPL_EVT 0x04 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_BIG_SYNC_LOST_EVT 0x08 /*!< \brief Byte 3 */ +#define HCI_EVT_MASK_LE_PEER_SCA_CMPL_EVT 0x10 /*!< \brief Byte 3 */ +/**@}*/ + +/** \name LE supported features + * + */ +/**@{*/ +/*! \brief New in version 4.0 */ +#define HCI_LE_SUP_FEAT_ENCRYPTION 0x00000001 /*!< \brief Encryption supported */ +/*! \brief New in version 4.1 */ +#define HCI_LE_SUP_FEAT_CONN_PARAM_REQ_PROC 0x00000002 /*!< \brief Connection Parameters Request Procedure supported */ +#define HCI_LE_SUP_FEAT_EXT_REJECT_IND 0x00000004 /*!< \brief Extended Reject Indication supported */ +#define HCI_LE_SUP_FEAT_SLV_INIT_FEAT_EXCH 0x00000008 /*!< \brief Slave-Initiated Features Exchange supported */ +#define HCI_LE_SUP_FEAT_LE_PING 0x00000010 /*!< \brief LE Ping supported */ +/*! \brief New in version 4.2 */ +#define HCI_LE_SUP_FEAT_DATA_LEN_EXT 0x00000020 /*!< \brief Data Length Extension supported */ +#define HCI_LE_SUP_FEAT_PRIVACY 0x00000040 /*!< \brief LL Privacy supported */ +#define HCI_LE_SUP_FEAT_EXT_SCAN_FILT_POLICY 0x00000080 /*!< \brief Extended Scan Filter Policy supported */ +/*! \brief New in version 5.0 */ +#define HCI_LE_SUP_FEAT_LE_2M_PHY 0x00000100 /*!< \brief LE 2M PHY supported */ +#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_TRANSMITTER 0x00000200 /*!< \brief Stable Modulation Index - Transmitter supported */ +#define HCI_LE_SUP_FEAT_STABLE_MOD_IDX_RECEIVER 0x00000400 /*!< \brief Stable Modulation Index - Receiver supported */ +#define HCI_LE_SUP_FEAT_LE_CODED_PHY 0x00000800 /*!< \brief LE Coded PHY supported */ +#define HCI_LE_SUP_FEAT_LE_EXT_ADV 0x00001000 /*!< \brief LE Extended Advertising supported */ +#define HCI_LE_SUP_FEAT_LE_PER_ADV 0x00002000 /*!< \brief LE Periodic Advertising supported */ +#define HCI_LE_SUP_FEAT_CH_SEL_2 0x00004000 /*!< \brief Channel Selection Algorithm #2 supported */ +#define HCI_LE_SUP_FEAT_LE_POWER_CLASS_1 0x00008000 /*!< \brief LE Power Class 1 supported */ +#define HCI_LE_SUP_FEAT_MIN_NUN_USED_CHAN 0x00010000 /*!< \brief Minimum Number of Used Channels Procedure supported */ +/*! \brief New in version 5.1 */ +#define HCI_LE_SUP_FEAT_CONN_CTE_REQ 0x00020000 /*!< \brief Connection CTE Request supported */ +#define HCI_LE_SUP_FEAT_CONN_CTE_RSP 0x00040000 /*!< \brief Connection CTE Response supported */ +#define HCI_LE_SUP_FEAT_CONNLESS_CTE_TRANS 0x00080000 /*!< \brief Connectionless CTE Transmitter supported */ +#define HCI_LE_SUP_FEAT_CONNLESS_CTE_RECV 0x00100000 /*!< \brief Connectionless CTE Receiver supported */ +#define HCI_LE_SUP_FEAT_ANTENNA_SWITCH_AOD 0x00200000 /*!< \brief Anetenna Switching during CTE Transmission (AoD) supported */ +#define HCI_LE_SUP_FEAT_ANTENNA_SWITCH_AOA 0x00400000 /*!< \brief Anetenna Switching during CTE Reception (AoA) supported */ +#define HCI_LE_SUP_FEAT_RECV_CTE 0x00800000 /*!< \brief Receive Constant Tone Extension supported */ +#define HCI_LE_SUP_FEAT_PAST_SENDER 0x01000000 /*!< \brief Periodic Advertising Sync Transfer Sender supported */ +#define HCI_LE_SUP_FEAT_PAST_RECIPIENT 0x02000000 /*!< \brief Periodic Advertising Sync Transfer Recipient supported */ +#define HCI_LE_SUP_FEAT_SCA_UPDATE 0x04000000 /*!< \brief Sleep Clock Accuracy Update supported */ +#define HCI_LE_SUP_FEAT_REMOTE_PUB_KEY_VALIDATION 0x08000000 /*!< \brief Remote Public Key Validation supported */ +/*! \brief New in version Milan */ +#define HCI_LE_SUP_FEAT_CIS_MASTER 0x10000000 /*!< \brief Connected Isochronous Master Role supported */ +#define HCI_LE_SUP_FEAT_CIS_SLAVE 0x20000000 /*!< \brief Connected Isochronous Slave Role supported */ +#define HCI_LE_SUP_FEAT_ISO_BROADCASTER 0x40000000 /*!< \brief Isochronous Broadcaster Role supported */ +#define HCI_LE_SUP_FEAT_ISO_SYNC 0x80000000 /*!< \brief Isochronous Synchronizer Role supported */ +/**@}*/ + +/** \name Advertising command parameters + * + */ +/**@{*/ +#define HCI_ADV_MIN_INTERVAL 0x0020 /*!< \brief Minimum advertising interval */ +#define HCI_ADV_MAX_INTERVAL 0x4000 /*!< \brief Maximum advertising interval */ +#define HCI_ADV_DIRECTED_MAX_DURATION 0x0500 /*!< \brief Maximum high duty cycle connectable directed advertising duration */ +#define HCI_ADV_TYPE_CONN_UNDIRECT 0x00 /*!< \brief Connectable undirected advertising */ +#define HCI_ADV_TYPE_CONN_DIRECT 0x01 /*!< \brief Connectable directed high duty cycle advertising */ +#define HCI_ADV_TYPE_DISC_UNDIRECT 0x02 /*!< \brief Discoverable undirected advertising */ +#define HCI_ADV_TYPE_NONCONN_UNDIRECT 0x03 /*!< \brief Nonconnectable undirected advertising */ +#define HCI_ADV_TYPE_CONN_DIRECT_LO_DUTY 0x04 /*!< \brief Connectable directed low duty cycle advertising */ +#define HCI_ADV_CHAN_37 0x01 /*!< \brief Advertising channel 37 */ +#define HCI_ADV_CHAN_38 0x02 /*!< \brief Advertising channel 38 */ +#define HCI_ADV_CHAN_39 0x04 /*!< \brief Advertising channel 39 */ +#define HCI_ADV_FILT_NONE 0x00 /*!< \brief No scan request or connection filtering */ +#define HCI_ADV_FILT_SCAN 0x01 /*!< \brief White list filters scan requests */ +#define HCI_ADV_FILT_CONN 0x02 /*!< \brief White list filters connections */ +#define HCI_ADV_FILT_ALL 0x03 /*!< \brief White list filters scan req. and conn. */ +/**@}*/ + +/** \name Scan command parameters + * + */ +/**@{*/ +#define HCI_SCAN_TYPE_PASSIVE 0 /*!< \brief Passive scan */ +#define HCI_SCAN_TYPE_ACTIVE 1 /*!< \brief Active scan */ +#define HCI_SCAN_INTERVAL_MIN 0x0004 /*!< \brief Minimum scan interval */ +#define HCI_SCAN_INTERVAL_MAX 0x4000 /*!< \brief Maximum scan interval */ +#define HCI_SCAN_INTERVAL_DEFAULT 0x0010 /*!< \brief Default scan interval */ +#define HCI_SCAN_WINDOW_MIN 0x0004 /*!< \brief Minimum scan window */ +#define HCI_SCAN_WINDOW_MAX 0x4000 /*!< \brief Maximum scan window */ +#define HCI_SCAN_WINDOW_DEFAULT 0x0010 /*!< \brief Default scan window */ +/**@}*/ + +/** \name Connection command parameters + * + */ +/**@{*/ +#define HCI_CONN_INTERVAL_MIN 0x0006 /*!< \brief Minimum connection interval */ +#define HCI_CONN_INTERVAL_MAX 0x0C80 /*!< \brief Maximum connection interval */ +#define HCI_CONN_LATENCY_MAX 0x01F3 /*!< \brief Maximum connection latency */ +#define HCI_SUP_TIMEOUT_MIN 0x000A /*!< \brief Minimum supervision timeout */ +#define HCI_SUP_TIMEOUT_MAX 0x0C80 /*!< \brief Maximum supervision timeout */ +/**@}*/ + +/** \name Connection event parameters + * + */ +/**@{*/ +#define HCI_ROLE_MASTER 0 /*!< \brief Role is master */ +#define HCI_ROLE_SLAVE 1 /*!< \brief Role is slave */ +#define HCI_CLOCK_500PPM 0x00 /*!< \brief 500 ppm clock accuracy */ +#define HCI_CLOCK_250PPM 0x01 /*!< \brief 250 ppm clock accuracy */ +#define HCI_CLOCK_150PPM 0x02 /*!< \brief 150 ppm clock accuracy */ +#define HCI_CLOCK_100PPM 0x03 /*!< \brief 100 ppm clock accuracy */ +#define HCI_CLOCK_75PPM 0x04 /*!< \brief 75 ppm clock accuracy */ +#define HCI_CLOCK_50PPM 0x05 /*!< \brief 50 ppm clock accuracy */ +#define HCI_CLOCK_30PPM 0x06 /*!< \brief 30 ppm clock accuracy */ +#define HCI_CLOCK_20PPM 0x07 /*!< \brief 20 ppm clock accuracy */ +/**@}*/ + +/** \name Advertising report event parameters + * + */ +/**@{*/ +#define HCI_ADV_CONN_UNDIRECT 0x00 /*!< \brief Connectable undirected advertising */ +#define HCI_ADV_CONN_DIRECT 0x01 /*!< \brief Connectable directed advertising */ +#define HCI_ADV_DISC_UNDIRECT 0x02 /*!< \brief Discoverable undirected advertising */ +#define HCI_ADV_NONCONN_UNDIRECT 0x03 /*!< \brief Non-connectable undirected advertising */ +#define HCI_ADV_SCAN_RESPONSE 0x04 /*!< \brief Scan response */ +/**@}*/ + +/** \name Extended advertising data operations + * + */ +/**@{*/ +#define HCI_ADV_DATA_OP_FRAG_INTER 0x00 /*!< \brief Intermediate fragment */ +#define HCI_ADV_DATA_OP_FRAG_FIRST 0x01 /*!< \brief First fragment */ +#define HCI_ADV_DATA_OP_FRAG_LAST 0x02 /*!< \brief Last fragment */ +#define HCI_ADV_DATA_OP_COMP_FRAG 0x03 /*!< \brief Complete extended advertising data */ +#define HCI_ADV_DATA_OP_UNCHANGED_DATA 0x04 /*!< \brief Unchanged data (just update Advertising DID) */ +/**@}*/ + +/** \name Advertising data fragment preference + * + */ +/**@{*/ +#define HCI_ADV_DATA_FRAG_PREF_FRAG 0x00 /*!< \brief Controller may fragment all Host advertising data */ +#define HCI_ADV_DATA_FRAG_PREF_NO_FRAG 0x01 /*!< \brief Controller should not fragment nor minimize fragmentation of Host advertising data */ +/**@}*/ + +/** \name Number of advertising sets + * + */ +/**@{*/ +#define HCI_ADV_NUM_SETS_ALL_DISABLE 0x00 /*!< \brief Disable all advertising sets */ +/**@}*/ + +/** \name Maximum number of scanning or initiating PHYs + * + */ +/**@{*/ +#define HCI_MAX_NUM_PHYS 3 /*!< \brief Maximum number of scanning or initiating PHYs */ +/**@}*/ + +/** \name Advertising PHY values + * + */ +/**@{*/ +#define HCI_ADV_PHY_LE_1M 0x01 /*!< \brief LE 1M PHY */ +#define HCI_ADV_PHY_LE_2M 0x02 /*!< \brief LE 2M PHY */ +#define HCI_ADV_PHY_LE_CODED 0x03 /*!< \brief LE Coded PHY */ +/**@}*/ + +/** \name Scanner PHY value bits + * + */ +/**@{*/ +#define HCI_SCAN_PHY_LE_1M_BIT (1<<0) /*!< \brief LE 1M PHY */ +#define HCI_SCAN_PHY_LE_2M_BIT (1<<1) /*!< \brief LE 2M PHY */ +#define HCI_SCAN_PHY_LE_CODED_BIT (1<<2) /*!< \brief LE Coded PHY */ +/**@}*/ + +/** \name Initiator PHY value bits + * + */ +/**@{*/ +#define HCI_INIT_PHY_LE_1M_BIT (1<<0) /*!< \brief LE 1M PHY */ +#define HCI_INIT_PHY_LE_2M_BIT (1<<1) /*!< \brief LE 2M PHY */ +#define HCI_INIT_PHY_LE_CODED_BIT (1<<2) /*!< \brief LE Coded PHY */ +/**@}*/ + +/** \name Advertising event properties type bits + * + */ +/**@{*/ +#define HCI_ADV_PROP_CONN_ADV_BIT (1<<0) /*!< \brief Connectable advertising bit */ +#define HCI_ADV_PROP_SCAN_ADV_BIT (1<<1) /*!< \brief Scannable advertising bit */ +#define HCI_ADV_PROP_DIRECT_ADV_BIT (1<<2) /*!< \brief Directed advertising bit */ +#define HCI_ADV_PROP_CONN_DIRECT_ADV_BIT (1<<3) /*!< \brief High duty cycle connectable directed advertising bit */ +#define HCI_ADV_PROP_USE_LEG_PDU_BIT (1<<4) /*!< \brief Use legacy advertising PDUs bit */ +#define HCI_ADV_PROP_OMIT_ADV_ADDR_BIT (1<<5) /*!< \brief Omit advertiser's address from all PDUs (anonymous advertising) bit */ +#define HCI_ADV_PROP_INC_TX_PWR_BIT (1<<6) /*!< \brief Include TxPower in extended header of advertising PDU bit */ +/**@}*/ + +/** \name Advertising event properties for legacy PDUs + * + */ +/**@{*/ +#define HCI_ADV_PROP_LEG_CONN_UNDIRECT 0x13 /*!< \brief Connectable and scannable undirected advertising (00010011b) */ +#define HCI_ADV_PROP_LEG_CONN_DIRECT 0x1D /*!< \brief Connectable directed high duty cycle advertising (00011101b) */ +#define HCI_ADV_PROP_LEG_SCAN_UNDIRECT 0x12 /*!< \brief Scannable undirected advertising (00010010b) */ +#define HCI_ADV_PROP_LEG_NONCONN_UNDIRECT 0x10 /*!< \brief Non-connectable and non-scannable undirected advertising (00010000b) */ +#define HCI_ADV_PROP_LEG_CONN_DIRECT_LO_DUTY 0x15 /*!< \brief Connectable directed low duty cycle advertising (00010101b) */ +/**@}*/ + +/** \name Extended advertising report event type bits + * + */ +/**@{*/ +#define HCI_ADV_RPT_CONN_ADV_BIT (1<<0) /*!< \brief Connectable advertising event bit */ +#define HCI_ADV_RPT_SCAN_ADV_BIT (1<<1) /*!< \brief Scannable advertising event bit */ +#define HCI_ADV_RPT_DIRECT_ADV_BIT (1<<2) /*!< \brief Directed advertising event bit */ +#define HCI_ADV_RPT_SCAN_RSP_BIT (1<<3) /*!< \brief Scan response event bit */ +#define HCI_ADV_RPT_LEG_ADV_BIT (1<<4) /*!< \brief Legacy advertising PDU event bit */ +#define HCI_ADV_RPT_DATA_STATUS_BITS (3<<5) /*!< \brief Data status bits */ +/**@}*/ + +/** \name Advertising report event types for legacy PDUs + * + */ +/**@{*/ +#define HCI_ADV_RPT_LEG_CONN_UNDIRECT 0x13 /*!< \brief Connectable and scannable undirected advertising (0010011b) */ +#define HCI_ADV_RPT_LEG_CONN_DIRECT 0x15 /*!< \brief Connectable directed advertising (0010101b) */ +#define HCI_ADV_RPT_LEG_SCAN_UNDIRECT 0x12 /*!< \brief Scannable undirected advertising (0010010b) */ +#define HCI_ADV_RPT_LEG_NONCONN_UNDIRECT 0x10 /*!< \brief Non-connectable and non-scannable undirected advertising (0010000b) */ +#define HCI_ADV_RPT_LEG_CONN_UNDIRECT_SCAN_RSP 0x1B /*!< \brief Scan response to connectable and scannable undirected advertising (0011011b) */ +#define HCI_ADV_RPT_LEG_SCAN_UNDIRECT_SCAN_RSP 0x1A /*!< \brief Scan response to scannable undirected advertising (0011010b) */ +/**@}*/ + +/** \name Advertising report data status + * + */ +/**@{*/ +#define HCI_ADV_RPT_DATA_CMPL 0x00 /*!< \brief Data complete */ +#define HCI_ADV_RPT_DATA_INCMPL_MORE 0x01 /*!< \brief Data incomplete, more date to come */ +#define HCI_ADV_RPT_DATA_INCMPL_TRUNC 0x02 /*!< \brief Data incomplete, data truncated, no more date to come */ +/**@}*/ + +/** \name Extended advertising report event primary PHY values + * + */ +/**@{*/ +#define HCI_ADV_RPT_PHY_PRIM_LE_1M 0x01 /*!< \brief Advertiser PHY is LE 1M */ +#define HCI_ADV_RPT_PHY_PRIM_LE_CODED 0x03 /*!< \brief Advertiser PHY is LE Coded */ +/**@}*/ + +/** \name Extended advertising report event seconday PHY values + * + */ +/**@{*/ +#define HCI_ADV_RPT_PHY_SEC_NONE 0x00 /*!< \brief No packets on seconday advertising channel */ +#define HCI_ADV_RPT_PHY_SEC_LE_1M 0x01 /*!< \brief Advertiser PHY is LE 1M */ +#define HCI_ADV_RPT_PHY_SEC_LE_2M 0x02 /*!< \brief Advertiser PHY is LE 2M */ +#define HCI_ADV_RPT_PHY_SEC_LE_CODED 0x03 /*!< \brief Advertiser PHY is LE Coded */ +/**@}*/ + +/** \name Channel selection algorithm used + * + */ +/**@{*/ +#define HCI_CH_SEL_ALGO_1 0x00 /*!< \brief LE channel selection algorithm #1 used */ +#define HCI_CH_SEL_ALGO_2 0x01 /*!< \brief LE channel selection algorithm #2 used */ +/**@}*/ + +/** \name KeyType parameters + * + */ +/**@{*/ +#define HCI_PRIVATE_KEY_GENERATED 0x00 /*!< \brief Use generated private key */ +#define HCI_PRIVATE_KEY_DEBUG 0x01 /*!< \brief Use debug private key */ +/**@{*/ + +/**@{*/ +/** \name Minimum number of used channels + * + */ +/**@{*/ +#define HCI_MIN_NUM_OF_USED_CHAN 8 /*!< \brief Minimum number of used channels */ +/**@}*/ + +/** \name Synchronization timeout for the periodic advertising +* +*/ +/**@{*/ +#define HCI_SYNC_MIN_TIMEOUT 0x000A /*!< \brief Minimum synchronization timeout */ +#define HCI_SYNC_MAX_TIMEOUT 0x4000 /*!< \brief Maximum synchronization timeout */ +/**@}*/ + +/** \name Maximum synchronization skip +* +*/ +/**@{*/ +#define HCI_SYNC_MAX_SKIP 0x01F3 /*!< \brief Maximum synchronization skip */ +/**@}*/ + +/** \name Maximum synchronization handle +* +*/ +/**@{*/ +#define HCI_SYNC_MAX_HANDLE 0x0EFF /*!< \brief Maximum synchronization handle */ +/**@}*/ + +/** \name Periodic sync transfer receive mode +* +*/ +/**@{*/ +#define HCI_SYNC_TRSF_MODE_OFF 0x00 /*!< \brief Periodic sync transfer receive is disabled */ +#define HCI_SYNC_TRSF_MODE_REP_DISABLED 0x01, /*!< \brief Periodic sync transfer receive is enabled, report event is disabled */ +#define HCI_SYNC_TRSF_MODE_REP_ENABLED 0x02, /*!< \brief Periodic sync transfer receive is enabled, report event is enabled */ +/**@}*/ + +/** \name Periodic advertising create sync options bits +* +*/ +/**@{*/ +#define HCI_OPTIONS_FILT_POLICY_BIT (1<<0) /*!< \brief filter policy bit */ +#define HCI_OPTIONS_INIT_RPT_ENABLE_BIT (1<<1) /*!< \brief initial periodic advertisement reporting bit */ +/**@}*/ + +/** \name Misc command parameters + * + */ +/**@{*/ +#define HCI_READ_TX_PWR_CURRENT 0 /*!< \brief Read current tx power */ +#define HCI_READ_TX_PWR_MAX 1 /*!< \brief Read maximum tx power */ +#define HCI_TX_PWR_MIN -30 /*!< \brief Minimum tx power dBm */ +#define HCI_TX_PWR_MAX 20 /*!< \brief Maximum tx power dBm */ +#define HCI_TX_PWR_NO_PREFERENCE 127 /*!< \brief Tx power no preference */ +#define HCI_VERSION 6 /*!< \brief HCI specification version */ +#define HCI_RSSI_MIN -127 /*!< \brief Minimum RSSI dBm */ +#define HCI_RSSI_MAX 20 /*!< \brief Maximum RSSI dBm */ +#define HCI_ADDR_TYPE_PUBLIC 0 /*!< \brief Public device address */ +#define HCI_ADDR_TYPE_RANDOM 1 /*!< \brief Random device address */ +#define HCI_ADDR_TYPE_PUBLIC_IDENTITY 2 /*!< \brief Public identity address */ +#define HCI_ADDR_TYPE_RANDOM_IDENTITY 3 /*!< \brief Random identity address */ +#define HCI_ADDR_TYPE_ANONYMOUS 0xFF /*!< \brief Anonymous device address */ +#define HCI_FILT_NONE 0 /*!< \brief Accept all advertising packets */ +#define HCI_FILT_WHITE_LIST 1 /*!< \brief Accept from While List only */ +#define HCI_FILT_RES_INIT 2 /*!< \brief Accept directed advertisements with RPAs */ +#define HCI_FILT_WHITE_LIST_RES_INIT 3 /*!< \brief Accept from White List or directed advertisements with RPAs */ +#define HCI_FILT_PER_ADV_PARAM 0 /*!< \brief Listen to advertiser specified by create sync command parameters */ +#define HCI_FILT_PER_ADV_LIST 1 /*!< \brief Listen to advertiser from Periodic Advertiser List only */ +#define HCI_ROLE_MASTER 0 /*!< \brief Role is master */ +#define HCI_ROLE_SLAVE 1 /*!< \brief Role is slave */ +#define HCI_PRIV_MODE_NETWORK 0x00 /*!< \brief Network privacy mode (default) */ +#define HCI_PRIV_MODE_DEVICE 0x01 /*!< \brief Device privacy mode */ +/**@}*/ + +/** \name PHY types + * + */ +/**@{*/ +#define HCI_PHY_NONE 0x00 /*!< \brief No selected PHY */ +#define HCI_PHY_LE_1M_BIT (1<<0) /*!< \brief LE 1M PHY */ +#define HCI_PHY_LE_2M_BIT (1<<1) /*!< \brief LE 2M PHY */ +#define HCI_PHY_LE_CODED_BIT (1<<2) /*!< \brief LE Coded PHY */ +/**@}*/ + +/** \name All PHYs preference + * + */ +/**@{*/ +#define HCI_ALL_PHY_ALL_PREFERENCES 0x00 /*!< \brief All PHY preferences */ +#define HCI_ALL_PHY_TX_PREFERENCE_BIT (1<<0) /*!< \brief Tx PHY preference */ +#define HCI_ALL_PHY_RX_PREFERENCE_BIT (1<<1) /*!< \brief Rx PHY preference */ +/**@}*/ + +/** \name PHY options + * + */ +/**@{*/ +#define HCI_PHY_OPTIONS_NONE 0x00 /*!< \brief No preferences */ +#define HCI_PHY_OPTIONS_S2_PREFERRED 0x01 /*!< \brief S=2 coding preferred when transmitting on LE Coded PHY */ +#define HCI_PHY_OPTIONS_S8_PREFERRED 0x02 /*!< \brief S=8 coding preferred when transmitting on LE Coded PHY */ +/**@}*/ + +/** \name CTE Slot Durations +* +*/ +/**@{*/ +#define HCI_CTE_SLOT_DURATION_NONE 0x00 /*!< \brief No switching and sampling */ +#define HCI_CTE_SLOT_DURATION_1_US 0x01 /*!< \brief Switching and sampling slots are 1 us each */ +#define HCI_CTE_SLOT_DURATION_2_US 0x02 /*!< \brief Switching and sampling slots are 2 us each */ +/**@}*/ + +/** \name Permitted CTE Type bits +* +*/ +/**@{*/ +#define HCI_CTE_TYPE_PERMIT_AOA_RSP_BIT (1<<0) /*!< \brief Allow AoA Constant Tone Extension Response */ +#define HCI_CTE_TYPE_PERMIT_AOD_RSP_1_US_BIT (1<<1) /*!< \brief Allow AoD Constant Tone Extension Response with 1 us slots */ +#define HCI_CTE_TYPE_PERMIT_AOD_RSP_2_US_BIT (1<<2) /*!< \brief Allow AoD Constant Tone Extension Response with 2 us slots */ +/**@}*/ + +/** \name Requested CTE Types +* +*/ +/**@{*/ +#define HCI_CTE_TYPE_REQ_AOA 0x00 /*!< \brief AoA Constant Tone Extension */ +#define HCI_CTE_TYPE_REQ_AOD_1_US 0x01 /*!< \brief AoD Constant Tone Extension with 1 us slots */ +#define HCI_CTE_TYPE_REQ_AOD_2_US 0x02 /*!< \brief AoD Constant Tone Extension with 2 us slots */ +/**@}*/ + +/** \name Bluetooth core specification versions + * + */ +/**@{*/ +#define HCI_VER_BT_CORE_SPEC_4_0 0x06 /*!< Bluetooth core specification 4.0 */ +#define HCI_VER_BT_CORE_SPEC_4_1 0x07 /*!< Bluetooth core specification 4.1 */ +#define HCI_VER_BT_CORE_SPEC_4_2 0x08 /*!< Bluetooth core specification 4.2 */ +#define HCI_VER_BT_CORE_SPEC_5_0 0x09 /*!< Bluetooth core specification 5.0 */ +#define HCI_VER_BT_CORE_SPEC_5_1 0x0A /*!< Bluetooth core specification 5.1 */ +/**@}*/ + +/** \name Parameter lengths + * + */ +/**@{*/ +#define HCI_EVT_MASK_LEN 8 /*!< \brief Length of event mask byte array */ +#define HCI_EVT_MASK_PAGE_2_LEN 8 /*!< \brief Length of event mask page 2 byte array */ +#define HCI_LE_EVT_MASK_LEN 8 /*!< \brief Length of LE event mask byte array */ +#define HCI_FEAT_LEN 8 /*!< \brief Length of features byte array */ +#define HCI_ADV_DATA_LEN 31 /*!< \brief Length of advertising data */ +#define HCI_SCAN_DATA_LEN 31 /*!< \brief Length of scan response data */ +#define HCI_EXT_ADV_DATA_LEN 251 /*!< \brief Length of extended advertising data */ +#define HCI_EXT_ADV_CONN_DATA_LEN 191 /*!< \brief Length of extended connectable advertising data */ +#define HCI_PER_ADV_DATA_LEN 252 /*!< \brief Length of periodic advertising data */ +#define HCI_EXT_ADV_RPT_DATA_LEN 229 /*!< \brief Length of extended advertising report data */ +#define HCI_PER_ADV_RPT_DATA_LEN 247 /*!< \brief Length of periodic advertising report data */ +#define HCI_CHAN_MAP_LEN 5 /*!< \brief Length of channel map byte array */ +#define HCI_KEY_LEN 16 /*!< \brief Length of encryption key */ +#define HCI_ENCRYPT_DATA_LEN 16 /*!< \brief Length of data used in encryption */ +#define HCI_RAND_LEN 8 /*!< \brief Length of random number */ +#define HCI_LE_STATES_LEN 8 /*!< \brief Length of LE states byte array */ +#define HCI_P256_KEY_LEN 64 /*!< \brief Length of P256 key */ +#define HCI_DH_KEY_LEN 32 /*!< \brief Length of DH Key */ + +#define HCI_EXT_ADV_RPT_DATA_LEN_OFFSET 23 /*!< \brief Length field offset of extended advertising report data */ +#define HCI_PER_ADV_RPT_DATA_LEN_OFFSET 6 /*!< \brief Length field offset of periodic advertising report data */ +/**@}*/ + +/** \name Number of Antenna IDs in Switching Pattern +* +*/ +/**@{*/ +#define HCI_MIN_NUM_ANTENNA_IDS 2 /*!< \brief Minimum number of Antenna IDs in switching pattern */ +#define HCI_MAX_NUM_ANTENNA_IDS 75 /*!< \brief Maximum number of Antenna IDs in switching pattern */ +/**@}*/ + +/** \name IQ Report Sample Counts +* +*/ +/**@{*/ +#define HCI_IQ_RPT_SAMPLE_CNT_MIN 9 /*!< \brief Minimum number of sample pairs in IQ report */ +#define HCI_IQ_RPT_SAMPLE_CNT_MAX 82 /*!< \brief Maximum number of sample pairs in IQ report */ + +#define HCI_CONN_IQ_RPT_SAMPLE_CNT_OFFSET 12 /*!< \brief Sample count field offset of connection IQ report */ +/**@}*/ + +/** \name Company ID + * + */ +/**@{*/ +#define HCI_ID_ARM 0x005F /*!< \brief ARM Ltd. company ID */ +/**@}*/ + +/** \name Manufacturer location in Local version + * + */ +/**@{*/ +#define HCI_LOCAL_VER_MANUFACTURER_POS 4 /*!< \brief Manufacturer location in local version */ +/**@}*/ + +/* \} */ /* STACK_HCI_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* HCI_DEFS_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bda.h b/lib/sdk/Libraries/BTLE/wsf/include/util/bda.h similarity index 82% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bda.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/bda.h index 009990bbd4a244e624e450caca832401f5613539..a00c64676ba445e9c35d4445671aaae7417a4442 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bda.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/bda.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file bda.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Bluetooth device address utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Bluetooth device address utilities. */ /*************************************************************************************************/ #ifndef BDA_H @@ -23,6 +26,9 @@ extern "C" { #endif +/*! \addtogroup WSF_UTIL_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ @@ -64,8 +70,6 @@ typedef uint8_t bdAddr_t[BDA_ADDR_LEN]; /*************************************************************************************************/ /*! - * \fn BdaCpy - * * \brief Copy a BD address from source to destination. * * \param pDst Pointer to destination. @@ -79,8 +83,6 @@ void BdaCpy(uint8_t *pDst, const uint8_t *pSrc); /*************************************************************************************************/ /*! - * \fn BdaCmp - * * \brief Compare two BD addresses. * * \param pAddr1 First address. @@ -93,8 +95,6 @@ bool_t BdaCmp(const uint8_t *pAddr1, const uint8_t *pAddr2); /*************************************************************************************************/ /*! - * \fn BdaClr - * * \brief Set a BD address to all zeros. * * \param pDst Pointer to destination. @@ -106,8 +106,6 @@ uint8_t *BdaClr(uint8_t *pDst); /*************************************************************************************************/ /*! -* \fn BdaIsZeros -* * \brief Check if a BD address is all zeros. * * \param pAddr Pointer to address. @@ -119,8 +117,6 @@ bool_t BdaIsZeros(const uint8_t *pAddr); /*************************************************************************************************/ /*! - * \fn Bda2Str - * * \brief Convert a BD address to a string. * * \param pAddr Pointer to BD address. @@ -130,6 +126,8 @@ bool_t BdaIsZeros(const uint8_t *pAddr); /*************************************************************************************************/ char *Bda2Str(const uint8_t *pAddr); +/*! \} */ /* WSF_UTIL_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/Libraries/BTLE/wsf/include/util/bstream.h b/lib/sdk/Libraries/BTLE/wsf/include/util/bstream.h new file mode 100644 index 0000000000000000000000000000000000000000..d318d6fcab77c7e4f4cb2c40b7b6f5a2aa7c00ea --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/bstream.h @@ -0,0 +1,318 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Byte stream to integer conversion macros. + */ +/*************************************************************************************************/ +#ifndef BSTREAM_H +#define BSTREAM_H + +#include "util/bda.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup WSF_UTIL_API + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/** + * \name Macros for converting a little endian byte buffer to integers. + */ +/**@{*/ +/*! \brief convert little endian byte buffer to int16_t. */ +#define BYTES_TO_INT16(n, p) {n = ((int16_t)(p)[0] + ((int16_t)(p)[1] << 8));} +/*! \brief convert little endian byte buffer to uint16_t. */ +#define BYTES_TO_UINT16(n, p) {n = ((uint16_t)(p)[0] + ((uint16_t)(p)[1] << 8));} +/*! \brief convert little endian byte buffer to uint24_t. */ +#define BYTES_TO_UINT24(n, p) {n = ((uint16_t)(p)[0] + ((uint16_t)(p)[1] << 8) + \ + ((uint16_t)(p)[2] << 16));} +/*! \brief convert little endian byte buffer to uint32_t. */ +#define BYTES_TO_UINT32(n, p) {n = ((uint32_t)(p)[0] + ((uint32_t)(p)[1] << 8) + \ + ((uint32_t)(p)[2] << 16) + ((uint32_t)(p)[3] << 24));} +/*! \brief convert little endian byte buffer to uint40_t. */ +#define BYTES_TO_UINT40(n, p) {n = ((uint64_t)(p)[0] + ((uint64_t)(p)[1] << 8) + \ + ((uint64_t)(p)[2] << 16) + ((uint64_t)(p)[3] << 24) + \ + ((uint64_t)(p)[4] << 32));} +/*! \brief convert little endian byte buffer to uint64_t. */ +#define BYTES_TO_UINT64(n, p) {n = ((uint64_t)(p)[0] + ((uint64_t)(p)[1] << 8) + \ + ((uint64_t)(p)[2] << 16) + ((uint64_t)(p)[3] << 24) + \ + ((uint64_t)(p)[4] << 32) + ((uint64_t)(p)[5] << 40) + \ + ((uint64_t)(p)[6] << 48) + ((uint64_t)(p)[7] << 56));} +/**@}*/ + +/** + * \name Macros for converting a big endian byte buffer to integers. + */ +/**@{*/ +/*! \brief convert big endian byte buffer to uint16_t. */ +#define BYTES_BE_TO_UINT16(n, p) {n = ((uint16_t)(p)[1] + ((uint16_t)(p)[0] << 8));} +/*! \brief convert big endian byte buffer to 24-bit uint32_t (MSB 0). */ +#define BYTES_BE_TO_UINT24(n, p) {n = ((uint16_t)(p)[2] + ((uint16_t)(p)[1] << 8) + \ + ((uint16_t)(p)[0] << 16));} +/*! \brief convert big endian byte buffer to uint32_t. */ +#define BYTES_BE_TO_UINT32(n, p) {n = ((uint32_t)(p)[3] + ((uint32_t)(p)[2] << 8) + \ + ((uint32_t)(p)[1] << 16) + ((uint32_t)(p)[0] << 24));} +/**@}*/ + +/** + * \name Macros for converting little endian integers to array of bytes + */ +/**@{*/ +/*! \brief convert little endian uint16_t to array of bytes. */ +#define UINT16_TO_BYTES(n) ((uint8_t) (n)), ((uint8_t)((n) >> 8)) +/*! \brief convert little endian uint32_t to array of bytes. */ +#define UINT32_TO_BYTES(n) ((uint8_t) (n)), ((uint8_t)((n) >> 8)), ((uint8_t)((n) >> 16)), ((uint8_t)((n) >> 24)) +/**@}*/ + +/** + * \name Macros for converting big endian integers to array of bytes + */ +/**@{*/ +/*! \brief convert big endian uint16_t to array of bytes. */ +#define UINT16_TO_BE_BYTES(n) ((uint8_t)((n) >> 8)), ((uint8_t) (n)) +/*! \brief convert 24-bit big endian uint32_t (MSB 0) to array of bytes. */ +#define UINT24_TO_BE_BYTES(n) ((uint8_t)((n) >> 16)), ((uint8_t)((n) >> 8)), ((uint8_t) (n)) +/*! \brief convert big endian uint32_t to array of bytes. */ +#define UINT32_TO_BE_BYTES(n) ((uint8_t)((n) >> 24)), ((uint8_t)((n) >> 16)), ((uint8_t)((n) >> 8)), ((uint8_t) (n)) +/**@}*/ + +/** + * \name Macros for converting little endian integers to single bytes + */ +/**@{*/ +/*! \brief convert little endian uint16_t to byte 0. */ +#define UINT16_TO_BYTE0(n) ((uint8_t) (n)) +/*! \brief convert little endian uint16_t to byte 1. */ +#define UINT16_TO_BYTE1(n) ((uint8_t) ((n) >> 8)) + +/*! \brief convert little endian uint32_t to byte 0. */ +#define UINT32_TO_BYTE0(n) ((uint8_t) (n)) +/*! \brief convert little endian uint32_t to byte 1. */ +#define UINT32_TO_BYTE1(n) ((uint8_t) ((n) >> 8)) +/*! \brief convert little endian uint32_t to byte 2. */ +#define UINT32_TO_BYTE2(n) ((uint8_t) ((n) >> 16)) +/*! \brief convert little endian uint32_t to byte 3. */ +#define UINT32_TO_BYTE3(n) ((uint8_t) ((n) >> 24)) +/**@}*/ + +/** + * \name Macros for converting a little endian byte stream to integers, with increment. + */ +/**@{*/ +/*! \brief convert little endian byte stream to uint8_t, incrementing one byte. */ +#define BSTREAM_TO_INT8(n, p) {n = (int8_t)(*(p)++);} +/*! \brief convert little endian byte stream to int8_t, incrementing one byte. */ +#define BSTREAM_TO_UINT8(n, p) {n = (uint8_t)(*(p)++);} +/*! \brief convert little endian byte stream to int16_t, incrementing two bytes. */ +#define BSTREAM_TO_INT16(n, p) {BYTES_TO_INT16(n, p); p += 2;} +/*! \brief convert little endian byte stream to uint16_t, incrementing two bytes. */ +#define BSTREAM_TO_UINT16(n, p) {BYTES_TO_UINT16(n, p); p += 2;} +/*! \brief convert little endian byte stream to uint24_t, incrementing three bytes. */ +#define BSTREAM_TO_UINT24(n, p) {BYTES_TO_UINT24(n, p); p += 3;} +/*! \brief convert little endian byte stream to uint32_t, incrementing four bytes. */ +#define BSTREAM_TO_UINT32(n, p) {BYTES_TO_UINT32(n, p); p += 4;} +/*! \brief convert little endian byte stream to uint40_t, incrementing five bytes. */ +#define BSTREAM_TO_UINT40(n, p) {BYTES_TO_UINT40(n, p); p += 5;} +/*! \brief convert little endian byte stream to uint64_t, incrementing eigth bytes. */ +#define BSTREAM_TO_UINT64(n, p) {n = BstreamToUint64(p); p += 8;} +/*! \brief convert little endian byte stream to six byte Bluetooth device address, incrementing six bytes. */ +#define BSTREAM_TO_BDA(bda, p) {BdaCpy(bda, p); p += BDA_ADDR_LEN;} +/*! \brief convert little endian byte stream to eight byte Bluetooth device address, incrementing eight bytes. */ +#define BSTREAM_TO_BDA64(bda, p) {bda = BstreamToBda64(p); p += BDA_ADDR_LEN;} +/**@}*/ + +/** + * \name Macros for converting a big endian byte stream to integers, with increment. + */ +/**@{*/ +/*! \brief convert big endian byte stream to uint16_t, incrementing one byte. */ +#define BSTREAM_BE_TO_UINT16(n, p) {BYTES_BE_TO_UINT16(n, p); p += 2;} +/*! \brief convert big endian byte stream to 24-bit uint32_t (MSB 0), incrementing one byte. */ +#define BSTREAM_BE_TO_UINT24(n, p) {BYTES_BE_TO_UINT24(n, p); p += 3;} +/**@}*/ + +/** + * \name Macros for converting integers to a little endian byte stream, with increment. + */ +/**@{*/ +/*! \brief convert uint8_t to little endian byte stream, incrementing one byte. */ +#define UINT8_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n);} +/*! \brief convert uint16_t to little endian byte stream, incrementing two bytes. */ +#define UINT16_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8);} +/*! \brief convert uint24_t to little endian byte stream, incrementing three bytes. */ +#define UINT24_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ + *(p)++ = (uint8_t)((n) >> 16);} +/*! \brief convert uint32_t to little endian byte stream, incrementing four bytes. */ +#define UINT32_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ + *(p)++ = (uint8_t)((n) >> 16); *(p)++ = (uint8_t)((n) >> 24);} +/*! \brief convert uint40_t to little endian byte stream, incrementing five bytes. */ +#define UINT40_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ + *(p)++ = (uint8_t)((n) >> 16); *(p)++ = (uint8_t)((n) >> 24); \ + *(p)++ = (uint8_t)((n) >> 32);} +/*! \brief convert uint64_t to little endian byte stream, incrementing eight bytes. */ +#define UINT64_TO_BSTREAM(p, n) {Uint64ToBstream(p, n); p += sizeof(uint64_t);} +/*! \brief convert six byte Bluetooth device address to little endian byte stream, incrementing six bytes. */ +#define BDA_TO_BSTREAM(p, bda) {BdaCpy(p, bda); p += BDA_ADDR_LEN;} +/*! \brief convert eight byte Bluetooth device address to little endian byte stream, incrementing eigth bytes. */ +#define BDA64_TO_BSTREAM(p, bda) {Bda64ToBstream(p, bda); p += BDA_ADDR_LEN;} +/**@}*/ + +/** + * \name Macros for converting integers to a big endian byte stream, with increment. + */ +/**@{*/ +/*! \brief convert uint16_t to big endian byte stream, incrementing one byte. */ +#define UINT16_TO_BE_BSTREAM(p, n) {*(p)++ = (uint8_t)((n) >> 8); *(p)++ = (uint8_t)(n);} +/*! \brief convert uint32_t to big endian byte stream, incrementing one byte. */ +#define UINT32_TO_BE_BSTREAM(p, n) {*(p)++ = (uint8_t)((n) >> 24); *(p)++ = (uint8_t)((n) >> 16);\ + *(p)++ = (uint8_t)((n) >> 8); *(p)++ = (uint8_t)(n);} +/**@}*/ + +/** + * \name Macros for converting integers to a little endian byte stream, without increment. + */ +/**@{*/ +/*! \brief convert uint16_t to little endian byte stream. */ +#define UINT16_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8);} +/*! \brief convert uint24_t to little endian byte stream. */ +#define UINT24_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ + (p)[2] = (uint8_t)((n) >> 16);} +/*! \brief convert uint32_t to little endian byte stream. */ +#define UINT32_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ + (p)[2] = (uint8_t)((n) >> 16); (p)[3] = (uint8_t)((n) >> 24);} +/*! \brief convert uint40_t to little endian byte stream. */ +#define UINT40_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ + (p)[2] = (uint8_t)((n) >> 16); (p)[3] = (uint8_t)((n) >> 24);\ + (p)[4] = (uint8_t)((n) >> 32);} +/**@}*/ + +/** + * \name Macros for converting integers to a big endian byte stream, without increment. + */ +/**@{*/ +/*! \brief convert uint16_t to big endian byte stream. */ +#define UINT16_TO_BE_BUF(p, n) {(p)[0] = (uint8_t)((n) >> 8); (p)[1] = (uint8_t)(n);} +/*! \brief convert 24-bit uint32_t (MSB 0) to big endian byte stream. */ +#define UINT24_TO_BE_BUF(p, n) {(p)[0] = (uint8_t)((n) >> 16); (p)[1] = (uint8_t)((n) >> 8); \ + (p)[2] = (uint8_t)(n);} +/*! \brief convert uint32_t to big endian byte stream. */ +#define UINT32_TO_BE_BUF(p, n) {(p)[0] = (uint8_t)((n) >> 24); (p)[1] = (uint8_t)((n) >> 16); \ + (p)[2] = (uint8_t)((n) >> 8); (p)[3] = (uint8_t)(n);} +/**@}*/ + +/** + * \name Macros for comparing a little endian byte buffer to integers. + */ +/**@{*/ +/*! \brief compare 2 byte little endian buffer with a uint16_t. */ +#define BYTES_UINT16_CMP(p, n) ((p)[1] == UINT16_TO_BYTE1(n) && (p)[0] == UINT16_TO_BYTE0(n)) +/**@}*/ + +/** + * \name Macros for IEEE FLOAT type: exponent = byte 3, mantissa = bytes 2-0 + */ +/**@{*/ +/*! \brief Convert float to uint32. */ +#define FLT_TO_UINT32(m, e) (uint32_t)((m) | ((int32_t)(e) * 16777216)) +/*! \brief Convert uint32_t to float. */ +#define UINT32_TO_FLT(m, e, n) {m = UINT32_TO_FLT_M(n); e = UINT32_TO_FLT_E(n);} +/*! \brief Convert uint32_t to float mantissa component */ +#define UINT32_TO_FLT_M(n) ((((n) & 0x00FFFFFF) >= 0x00800000) ? \ + ((int32_t)(((n) | 0xFF000000))) : ((int32_t)((n) & 0x00FFFFFF))) +/*! \brief Convert uint32_t to float exponent component. */ +#define UINT32_TO_FLT_E(n) ((int8_t)(n >> 24)) +/**@}*/ + +/** + * \name Macros for IEEE SFLOAT type: exponent = bits 15-12, mantissa = bits 11-0 + */ +/**@{*/ +/*! \brief Convert sfloat to uint16_t */ +#define SFLT_TO_UINT16(m, e) ((m) | (0xF000 & ((int16_t)(e) * 4096))) +/*! \brief Convert uint16_t to sfloat */ +#define UINT16_TO_SFLT(m, e, n) {m = UINT16_TO_SFLT_M(n); e = UINT16_TO_SFLT_E(n);} +/*! \brief Convert uint16_T to sfloat mantissa component */ +#define UINT16_TO_SFLT_M(n) ((((n) & 0x0FFF) >= 0x0800) ? \ + ((int16_t)(((n) | 0xF000))) : ((int16_t)((n) & 0x0FFF))) +/*! \brief Convert uint16_T to sfloat exponent component */ +#define UINT16_TO_SFLT_E(n) (((n >> 12) >= 0x0008) ? \ + ((int8_t)(((n >> 12) | 0xF0))) : ((int8_t)(n >> 12))) +/**@}*/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Convert bstream to BDA64. + * + * \param p Bstream pointer. + * + * \return Resulting BDA64 number. + */ +/*************************************************************************************************/ +uint64_t BstreamToBda64(const uint8_t *p); + +/*************************************************************************************************/ +/*! + * \brief Convert bstream to uint64_t. + * + * \param p Bstream pointer. + * + * \return Resulting uint64_t number. + */ +/*************************************************************************************************/ +uint64_t BstreamToUint64(const uint8_t *p); + +/*************************************************************************************************/ +/*! + * \brief Convert BDA64 to bstream. + * + * \param p Bstream pointer. + * \param bda uint64_t BDA. + * + * \return None. + */ +/*************************************************************************************************/ +void Bda64ToBstream(uint8_t *p, uint64_t bda); + +/*************************************************************************************************/ +/*! + * \brief Convert uint64_t to bstream. + * + * \param p Bstream pointer. + * \param n uint64_t number. + * + * \return None. + */ +/*************************************************************************************************/ +void Uint64ToBstream(uint8_t *p, uint64_t n); + +/*! \} */ /* WSF_UTIL_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* BSTREAM_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/calc128.h b/lib/sdk/Libraries/BTLE/wsf/include/util/calc128.h similarity index 73% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/calc128.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/calc128.h index b18af3898d46bb994027e067da46f01a63c278e3..2eb619c797e99ba25fbf31185cee335d26df4c48 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/calc128.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/calc128.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file calc128.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief 128-bit integer utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief 128-bit integer utilities. */ /*************************************************************************************************/ #ifndef CALC128_H @@ -23,18 +26,21 @@ extern "C" { #endif +/*! \addtogroup WSF_UTIL_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ -/*! 128-bit integer length in bytes */ +/*! \brief 128-bit integer length in bytes */ #define CALC128_LEN 16 /************************************************************************************************** Global Variables **************************************************************************************************/ -/*! 128-bit zero value */ +/*! \brief 128-bit zero value */ extern const uint8_t calc128Zeros[CALC128_LEN]; /************************************************************************************************** @@ -43,8 +49,6 @@ extern const uint8_t calc128Zeros[CALC128_LEN]; /*************************************************************************************************/ /*! - * \fn Calc128Cpy - * * \brief Copy a 128-bit integer from source to destination. * * \param pDst Pointer to destination. @@ -57,8 +61,6 @@ void Calc128Cpy(uint8_t *pDst, uint8_t *pSrc); /*************************************************************************************************/ /*! - * \fn Calc128Cpy64 - * * \brief Copy a 64-bit integer from source to destination. * * \param pDst Pointer to destination. @@ -71,8 +73,6 @@ void Calc128Cpy64(uint8_t *pDst, uint8_t *pSrc); /*************************************************************************************************/ /*! - * \fn Calc128Xor - * * \brief Exclusive-or two 128-bit integers and return the result in pDst. * * \param pDst Pointer to destination. @@ -83,6 +83,8 @@ void Calc128Cpy64(uint8_t *pDst, uint8_t *pSrc); /*************************************************************************************************/ void Calc128Xor(uint8_t *pDst, uint8_t *pSrc); +/*! \} */ /* WSF_UTIL_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/crc32.h b/lib/sdk/Libraries/BTLE/wsf/include/util/crc32.h similarity index 57% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/crc32.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/crc32.h index e74c16d414b25921d493348899f6921b287ebeab..3931d81262c4d0ef6c4f51acb71b9ffd78e5adeb 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/crc32.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/crc32.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file crc32.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief CRC-32 utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief CRC-32 utilities. */ /*************************************************************************************************/ #ifndef CRC32_H @@ -23,10 +26,11 @@ extern "C" { #endif +/*! \addtogroup WSF_UTIL_API + * \{ */ + /*************************************************************************************************/ /*! - * \fn CalcCrc32 - * * \brief Calculate the CRC-32 of the given buffer. * * \param crcInit Initial value of the CRC. @@ -42,6 +46,8 @@ extern "C" { /*************************************************************************************************/ uint32_t CalcCrc32(uint32_t crcInit, uint32_t len, const uint8_t *pBuf); +/*! \} */ /* WSF_UTIL_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/Libraries/BTLE/wsf/include/util/fcs.h b/lib/sdk/Libraries/BTLE/wsf/include/util/fcs.h new file mode 100644 index 0000000000000000000000000000000000000000..a56bc793288ca5d61ec2f3a46c4acd0f305f52d3 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/fcs.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief FCS utilities (3GPP TS 27.010). + */ +/*************************************************************************************************/ +#ifndef FCS_H +#define FCS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************************************************/ +/*! + * \brief Calculate the FCS of the given buffer. + * + * \param len Length of the buffer. + * \param pBuf Buffer to compute the CRC. + * + * \return FCS value. + */ +/*************************************************************************************************/ +uint8_t FcsCalc(uint32_t len, const uint8_t *pBuf); + +/*************************************************************************************************/ +/*! + * \brief Computes resultant CRC by appending one byte. + * + * \param pFcs CRC value on which to append the byte. + * \param byte Byte to be added to CRC computation. + * + * \return FCS value. + */ +/*************************************************************************************************/ +void FcsAddByte(uint8_t *pFcs, uint8_t byte); + +#ifdef __cplusplus +}; +#endif + +#endif /* FCS_H */ diff --git a/lib/sdk/NDALibraries/BTLE/platform/common/include/prand.h b/lib/sdk/Libraries/BTLE/wsf/include/util/prand.h similarity index 61% rename from lib/sdk/NDALibraries/BTLE/platform/common/include/prand.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/prand.h index f68dea915ad46bfc29fb525556c274a7d7719fe5..6d95a73d1d447cdde4aad163393aebec04ea94f0 100644 --- a/lib/sdk/NDALibraries/BTLE/platform/common/include/prand.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/prand.h @@ -1,24 +1,27 @@ -/*************************************************************************************************/ -/*! - * \file +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Cordio pseudo-random number generator interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Pseudo-random number generator interface. */ /*************************************************************************************************/ -#ifndef CORDIO_PRAND_H -#define CORDIO_PRAND_H +#ifndef PRAND_H +#define PRAND_H #include "wsf_types.h" @@ -55,4 +58,4 @@ void PrandGen(uint8_t *pBuf, uint16_t len); } #endif -#endif /* CORDIO_PRAND_H */ +#endif /* PRAND_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/print.h b/lib/sdk/Libraries/BTLE/wsf/include/util/print.h similarity index 63% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/print.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/print.h index 2c26302b46f0dde039b963b06058ea24e02c3143..cf63ac61936b284761b24527beddf0c687747cfd 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/print.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/print.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file print.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Print functions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Print functions. */ /*************************************************************************************************/ @@ -24,6 +27,9 @@ #include "wsf_types.h" +/*! \addtogroup WSF_UTIL_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ @@ -37,8 +43,6 @@ /*************************************************************************************************/ /*! - * \fn UtilVsnPrintf - * * \brief Print a trace message. * * \param pStr Storage for formatted string. @@ -51,4 +55,6 @@ /*************************************************************************************************/ uint32_t PrintVsn(char *pStr, uint32_t size, const char *pFmt, va_list ap) PRINT_ATTRIBUTE(3, 0); +/*! \} */ /* WSF_UTIL_API */ + #endif /* PRINT_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/terminal.h b/lib/sdk/Libraries/BTLE/wsf/include/util/terminal.h similarity index 70% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/terminal.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/terminal.h index 050a60b4f053392c26f89072a8bce57b286f56fb..88d89d60324ec7bbf207aa50d656199b8a16d616 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/terminal.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/terminal.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file terminal.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Terminal handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Terminal handler. */ /*************************************************************************************************/ @@ -25,26 +28,33 @@ #include "wsf_types.h" #include "wsf_os.h" +/*! \addtogroup WSF_UTIL_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ -#define TERMINAL_MAX_ARGC 8u /*!< Maximum number of arguments to any command. */ -#define TERMINAL_MAX_COMMAND_LEN 100u /*!< Maximum length of command line. */ -#define TERMINAL_PRINTF_MAX_LEN 128u /*!< Maximum length of any printed output. */ -#define TERMINAL_STRING_PROMPT "> " /*!< Prompt string. */ -#define TERMINAL_STRING_ERROR "ERROR: " /*!< Error prefix. */ -#define TERMINAL_STRING_USAGE "USAGE: " /*!< Usage prefix. */ -#define TERMINAL_STRING_NEW_LINE "\r\n" /*!< New line string. */ +#ifndef TERMINAL_MAX_ARGC +#define TERMINAL_MAX_ARGC 8u /*!< \brief Maximum number of arguments to any command. */ +#endif +#ifndef TERMINAL_MAX_COMMAND_LEN +#define TERMINAL_MAX_COMMAND_LEN 100u /*!< \brief Maximum length of command line. */ +#endif +#define TERMINAL_PRINTF_MAX_LEN 256u /*!< \brief Maximum length of any printed output. */ +#define TERMINAL_STRING_PROMPT "> " /*!< \brief Prompt string. */ +#define TERMINAL_STRING_ERROR "ERROR: " /*!< \brief Error prefix. */ +#define TERMINAL_STRING_USAGE "USAGE: " /*!< \brief Usage prefix. */ +#define TERMINAL_STRING_NEW_LINE "\r\n" /*!< \brief New line string. */ /*! \brief Terminal command error codes. */ enum { - TERMINAL_ERROR_OK = 0, /*!< Command completed. */ - TERMINAL_ERROR_BAD_ARGUMENTS = 1, /*!< ERROR: Invalid argument(s) */ - TERMINAL_ERROR_TOO_FEW_ARGUMENTS = 2, /*!< ERROR: Too few arguments */ - TERMINAL_ERROR_TOO_MANY_ARGUMENTS = 3, /*!< ERROR: Too many arguments */ - TERMINAL_ERROR_EXEC = 4 /*!< Command completed with execution error. */ + TERMINAL_ERROR_OK = 0, /*!< \brief Command completed. */ + TERMINAL_ERROR_BAD_ARGUMENTS = 1, /*!< \brief ERROR: Invalid argument(s) */ + TERMINAL_ERROR_TOO_FEW_ARGUMENTS = 2, /*!< \brief ERROR: Too few arguments */ + TERMINAL_ERROR_TOO_MANY_ARGUMENTS = 3, /*!< \brief ERROR: Too many arguments */ + TERMINAL_ERROR_EXEC = 4 /*!< \brief Command completed with execution error. */ }; /************************************************************************************************** @@ -73,15 +83,15 @@ typedef uint8_t (*terminalHandler_t)(uint32_t argc, char **argv); * \return None. */ /*************************************************************************************************/ -typedef void (*terminalUartTx_t)(const uint8_t *pBuf, uint32_t len); +typedef bool_t (*terminalUartTx_t)(const uint8_t *pBuf, uint32_t len); /*! \brief Terminal command. */ typedef struct terminalCommand_tag { - struct terminalCommand_tag *pNext; /*!< Pointer to next command in list. */ - const char *pName; /*!< Name of command. */ - const char *pHelpStr; /*!< Help String for command. */ - terminalHandler_t handler; /*!< Handler for command. */ + struct terminalCommand_tag *pNext; /*!< \brief Pointer to next command in list. */ + const char *pName; /*!< \brief Name of command. */ + const char *pHelpStr; /*!< \brief Help String for command. */ + terminalHandler_t handler; /*!< \brief Handler for command. */ } terminalCommand_t; /************************************************************************************************** @@ -90,8 +100,6 @@ typedef struct terminalCommand_tag /*************************************************************************************************/ /*! - * \fn TerminalInit - * * \brief Initialize terminal. * * \param handlerId Handler ID for TerminalHandler(). @@ -103,10 +111,10 @@ void TerminalInit(wsfHandlerId_t handlerId); /*************************************************************************************************/ /*! - * \fn TerminalRegisterUartTxFunc - * * \brief Register the UART Tx Function for the platform. * + * \param uartTxFunc UART Tx callback function. + * * \return None. */ /*************************************************************************************************/ @@ -114,8 +122,6 @@ void TerminalRegisterUartTxFunc(terminalUartTx_t uartTxFunc); /*************************************************************************************************/ /*! - * \fn TerminalRegisterCommand - * * \brief Register command with terminal. * * \param pCommand Command. @@ -127,8 +133,6 @@ void TerminalRegisterCommand(terminalCommand_t *pCommand); /*************************************************************************************************/ /*! - * \fn TerminalHandler - * * \brief Handler for terminal messages. * * \param event WSF event mask. @@ -141,8 +145,6 @@ void TerminalHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); /*************************************************************************************************/ /*! - * \fn TerminalRx - * * \brief Called by application when a data byte is received. * * \param dataByte received byte @@ -154,8 +156,6 @@ void TerminalRx(uint8_t dataByte); /*************************************************************************************************/ /*! - * \fn TerminalTxStr - * * \brief Called by application to transmit string. * * \param pStr String. @@ -167,8 +167,6 @@ void TerminalTxStr(const char *pStr); /*************************************************************************************************/ /*! - * \fn TerminalTxChar - * * \brief Called by application to transmit character. * * \param c Character. @@ -180,8 +178,6 @@ void TerminalTxChar(char c); /*************************************************************************************************/ /*! - * \fn TerminalTxPrint - * * \brief Called by application to print formatted data. * * \param pStr Message format string @@ -194,8 +190,6 @@ void TerminalTxPrint(const char *pStr, ...); /*************************************************************************************************/ /*! - * \fn TerminalTx - * * \brief Application function to transmit data.. * * \param pData Data. @@ -206,4 +200,6 @@ void TerminalTxPrint(const char *pStr, ...); /*************************************************************************************************/ void TerminalTx(const uint8_t *pData, uint16_t len); +/*! \} */ /* WSF_UTIL_API */ + #endif /* TERMINAL_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/wstr.h b/lib/sdk/Libraries/BTLE/wsf/include/util/wstr.h similarity index 55% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/util/wstr.h rename to lib/sdk/Libraries/BTLE/wsf/include/util/wstr.h index 8acfac742bbf9dc2f7e710e2e7aa71055db28639..f47d5a2b4d50751201835605399d685fa4cac55e 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/wstr.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/util/wstr.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wstr.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief String manipulation functions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2014-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief String manipulation functions. */ /*************************************************************************************************/ @@ -24,10 +27,22 @@ extern "C" { #endif +/*! \addtogroup WSF_UTIL_API + * \{ */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! HEX format '0x' or '0X' check */ +#define WSTR_IS_HEX_FORMAT(c) (((char)(c)[0] == '0') && \ + (((char)(c)[1] == 'x') || ((char)(c)[1] == 'X'))) + +/*! Binary format '0b' check */ +#define WSTR_IS_BIN_FORMAT(c) (((char)(c)[0] == '0') && ((char)(c)[1] == 'b')) + /*************************************************************************************************/ /*! - * \fn WstrnCpy - * * \brief Copies a string up to a given length. * * \param pBuf Pointer to buffer to copy to. @@ -41,8 +56,6 @@ void WstrnCpy(char *pBuf, const char *pData, uint8_t n); /*************************************************************************************************/ /*! - * \fn WStrReverseCpy - * * \brief Byte by byte reverse and copy a buffer. * * \param pBuf1 Buffer to hold reversed copy. @@ -56,8 +69,6 @@ void WStrReverseCpy(uint8_t *pBuf1, const uint8_t *pBuf2, uint16_t len); /*************************************************************************************************/ /*! - * \fn WStrReverse - * * \brief Byte by byte reverse a buffer. * * \param pBuf Buffer to reverse. @@ -81,6 +92,21 @@ void WStrReverse(uint8_t *pBuf, uint8_t len); /*************************************************************************************************/ void WStrFormatHex(char *pBuf, uint32_t val, uint8_t len); +/*************************************************************************************************/ +/*! + * \brief Convert a formatted string to int array, zero out space after the string length. + * + * \param pStr Pointer to the string to convert. + * \param pBuf Pointer to destination buffer. + * \param len Size of pBuf in bytes. + * + * \return none. + */ +/*************************************************************************************************/ +void WStrHexToArray(const char *pStr, uint8_t *pBuf, uint16_t len); + +/*! \} */ /* WSF_UTIL_API */ + #ifdef __cplusplus } #endif diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_assert.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_assert.h similarity index 63% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_assert.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_assert.h index b168ad9fa8e43fc6a7467d08d03d4ba8e93a75aa..b45f3f449c61ddb32f7a1a2c2c55006228955329 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_assert.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_assert.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_assert.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Assert macro. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Assert macro. */ /*************************************************************************************************/ #ifndef WSF_ASSERT_H @@ -25,16 +28,47 @@ extern "C" { #endif +/*! \addtogroup WSF_ASSERT_API + * \{ */ + /************************************************************************************************** Function Prototypes **************************************************************************************************/ #if WSF_TOKEN_ENABLED == TRUE +/*************************************************************************************************/ +/*! + * \brief Perform an assert action. + * + * \param modId Name of file originating assert. + * \param line Line number of assert statement. + * + * \return None. + */ +/*************************************************************************************************/ void WsfAssert(uint16_t modId, uint16_t line); #else void WsfAssert(const char *pFile, uint16_t line); #endif + +/*************************************************************************************************/ +/*! + * \brief Get number of asserts. + * + * \return Number of asserts. + */ +/*************************************************************************************************/ uint16_t WsfAssertNum(void); + +/*************************************************************************************************/ +/*! + * \brief Enable assert trap. + * + * \param enaAssertTrap TRUE to enable assert trap. + * + * \return None. + */ +/*************************************************************************************************/ void WsfAssertTrapEnable(bool_t enaAssertTrap); /************************************************************************************************** @@ -53,11 +87,11 @@ void WsfAssertTrapEnable(bool_t enaAssertTrap); /*************************************************************************************************/ /*! - * \def WSF_ASSERT - * * \brief Run-time assert macro. The assert executes when the expression is FALSE. * * \param expr Boolean expression to be tested. + * + * \return None */ /*************************************************************************************************/ #if WSF_ASSERT_ENABLED == TRUE @@ -67,30 +101,23 @@ void WsfAssertTrapEnable(bool_t enaAssertTrap); #define WSF_ASSERT(expr) if (!(expr)) {WsfAssert(__FILE__, (uint16_t) __LINE__);} #endif #else -#define WSF_ASSERT(expr) +#define WSF_ASSERT(expr) (void)(expr); #endif /*************************************************************************************************/ /*! - * \def WSF_CT_ASSERT - * * \brief Compile-time assert macro. This macro causes a compiler error when the * expression is FALSE. Note that this macro is generally used at file scope to * test constant expressions. Errors may result of it is used in executing code. * * \param expr Boolean expression to be tested. + * + * \return None */ /*************************************************************************************************/ #define WSF_CT_ASSERT(expr) extern char wsf_ct_assert[(expr) ? 1 : -1] -/*************************************************************************************************/ -/*! - * \brief Register assert handler. - * - * \param cback Callback called upon assert condition. - */ -/*************************************************************************************************/ -void WsfAssertRegister(void (*cback)(void)); +/*! \} */ /* WSF_ASSERT_API */ #ifdef __cplusplus }; diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_buf.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_buf.h similarity index 79% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_buf.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_buf.h index 60e4d6ec768ff8f9148f05d29ec0f6c3080b1823..b9e41872bc43e1ab9d8f8509bfdf22ebf167d1c7 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_buf.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_buf.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_buf.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Buffer pool service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Buffer pool service. */ /*************************************************************************************************/ #ifndef WSF_BUF_H @@ -30,22 +33,22 @@ extern "C" { Configuration **************************************************************************************************/ -/*! \brief check if trying to free a buffer that is already free */ +/*! \brief Check if trying to free a buffer that is already free */ #ifndef WSF_BUF_FREE_CHECK #define WSF_BUF_FREE_CHECK TRUE #endif -/*! \brief assert on best-fit buffer allocation failure */ +/*! \brief Assert on best-fit buffer allocation failure */ #ifndef WSF_BUF_ALLOC_BEST_FIT_FAIL_ASSERT #define WSF_BUF_ALLOC_BEST_FIT_FAIL_ASSERT FALSE #endif -/*! \brief assert on buffer allocation failure */ +/*! \brief Assert on buffer allocation failure */ #ifndef WSF_BUF_ALLOC_FAIL_ASSERT #define WSF_BUF_ALLOC_FAIL_ASSERT TRUE #endif -/*! \brief buffer histogram stats */ +/*! \brief Buffer histogram stats */ #ifndef WSF_BUF_STATS_HIST #define WSF_BUF_STATS_HIST FALSE #endif @@ -61,7 +64,7 @@ extern "C" { #define WSF_BUF_STATS_MAX_POOL 32 /*! \brief Failure Codes */ -#define WSF_BUF_ALLOC_FAILED 0x01 +#define WSF_BUF_ALLOC_FAILED 1 #ifndef WSF_BUF_STATS /*! \brief Enable buffer allocation statistics. */ @@ -75,8 +78,8 @@ extern "C" { /*! \brief Buffer pool descriptor structure */ typedef struct { - uint16_t len; /*!< \brief length of buffers in pool */ - uint8_t num; /*!< \brief number of buffers in pool */ + uint16_t len; /*!< \brief Length of buffers in pool */ + uint8_t num; /*!< \brief Number of buffers in pool */ } wsfBufPoolDesc_t; /*! \brief Pool statistics */ @@ -115,31 +118,41 @@ typedef struct /*! * \brief Callback providing WSF buffer diagnostic messages. * - * \param pInfo Diagnostics message + * \param pInfo Diagnostics message. * * \return None. */ /*************************************************************************************************/ -typedef void (*wsfBufDiagCback_t)(WsfBufDiag_t *pInfo); +typedef void (*WsfBufDiagCback_t)(WsfBufDiag_t *pInfo); /************************************************************************************************** Function Declarations **************************************************************************************************/ +/*************************************************************************************************/ +/*! + * \brief Calculate size required by the buffer pool. + * + * \param numPools Number of buffer pools. + * \param pDesc Array of buffer pool descriptors, one for each pool. + * + * \return Amount of pBufMem used. + */ +/*************************************************************************************************/ +uint32_t WsfBufCalcSize(uint8_t numPools, wsfBufPoolDesc_t *pDesc); + /*************************************************************************************************/ /*! * \brief Initialize the buffer pool service. This function should only be called once * upon system initialization. * - * \param bufMemLen Length in bytes of memory pointed to by pBufMem. - * \param pBufMem Memory in which to store the pools used by the buffer pool service. * \param numPools Number of buffer pools. * \param pDesc Array of buffer pool descriptors, one for each pool. * * \return Amount of pBufMem used or 0 for failures. */ /*************************************************************************************************/ -uint32_t WsfBufInit(uint32_t bufMemLen, uint8_t *pBufMem, uint8_t numPools, wsfBufPoolDesc_t *pDesc); +uint32_t WsfBufInit(uint8_t numPools, wsfBufPoolDesc_t *pDesc); /*************************************************************************************************/ /*! @@ -211,7 +224,7 @@ void WsfBufGetPoolStats(WsfBufPoolStat_t *pStat, uint8_t numPool); * \return None. */ /*************************************************************************************************/ -void WsfBufDiagRegister(wsfBufDiagCback_t callback); +void WsfBufDiagRegister(WsfBufDiagCback_t callback); /*! \} */ /* WSF_BUF_API */ diff --git a/lib/sdk/Libraries/BTLE/wsf/include/wsf_bufio.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_bufio.h new file mode 100644 index 0000000000000000000000000000000000000000..6a6d8f197d241b96ad7abb2ba3ace7dc1c1e9740 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_bufio.h @@ -0,0 +1,93 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Buffer I/O service. + */ +/*************************************************************************************************/ +#ifndef WSF_BUF_IO_H +#define WSF_BUF_IO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup WSF_BUF_IO_API + * \{ */ + + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/************************************************************************************************** + Callback Function Datatypes +**************************************************************************************************/ + +/*! \brief Buffer IO UART Rx callback. */ +typedef void (*WsfBufIoUartRxCback_t)(uint8_t rxByte); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the platform UART. + * + * \param pBuf Tx Buffer pointer. + * \param size Length of buffer. + * + * \return memory used. + */ +/*************************************************************************************************/ +uint32_t WsfBufIoUartInit(void *pBuf, uint32_t size); + +/*************************************************************************************************/ +/*! + * \brief Register the platform UART RX callback. + * + * \param[in] Callback function for UART RX. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfBufIoUartRegister(WsfBufIoUartRxCback_t rxCback); + +/*************************************************************************************************/ +/*! + * \brief Transmit buffer on platform UART. + * + * \param pBuf Buffer to transmit. + * \param len Length of buffer in octets. + * + * \return None. + */ +/*************************************************************************************************/ +bool_t WsfBufIoWrite(const uint8_t *pBuf, uint32_t len); + +/*! \} */ /* WSF_BUF_IO_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* WSF_BUF_IO_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_cs.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_cs.h similarity index 61% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_cs.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_cs.h index 1d96cbc4c1ff4327220ac22f5c462afc48fd2e95..e75a7611ddf02038ed08a8eec0fe6442afdae79f 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_cs.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_cs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_cs.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Critical section macros. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Critical section macros. */ /*************************************************************************************************/ #ifndef WSF_CS_H @@ -23,6 +26,9 @@ extern "C" { #endif +/*! \addtogroup WSF_CS_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ @@ -65,30 +71,39 @@ extern "C" { /*************************************************************************************************/ #define WSF_CS_EXIT(cs) WsfCsExit() -/************************************************************************************************** - Data Types -**************************************************************************************************/ - -/*! \brief Timestamp call signature. */ -typedef bool_t (*WsfCsTimestamp_t)(uint32_t *); - -/*! \brief Timestamp delta and time base converter call signature. */ -typedef uint32_t (*WsfCsTimebase_t)(uint32_t); - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -extern uint16_t wsfCsStatsWatermarkUsec; - /************************************************************************************************** Function Declarations **************************************************************************************************/ -void WsfCsStatsRegister(WsfCsTimestamp_t timestampCback, WsfCsTimebase_t timebaseCback); +/*************************************************************************************************/ +/*! + * \brief Get critical section duration watermark level. + * + * \return Critical section duration watermark level. + */ +/*************************************************************************************************/ +uint32_t WsfCsStatsGetCsWaterMark(void); + +/*************************************************************************************************/ +/*! + * \brief Enter a critical section. + * + * \return None. + */ +/*************************************************************************************************/ void WsfCsEnter(void); + +/*************************************************************************************************/ +/*! + * \brief Enter a critical section. + * + * \return None. + */ +/*************************************************************************************************/ void WsfCsExit(void); +/*! \} */ /* WSF_CS_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/Libraries/BTLE/wsf/include/wsf_detoken.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_detoken.h new file mode 100644 index 0000000000000000000000000000000000000000..605f11a77b7b34d56e21188a1a8adf6d8368bcf8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_detoken.h @@ -0,0 +1,98 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Token trace decode header file. + */ +/*************************************************************************************************/ + +#ifndef WSF_DETOKEN_H +#define WSF_DETOKEN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Vendor specific event mask opcode. */ +#define WSF_DETOKEN_VS_SET_EVENT_MASK_OPCODE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3E1) + +/*! \brief Event mask bits. */ +#define WSF_DETOKEN_ENABLE_BIT (1<<1) + +/*! \brief Vendor specific token event. */ +#define WSF_DETOKEN_VS_EVT_TOKEN 0xFFF0 + +/** \name Platform identifiers + * + */ +/**@{*/ +#define WSF_DETOKEN_TRACE_NORDIC 1 +/**@}*/ + +/** \name Parameter mask bits + * + */ +/**@{*/ +#define WSF_DETOKEN_PARAM_VARIABLE 0 +#define WSF_DETOKEN_PARAM_STRING 1 +/**@}*/ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize detoken trace. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfDetokenInit(void); + +/*************************************************************************************************/ +/*! + * \brief Enable/disable detoken trace. + * + * \param enable TRUE to enable, FALSE to disable. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfDetokenEnable(bool_t enable); + +/*************************************************************************************************/ +/*! + * \brief Process vendor specific HCI events and decode token trace events from the LL. + * + * \param len Length of pBuffer in bytes. + * \param pBuffer Buffer containing HCI event. + * + * \return TRUE if VS HCI message is a token, else FALSE. + */ +/*************************************************************************************************/ +bool_t WsfDetokenProcessHciEvent(uint16_t len, uint8_t *pBuffer); + +#ifdef __cplusplus +}; +#endif + +#endif /* WSF_DETOKEN_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_efs.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_efs.h similarity index 69% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_efs.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_efs.h index 82ea678dee952d1d94fd549f7d208dd4079e83e9..4958084dcf76021708f7ee26b12384a334208c62 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_efs.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_efs.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_efs.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Embedded File System service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2014-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Embedded File System service. */ /*************************************************************************************************/ @@ -24,105 +27,125 @@ extern "C" { #endif +/*! \addtogroup WSF_EFS_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ -/* Max Number of Files and Media */ +/*! \brief Max Number of Files and Media */ #ifndef WSF_EFS_MAX_FILES #define WSF_EFS_MAX_FILES 6 #endif -/* Max Number of Media */ +/*! \brief Max Number of Media */ #ifndef WSF_EFS_MAX_MEDIA #define WSF_EFS_MAX_MEDIA 4 #endif -/* Status codes */ -#define WSF_EFS_SUCCESS 0 /*! Success */ -#define WSF_EFS_FAILURE 1 /*! Failure */ -#define WSF_EFS_GET_FAILED 0xFFFF /*! Get operation failure */ -#define WSF_EFS_PUT_FAILED 0xFFFF /*! PUT operation failure */ +/** \name Status Codes + * + */ +/**@{*/ +#define WSF_EFS_SUCCESS 0 /*!< \brief Success */ +#define WSF_EFS_FAILURE 1 /*!< \brief Failure */ +#define WSF_EFS_GET_FAILED 0xFFFF /*!< \brief Get operation failure */ +#define WSF_EFS_PUT_FAILED 0xFFFF /*!< \brief PUT operation failure */ +/**@}*/ -/* Invalid parameter Identifiers */ -#define WSF_EFS_INVALID_HANDLE 0xFFFF /*! Invalid Handle */ -#define WSF_EFS_INVALID_OFFSET 0xFFFFFFFF /*! Invalid Offset */ -#define WSF_EFS_INVALID_SIZE 0xFFFFFFFF /*! Invalid Size */ -#define WSF_EFS_INVALID_MEDIA 0xFF /*! Invalid Media */ -/* File Types */ -#define WSF_EFS_FILE_TYPE_BULK 0 /*! Bulk File Type */ -#define WSF_EFS_FILE_TYPE_STREAM 1 /*! Stream File Type */ +/** \name Invalid Parameter Identifiers + * + */ +/**@{*/ +#define WSF_EFS_INVALID_HANDLE 0xFFFF /*!< \brief Invalid Handle */ +#define WSF_EFS_INVALID_OFFSET 0xFFFFFFFF /*!< \brief Invalid Offset */ +#define WSF_EFS_INVALID_SIZE 0xFFFFFFFF /*!< \brief Invalid Size */ +#define WSF_EFS_INVALID_MEDIA 0xFF /*!< \brief Invalid Media */ +/**@}*/ -/* Offset to WsfEfsAddFile indicating any file offset can be used */ +/** \name File Types + * + */ +/**@{*/ +#define WSF_EFS_FILE_TYPE_BULK 0 /*!< \brief Bulk File Type */ +#define WSF_EFS_FILE_TYPE_STREAM 1 /*!< \brief Stream File Type */ +/**@}*/ + +/*! \brief Offset to WsfEfsAddFile indicating any file offset can be used */ #define WSF_EFS_FILE_OFFSET_ANY 0xFFFFFFFF -/* File Permissions */ -#define WSF_EFS_REMOTE_PERMISSIONS_MASK 0xFF /*! Remote Permissions */ -#define WSF_EFS_REMOTE_GET_PERMITTED 0x01 /*! Remote Get Permitted */ -#define WSF_EFS_REMOTE_PUT_PERMITTED 0x02 /*! Remote Put Permitted */ -#define WSF_EFS_REMOTE_ERASE_PERMITTED 0x04 /*! Remote Erase Permitted */ -#define WSF_EFS_REMOTE_VERIFY_PERMITTED 0x08 /*! Remote Verify Permitted */ -#define WSF_EFS_LOCAL_GET_PERMITTED 0x0100 /*! Local Get Permitted */ -#define WSF_EFS_LOCAL_PUT_PERMITTED 0x0200 /*! Local Put Permitted */ -#define WSF_EFS_LOCAL_ERASE_PERMITTED 0x0400 /*! Local Erase Permitted */ -#define WSF_EFS_REMOTE_VISIBLE 0x0800 /*! File Visible via Remote WDXS */ - -/* File name length in bytes */ +/** \name File Permissions + * + */ +/**@{*/ +#define WSF_EFS_REMOTE_PERMISSIONS_MASK 0xFF /*!< \brief Remote Permissions */ +#define WSF_EFS_REMOTE_GET_PERMITTED 0x01 /*!< \brief Remote Get Permitted */ +#define WSF_EFS_REMOTE_PUT_PERMITTED 0x02 /*!< \brief Remote Put Permitted */ +#define WSF_EFS_REMOTE_ERASE_PERMITTED 0x04 /*!< \brief Remote Erase Permitted */ +#define WSF_EFS_REMOTE_VERIFY_PERMITTED 0x08 /*!< \brief Remote Verify Permitted */ +#define WSF_EFS_LOCAL_GET_PERMITTED 0x0100 /*!< \brief Local Get Permitted */ +#define WSF_EFS_LOCAL_PUT_PERMITTED 0x0200 /*!< \brief Local Put Permitted */ +#define WSF_EFS_LOCAL_ERASE_PERMITTED 0x0400 /*!< \brief Local Erase Permitted */ +#define WSF_EFS_REMOTE_VISIBLE 0x0800 /*!< \brief File Visible via Remote WDXS */ +/**@}*/ + +/*! \brief File name length in bytes */ #define WSF_EFS_NAME_LEN 16 -/* File version length in bytes */ +/*! \brief File version length in bytes */ #define WSF_EFS_VERSION_LEN 16 -/* Standard Media Specific Command Identifiers */ -#define WSF_EFS_WDXS_PUT_COMPLETE_CMD 0x00 /*! Put Complete */ -#define WSF_EFS_VALIDATE_CMD 0x01 /*! Validate Req for the file */ +/** \name Standard Media Specific Command Identifiers + * + */ +/**@{*/ +#define WSF_EFS_WDXS_PUT_COMPLETE_CMD 0x00 /*!< \brief Put Complete */ +#define WSF_EFS_VALIDATE_CMD 0x01 /*!< \brief Validate Req for the file */ +/**@}*/ -/* Media Specific Command Identifiers reserved for applications begin at 0x80 */ +/*! \brief Media Specific Command Identifiers reserved for applications begin at 0x80 */ #define WSF_EFS_USER_CMD 0x80 /************************************************************************************************** Data Types **************************************************************************************************/ -/* File handle data type */ +/*! \brief File handle data type */ typedef uint16_t wsfEfsHandle_t; -/* File attributes data type */ +/*! \brief File attributes data type */ typedef struct { - char name[WSF_EFS_NAME_LEN]; - char version[WSF_EFS_VERSION_LEN]; - uint16_t permissions; - uint8_t type; + char name[WSF_EFS_NAME_LEN]; /*!< \brief File name string. */ + char version[WSF_EFS_VERSION_LEN]; /*!< \brief File version string. */ + uint16_t permissions; /*!< \brief File permissions. */ + uint8_t type; /*!< \brief File type. */ } wsfEsfAttributes_t; -/* File control block data type */ +/*! \brief File control block data type */ typedef struct { - uint32_t maxSize; - uint32_t address; - uint8_t media; - uint32_t size; - wsfEsfAttributes_t attributes; + uint32_t maxSize; /*!< \brief File maximum size. */ + uint32_t address; /*!< \brief File storage address. */ + uint8_t media; /*!< \brief File media. */ + uint32_t size; /*!< \brief File size. */ + wsfEsfAttributes_t attributes; /*!< \brief File attributes. */ } wsfEfsControl_t; -/* File Listing Information */ +/*! \brief File Listing Information */ typedef struct { - wsfEfsHandle_t handle; - uint32_t size; - wsfEsfAttributes_t attributes; + wsfEfsHandle_t handle; /*!< \brief File handle. */ + uint32_t size; /*!< \brief File size. */ + wsfEsfAttributes_t attributes; /*!< \brief File attributes. */ } wsfEfsFileInfo_t; /*************************************************************************************************/ /*! - * \fn wsfMediaInitFunc_t - * * \brief Media Init function, called when media is registered. * - * \param none. - * * \return Status of the operation. */ /*************************************************************************************************/ @@ -130,8 +153,6 @@ typedef uint8_t wsfMediaInitFunc_t(void); /*************************************************************************************************/ /*! - * \fn wsfMediaEraseFunc_t - * * \brief Media Erase function. * * \param address Address in media to start erasing. @@ -144,8 +165,6 @@ typedef uint8_t wsfMediaEraseFunc_t(uint32_t address, uint32_t size); /*************************************************************************************************/ /*! - * \fn wsfMediaReadFunc_t - * * \brief Media Read function. * * \param pBuf Buffer to hold data. @@ -159,8 +178,6 @@ typedef uint8_t wsfMediaReadFunc_t(uint8_t *pBuf, uint32_t address, uint32_t siz /*************************************************************************************************/ /*! - * \fn wsfMediaWriteFunc_t - * * \brief Media Write function. * * \param pBuf Buffer with data to be written. @@ -174,8 +191,6 @@ typedef uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint32_t address, uint3 /*************************************************************************************************/ /*! - * \fn wsfMediaHandleCmdFunc_t - * * \brief Media Specific Command handler. * * \param cmd Identifier of the media specific command. @@ -186,20 +201,20 @@ typedef uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint32_t address, uint3 /*************************************************************************************************/ typedef uint8_t wsfMediaHandleCmdFunc_t(uint8_t cmd, uint32_t param); -/* Media Control data type */ +/*! \brief Media Control data type */ typedef struct { - uint32_t startAddress; - uint32_t endAddress; - uint32_t pageSize; - wsfMediaInitFunc_t *init; - wsfMediaEraseFunc_t *erase; - wsfMediaReadFunc_t *read; - wsfMediaWriteFunc_t *write; - wsfMediaHandleCmdFunc_t *handleCmd; + uint32_t startAddress; /*!< \brief Start address. */ + uint32_t endAddress; /*!< \brief End address. */ + uint32_t pageSize; /*!< \brief Page size. */ + wsfMediaInitFunc_t *init; /*!< \brief Media intialization callback. */ + wsfMediaEraseFunc_t *erase; /*!< \brief Media erase callback. */ + wsfMediaReadFunc_t *read; /*!< \brief Media read callback. */ + wsfMediaWriteFunc_t *write; /*!< \brief Media write callback. */ + wsfMediaHandleCmdFunc_t *handleCmd; /*!< \brief Media command handler callback. */ } wsfEfsMedia_t; -/* Pointer to Media Control data type */ +/*! \brief Pointer to Media Control data type */ typedef const wsfEfsMedia_t *pWsfEfsMedia_t; /************************************************************************************************** @@ -208,8 +223,6 @@ typedef const wsfEfsMedia_t *pWsfEfsMedia_t; /*************************************************************************************************/ /*! - * \fn WsfEfsInit - * * \brief Initialise the embedded file system. * * \return none. @@ -219,8 +232,6 @@ void WsfEfsInit(void); /*************************************************************************************************/ /*! - * \fn WsfEfsAddFile - * * \brief Create a file in the embedded file system. * * \param maxSize Max length in bytes of of the file. @@ -235,8 +246,6 @@ wsfEfsHandle_t WsfEfsAddFile(uint32_t maxSize, uint8_t media, wsfEsfAttributes_t /*************************************************************************************************/ /*! - * \fn WsfEfsRemoveFile - * * \brief Deletes a file in the embedded file system. * * \param handle Handle identifying the file. @@ -248,8 +257,6 @@ uint8_t WsfEfsRemoveFile(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsErase - * * \brief Clears the contents of a file without deleting the file. * * \param handle Handle identifying the file. @@ -261,8 +268,6 @@ uint8_t WsfEfsErase(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetAttributes - * * \brief Gets the attributes of a file. * * \param handle Handle identifying the file. @@ -275,12 +280,10 @@ uint8_t WsfEfsGetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pAttr); /*************************************************************************************************/ /*! - * \fn WsfEfsSetAttributes - * * \brief Updates the attributes of a file. * * \param handle Handle identifying the file. - * \param pAttr Pointer to memory to with the updated attributes. + * \param pInfo Pointer to memory to with the updated attributes. * * \return WSF_EFS_SUCCESS or WSF_EFS_FAILURE. */ @@ -289,8 +292,6 @@ uint8_t WsfEfsSetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pInfo); /*************************************************************************************************/ /*! - * \fn WsfEfsGet - * * \brief Copies data from a file. * * \param handle Handle identifying the file. @@ -305,8 +306,6 @@ uint16_t WsfEfsGet(wsfEfsHandle_t handle, uint32_t offset, uint8_t *pBuffer, uin /*************************************************************************************************/ /*! - * \fn WsfEfsPut - * * \brief Writes data to a file. * * \param handle Handle identifying the file. @@ -321,12 +320,10 @@ uint16_t WsfEfsPut(wsfEfsHandle_t handle, uint32_t offset, const uint8_t *pBuffe /*************************************************************************************************/ /*! - * \fn WsfEfsRegisterMedia - * * \brief Registers a File Storage Medium with the Embedded File System. * - * \param pMedia Pointer to the media control structure. - * \param mediaID User specified identifier of the media. + * \param pMediaCtrl Pointer to the media control structure. + * \param mediaID User specified identifier of the media. * * \return WSF_EFS_SUCCESS or WSF_EFS_FAILURE. */ @@ -335,8 +332,6 @@ uint8_t WsfEfsRegisterMedia(const wsfEfsMedia_t *pMediaCtrl, uint8_t mediaID); /*************************************************************************************************/ /*! - * \fn wsfEfsGetFileByHandle - * * \brief Returns the file control block for the given handle. * * \param handle Handle of the file @@ -348,8 +343,6 @@ wsfEfsControl_t *WsfEfsGetFileByHandle(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileName - * * \brief Get the name of a file. * * \param handle File Handle. @@ -361,8 +354,6 @@ char *WsfEfsGetFileName(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileVersion - * * \brief Get the version of a file. * * \param handle File Handle. @@ -374,8 +365,6 @@ char *WsfEfsGetFileVersion(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileSize - * * \brief Get the size of a file. * * \param handle File Handle. @@ -387,8 +376,6 @@ uint32_t WsfEfsGetFileSize(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileMaxSize - * * \brief Get the number of bytes of memory reserved for use by a file. * * \param handle File Handle. @@ -400,8 +387,6 @@ uint32_t WsfEfsGetFileMaxSize(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileType - * * \brief Get the type of a file. * * \param handle File Handle. @@ -413,8 +398,6 @@ uint8_t WsfEfsGetFileType(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsGetFilePermissions - * * \brief Get the permissions of a file. * * \param handle File Handle. @@ -426,8 +409,6 @@ uint16_t WsfEfsGetFilePermissions(wsfEfsHandle_t handle); /*************************************************************************************************/ /*! - * \fn WsfEfsMediaSpecificCommand - * * \brief Execute a media specific command on a file. * * \param handle File Handle. @@ -439,6 +420,8 @@ uint16_t WsfEfsGetFilePermissions(wsfEfsHandle_t handle); /*************************************************************************************************/ uint8_t WsfEfsMediaSpecificCommand(wsfEfsHandle_t handle, uint8_t cmd, uint32_t param); +/*! \} */ /* WSF_EFS_API */ + #ifdef __cplusplus } #endif diff --git a/lib/sdk/Libraries/BTLE/wsf/include/wsf_heap.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_heap.h new file mode 100644 index 0000000000000000000000000000000000000000..fa87751877aa94b932c8aa90dfe453f02441db79 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_heap.h @@ -0,0 +1,77 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Buffer heap service. + */ +/*************************************************************************************************/ +#ifndef WSF_HEAP_H +#define WSF_HEAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup WSF_HEAP_API + * \{ */ + +/*************************************************************************************************/ +/*! + * \brief Get heap available. + * + * \return Number of bytes of heap memory available. + */ +/*************************************************************************************************/ +uint32_t WsfHeapCountAvailable(void); + +/*************************************************************************************************/ +/*! + * \brief Get heap used. + * + * \return Number of bytes of heap memory used. + */ +/*************************************************************************************************/ +uint32_t WsfHeapCountUsed(void); + +/*************************************************************************************************/ +/*! + * \brief Reserve heap memory. + * + * \param size Number of bytes of heap memory used. + * + * \return None + */ +/*************************************************************************************************/ +void WsfHeapAlloc(uint32_t size); + +/*************************************************************************************************/ +/*! + * \brief Get next available heap memory. + * + * \return Address of the start of heap memory. + */ +/*************************************************************************************************/ +void *WsfHeapGetFreeStartAddress(void); + +/*! \} */ /* WSF_HEAP_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* WSF_HEAP_H */ + diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_math.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_math.h similarity index 52% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_math.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_math.h index 8ff893380d8f5f4764fbaa270a4d41745a6adc70..4f51c544be597753e5c40bf2859bc2034f50aca6 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_math.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_math.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_math.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Common math utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Common math utilities. */ /*************************************************************************************************/ #ifndef WSF_MATH_H @@ -25,6 +28,9 @@ extern "C" { #endif +/*! \addtogroup WSF_MATH_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ @@ -35,6 +41,8 @@ extern "C" { /*! \brief Returns the maximum of two values. */ #define WSF_MAX(a,b) ((a) > (b) ? (a) : (b)) +/*! \} */ /* WSF_MATH_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_msg.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_msg.h similarity index 77% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_msg.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_msg.h index e88030ebc7a6edbea729a4015eaca6e9e2c15445..a89c501556ba54d30a1fdd4de3af947ef2e3c453 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_msg.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_msg.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_msg.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Message passing service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Message passing service. */ /*************************************************************************************************/ #ifndef WSF_MSG_H @@ -26,14 +29,15 @@ extern "C" { #endif +/*! \addtogroup WSF_MSG_API + * \{ */ + /************************************************************************************************** Function Declarations **************************************************************************************************/ /*************************************************************************************************/ /*! - * \fn WsfMsgDataAlloc - * * \brief Allocate a data message buffer to be sent with WsfMsgSend(). * * \param len Message length in bytes. @@ -46,8 +50,6 @@ void *WsfMsgDataAlloc(uint16_t len, uint8_t tailroom); /*************************************************************************************************/ /*! - * \fn WsfMsgAlloc - * * \brief Allocate a message buffer to be sent with WsfMsgSend(). * * \param len Message length in bytes. @@ -59,8 +61,6 @@ void *WsfMsgAlloc(uint16_t len); /*************************************************************************************************/ /*! - * \fn WsfMsgFree - * * \brief Free a message buffer allocated with WsfMsgAlloc(). * * \param pMsg Pointer to message buffer. @@ -72,8 +72,6 @@ void WsfMsgFree(void *pMsg); /*************************************************************************************************/ /*! - * \fn WsfMsgSend - * * \brief Send a message to an event handler. * * \param handlerId Event handler ID. @@ -86,13 +84,11 @@ void WsfMsgSend(wsfHandlerId_t handlerId, void *pMsg); /*************************************************************************************************/ /*! - * \fn WsfMsgEnq - * * \brief Enqueue a message. * - * \param pQueue Pointer to queue. - * \param handerId Set message handler ID to this value. - * \param pElem Pointer to message buffer. + * \param pQueue Pointer to queue. + * \param handlerId Set message handler ID to this value. + * \param pMsg Pointer to message buffer. * * \return None. */ @@ -101,8 +97,6 @@ void WsfMsgEnq(wsfQueue_t *pQueue, wsfHandlerId_t handlerId, void *pMsg); /*************************************************************************************************/ /*! - * \fn WsfMsgDeq - * * \brief Dequeue a message. * * \param pQueue Pointer to queue. @@ -115,8 +109,6 @@ void *WsfMsgDeq(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); /*************************************************************************************************/ /*! - * \fn WsfMsgPeek - * * \brief Get the next message without removing it from the queue. * * \param pQueue Pointer to queue. @@ -127,6 +119,8 @@ void *WsfMsgDeq(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); /*************************************************************************************************/ void *WsfMsgPeek(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); +/*! \} */ /* WSF_MSG_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/Libraries/BTLE/wsf/include/wsf_nvm.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_nvm.h new file mode 100644 index 0000000000000000000000000000000000000000..14a5ebee09b2afa31b2f1fec4fbe65010b0594b1 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_nvm.h @@ -0,0 +1,106 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief NVM service. + */ +/*************************************************************************************************/ +#ifndef WSF_NVM_H +#define WSF_NVM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \addtogroup WSF_NVM_API + * \{ */ + +/*! \brief Operation completion callback. */ +typedef void (*WsfNvmCompEvent_t)(bool_t status); + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the WSF NVM. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfNvmInit(void); + +/*************************************************************************************************/ +/*! + * \brief Read data. + * + * \param id Read ID. + * \param pData Buffer to read to. + * \param len Data length to read. + * \param compCback Read callback. + * + * \return if Read NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmReadData(uint32_t id, uint8_t *pData, uint16_t len, WsfNvmCompEvent_t compCback); + +/*************************************************************************************************/ +/*! + * \brief Write data. + * + * \param id Write ID. + * \param pData Buffer to write. + * \param len Data length to write. + * \param compCback Write callback. + * + * \return if write NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmWriteData(uint32_t id, const uint8_t *pData, uint16_t len, WsfNvmCompEvent_t compCback); + +/*************************************************************************************************/ +/*! + * \brief Erase data. + * + * \param id Erase ID. + * \param compCback Write callback. + * + * \return if erase NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmEraseData(uint32_t id, WsfNvmCompEvent_t compCback); + +/*************************************************************************************************/ +/*! + * \brief Erase sectors. + * + * \param numOfSectors Number of sectors to be erased. + * \param compCback Erase callback. + * + * \return if erase NVM successfully. + */ +/*************************************************************************************************/ +void WsfNvmEraseSector(uint32_t numOfSectors, WsfNvmCompEvent_t compCback); + +/*! \} */ /* WSF_NVM_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* WSF_NVM_H */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_os.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_os.h similarity index 75% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_os.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_os.h index 5a5502f61b05e946dcc854524e3183c1926e561c..674ffb73d1f572074448d48066ab141b0c337304 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_os.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_os.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_os.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Software foundation OS API. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Software foundation OS API. */ /*************************************************************************************************/ #ifndef WSF_OS_H @@ -25,11 +28,14 @@ extern "C" { #endif +/*! \addtogroup WSF_OS_API + * \{ */ + /************************************************************************************************** Configuration **************************************************************************************************/ -/* OS Diagnostics */ +/*! \brief OS Diagnostics */ #ifndef WSF_OS_DIAG #define WSF_OS_DIAG FALSE #endif @@ -38,59 +44,64 @@ extern "C" { Macros **************************************************************************************************/ -/* Derive task from handler ID */ +/*! \brief Derive task from handler ID */ #define WSF_TASK_FROM_ID(handlerID) (((handlerID) >> 4) & 0x0F) -/* Derive handler from handler ID */ +/*! \brief Derive handler from handler ID */ #define WSF_HANDLER_FROM_ID(handlerID) ((handlerID) & 0x0F) -/* Invalid Task Identifier */ +/*! \brief Invalid Task Identifier */ #define WSF_INVALID_TASK_ID 0xFF +/*! \brief Get Diagnostic Task Identifier */ #if WSF_OS_DIAG == TRUE #define WSF_OS_GET_ACTIVE_HANDLER_ID() WsfActiveHandler #else #define WSF_OS_GET_ACTIVE_HANDLER_ID() WSF_INVALID_TASK_ID #endif /* WSF_OS_DIAG */ -/* Task events */ -#define WSF_MSG_QUEUE_EVENT 0x01 /* Message queued for event handler */ -#define WSF_TIMER_EVENT 0x02 /* Timer expired for event handler */ -#define WSF_HANDLER_EVENT 0x04 /* Event set for event handler */ +/** @name WSF Task Events + * + */ +/**@{*/ +#define WSF_MSG_QUEUE_EVENT 0x01 /*!< \brief Message queued for event handler */ +#define WSF_TIMER_EVENT 0x02 /*!< \brief Timer expired for event handler */ +#define WSF_HANDLER_EVENT 0x04 /*!< \brief Event set for event handler */ +/**@}*/ /************************************************************************************************** Data Types **************************************************************************************************/ -/* Event handler ID data type */ +/*! \brief Event handler ID data type */ typedef uint8_t wsfHandlerId_t; -/* Event handler event mask data type */ -typedef uint8_t wsfEventMask_t; +/*! \brief Event handler event mask data type */ +typedef uint16_t wsfEventMask_t; -/* Task ID data type */ +/*! \brief Task ID data type */ typedef wsfHandlerId_t wsfTaskId_t; -/* Task event mask data type */ +/*! \brief Task event mask data type */ typedef uint8_t wsfTaskEvent_t; /************************************************************************************************** External Variables **************************************************************************************************/ -/* Diagnostic Task Identifier */ +/*! \brief Diagnostic Task Identifier */ extern wsfHandlerId_t WsfActiveHandler; /************************************************************************************************** Data Types **************************************************************************************************/ -/*! Common message structure passed to event handler */ +/*! \brief Common message structure passed to event handler */ typedef struct { - uint16_t param; /*! General purpose parameter passed to event handler */ - uint8_t event; /*! General purpose event value passed to event handler */ - uint8_t status; /*! General purpose status value passed to event handler */ + uint16_t param; /*!< \brief General purpose parameter passed to event handler */ + uint8_t event; /*!< \brief General purpose event value passed to event handler */ + uint8_t status; /*!< \brief General purpose status value passed to event handler */ } wsfMsgHdr_t; /************************************************************************************************** @@ -99,8 +110,6 @@ typedef struct /*************************************************************************************************/ /*! - * \fn wsfEventHandler_t - * * \brief Event handler callback function. * * \param event Mask of events set for the event handler. @@ -117,8 +126,6 @@ typedef void (*wsfEventHandler_t)(wsfEventMask_t event, wsfMsgHdr_t *pMsg); /*************************************************************************************************/ /*! - * \fn WsfSetEvent - * * \brief Set an event for an event handler. * * \param handlerId Handler ID. @@ -131,8 +138,6 @@ void WsfSetEvent(wsfHandlerId_t handlerId, wsfEventMask_t event); /*************************************************************************************************/ /*! - * \fn WsfTaskLock - * * \brief Lock task scheduling. * * \return None. @@ -142,8 +147,6 @@ void WsfTaskLock(void); /*************************************************************************************************/ /*! - * \fn WsfTaskUnlock - * * \brief Unlock task scheduling. * * \return None. @@ -153,8 +156,6 @@ void WsfTaskUnlock(void); /*************************************************************************************************/ /*! - * \fn WsfTaskSetReady - * * \brief Set the task used by the given handler as ready to run. * * \param handlerId Event handler ID. @@ -167,8 +168,6 @@ void WsfTaskSetReady(wsfHandlerId_t handlerId, wsfTaskEvent_t event); /*************************************************************************************************/ /*! - * \fn WsfTaskMsgQueue - * * \brief Return the task message queue used by the given handler. * * \param handlerId Event handler ID. @@ -180,8 +179,6 @@ wsfQueue_t *WsfTaskMsgQueue(wsfHandlerId_t handlerId); /*************************************************************************************************/ /*! - * \fn WsfOsSetNextHandler - * * \brief Set the next WSF handler function in the WSF OS handler array. This function * should only be called as part of the OS initialization procedure. * @@ -194,12 +191,8 @@ wsfHandlerId_t WsfOsSetNextHandler(wsfEventHandler_t handler); /*************************************************************************************************/ /*! - * \fn wsfOsReadyToSleep - * * \brief Check if WSF is ready to sleep. * - * \param None. - * * \return Return TRUE if there are no pending WSF task events set, FALSE otherwise. */ /*************************************************************************************************/ @@ -207,12 +200,8 @@ bool_t wsfOsReadyToSleep(void); /*************************************************************************************************/ /*! - * \fn wsfOsDispatcher - * * \brief Event dispatched. Designed to be called repeatedly from infinite loop. * - * \param None. - * * \return None. */ /*************************************************************************************************/ @@ -220,14 +209,14 @@ void wsfOsDispatcher(void); /*************************************************************************************************/ /*! - * \fn WsfOsShutdown - * - * \brief Shutdown OS. - * - * \return None. - */ +* \brief Initialize OS control structure. +* +* \return None. +*/ /*************************************************************************************************/ -void WsfOsShutdown(void); +void WsfOsInit(void); + +/*! \} */ /* WSF_OS_API */ #ifdef __cplusplus }; diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_queue.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_queue.h similarity index 77% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_queue.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_queue.h index bea503213794cfd2cbe187661987adc12edf86cf..e9e8f48fc195c027e35ba731f957d521eb82361d 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_queue.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_queue.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_queue.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief General purpose queue service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief General purpose queue service. */ /*************************************************************************************************/ #ifndef WSF_QUEUE_H @@ -23,22 +26,25 @@ extern "C" { #endif +/*! \addtogroup WSF_QUEUE_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ -/*! Initialize a queue */ +/*! \brief Initialize a queue */ #define WSF_QUEUE_INIT(pQueue) {(pQueue)->pHead = NULL; (pQueue)->pTail = NULL;} /************************************************************************************************** Data Types **************************************************************************************************/ -/*! Queue structure */ +/*! \brief Queue structure */ typedef struct { - void *pHead; /*! head of queue */ - void *pTail; /*! tail of queue */ + void *pHead; /*!< \brief head of queue */ + void *pTail; /*!< \brief tail of queue */ } wsfQueue_t; /************************************************************************************************** @@ -47,8 +53,6 @@ typedef struct /*************************************************************************************************/ /*! - * \fn WsfQueueEnq - * * \brief Enqueue an element to the tail of a queue. * * \param pQueue Pointer to queue. @@ -61,8 +65,6 @@ void WsfQueueEnq(wsfQueue_t *pQueue, void *pElem); /*************************************************************************************************/ /*! - * \fn WsfQueueDeq - * * \brief Dequeue an element from the head of a queue. * * \param pQueue Pointer to queue. @@ -74,8 +76,6 @@ void *WsfQueueDeq(wsfQueue_t *pQueue); /*************************************************************************************************/ /*! - * \fn WsfQueuePush - * * \brief Push an element to the head of a queue. * * \param pQueue Pointer to queue. @@ -88,8 +88,6 @@ void WsfQueuePush(wsfQueue_t *pQueue, void *pElem); /*************************************************************************************************/ /*! - * \fn WsfQueueInsert - * * \brief Insert an element into a queue. This function is typically used when iterating * over a queue. * @@ -104,8 +102,6 @@ void WsfQueueInsert(wsfQueue_t *pQueue, void *pElem, void *pPrev); /*************************************************************************************************/ /*! - * \fn WsfQueueRemove - * * \brief Remove an element from a queue. This function is typically used when iterating * over a queue. * @@ -120,8 +116,6 @@ void WsfQueueRemove(wsfQueue_t *pQueue, void *pElem, void *pPrev); /*************************************************************************************************/ /*! - * \fn WsfQueueCount - * * \brief Count the number of elements in a queue. * * \param pQueue Pointer to queue. @@ -133,8 +127,6 @@ uint16_t WsfQueueCount(wsfQueue_t *pQueue); /*************************************************************************************************/ /*! - * \fn WsfQueueEmpty - * * \brief Return TRUE if queue is empty. * * \param pQueue Pointer to queue. @@ -144,6 +136,18 @@ uint16_t WsfQueueCount(wsfQueue_t *pQueue); /*************************************************************************************************/ bool_t WsfQueueEmpty(wsfQueue_t *pQueue); +/*************************************************************************************************/ +/*! + * \brief Check for a queue depth of 1 element. + * + * \param pQueue Queue. + * + * \return TRUE if Queue only has 1 element, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t WsfIsQueueDepthOne(wsfQueue_t *pQueue); + +/*! \} */ /* WSF_QUEUE_API */ #ifdef __cplusplus }; diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_timer.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_timer.h similarity index 70% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_timer.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_timer.h index 0019efdf25ff1e29dd1bc5ab59538bbb419e8ac0..41259e38c80ec073d008931f4d7f6896ef64bbf1 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_timer.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_timer.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_timer.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Timer service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Timer service. */ /*************************************************************************************************/ #ifndef WSF_TIMER_H @@ -25,12 +28,15 @@ extern "C" { #endif +/*! \addtogroup WSF_TIMER_API + * \{ */ + /************************************************************************************************** Macros **************************************************************************************************/ #ifndef WSF_MS_PER_TICK -/*! Default milliseconds per tick rate */ +/*! \brief Default milliseconds per tick rate */ #define WSF_MS_PER_TICK 10 #endif @@ -38,28 +44,25 @@ extern "C" { Data Types **************************************************************************************************/ -/*! Timer ticks data type */ +/*! \brief Timer ticks data type */ typedef uint32_t wsfTimerTicks_t; -/*! Timer structure */ +/*! \brief Timer structure */ typedef struct wsfTimer_tag { - struct wsfTimer_tag *pNext; /*! pointer to next timer in queue */ - wsfTimerTicks_t ticks; /*! number of ticks until expiration */ - wsfHandlerId_t handlerId; /*! event handler for this timer */ - bool_t isStarted; /*! TRUE if timer has been started */ - wsfMsgHdr_t msg; /*! application-defined timer event parameters */ + struct wsfTimer_tag *pNext; /*!< \brief pointer to next timer in queue */ + wsfMsgHdr_t msg; /*!< \brief application-defined timer event parameters */ + wsfTimerTicks_t ticks; /*!< \brief number of ticks until expiration */ + wsfHandlerId_t handlerId; /*!< \brief event handler for this timer */ + bool_t isStarted; /*!< \brief TRUE if timer has been started */ } wsfTimer_t; - /************************************************************************************************** Function Declarations **************************************************************************************************/ /*************************************************************************************************/ /*! - * \fn WsfTimerInit - * * \brief Initialize the timer service. This function should only be called once * upon system initialization. * @@ -70,8 +73,6 @@ void WsfTimerInit(void); /*************************************************************************************************/ /*! - * \fn WsfTimerStartSec - * * \brief Start a timer in units of seconds. Before this function is called parameter * pTimer->handlerId must be set to the event handler for this timer and parameter * pTimer->msg must be set to any application-defined timer event parameters. @@ -86,8 +87,6 @@ void WsfTimerStartSec(wsfTimer_t *pTimer, wsfTimerTicks_t sec); /*************************************************************************************************/ /*! - * \fn WsfTimerStartMs - * * \brief Start a timer in units of milliseconds. * * \param pTimer Pointer to timer. @@ -100,8 +99,6 @@ void WsfTimerStartMs(wsfTimer_t *pTimer, wsfTimerTicks_t ms); /*************************************************************************************************/ /*! - * \fn WsfTimerStop - * * \brief Stop a timer. * * \param pTimer Pointer to timer. @@ -113,8 +110,6 @@ void WsfTimerStop(wsfTimer_t *pTimer); /*************************************************************************************************/ /*! - * \fn WsfTimerUpdate - * * \brief Update the timer service with the number of elapsed ticks. This function is * typically called only from timer porting code. * @@ -127,8 +122,6 @@ void WsfTimerUpdate(wsfTimerTicks_t ticks); /*************************************************************************************************/ /*! - * \fn WsfTimerNextExpiration - * * \brief Return the number of ticks until the next timer expiration. Note that this * function can return zero even if a timer is running, indicating the timer * has expired but has not yet been serviced. @@ -142,8 +135,6 @@ wsfTimerTicks_t WsfTimerNextExpiration(bool_t *pTimerRunning); /*************************************************************************************************/ /*! - * \fn WsfTimerServiceExpired - * * \brief Service expired timers for the given task. This function is typically called only * WSF OS porting code. * @@ -154,6 +145,27 @@ wsfTimerTicks_t WsfTimerNextExpiration(bool_t *pTimerRunning); /*************************************************************************************************/ wsfTimer_t *WsfTimerServiceExpired(wsfTaskId_t taskId); +/*************************************************************************************************/ +/*! + * \brief Check if there is an active timer and if there is enough time to + * go to sleep. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTimerSleep(void); + +/*************************************************************************************************/ +/*! + * \brief Update WSF timer based on elapsed RTC ticks. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTimerSleepUpdate(void); + +/*! \} */ /* WSF_TIMER_API */ + #ifdef __cplusplus }; #endif diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_trace.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_trace.h similarity index 66% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_trace.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_trace.h index de5b3393404460f27a6540d4bc55a5c2e0e1bcee..6bb3d2cd2c5fa11071d7fedb1384884e5b0c378e 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_trace.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_trace.h @@ -1,25 +1,29 @@ -/*************************************************************************************************/ -/*! - * \file wsf_trace.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Trace message interface. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Trace message interface. */ /*************************************************************************************************/ #ifndef WSF_TRACE_H #define WSF_TRACE_H #include <stdarg.h> +#include "wsf_types.h" #ifdef __cplusplus extern "C" { @@ -34,12 +38,17 @@ extern "C" { #ifndef WSF_TRACE_ENABLED /*! \brief Trace enable flag (default is disabled, override with compile-time directive). */ -#define WSF_TRACE_ENABLED FALSE +#define WSF_TRACE_ENABLED FALSE #endif #ifndef WSF_TOKEN_ENABLED /*! \brief Tokenized tracing enable flag (default is disabled, override with compile-time directive). */ -#define WSF_TOKEN_ENABLED FALSE +#define WSF_TOKEN_ENABLED FALSE +#endif + +#ifndef LL_TRACE_ENABLED +/*! \brief Trace enabled for controller */ +#define LL_TRACE_ENABLED FALSE #endif /************************************************************************************************** @@ -47,27 +56,15 @@ extern "C" { **************************************************************************************************/ /*! \brief Token event handler. */ -typedef void (*WsfTokenHandler_t)(uint8_t *pBuf, uint8_t len); +typedef bool_t (*WsfTraceHandler_t)(const uint8_t *pBuf, uint32_t len); -/*! \brief Platform trace callback. */ -typedef void (*wsfTraceCback_t)(const char *pStr, va_list args); +/*! \brief BT4 Platform trace callback. */ +typedef void (*WsfBt4TraceCback_t)(const char *pStr, va_list args); /************************************************************************************************** Function Prototypes **************************************************************************************************/ -/*************************************************************************************************/ -/*! - * \brief Print a trace message. - * - * \param pStr Message format string - * \param ... Additional arguments, printf-style - * - * \return None. - */ -/*************************************************************************************************/ -void WsfTrace(const char *pStr, ...); - /*************************************************************************************************/ /*! * \brief Output tokenized message. @@ -91,23 +88,23 @@ void WsfToken(uint32_t tok, uint32_t var); /*************************************************************************************************/ void WsfTraceEnable(bool_t enable); - /*************************************************************************************************/ /*! - * \brief Service the trace ring buffer. + * \brief Output trace message. * - * \return TRUE if trace messages pending, FALSE otherwise. + * \param pStr Format string + * Addition parameters variable arguments to the format string. * - * This routine is called in the main loop for a "push" type trace systems. + * \return None. */ /*************************************************************************************************/ -bool_t WsfTokenService(void); +void WsfTrace(const char *pStr, ...); /*************************************************************************************************/ /*! - * \brief Regsiter token handler. + * \brief Register trace handler. * - * \param tokenCback Token event handler. + * \param traceCback Token event handler. * * \return None. * @@ -115,18 +112,29 @@ bool_t WsfTokenService(void); * is ready to be written to the I/O. */ /*************************************************************************************************/ -void WsfTokenRegisterHandler(WsfTokenHandler_t tokenCback); +void WsfTraceRegisterHandler(WsfTraceHandler_t traceCback); /*************************************************************************************************/ /*! - * \brief Register platform trace callback function. + * \brief Register BT4 platform trace callback function. * * \param cback Callback function * * \return None. */ /*************************************************************************************************/ -void WsfTraceRegister(wsfTraceCback_t cback); +void WsfTraceRegister(WsfBt4TraceCback_t cback); + +/*************************************************************************************************/ +/*! + * \brief Service the trace ring buffer. + * + * \return TRUE if trace messages pending, FALSE otherwise. + * + * This routine is called in the main loop for a "push" type trace systems. + */ +/*************************************************************************************************/ +bool_t WsfTokenService(void); /************************************************************************************************** Macros @@ -145,19 +153,12 @@ void WsfTraceRegister(wsfTraceCback_t cback); #define WSF_TRACE2(subsys, stat, msg, var1, var2) WSF_TOKEN(subsys, stat, msg) #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) WSF_TOKEN(subsys, stat, msg) -#elif WSF_TRACE_ENABLED == TRUE - -/*! \brief Generic 0 argument trace. */ -#define WSF_TRACE0(subsys, stat, msg) WsfTrace(msg) -/*! \brief Generic 1 argument trace. */ -#define WSF_TRACE1(subsys, stat, msg, var1) WsfTrace(msg, var1) -/*! \brief Generic 2 argument trace. */ -#define WSF_TRACE2(subsys, stat, msg, var1, var2) WsfTrace(msg, var1, var2) -/*! \brief Generic 3 argument trace. */ -#define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) WsfTrace(msg, var1, var2, var3) - #elif WSF_TOKEN_ENABLED == TRUE +/** \name Trace macros + * + */ +/**@{*/ #define WSF_TRACE0(subsys, stat, msg) \ WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, 0) #define WSF_TRACE1(subsys, stat, msg, var1) \ @@ -166,14 +167,56 @@ void WsfTraceRegister(wsfTraceCback_t cback); WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)(((var2) << 16) | ((var1) & 0xFFFF))) #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \ WsfToken(((__LINE__ & 0xFFF) << 16) | MODULE_ID, (uint32_t)((((var3) & 0xFFFF) << 16) | (((var2) & 0xFF) << 8) | ((var1) & 0xFF))) +/**@}*/ + +#elif WSF_TRACE_ENABLED == TRUE + +/** \name Trace macros + * + */ +/**@{*/ +#define WSF_TRACE0(subsys, stat, msg) \ + WsfTrace(msg) +#define WSF_TRACE1(subsys, stat, msg, var1) \ + WsfTrace(msg, var1) +#define WSF_TRACE2(subsys, stat, msg, var1, var2) \ + WsfTrace(msg, var1, var2) +#define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) \ + WsfTrace(msg, var1, var2, var3) +#define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4) \ + WsfTrace(msg, var1, var2, var3, var4) +#define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5) \ + WsfTrace(msg, var1, var2, var3, var4, var5) +#define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6) \ + WsfTrace(msg, var1, var2, var3, var4, var5, var6) +#define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7) \ + WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7) +#define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8) \ + WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8) +#define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \ + WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) +#define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \ + WsfTrace(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) +/**@}*/ #else +/** \name Trace macros + * + */ +/**@{*/ #define WSF_TRACE0(subsys, stat, msg) #define WSF_TRACE1(subsys, stat, msg, var1) #define WSF_TRACE2(subsys, stat, msg, var1, var2) #define WSF_TRACE3(subsys, stat, msg, var1, var2, var3) - +#define WSF_TRACE4(subsys, stat, msg, var1, var2, var3, var4) +#define WSF_TRACE5(subsys, stat, msg, var1, var2, var3, var4, var5) +#define WSF_TRACE6(subsys, stat, msg, var1, var2, var3, var4, var5, var6) +#define WSF_TRACE7(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7) +#define WSF_TRACE8(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8) +#define WSF_TRACE9(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) +#define WSF_TRACE12(subsys, stat, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) +/**@}*/ #endif /*! \brief 0 argument WSF info trace. */ @@ -226,13 +269,13 @@ void WsfTraceRegister(wsfTraceCback_t cback); #define WSF_TRACE_MSG3(msg, var1, var2, var3) /*! \brief 0 argument HCI info trace. */ -#define HCI_TRACE_INFO0(msg) +#define HCI_TRACE_INFO0(msg) WSF_TRACE0("HCI", "INFO", msg) /*! \brief 1 argument HCI info trace. */ -#define HCI_TRACE_INFO1(msg, var1) +#define HCI_TRACE_INFO1(msg, var1) WSF_TRACE1("HCI", "INFO", msg, var1) /*! \brief 2 argument HCI info trace. */ -#define HCI_TRACE_INFO2(msg, var1, var2) +#define HCI_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("HCI", "INFO", msg, var1, var2) /*! \brief 3 argument HCI info trace. */ -#define HCI_TRACE_INFO3(msg, var1, var2, var3) +#define HCI_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("HCI", "INFO", msg, var1, var2, var3) /*! \brief 0 argument HCI warning trace. */ #define HCI_TRACE_WARN0(msg) WSF_TRACE0("HCI", "WARN", msg) /*! \brief 1 argument HCI warning trace. */ @@ -383,6 +426,27 @@ void WsfTraceRegister(wsfTraceCback_t cback); #define APP_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("APP", "INFO", msg, var1, var2) /*! \brief 3 argument App info trace. */ #define APP_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("APP", "INFO", msg, var1, var2, var3) +/*! \brief 4 argument App info trace. */ +#define APP_TRACE_INFO4(msg, var1, var2, var3, var4) \ + WSF_TRACE4(INFO, APP, msg, var1, var2, var3, var4) +/*! \brief 5 argument App info trace. */ +#define APP_TRACE_INFO5(msg, var1, var2, var3, var4, var5) \ + WSF_TRACE5(INFO, APP, msg, var1, var2, var3, var4, var5) +/*! \brief 6 argument App info trace. */ +#define APP_TRACE_INFO6(msg, var1, var2, var3, var4, var5, var6) \ + WSF_TRACE6(INFO, APP, msg, var1, var2, var3, var4, var5, var6) +/*! \brief 7 argument App info trace. */ +#define APP_TRACE_INFO7(msg, var1, var2, var3, var4, var5, var6, var7) \ + WSF_TRACE7(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7) +/*! \brief 8 argument App info trace. */ +#define APP_TRACE_INFO8(msg, var1, var2, var3, var4, var5, var6, var7, var8) \ + WSF_TRACE8(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8) +/*! \brief 9 argument App info trace. */ +#define APP_TRACE_INFO9(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) \ + WSF_TRACE9(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9) +/*! \brief 12 argument App info trace. */ +#define APP_TRACE_INFO12(msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) \ + WSF_TRACE12(INFO, APP, msg, var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12) /*! \brief 0 argument App warning trace. */ #define APP_TRACE_WARN0(msg) WSF_TRACE0("APP", "WARN", msg) /*! \brief 1 argument App warning trace. */ @@ -401,6 +465,7 @@ void WsfTraceRegister(wsfTraceCback_t cback); #define APP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("APP", "ERR", msg, var1, var2, var3) /*! \brief 0 argument LL info trace. */ +#if (LL_TRACE_ENABLED == TRUE) #define LL_TRACE_INFO0(msg) WSF_TRACE0("LL", "INFO", msg) /*! \brief 1 argument LL info trace. */ #define LL_TRACE_INFO1(msg, var1) WSF_TRACE1("LL", "INFO", msg, var1) @@ -449,9 +514,109 @@ void WsfTraceRegister(wsfTraceCback_t cback); #define BBP_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("BBP", "ERR", msg, var1, var2) /*! \brief 3 argument BBP error trace. */ #define BBP_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("BBP", "ERR", msg, var1, var2, var3) +#else /* LL_TRACE_ENABLED */ +#define LL_TRACE_INFO0(msg) +/*! \brief 1 argument LL info trace. */ +#define LL_TRACE_INFO1(msg, var1) +/*! \brief 2 argument LL info trace. */ +#define LL_TRACE_INFO2(msg, var1, var2) +/*! \brief 3 argument LL info trace. */ +#define LL_TRACE_INFO3(msg, var1, var2, var3) +/*! \brief 0 argument LL warning trace. */ +#define LL_TRACE_WARN0(msg) +/*! \brief 1 argument LL warning trace. */ +#define LL_TRACE_WARN1(msg, var1) +/*! \brief 2 argument LL warning trace. */ +#define LL_TRACE_WARN2(msg, var1, var2) +/*! \brief 3 argument LL warning trace. */ +#define LL_TRACE_WARN3(msg, var1, var2, var3) +/*! \brief 0 argument LL error trace. */ +#define LL_TRACE_ERR0(msg) +/*! \brief 1 argument LL error trace. */ +#define LL_TRACE_ERR1(msg, var1) +/*! \brief 2 argument LL error trace. */ +#define LL_TRACE_ERR2(msg, var1, var2) +/*! \brief 3 argument LL error trace. */ +#define LL_TRACE_ERR3(msg, var1, var2, var3) + +/*! \brief 0 argument BBP warning trace. */ +#define BBP_TRACE_INFO0(msg) +/*! \brief 1 argument BBP warning trace. */ +#define BBP_TRACE_INFO1(msg, var1) +/*! \brief 2 argument BBP warning trace. */ +#define BBP_TRACE_INFO2(msg, var1, var2) +/*! \brief 3 argument BBP info trace. */ +#define BBP_TRACE_INFO3(msg, var1, var2, var3) +/*! \brief 0 argument BBP warning trace. */ +#define BBP_TRACE_WARN0(msg) +/*! \brief 1 argument BBP warning trace. */ +#define BBP_TRACE_WARN1(msg, var1) +/*! \brief 2 argument BBP warning trace. */ +#define BBP_TRACE_WARN2(msg, var1, var2) +/*! \brief 3 argument BBP warning trace. */ +#define BBP_TRACE_WARN3(msg, var1, var2, var3) +/*! \brief 0 argument BBP error trace. */ +#define BBP_TRACE_ERR0(msg) +/*! \brief 1 argument BBP error trace. */ +#define BBP_TRACE_ERR1(msg, var1) +/*! \brief 2 argument BBP error trace. */ +#define BBP_TRACE_ERR2(msg, var1, var2) +/*! \brief 3 argument BBP error trace. */ +#define BBP_TRACE_ERR3(msg, var1, var2, var3) +#endif /* LL_TRACE_ENABLED */ + +/*! \brief 0 argument MESH info trace. */ +#define MESH_TRACE_INFO0(msg) WSF_TRACE0("MESH", "INFO", msg) +/*! \brief 1 argument MESH info trace. */ +#define MESH_TRACE_INFO1(msg, var1) WSF_TRACE1("MESH", "INFO", msg, var1) +/*! \brief 2 argument MESH info trace. */ +#define MESH_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MESH", "INFO", msg, var1, var2) +/*! \brief 3 argument MESH info trace. */ +#define MESH_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MESH", "INFO", msg, var1, var2, var3) +/*! \brief 0 argument MESH warning trace. */ +#define MESH_TRACE_WARN0(msg) WSF_TRACE0("MESH", "WARN", msg) +/*! \brief 1 argument MESH warning trace. */ +#define MESH_TRACE_WARN1(msg, var1) WSF_TRACE1("MESH", "WARN", msg, var1) +/*! \brief 2 argument MESH warning trace. */ +#define MESH_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MESH", "WARN", msg, var1, var2) +/*! \brief 3 argument MESH warning trace. */ +#define MESH_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MESH", "WARN", msg, var1, var2, var3) +/*! \brief 0 argument MESH error trace. */ +#define MESH_TRACE_ERR0(msg) WSF_TRACE0("MESH", "ERR", msg) +/*! \brief 1 argument MESH error trace. */ +#define MESH_TRACE_ERR1(msg, var1) WSF_TRACE1("MESH", "ERR", msg, var1) +/*! \brief 2 argument MESH error trace. */ +#define MESH_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MESH", "ERR", msg, var1, var2) +/*! \brief 3 argument MESH error trace. */ +#define MESH_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MESH", "ERR", msg, var1, var2, var3) + +/*! \brief 0 argument MMDL info trace. */ +#define MMDL_TRACE_INFO0(msg) WSF_TRACE0("MMDL", "INFO", msg) +/*! \brief 1 argument MMDL info trace. */ +#define MMDL_TRACE_INFO1(msg, var1) WSF_TRACE1("MMDL", "INFO", msg, var1) +/*! \brief 2 argument MMDL info trace. */ +#define MMDL_TRACE_INFO2(msg, var1, var2) WSF_TRACE2("MMDL", "INFO", msg, var1, var2) +/*! \brief 3 argument MMDL info trace. */ +#define MMDL_TRACE_INFO3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "INFO", msg, var1, var2, var3) +/*! \brief 0 argument MMDL warning trace. */ +#define MMDL_TRACE_WARN0(msg) WSF_TRACE0("MMDL", "WARN", msg) +/*! \brief 1 argument MMDL warning trace. */ +#define MMDL_TRACE_WARN1(msg, var1) WSF_TRACE1("MMDL", "WARN", msg, var1) +/*! \brief 2 argument MMDL warning trace. */ +#define MMDL_TRACE_WARN2(msg, var1, var2) WSF_TRACE2("MMDL", "WARN", msg, var1, var2) +/*! \brief 3 argument MMDL warning trace. */ +#define MMDL_TRACE_WARN3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "WARN", msg, var1, var2, var3) +/*! \brief 0 argument MMDL error trace. */ +#define MMDL_TRACE_ERR0(msg) WSF_TRACE0("MMDL", "ERR", msg) +/*! \brief 1 argument MMDL error trace. */ +#define MMDL_TRACE_ERR1(msg, var1) WSF_TRACE1("MMDL", "ERR", msg, var1) +/*! \brief 2 argument MMDL error trace. */ +#define MMDL_TRACE_ERR2(msg, var1, var2) WSF_TRACE2("MMDL", "ERR", msg, var1, var2) +/*! \brief 3 argument MMDL error trace. */ +#define MMDL_TRACE_ERR3(msg, var1, var2, var3) WSF_TRACE3("MMDL", "ERR", msg, var1, var2, var3) -#if (WSF_TRACE_ENABLED == TRUE) || (WSF_TOKEN_ENABLED == TRUE) /*! \brief Enable LL trace. */ +#if (WSF_TRACE_ENABLED == TRUE) || (WSF_TOKEN_ENABLED == TRUE) #define LL_TRACE_ENABLE(ena) WsfTraceEnable(ena) #else #define LL_TRACE_ENABLE(ena) diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_types.h b/lib/sdk/Libraries/BTLE/wsf/include/wsf_types.h similarity index 62% rename from lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_types.h rename to lib/sdk/Libraries/BTLE/wsf/include/wsf_types.h index a84331b1870c02a84914a117b9d5b7e47bc6fb26..254a512236ff7f9f068843506c143bb9545670db 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/wsf_types.h +++ b/lib/sdk/Libraries/BTLE/wsf/include/wsf_types.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_types.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Platform-independent data types. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Platform-independent data types. */ /*************************************************************************************************/ #ifndef WSF_TYPES_H @@ -53,8 +56,11 @@ extern "C" { * */ /**@{*/ -#if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \ - (!defined(__ICC8051__) || (__ICC8051__ == 0))) +#if (((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \ + (!defined(__ICC8051__) || (__ICC8051__ == 0))) || \ + (defined(__clang__) || defined(_MSC_VER)) || \ + defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) || \ + defined(__ARMCC_VERSION) || defined(__CROSSWORKS)) #include <stdint.h> #else /*! \brief Signed 8-bit value. */ diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_assert.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_assert.c new file mode 100644 index 0000000000000000000000000000000000000000..b96b6efeebf6819095db2c64de0c57e306d6fc4b --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_assert.c @@ -0,0 +1,63 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Assert implementation. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_trace.h" +#include "stack/platform/include/pal_sys.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Perform an assert action. + * + * \param pFile Name of file originating assert. + * \param line Line number of assert statement. + * + * \return None. + */ +/*************************************************************************************************/ +#if WSF_TOKEN_ENABLED == TRUE +void WsfAssert(uint16_t modId, uint16_t line) +#else +void WsfAssert(const char *pFile, uint16_t line) +#endif +{ + /* Possibly unused parameters */ +#if WSF_TOKEN_ENABLED == TRUE + (void)modId; +#else + (void)pFile; +#endif + (void)line; + +#if WSF_TOKEN_ENABLED == TRUE + WSF_TRACE_ERR2("Assertion detected on %s:%u", modId, line); +#else + WSF_TRACE_ERR2("Assertion detected on %s:%u", pFile, line); +#endif + + PalSysAssertTrap(); +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_buf.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_buf.c similarity index 65% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_buf.c rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_buf.c index 6635dc1c1bf74b4bc78c729f3c9d22afd6fefa22..4893c467bb23d7469cc4fc7b8b4fb5c49d0e03f4 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_buf.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_buf.c @@ -1,24 +1,28 @@ -/*************************************************************************************************/ -/*! - * \file wsf_buf.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Buffer pool service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Buffer pool service. */ /*************************************************************************************************/ #include "wsf_types.h" #include "wsf_buf.h" +#include "wsf_heap.h" #include "wsf_assert.h" #include "wsf_math.h" #include "wsf_os.h" @@ -29,14 +33,14 @@ Macros **************************************************************************************************/ -/* magic number used to check for free buffer */ +/* Magic number used to check for free buffer. */ #define WSF_BUF_FREE_NUM 0xFAABD00D /************************************************************************************************** Data Types **************************************************************************************************/ -/* Unit of memory storage-- a structure containing a pointer */ +/* Unit of memory storage-- a structure containing a pointer. */ typedef struct wsfBufMem_tag { struct wsfBufMem_tag *pNext; @@ -45,16 +49,16 @@ typedef struct wsfBufMem_tag #endif } wsfBufMem_t; -/* Internal buffer pool */ +/* Internal buffer pool. */ typedef struct { - wsfBufPoolDesc_t desc; /* number of buffers and length */ - wsfBufMem_t *pStart; /* start of pool */ - wsfBufMem_t *pFree; /* first free buffer in pool */ + wsfBufPoolDesc_t desc; /* Number of buffers and length. */ + wsfBufMem_t *pStart; /* Start of pool. */ + wsfBufMem_t *pFree; /* First free buffer in pool. */ #if WSF_BUF_STATS == TRUE - uint8_t numAlloc; /* number of buffers currently allocated from pool */ - uint8_t maxAlloc; /* maximum buffers ever allocated from pool */ - uint16_t maxReqLen; /* maximum request length from pool. */ + uint8_t numAlloc; /* Number of buffers currently allocated from pool. */ + uint8_t maxAlloc; /* Maximum buffers ever allocated from pool. */ + uint16_t maxReqLen; /* Maximum request length from pool. */ #endif } wsfBufPool_t; @@ -62,73 +66,130 @@ typedef struct Global Variables **************************************************************************************************/ -/* Number of pools */ +/* Number of pools. */ uint8_t wsfBufNumPools; -/* Memory used for pools */ +/* Memory used for pools. */ wsfBufMem_t *wsfBufMem = NULL; -/* Currently use for debugging only */ +/* Currently use for debugging only. */ uint32_t wsfBufMemLen; #if WSF_BUF_STATS_HIST == TRUE -/* Buffer allocation counter */ +/* Buffer allocation counter. */ uint8_t wsfBufAllocCount[WSF_BUF_STATS_MAX_LEN]; -/* Pool Overflow counter */ +/* Pool Overflow counter. */ uint8_t wsfPoolOverFlowCount[WSF_BUF_STATS_MAX_POOL]; #endif #if WSF_OS_DIAG == TRUE -/* WSF buffer diagnostic callback function */ -static wsfBufDiagCback_t wsfBufDiagCback = NULL; +/* WSF buffer diagnostic callback function. */ +static WsfBufDiagCback_t wsfBufDiagCback = NULL; #endif +/*************************************************************************************************/ +/*! + * \brief Calculate size required by the buffer pool. + * + * \param numPools Number of buffer pools. + * \param pDesc Array of buffer pool descriptors, one for each pool. + * + * \return Amount of pBufMem used. + */ +/*************************************************************************************************/ +uint32_t WsfBufCalcSize(uint8_t numPools, wsfBufPoolDesc_t *pDesc) +{ + uint32_t len; + uint32_t descLen; + wsfBufPool_t *pPool; + wsfBufMem_t *pStart; + uint8_t i; + + wsfBufMem = (wsfBufMem_t *)0; + pPool = (wsfBufPool_t *)wsfBufMem; + + /* Buffer storage starts after the pool structs. */ + pStart = (wsfBufMem_t *) (pPool + numPools); + + /* Create each pool; see loop exit condition below. */ + while (TRUE) + { + /* Exit loop after verification check. */ + if (numPools-- == 0) + { + break; + } + + /* Adjust pool lengths for minimum size and alignment. */ + if (pDesc->len < sizeof(wsfBufMem_t)) + { + descLen = sizeof(wsfBufMem_t); + } + else if ((pDesc->len % sizeof(wsfBufMem_t)) != 0) + { + descLen = pDesc->len + sizeof(wsfBufMem_t) - (pDesc->len % sizeof(wsfBufMem_t)); + } + else + { + descLen = pDesc->len; + } + + len = descLen / sizeof(wsfBufMem_t); + for (i = pDesc->num; i > 0; i--) + { + /* Pointer to the next free buffer is stored in the buffer itself. */ + pStart += len; + } + pDesc++; + } + + return (uint8_t *)pStart - (uint8_t *)wsfBufMem; +} + /*************************************************************************************************/ /*! * \brief Initialize the buffer pool service. This function should only be called once * upon system initialization. * - * \param bufMemLen Length of free memory - * \param pBufMem Free memory buffer for building buffer pools * \param numPools Number of buffer pools. * \param pDesc Array of buffer pool descriptors, one for each pool. * * \return Amount of pBufMem used or 0 for failures. */ /*************************************************************************************************/ -uint32_t WsfBufInit(uint32_t bufMemLen, uint8_t *pBufMem, uint8_t numPools, wsfBufPoolDesc_t *pDesc) +uint32_t WsfBufInit(uint8_t numPools, wsfBufPoolDesc_t *pDesc) { wsfBufPool_t *pPool; wsfBufMem_t *pStart; uint16_t len; uint8_t i; - wsfBufMem = (wsfBufMem_t *) pBufMem; + wsfBufMem = (wsfBufMem_t *) WsfHeapGetFreeStartAddress(); pPool = (wsfBufPool_t *) wsfBufMem; - /* buffer storage starts after the pool structs */ + /* Buffer storage starts after the pool structs. */ pStart = (wsfBufMem_t *) (pPool + numPools); wsfBufNumPools = numPools; - /* create each pool; see loop exit condition below */ + /* Create each pool; see loop exit condition below. */ while (TRUE) { - /* verify we didn't overrun memory; if we did, abort */ - if (pStart > &wsfBufMem[bufMemLen / sizeof(wsfBufMem_t)]) + /* Verify we didn't overrun memory; if we did, abort. */ + if (pStart > &wsfBufMem[WsfHeapCountAvailable() / sizeof(wsfBufMem_t)]) { WSF_ASSERT(FALSE); return 0; } - /* exit loop after verification check */ + /* Exit loop after verification check. */ if (numPools-- == 0) { break; } - /* adjust pool lengths for minimum size and alignment */ + /* Adjust pool lengths for minimum size and alignment. */ if (pDesc->len < sizeof(wsfBufMem_t)) { pPool->desc.len = sizeof(wsfBufMem_t); @@ -156,32 +217,32 @@ uint32_t WsfBufInit(uint32_t bufMemLen, uint8_t *pBufMem, uint8_t numPools, wsfB WSF_TRACE_INFO2("Creating pool len=%u num=%u", pPool->desc.len, pPool->desc.num); WSF_TRACE_INFO1(" pStart=0x%x", (uint32_t)pPool->pStart); - /* initialize free list */ + /* Initialize free list. */ len = pPool->desc.len / sizeof(wsfBufMem_t); for (i = pPool->desc.num; i > 1; i--) { - /* verify we didn't overrun memory; if we did, abort */ - if (pStart > &wsfBufMem[bufMemLen / sizeof(wsfBufMem_t)]) + /* Verify we didn't overrun memory; if we did, abort. */ + if (pStart > &wsfBufMem[WsfHeapCountAvailable() / sizeof(wsfBufMem_t)]) { WSF_ASSERT(FALSE); return 0; } - /* pointer to the next free buffer is stored in the buffer itself */ + /* Pointer to the next free buffer is stored in the buffer itself. */ pStart->pNext = pStart + len; pStart += len; } - /* verify we didn't overrun memory; if we did, abort */ - if (pStart > &wsfBufMem[bufMemLen / sizeof(wsfBufMem_t)]) + /* Verify we didn't overrun memory; if we did, abort. */ + if (pStart > &wsfBufMem[WsfHeapCountAvailable() / sizeof(wsfBufMem_t)]) { WSF_ASSERT(FALSE); return 0; } - /* last one in list points to NULL */ + /* Last one in list points to NULL. */ pStart->pNext = NULL; pStart += len; - /* next pool */ + /* Next pool. */ pPool++; } @@ -214,26 +275,26 @@ void *WsfBufAlloc(uint16_t len) for (i = wsfBufNumPools; i > 0; i--, pPool++) { - /* if buffer is big enough */ + /* Check if buffer is big enough. */ if (len <= pPool->desc.len) { - /* enter critical section */ + /* Enter critical section. */ WSF_CS_ENTER(cs); - /* if buffers available */ + /* Check if buffers are available. */ if (pPool->pFree != NULL) { - /* allocation succeeded */ + /* Allocation succeeded. */ pBuf = pPool->pFree; - /* next free buffer is stored inside current free buffer */ + /* Next free buffer is stored inside current free buffer. */ pPool->pFree = pBuf->pNext; #if WSF_BUF_FREE_CHECK == TRUE pBuf->free = 0; #endif #if WSF_BUF_STATS_HIST == TRUE - /* increment count for buffers of this length */ + /* Increment count for buffers of this length. */ if (len < WSF_BUF_STATS_MAX_LEN) { wsfBufAllocCount[len]++; @@ -250,7 +311,7 @@ void *WsfBufAlloc(uint16_t len) } pPool->maxReqLen = WSF_MAX(pPool->maxReqLen, len); #endif - /* exit critical section */ + /* Exit critical section. */ WSF_CS_EXIT(cs); WSF_TRACE_ALLOC2("WsfBufAlloc len:%u pBuf:%08x", pPool->desc.len, pBuf); @@ -260,11 +321,11 @@ void *WsfBufAlloc(uint16_t len) #if WSF_BUF_STATS_HIST == TRUE else { - /* Pool overflow: increment count of overflow for current pool */ + /* Pool overflow: increment count of overflow for current pool. */ wsfPoolOverFlowCount[wsfBufNumPools-i]++; } #endif - /* exit critical section */ + /* Exit critical section. */ WSF_CS_EXIT(cs); #if WSF_BUF_ALLOC_BEST_FIT_FAIL_ASSERT == TRUE @@ -273,7 +334,7 @@ void *WsfBufAlloc(uint16_t len) } } - /* allocation failed */ + /* Allocation failed. */ #if WSF_OS_DIAG == TRUE if (wsfBufDiagCback != NULL) { @@ -287,10 +348,10 @@ void *WsfBufAlloc(uint16_t len) } else { - WSF_TRACE_WARN2("WsfBufAlloc failed len:%u - task:%u", len, WSF_OS_GET_ACTIVE_HANDLER_ID()); + WSF_TRACE_ALLOC2("WsfBufAlloc failed len:%u - task:%u", len, WSF_OS_GET_ACTIVE_HANDLER_ID()); } #else - WSF_TRACE_WARN1("WsfBufAlloc failed len:%u", len); + WSF_TRACE_ALLOC1("WsfBufAlloc failed len:%u", len); #endif #if WSF_BUF_ALLOC_FAIL_ASSERT == TRUE @@ -316,20 +377,20 @@ void WsfBufFree(void *pBuf) WSF_CS_INIT(cs); - /* verify pointer is within range */ + /* Verify pointer is within range. */ #if WSF_BUF_FREE_CHECK == TRUE WSF_ASSERT(p >= ((wsfBufPool_t *) wsfBufMem)->pStart); WSF_ASSERT(p < (wsfBufMem_t *)(((uint8_t *) wsfBufMem) + wsfBufMemLen)); #endif - /* iterate over pools starting from last pool */ + /* Iterate over pools starting from last pool. */ pPool = (wsfBufPool_t *) wsfBufMem + (wsfBufNumPools - 1); while (pPool >= (wsfBufPool_t *) wsfBufMem) { - /* if the buffer memory is located inside this pool */ + /* Check if the buffer memory is located inside this pool. */ if (p >= pPool->pStart) { - /* enter critical section */ + /* Enter critical section. */ WSF_CS_ENTER(cs); #if WSF_BUF_FREE_CHECK == TRUE @@ -340,11 +401,11 @@ void WsfBufFree(void *pBuf) pPool->numAlloc--; #endif - /* pool found; put buffer back in free list */ + /* Pool found; put buffer back in free list. */ p->pNext = pPool->pFree; pPool->pFree = p; - /* exit critical section */ + /* Exit critical section. */ WSF_CS_EXIT(cs); WSF_TRACE_FREE2("WsfBufFree len:%u pBuf:%08x", pPool->desc.len, pBuf); @@ -352,11 +413,11 @@ void WsfBufFree(void *pBuf) return; } - /* next pool */ + /* Next pool. */ pPool--; } - /* should never get here */ + /* Should never get here. */ WSF_ASSERT(FALSE); return; @@ -443,7 +504,7 @@ void WsfBufGetPoolStats(WsfBufPoolStat_t *pStat, uint8_t poolId) pStat->maxReqLen = 0; #endif - /* exit critical section */ + /* Exit critical section. */ WSF_CS_EXIT(cs); } @@ -456,9 +517,12 @@ void WsfBufGetPoolStats(WsfBufPoolStat_t *pStat, uint8_t poolId) * \return None. */ /*************************************************************************************************/ -void WsfBufDiagRegister(wsfBufDiagCback_t callback) +void WsfBufDiagRegister(WsfBufDiagCback_t callback) { #if WSF_OS_DIAG == TRUE wsfBufDiagCback = callback; +#else + /* Unused parameter */ + (void)callback; #endif } diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_bufio.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_bufio.c new file mode 100644 index 0000000000000000000000000000000000000000..db5a78be3fe765d83e049f6ceb3ef99d769ea114 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_bufio.c @@ -0,0 +1,296 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief WSF buffer IO for UART driver. + */ +/*************************************************************************************************/ + +#include <string.h> + +#include "wsf_types.h" +#include "wsf_trace.h" +#include "wsf_bufio.h" +#include "wsf_cs.h" +#include "wsf_os.h" + +#include "stack/platform/include/pal_uart.h" + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief TX structure */ +typedef struct +{ + uint8_t *pBuf; /*!< UART TX buffer pointer */ + uint16_t size; /*!< UART TX buffer size */ + uint16_t in; /*!< UART TX buffer in index */ + uint16_t out; /*!< UART TX buffer out index */ + uint16_t crt; /*!< UART TX current number of bytes sent */ +} WsfBufIoUartTx_t; + +/*! \brief RX structure */ +typedef struct +{ + WsfBufIoUartRxCback_t cback; /*!< UART RX callback. */ + uint8_t buf[1]; /*!< UART RX buffer */ +} WsfBufIoUartRx_t; + +/************************************************************************************************** + Local Variables +**************************************************************************************************/ + +/*! \brief Control block. */ +static struct +{ + WsfBufIoUartTx_t tx; /*!< Platform UART TX structure */ + WsfBufIoUartRx_t rx; /*!< Platform UART RX structure */ + bool_t initialized; /*!< UART RX is initialized */ +} WsfBufIoCb = {0}; + +/************************************************************************************************** + Local Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Start transmit. + * + * \param len Length to transmit. + * + * \return None. + */ +/*************************************************************************************************/ +static void wsfBufIoUartTxStart(uint16_t len) +{ + /* If TX buffer overrun happens, send bytes only till the end of the buffer. */ + if (WsfBufIoCb.tx.out + len > WsfBufIoCb.tx.size) + { + len = WsfBufIoCb.tx.size - WsfBufIoCb.tx.out; + } + + /* Check if TX length exceeds 1 octet size from UART driver. */ + if (len <= 0xFF) + { + PalUartWriteData(PAL_UART_ID_TERMINAL, WsfBufIoCb.tx.pBuf + WsfBufIoCb.tx.out, (uint16_t)len); + WsfBufIoCb.tx.crt = len; + } + else + { + PalUartWriteData(PAL_UART_ID_TERMINAL, WsfBufIoCb.tx.pBuf + WsfBufIoCb.tx.out, 0xFF); + WsfBufIoCb.tx.crt = 0xFF; + } +} + +/*************************************************************************************************/ +/*! + * \brief Get number of characters in Tx buffer. + * + * \return Number of characters in Tx buffer. + */ +/*************************************************************************************************/ +static uint16_t wsfBufIoUartTxBufCount(void) +{ + uint16_t count; + + if (WsfBufIoCb.tx.in >= WsfBufIoCb.tx.out) + { + count = WsfBufIoCb.tx.in - WsfBufIoCb.tx.out; + } + else + { + count = WsfBufIoCb.tx.size - WsfBufIoCb.tx.out + WsfBufIoCb.tx.in; + } + + return count; +} + +/*************************************************************************************************/ +/*! + * \brief Rx handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void wsfBufIoUartRxHandler(void) +{ + if (WsfBufIoCb.rx.cback) + { + WsfBufIoCb.rx.cback(WsfBufIoCb.rx.buf[0]); + } + /* Read next byte. */ + PalUartReadData(PAL_UART_ID_TERMINAL, WsfBufIoCb.rx.buf, 1); +} + +/*************************************************************************************************/ +/*! + * \brief Tx handler. + * + * \return None. + */ +/*************************************************************************************************/ +static void wsfBufIoUartTxHandler(void) +{ + uint16_t count; + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + if (WsfBufIoCb.tx.out + WsfBufIoCb.tx.crt >= WsfBufIoCb.tx.size) + { + WsfBufIoCb.tx.out = WsfBufIoCb.tx.crt - (WsfBufIoCb.tx.size - WsfBufIoCb.tx.out); + } + else + { + WsfBufIoCb.tx.out += WsfBufIoCb.tx.crt; + } + + WsfBufIoCb.tx.crt = 0; + + count = wsfBufIoUartTxBufCount(); + + if (count != 0) + { + wsfBufIoUartTxStart(count); + } + + WSF_CS_EXIT(cs); +} + +/************************************************************************************************** + Global Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the UART. + * + * \param pBuf Tx Buffer pointer. + * \param size Length of buffer. + * + * \return memory used. + */ +/*************************************************************************************************/ +uint32_t WsfBufIoUartInit(void *pBuf, uint32_t size) +{ + PalUartConfig_t cfg; + + /* Skip initialization if it is already done. */ + if (WsfBufIoCb.initialized) + { + return 0; + } + + WsfBufIoCb.tx.pBuf = (uint8_t *)pBuf; + WsfBufIoCb.tx.size = size; + + cfg.baud = 115200; + cfg.hwFlow = FALSE; + cfg.rdCback = wsfBufIoUartRxHandler; + cfg.wrCback = wsfBufIoUartTxHandler; + + PalUartInit(PAL_UART_ID_TERMINAL, &cfg); + + /* Start UART RX. */ + PalUartReadData(PAL_UART_ID_TERMINAL, WsfBufIoCb.rx.buf, 1); + + WsfBufIoCb.initialized = TRUE; + return WsfBufIoCb.tx.size; +} + +/*************************************************************************************************/ +/*! + * \brief Register the UART RX callback. + * + * \param Callback function for UART RX. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfBufIoUartRegister(WsfBufIoUartRxCback_t rxCback) +{ + if (rxCback != NULL) + { + WsfBufIoCb.rx.cback = rxCback; + } +} + +/*************************************************************************************************/ +/*! + * \brief Transmit buffer on UART. + * + * \param pBuf Buffer to transmit. + * \param len Length of buffer in octets. + * + * \return if write successfully. + */ +/*************************************************************************************************/ +bool_t WsfBufIoWrite(const uint8_t *pBuf, uint32_t len) +{ + uint16_t end; + uint32_t retValue = TRUE; + + WSF_CS_INIT(cs); + + WSF_CS_ENTER(cs); + + /* Check if there is enough space in TX buffer */ + if ((WsfBufIoCb.tx.size - wsfBufIoUartTxBufCount() >= (uint16_t)len) && + (WsfBufIoCb.tx.size > WsfBufIoCb.tx.crt)) + { + /* Compute the space available till the end of the buffer. */ + end = WsfBufIoCb.tx.size - WsfBufIoCb.tx.in; + + /* Check if overrun should happen. */ + if (end < len) + { + /* Copy the bytes till the end of the buffer. */ + memcpy(WsfBufIoCb.tx.pBuf + WsfBufIoCb.tx.in, pBuf, end); + /* Copy the remaining bytes. */ + memcpy(WsfBufIoCb.tx.pBuf, pBuf + end, len - end); + /* Increment input count */ + WsfBufIoCb.tx.in = len - end; + } + else + { + /* Enough space till the end of the buffer. Just copy. */ + memcpy(WsfBufIoCb.tx.pBuf + WsfBufIoCb.tx.in, pBuf, len); + WsfBufIoCb.tx.in += len; + } + + if (WsfBufIoCb.tx.in == WsfBufIoCb.tx.size) + { + WsfBufIoCb.tx.in = 0; + } + + /* Check if UART TX is idle. */ + if (PalUartGetState(PAL_UART_ID_TERMINAL) == PAL_UART_STATE_READY) + { + /* Start TX */ + wsfBufIoUartTxStart(len); + } + } + else + { + retValue = FALSE; + } + + WSF_CS_EXIT(cs); + + return retValue; +} diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_detoken.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_detoken.c new file mode 100644 index 0000000000000000000000000000000000000000..8df3be01654a1db52ebd4575802f033b65ada68e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_detoken.c @@ -0,0 +1,260 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Token trace decode. + */ +/*************************************************************************************************/ + +#ifdef WSF_DETOKEN_TRACE + +#include <string.h> +#include "wsf_types.h" +#include "wsf_trace.h" +#include "util/bstream.h" +#include "wsf_types.h" +#include "wsf_detoken.h" +#include "wsf_assert.h" +#include "hci_defs.h" +#include "hci_api.h" + +#if WSF_DETOKEN_TRACE == WSF_DETOKEN_TRACE_NORDIC +#include "../../controller/ble5-ctr/gcc/bin/ble5-ctr_tokens.h" +#endif /* WSF_DETOKEN_TRACE */ + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Maximum size of a single trace log message. */ +#define WSF_TOKEN_BUFFER_SIZE 128 + +/************************************************************************************************** + Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize detoken trace. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfDetokenInit(void) +{ + /* Take no action - place holder should future platform require initialization */ +} + +/*************************************************************************************************/ +/*! + * \brief Enable/disable detoken trace. + * + * \param enable TRUE to enable, FALSE to disable. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfDetokenEnable(bool_t enable) +{ + uint8_t pEvtMask[] = {0, 0, 0, 0, 0, 0, 0, 0}; + + if (enable) + { + pEvtMask[0] = WSF_DETOKEN_ENABLE_BIT; + } + + HciVendorSpecificCmd(WSF_DETOKEN_VS_SET_EVENT_MASK_OPCODE, sizeof(pEvtMask), pEvtMask); +} + +/*************************************************************************************************/ +/*! + * \brief Find token by id via binary search + * + * \param token Token identifier. + * + * \return None. + */ +/*************************************************************************************************/ +static const tokenElem_t *wsfDetokenFindToken(uint32_t token) +{ + uint16_t numTokens = sizeof (tokenLookupTbl) / sizeof(tokenElem_t); + uint16_t top = 0; + uint16_t bottom = numTokens - 1; + uint16_t midPoint = (top + bottom) / 2; + + if ((token < tokenLookupTbl[0].token) || (token > tokenLookupTbl[numTokens-1].token)) + { + return NULL; + } + + while (top <= bottom) + { + if (tokenLookupTbl[midPoint].token < token) + { + top = midPoint + 1; + } + else if (tokenLookupTbl[midPoint].token == token) + { + return &tokenLookupTbl[midPoint]; + } + else + { + bottom = midPoint - 1; + } + + midPoint = (top + bottom) / 2; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Find token string by id via binary search + * + * \param token Token identifier. + * + * \return None. + */ +/*************************************************************************************************/ +static const char *wsfDetokenFindTokenString(uint32_t token) +{ + uint16_t numTokens = sizeof (tokenLookupTbl) / sizeof(tokenElem_t); + uint16_t top = 0; + uint16_t bottom = numTokens - 1; + uint16_t midPoint = (top + bottom) / 2; + + while (top <= bottom) + { + if (tokenStrTbl[midPoint].strId < token) + { + top = midPoint + 1; + } + else if (tokenStrTbl[midPoint].strId == token) + { + return tokenStrTbl[midPoint].pText; + } + else + { + bottom = midPoint - 1; + } + + midPoint = (top + bottom) / 2; + } + + return NULL; +} + +/*************************************************************************************************/ +/*! + * \brief Decode and display HCI Token Trace events + * + * \param pBuffer Buffer containing HCI event. + * + * \return None. + */ +/*************************************************************************************************/ +static void wsfDetokenDecodeHciTokenTrace(uint8_t *pBuffer) +{ + uint32_t tokenId; + uint32_t var; + const tokenElem_t *pToken; + char lineBuf[WSF_TOKEN_BUFFER_SIZE + 1]; + + BYTES_TO_UINT32(tokenId, (pBuffer + 2)); + BYTES_TO_UINT32(var, (pBuffer + 6)); + + tokenId = tokenId & 0x0FFFFFFF; + + pToken = wsfDetokenFindToken(tokenId); + + if (pToken != NULL) + { + uint8_t numParams = pToken->paramInfo & 0xf; + uint8_t paramMask = pToken->paramInfo >> 4; + + strncpy(lineBuf, pToken->pMsg, WSF_TOKEN_BUFFER_SIZE); + + switch (numParams) + { + case 0: + LL_TRACE_INFO0(lineBuf); + break; + + case 1: + if (paramMask == WSF_DETOKEN_PARAM_VARIABLE) + { + LL_TRACE_INFO1(lineBuf, var); + } + else + { + LL_TRACE_INFO1(lineBuf, wsfDetokenFindTokenString(var)); + } + break; + + case 2: + if (paramMask == WSF_DETOKEN_PARAM_VARIABLE) + { + LL_TRACE_INFO2(lineBuf, var & 0xfff, var >> 16); + } + else if (paramMask == WSF_DETOKEN_PARAM_STRING) + { + LL_TRACE_INFO2(lineBuf, var & 0xfff, wsfDetokenFindTokenString(var >> 16)); + } + else + { + LL_TRACE_INFO2(lineBuf, wsfDetokenFindTokenString(var & 0xfff), var >> 16); + } + break; + + case 3: + LL_TRACE_INFO3(lineBuf, var & 0xff, (var >> 8) & 0xff, (var >> 16) & 0xffff); + break; + } + } + else + { + LL_TRACE_INFO0("UNKNOWN TOKEN TRACE\n"); + } +} + +/*************************************************************************************************/ +/*! + * \brief Process vendor specific HCI events and decode token trace events from the LL + * + * \param len Length of pBuffer in bytes. + * \param pBuffer Buffer containing HCI event. + * + * \return TRUE if VS HCI message is a token, else FALSE. + */ +/*************************************************************************************************/ +bool_t WsfDetokenProcessHciEvent(uint16_t len, uint8_t *pBuffer) +{ + uint16_t vsEvent; + + BYTES_TO_UINT16(vsEvent, pBuffer); + + if (vsEvent == WSF_DETOKEN_VS_EVT_TOKEN) + { + wsfDetokenDecodeHciTokenTrace(pBuffer); + return TRUE; + } + + return FALSE; +} + +#endif /* WSF_DETOKEN_TRACE */ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_efs.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_efs.c similarity index 92% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_efs.c rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_efs.c index 3386b62dd71c6daaac5ff46fce083966b75c648e..8f35aa440c293a9950b6ebb1af8119cae9df5349 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_efs.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_efs.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_efs.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Embedded File System service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2014-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Embedded File System service. */ /*************************************************************************************************/ @@ -33,8 +36,6 @@ static wsfEfsControl_t wsfEfsFileTbl[WSF_EFS_MAX_FILES]; /*************************************************************************************************/ /*! - * \fn wsfEfsMediaValid - * * \brief Checks if the given physical media identifier has been registered with the file system. * * \param media The physical media identifier @@ -54,8 +55,6 @@ static bool_t wsfEfsMediaValid(uint8_t media) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileByHandle - * * \brief Returns the file control block for the given handle. * * \param handle Handle of the file @@ -76,8 +75,6 @@ wsfEfsControl_t *WsfEfsGetFileByHandle(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn wsfEfsFileOverlap - * * \brief Checks if the given offset and size overlaps with a given file. * * \param handle The handle of the file to check against @@ -117,8 +114,6 @@ static bool_t wsfEfsFileOverlap(wsfEfsHandle_t handle, uint8_t media, uint32_t a /*************************************************************************************************/ /*! - * \fn wsfEfsFindAvailableOffset - * * \brief Finds the offset of an unused area of the physical media big enough for a file * of the given size. * @@ -158,8 +153,6 @@ static uint32_t wsfEfsFindAvailableOffset(uint8_t media, uint32_t size) /*************************************************************************************************/ /*! - * \fn WsfEfsInit - * * \brief Initialize the embedded file system. * * \return none. @@ -181,8 +174,6 @@ void WsfEfsInit(void) /*************************************************************************************************/ /*! - * \fn WsfEfsAddFile - * * \brief Create a file in the embedded file system. * * \param maxSize Number of bytes to reserve for the file. @@ -266,8 +257,6 @@ wsfEfsHandle_t WsfEfsAddFile(uint32_t maxSize, uint8_t media, wsfEsfAttributes_t /*************************************************************************************************/ /*! - * \fn WsfEfsRemoveFile - * * \brief Deletes a file in the embedded file system. * * \param handle Handle identifying the file. @@ -288,8 +277,6 @@ uint8_t WsfEfsRemoveFile(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsErase - * * \brief Clears the contents of a file without deleting the file. * * \param handle Handle identifying the file. @@ -324,8 +311,6 @@ uint8_t WsfEfsErase(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetAttributes - * * \brief Gets the attributes of a file. * * \param handle Handle identifying the file. @@ -349,8 +334,6 @@ uint8_t WsfEfsGetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pAttr) /*************************************************************************************************/ /*! - * \fn WsfEfsSetAttributes - * * \brief Updates the attributes of a file. * * \param handle Handle identifying the file. @@ -374,8 +357,6 @@ uint8_t WsfEfsSetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pAttr) /*************************************************************************************************/ /*! - * \fn WsfEfsGet - * * \brief Copies data from a file. * * \param handle Handle identifying the file. @@ -425,8 +406,6 @@ uint16_t WsfEfsGet(wsfEfsHandle_t handle, uint32_t offset, uint8_t *pBuffer, uin /*************************************************************************************************/ /*! - * \fn WsfEfsPut - * * \brief Writes data to a file. * * \param handle Handle identifying the file. @@ -482,8 +461,6 @@ uint16_t WsfEfsPut(wsfEfsHandle_t handle, uint32_t offset, const uint8_t *pBuffe /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileName - * * \brief Get the name of a file. * * \param handle File Handle. @@ -505,8 +482,6 @@ char *WsfEfsGetFileName(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileVersion - * * \brief Get the version of a file. * * \param handle File Handle. @@ -528,8 +503,6 @@ char *WsfEfsGetFileVersion(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileMaxSize - * * \brief Get the number of bytes of memory reserved for use by a file. * * \param handle File Handle. @@ -551,8 +524,6 @@ uint32_t WsfEfsGetFileMaxSize(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileSize - * * \brief Get the size of a file. * * \param handle File Handle. @@ -574,8 +545,6 @@ uint32_t WsfEfsGetFileSize(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFileType - * * \brief Get the type of a file. * * \param handle File Handle. @@ -597,8 +566,6 @@ uint8_t WsfEfsGetFileType(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsGetFilePermissions - * * \brief Get the permissions of a file. * * \param handle File Handle. @@ -620,8 +587,6 @@ uint16_t WsfEfsGetFilePermissions(wsfEfsHandle_t handle) /*************************************************************************************************/ /*! - * \fn WsfEfsMediaSpecificCommand - * * \brief Execute a media specific command on a file. * * \param handle File Handle. @@ -649,8 +614,6 @@ uint8_t WsfEfsMediaSpecificCommand(wsfEfsHandle_t handle, uint8_t cmd, uint32_t /*************************************************************************************************/ /*! - * \fn WsfEfsRegisterMedia - * * \brief Registers a File Storage Medium with the Embedded File System. * * \param pMedia Pointer to the media control structure. diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_heap.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_heap.c new file mode 100644 index 0000000000000000000000000000000000000000..d94acdddee0e01cd266d417f0548823593bd5c53 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_heap.c @@ -0,0 +1,94 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Heap service. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_buf.h" +#include "wsf_assert.h" +#include "wsf_math.h" +#include "wsf_os.h" +#include "wsf_trace.h" +#include "wsf_cs.h" +#include "stack/platform/include/pal_sys.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +extern uint8_t *SystemHeapStart; +extern uint32_t SystemHeapSize; +extern unsigned long __heap_end__; +extern unsigned long __heap_start__; + +/*************************************************************************************************/ +/*! + * \brief Reserve heap memory. + * + * \param size Number of bytes of heap memory used. + * + * \return None + */ +/*************************************************************************************************/ +void WsfHeapAlloc(uint32_t size) +{ + /* Round up to nearest multiple of 4 for word alignment */ + size = (size + 3); + size = size & 0xFFFFFFFC; + + SystemHeapStart += size; + SystemHeapSize -= size; +} + +/*************************************************************************************************/ +/*! + * \brief Get next available heap memory. + * + * \return Address of the start of heap memory. + */ +/*************************************************************************************************/ +void *WsfHeapGetFreeStartAddress(void) +{ + return (void *)SystemHeapStart; +} + +/*************************************************************************************************/ +/*! + * \brief Get heap available. + * + * \return Number of bytes of heap memory available. + */ +/*************************************************************************************************/ +uint32_t WsfHeapCountAvailable(void) +{ + return SystemHeapSize; +} + +/*************************************************************************************************/ +/*! + * \brief Get heap used. + * + * \return Number of bytes of heap memory used. + */ +/*************************************************************************************************/ +uint32_t WsfHeapCountUsed(void) +{ + return 0; +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_msg.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_msg.c similarity index 84% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_msg.c rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_msg.c index ac0441bcf123a160396f4f234a8ad9a0f7301d5b..4c1dbc0024239485d37352e685a6ae3ae60ea93d 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_msg.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_msg.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_msg.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Message passing service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Message passing service. */ /*************************************************************************************************/ @@ -38,8 +41,6 @@ typedef struct wsfMsg_tag /*************************************************************************************************/ /*! - * \fn WsfMsgDataAlloc - * * \brief Allocate a data message buffer to be sent with WsfMsgSend(). * * \param len Message length in bytes. @@ -55,8 +56,6 @@ void *WsfMsgDataAlloc(uint16_t len, uint8_t tailroom) /*************************************************************************************************/ /*! - * \fn WsfMsgAlloc - * * \brief Allocate a message buffer to be sent with WsfMsgSend(). * * \param len Message length in bytes. @@ -81,8 +80,6 @@ void *WsfMsgAlloc(uint16_t len) /*************************************************************************************************/ /*! - * \fn WsfMsgFree - * * \brief Free a message buffer allocated with WsfMsgAlloc(). * * \param pMsg Pointer to message buffer. @@ -97,8 +94,6 @@ void WsfMsgFree(void *pMsg) /*************************************************************************************************/ /*! - * \fn WsfMsgSend - * * \brief Send a message to an event handler. * * \param handlerId Event handler ID. @@ -120,8 +115,6 @@ void WsfMsgSend(wsfHandlerId_t handlerId, void *pMsg) /*************************************************************************************************/ /*! - * \fn WsfMsgEnq - * * \brief Enqueue a message. * * \param pQueue Pointer to queue. @@ -148,8 +141,6 @@ void WsfMsgEnq(wsfQueue_t *pQueue, wsfHandlerId_t handlerId, void *pMsg) /*************************************************************************************************/ /*! - * \fn WsfMsgDeq - * * \brief Dequeue a message. * * \param pQueue Pointer to queue. @@ -175,8 +166,6 @@ void *WsfMsgDeq(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId) /*************************************************************************************************/ /*! - * \fn WsfMsgPeek - * * \brief Get the next message without removing it from the queue. * * \param pQueue Pointer to queue. diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_nvm.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_nvm.c new file mode 100644 index 0000000000000000000000000000000000000000..66734d6b0cb452e6ee422e80cc7f65407d5958c7 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_nvm.c @@ -0,0 +1,305 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief NVM service. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_assert.h" +#include "wsf_nvm.h" +#include "stack/platform/include/pal_nvm.h" +#include "util/crc32.h" + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! NVM data start address. */ +#define WSF_NVM_START_ADDR 0x0000 + +/*! Reserved filecode. */ +#define WSF_NVM_RESERVED_FILECODE ((uint32_t)0) + +/* Unused (erased) filecode. */ +/* TODO: May depend on flash type */ +#define WSF_NVM_UNUSED_FILECODE ((uint32_t)0xFFFFFFFF) + +/*! Align value to word boundary. */ +#define WSF_NVM_WORD_ALIGN(x) (((x) + (PAL_NVM_WORD_SIZE - 1)) & \ + ~(PAL_NVM_WORD_SIZE - 1)) + +#define WSF_NVM_CRC_INIT_VALUE 0xFEDCBA98 + +/************************************************************************************************** + Data Types +**************************************************************************************************/ + +/*! \brief Header. */ +typedef struct +{ + uint32_t id; /*!< Stored data ID. */ + uint32_t len; /*!< Stored data length. */ + uint32_t headerCrc; /*!< CRC of this header. */ + uint32_t dataCrc; /*!< CRC of subsequent data. */ +} WsfNvmHeader_t; + +/************************************************************************************************** + Global Functions +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Initialize the WSF NVM. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfNvmInit(void) +{ + PalNvmInit(NULL); +} + +/*************************************************************************************************/ +/*! + * \brief Read data. + * + * \param id Stored data ID. + * \param pData Buffer to read to. + * \param len Data length to read. + * \param compCback Read callback. + * + * \return if Read NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmReadData(uint32_t id, uint8_t *pData, uint16_t len, WsfNvmCompEvent_t compCback) +{ + WsfNvmHeader_t header; + uint32_t headerCrc, dataCrc; + uint32_t storageAddr = WSF_NVM_START_ADDR; + bool_t findId = FALSE; + + WSF_ASSERT(!((id == WSF_NVM_RESERVED_FILECODE) || (id == WSF_NVM_UNUSED_FILECODE))); + + /* Read first header. */ + PalNvmRead(&header, sizeof(header), storageAddr); + + do + { + if (header.id == WSF_NVM_UNUSED_FILECODE) + { + /* Found unused entry at end of used storage. */ + break; + } + + /* Iterate through stored data headers, looking for existing matching stored data header. */ + if (header.id != WSF_NVM_RESERVED_FILECODE) + { + /* Calculate CRC of header itself. */ + headerCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, sizeof(header.id) + sizeof(header.len), + (uint8_t *)&header); + + if (headerCrc != header.headerCrc) + { + /* Corrupt header. */ + /* TODO: Catastrophic failure? */ + break; + } + else if ((header.id == id) && (header.len == len)) + { + /* Valid header and matching ID - read data after header. */ + storageAddr += sizeof(header); + PalNvmRead(pData, header.len, storageAddr); + dataCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, header.len, pData); + if (dataCrc == header.dataCrc) + { + findId = TRUE; + } + break; + } + } + + /* Move to next stored data block and read header. */ + storageAddr += WSF_NVM_WORD_ALIGN(header.len) + sizeof(header); + PalNvmRead(&header, sizeof(header), storageAddr); + } while(1); + + if (compCback) + { + compCback(findId); + } + return findId; +} + +/*************************************************************************************************/ +/*! + * \brief Write data. + * + * \param id Stored data ID. + * \param pData Buffer to write. + * \param len Data length to write. + * \param compCback Write callback. + * + * \return if write NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmWriteData(uint32_t id, const uint8_t *pData, uint16_t len, WsfNvmCompEvent_t compCback) +{ + WsfNvmHeader_t header; + uint32_t headerCrc; + uint32_t storageAddr = WSF_NVM_START_ADDR; + + WSF_ASSERT(!((id == WSF_NVM_RESERVED_FILECODE) || (id == WSF_NVM_UNUSED_FILECODE))); + + /* Read first header. */ + PalNvmRead(&header, sizeof(header), storageAddr); + + do + { + if (header.id == WSF_NVM_UNUSED_FILECODE) + { + /* Found unused entry at end of used storage. */ + break; + } + + /* Iterate through stored data headers, looking for existing matching stored data header. */ + if (header.id != WSF_NVM_RESERVED_FILECODE) + { + /* Calculate CRC of header itself. */ + headerCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, sizeof(header.id) + sizeof(header.len), + (uint8_t *)&header); + + if (headerCrc != header.headerCrc) + { + /* Corrupt header. */ + /* TODO: Catastrophic failure? */ + break; + } + else if (header.id == id) + { + /* Valid header and matching ID - scratch header out. */ + header.id = WSF_NVM_RESERVED_FILECODE; + header.headerCrc = 0; + header.dataCrc = 0; + PalNvmWrite(&header, sizeof(header), storageAddr); + } + } + + /* Move to next stored data block and read header. */ + storageAddr += WSF_NVM_WORD_ALIGN(header.len) + sizeof(header); + PalNvmRead(&header, sizeof(header), storageAddr); + } while(1); + + /* After cycling through all headers, create a new stored data header and store data */ + header.id = id; + header.len = len; + header.headerCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, sizeof(header.id) + sizeof(header.len), + (uint8_t *)&header); + header.dataCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, len, pData); + PalNvmWrite(&header, sizeof(header), storageAddr); + PalNvmWrite((void *)pData, len, storageAddr + sizeof(header)); + if (compCback) + { + compCback(TRUE); + } + return TRUE; +} + +/*************************************************************************************************/ +/*! + * \brief Erase data. + * + * \param id Erase ID. + * \param compCback Write callback. + * + * \return if erase NVM successfully. + */ +/*************************************************************************************************/ +bool_t WsfNvmEraseData(uint32_t id, WsfNvmCompEvent_t compCback) +{ + WsfNvmHeader_t header; + uint32_t headerCrc; + uint32_t storageAddr = WSF_NVM_START_ADDR; + bool_t erased = FALSE; + + WSF_ASSERT(!((id == WSF_NVM_RESERVED_FILECODE) || (id == WSF_NVM_UNUSED_FILECODE))); + + /* Read first header. */ + PalNvmRead(&header, sizeof(header), storageAddr); + + do + { + if (header.id == WSF_NVM_UNUSED_FILECODE) + { + /* Found unused entry at end of used storage. */ + break; + } + + /* Iterate through stored data headers, looking for existing matching stored data header. */ + if (header.id != WSF_NVM_RESERVED_FILECODE) + { + headerCrc = CalcCrc32(WSF_NVM_CRC_INIT_VALUE, sizeof(header.id) + sizeof(header.len), + (uint8_t *)&header); + + if (headerCrc != header.headerCrc) + { + /* Corrupt header. */ + /* TODO: Catastrophic failure? */ + break; + } + else if (header.id == id) + { + header.id = WSF_NVM_RESERVED_FILECODE; + header.headerCrc = 0; + header.dataCrc = 0; + PalNvmWrite(&header, sizeof(header), storageAddr); + erased = TRUE; + } + } + + /* Move to next stored data block and read header. */ + storageAddr += WSF_NVM_WORD_ALIGN(header.len) + sizeof(header); + PalNvmRead(&header, sizeof(header), storageAddr); + } while(1); + + if (compCback) + { + compCback(erased); + } + return erased; +} + +/*************************************************************************************************/ +/*! + * \brief Erase sectors. + * + * \param numOfSectors Number of sectors to be erased. + * \param compCback Erase callback. + * + * \return if erase NVM successfully. + */ +/*************************************************************************************************/ +void WsfNvmEraseSector(uint32_t numOfSectors, WsfNvmCompEvent_t compCback) +{ + PalNvmEraseSector(numOfSectors * PAL_NVM_SECTOR_SIZE, WSF_NVM_START_ADDR); + + if (compCback) + { + compCback(TRUE); + } +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os_int.h b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_os_int.h similarity index 67% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os_int.h rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_os_int.h index 2d9cd88368f0bfa622c1fe2959c69e030e5e8d4d..bd77942525b5c18edd338616abe12b904a594a4d 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_os_int.h +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_os_int.h @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_os_int.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Software foundation OS platform-specific interface file. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Software foundation OS platform-specific interface file. */ /*************************************************************************************************/ #ifndef WSF_OS_INT_H @@ -60,12 +63,8 @@ typedef uint8_t wsfTaskEvent_t; /*************************************************************************************************/ /*! - * \fn wsfOsReadyToSleep - * * \brief Check if WSF is ready to sleep. * - * \param None. - * * \return Return TRUE if there are no pending WSF task events set, FALSE otherwise. */ /*************************************************************************************************/ @@ -73,28 +72,13 @@ bool_t wsfOsReadyToSleep(void); /*************************************************************************************************/ /*! - * \fn wsfOsDispatcher - * * \brief Event dispatched. Designed to be called repeatedly from infinite loop. * - * \param None. - * * \return None. */ /*************************************************************************************************/ void wsfOsDispatcher(void); -/*************************************************************************************************/ -/*! - * \fn WsfOsShutdown - * - * \brief Shutdown OS. - * - * \return None. - */ -/*************************************************************************************************/ -void WsfOsShutdown(void); - #ifdef __cplusplus }; #endif diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_queue.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_queue.c similarity index 87% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_queue.c rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_queue.c index 1b4279f98a0f5527ea7e1c32eae6559e518825f5..49ff22747cdb64092b3b0a08cc92bde7e19d0951 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_queue.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_queue.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_queue.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief General purpose queue service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief General purpose queue service. */ /*************************************************************************************************/ @@ -41,8 +44,6 @@ typedef struct wsfQueueElem_tag /*************************************************************************************************/ /*! - * \fn WsfQueueEnq - * * \brief Enqueue and element to the tail of a queue. * * \param pQueue Pointer to queue. @@ -83,8 +84,6 @@ void WsfQueueEnq(wsfQueue_t *pQueue, void *pElem) /*************************************************************************************************/ /*! - * \fn WsfQueueDeq - * * \brief Dequeue and element from the head of a queue. * * \param pQueue Pointer to queue. @@ -126,8 +125,6 @@ void *WsfQueueDeq(wsfQueue_t *pQueue) /*************************************************************************************************/ /*! - * \fn WsfQueuePush - * * \brief Push and element to the head of a queue. * * \param pQueue Pointer to queue. @@ -164,8 +161,6 @@ void WsfQueuePush(wsfQueue_t *pQueue, void *pElem) /*************************************************************************************************/ /*! - * \fn WsfQueueInsert - * * \brief Insert an element into a queue. This function is typically used when iterating * over a queue. * @@ -211,8 +206,6 @@ void WsfQueueInsert(wsfQueue_t *pQueue, void *pElem, void *pPrev) /*************************************************************************************************/ /*! - * \fn WsfQueueRemove - * * \brief Remove an element from a queue. This function is typically used when iterating * over a queue. * @@ -259,8 +252,6 @@ void WsfQueueRemove(wsfQueue_t *pQueue, void *pElem, void *pPrev) /*************************************************************************************************/ /*! - * \fn WsfQueueCount - * * \brief Count the number of elements in a queue. * * \param pQueue Pointer to queue. @@ -297,8 +288,6 @@ uint16_t WsfQueueCount(wsfQueue_t *pQueue) /*************************************************************************************************/ /*! - * \fn WsfQueueEmpty - * * \brief Return TRUE if queue is empty. * * \param pQueue Pointer to queue. @@ -324,3 +313,17 @@ bool_t WsfQueueEmpty(wsfQueue_t *pQueue) return empty; } + +/*************************************************************************************************/ +/*! + * \brief Check for a queue depth of 1 element. + * + * \param pQueue Queue. + * + * \return TRUE if Queue only has 1 element, FALSE otherwise. + */ +/*************************************************************************************************/ +bool_t WsfIsQueueDepthOne(wsfQueue_t *pQueue) +{ + return pQueue->pHead == pQueue->pTail; +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_timer.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_timer.c similarity index 50% rename from lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_timer.c rename to lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_timer.c index fd4b84b6e45eb486a0a0da22a15713463f95a4cf..3ed48a4360efaee01858a83c15e31c64b8afd888 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_timer.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_timer.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wsf_timer.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Timer service. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Timer service. */ /*************************************************************************************************/ @@ -21,18 +24,67 @@ #include "wsf_queue.h" #include "wsf_timer.h" #include "wsf_assert.h" +#include "wsf_cs.h" #include "wsf_trace.h" +#include "stack/platform/include/pal_rtc.h" +#include "stack/platform/include/pal_led.h" +#include "stack/platform/include/pal_sys.h" /************************************************************************************************** Macros **************************************************************************************************/ +#if (WSF_MS_PER_TICK == 10) +/* convert seconds to timer ticks */ +#define WSF_TIMER_SEC_TO_TICKS(sec) (100 * (sec) + 1) + +/* convert milliseconds to timer ticks */ +/* Extra tick should be added to guarantee waiting time is longer than the specified ms. */ +#define WSF_TIMER_MS_TO_TICKS(ms) (((uint32_t)(((uint64_t)(ms) * (uint64_t)(419431)) >> 22)) + 1) + +/*! \brief WSF timer ticks per second. */ +#define WSF_TIMER_TICKS_PER_SEC (1000 / WSF_MS_PER_TICK) + +#elif (WSF_MS_PER_TICK == 1) /* convert seconds to timer ticks */ -#define WSF_TIMER_SEC_TO_TICKS(sec) ((1000 / WSF_MS_PER_TICK) * (sec) + 1) +#define WSF_TIMER_SEC_TO_TICKS(sec) (1000 * (sec) + 1) /* convert milliseconds to timer ticks */ /* Extra tick should be added to guarantee waiting time is longer than the specified ms. */ -#define WSF_TIMER_MS_TO_TICKS(ms) (((ms) / WSF_MS_PER_TICK) + 1) +#define WSF_TIMER_MS_TO_TICKS(ms) ((uint64_t)ms + 1) + +#define WSF_TIMER_TICKS_PER_SEC (1000) + +#else +#error "WSF_TIMER_MS_TO_TICKS() and WSF_TIMER_SEC_TO_TICKS not defined for WSF_MS_PER_TICK" +#endif + +/*! \brief Number of RTC ticks per WSF timer tick. */ +#define WSF_TIMER_RTC_TICKS_PER_WSF_TICK ((PAL_RTC_TICKS_PER_SEC + WSF_TIMER_TICKS_PER_SEC - 1) / (WSF_TIMER_TICKS_PER_SEC)) + +/*! \brief Calculate number of elapsed WSF timer ticks. */ +#define WSF_RTC_TICKS_TO_WSF(x) ((x) / WSF_TIMER_RTC_TICKS_PER_WSF_TICK) + +/*! \brief Mask of seconds part in RTC ticks. */ +#define WSF_TIMER_RTC_TICKS_SEC_MASK (0x00FF8000) + +/*! \brief Addition of RTC ticks. */ +#define WSF_TIMER_RTC_ADD_TICKS(x, y) (((x) + (y)) & PAL_MAX_RTC_COUNTER_VAL) + +/*! \brief Subtraction of RTC ticks. */ +#define WSF_TIMER_RTC_SUB_TICKS(x, y) ((PAL_MAX_RTC_COUNTER_VAL + 1 + (x) - (y)) & PAL_MAX_RTC_COUNTER_VAL) + +/*! \brief Minimum RTC ticks required to go into sleep. */ +#define WSF_TIMER_MIN_RTC_TICKS_FOR_SLEEP (2) + +/*! + * \brief Computing the difference between two RTC counter values. + * + * Calculate elapsed ticks since last WSF timer update, with remainder; + * since the RTC timer is 24 bit set the 24th bit to handle any underflow. + */ +#define WSF_TIMER_RTC_ELAPSED_TICKS(x) ((PAL_MAX_RTC_COUNTER_VAL + 1 + x - wsfTimerRtcLastTicks \ + + wsfTimerRtcRemainder) & PAL_MAX_RTC_COUNTER_VAL) /************************************************************************************************** Global Variables @@ -40,6 +92,12 @@ wsfQueue_t wsfTimerTimerQueue; /*!< Timer queue */ +/*! \brief Last RTC value read. */ +static uint32_t wsfTimerRtcLastTicks = 0; + +/*! \brief Remainder value. */ +static uint32_t wsfTimerRtcRemainder = 0; + /*************************************************************************************************/ /*! * \brief Remove a timer from queue. Note this function does not lock task scheduling. @@ -123,6 +181,20 @@ static void wsfTimerInsert(wsfTimer_t *pTimer, wsfTimerTicks_t ticks) WsfTaskUnlock(); } +/*************************************************************************************************/ +/*! + * \brief Convert WSF ticks into RTC ticks. + * + * \return Number of RTC ticks + */ +/*************************************************************************************************/ +static uint32_t wsfTimerTicksToRtc(wsfTimerTicks_t wsfTicks) +{ + uint32_t numSec = wsfTicks / WSF_TIMER_TICKS_PER_SEC; + uint32_t remainder = wsfTicks - numSec * WSF_TIMER_TICKS_PER_SEC; + + return ((numSec * PAL_RTC_TICKS_PER_SEC) + (remainder * WSF_TIMER_RTC_TICKS_PER_WSF_TICK)); +} /*************************************************************************************************/ /*! @@ -135,6 +207,9 @@ static void wsfTimerInsert(wsfTimer_t *pTimer, wsfTimerTicks_t ticks) void WsfTimerInit(void) { WSF_QUEUE_INIT(&wsfTimerTimerQueue); + + wsfTimerRtcLastTicks = 0; + wsfTimerRtcRemainder = 0; } /*************************************************************************************************/ @@ -285,6 +360,9 @@ wsfTimer_t *WsfTimerServiceExpired(wsfTaskId_t taskId) wsfTimer_t *pElem; wsfTimer_t *pPrev = NULL; + /* Unused parameters */ + (void)taskId; + /* task schedule lock */ WsfTaskLock(); @@ -311,3 +389,132 @@ wsfTimer_t *WsfTimerServiceExpired(wsfTaskId_t taskId) return NULL; } + +/*************************************************************************************************/ +/*! + * \brief Function for checking if there is an active timer and if there is enough time to + * go to sleep and going to sleep. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTimerSleep(void) +{ + wsfTimerTicks_t nextExpiration; + bool_t timerRunning; + + /* If PAL system is busy, no need to sleep. */ + if (PalSysIsBusy()) + { + return; + } + + nextExpiration = WsfTimerNextExpiration(&timerRunning); + + if (timerRunning && (nextExpiration > 0)) + { + uint32_t awake = wsfTimerTicksToRtc(nextExpiration); + uint32_t rtcCurrentTicks = PalRtcCounterGet(); + uint32_t elapsed = WSF_TIMER_RTC_ELAPSED_TICKS(rtcCurrentTicks); + + /* if we have time to sleep before timer expiration */ + if ((awake - elapsed) > WSF_TIMER_MIN_RTC_TICKS_FOR_SLEEP) + { + uint32_t compareVal = (rtcCurrentTicks + awake - elapsed) & PAL_MAX_RTC_COUNTER_VAL; + + /* set RTC timer compare */ + PalRtcCompareSet(compareVal); + + /* enable RTC interrupt */ + PalRtcEnableCompareIrq(); + + /* one final check for OS activity then enter sleep */ + WSF_CS_ENTER(cs); + if (wsfOsReadyToSleep() && (PalRtcCounterGet() != PalRtcCompareGet())) + { + PalLedOff(PAL_LED_ID_CPU_ACTIVE); + PalSysSleep(); + PalLedOn(PAL_LED_ID_CPU_ACTIVE); + } + WSF_CS_EXIT(cs); + } + else + { + /* Not enough time to go to sleep. Let the system run till the pending timer expires. */ + LL_TRACE_WARN0("WsfTimerSleep, not enough time to sleep"); + } + } + else + { + /* disable RTC interrupt */ + PalRtcDisableCompareIrq(); + + /* one final check for OS activity then enter sleep */ + WSF_CS_ENTER(cs); + if (wsfOsReadyToSleep()) + { + PalLedOff(PAL_LED_ID_CPU_ACTIVE); + PalSysSleep(); + PalLedOn(PAL_LED_ID_CPU_ACTIVE); + } + WSF_CS_EXIT(cs); + } +} + + +/*************************************************************************************************/ +/*! + * \brief Function for updating WSF timer based on elapsed RTC ticks. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTimerSleepUpdate(void) +{ + uint32_t elapsed; + wsfTimerTicks_t wsfElapsed = 0; + uint32_t secBoundary, prevBoundary; + + /* Get current RTC tick count. */ + uint32_t rtcCurrentTicks = PalRtcCounterGet(); + + if (rtcCurrentTicks != wsfTimerRtcLastTicks) + { + /* Check if RTC ticks go beyond seconds boundary. */ + if ((rtcCurrentTicks & WSF_TIMER_RTC_TICKS_SEC_MASK) != (wsfTimerRtcLastTicks & WSF_TIMER_RTC_TICKS_SEC_MASK)) + { + /* Calculate current and previous second boundary */ + secBoundary = WSF_TIMER_RTC_ADD_TICKS((wsfTimerRtcLastTicks & WSF_TIMER_RTC_TICKS_SEC_MASK), PAL_RTC_TICKS_PER_SEC); + prevBoundary = WSF_TIMER_RTC_SUB_TICKS(secBoundary, PAL_RTC_TICKS_PER_SEC); + + /* Check how many wsf ticks were already counted in this second. */ + /* Claim all uncounted wsf ticks within the second. */ + wsfElapsed += (WSF_TIMER_TICKS_PER_SEC - WSF_RTC_TICKS_TO_WSF(WSF_TIMER_RTC_SUB_TICKS(wsfTimerRtcLastTicks, prevBoundary))); + + while (WSF_TIMER_RTC_SUB_TICKS(rtcCurrentTicks, secBoundary) >= PAL_RTC_TICKS_PER_SEC) + { + wsfElapsed += WSF_TIMER_TICKS_PER_SEC; + secBoundary = WSF_TIMER_RTC_ADD_TICKS(secBoundary, PAL_RTC_TICKS_PER_SEC); + } + + wsfTimerRtcRemainder = 0; + wsfTimerRtcLastTicks = secBoundary; + } + + /* Elapsed must be less than PAL_RTC_TICKS_PER_SEC at this point. */ + elapsed = WSF_TIMER_RTC_ELAPSED_TICKS(rtcCurrentTicks); + + /* Rough conversion from RTC ticks to WFS ticks. It will be synchronized at the end of each second boundary. */ + wsfElapsed += (wsfTimerTicks_t) WSF_RTC_TICKS_TO_WSF(elapsed); + + if (wsfElapsed) + { + /* update last ticks and remainder */ + wsfTimerRtcLastTicks = rtcCurrentTicks; + wsfTimerRtcRemainder = elapsed - (WSF_RTC_TICKS_TO_WSF(elapsed) * WSF_TIMER_RTC_TICKS_PER_WSF_TICK); + + /* update wsf timers */ + WsfTimerUpdate(wsfElapsed); + } + } +} diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_trace.c b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_trace.c new file mode 100644 index 0000000000000000000000000000000000000000..2e99669773c09280584cd208869e59dac1cd14e8 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/port/baremetal/wsf_trace.c @@ -0,0 +1,276 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Trace message implementation. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "wsf_trace.h" +#include "wsf_bufio.h" +#include "wsf_assert.h" +#include "wsf_buf.h" +#include "wsf_cs.h" +#include "util/print.h" +#include "stack/platform/include/pal_sys.h" +#include <stdarg.h> + +/************************************************************************************************** + Macros +**************************************************************************************************/ + +/*! \brief Length of newline and carriage return suffix. */ +#define WSF_TRACE_SUFFIX_LEN 2 + +#ifndef WSF_PRINTF_MAX_LEN +/*! \brief Maximum length of a trace string. */ +#define WSF_PRINTF_MAX_LEN 128 +#endif + +#ifndef WSF_TOKEN_RING_BUF_SIZE +/*! \brief Size of token ring buffer (multiple of 2^N). */ +#define WSF_TOKEN_RING_BUF_SIZE 32 +#endif + +/*! \brief Ring buffer flow control condition detected. */ +#define WSF_TOKEN_FLAG_FLOW_CTRL (1 << 28) + +/*! UART TX buffer size. */ +#ifndef WSF_TRACE_BUFIO_BUFFER_SIZE +#define WSF_TRACE_BUFIO_BUFFER_SIZE 2048U +#endif + +/************************************************************************************************** + Data types +**************************************************************************************************/ + +/*! \brief Trace control block. */ +struct +{ + WsfTraceHandler_t sendMsgCback; /*!< Send trace message callback. */ + uint32_t numDropMsg; /*!< Number of dropped messages since last successful. */ + bool_t enabled; /*!< Tracing state. */ + +#if WSF_TOKEN_ENABLED == TRUE + union + { + struct + { + uint32_t token; /*!< Token. */ + uint32_t param; /*!< Parameter. */ + } v; /*!< Value accessor. */ + /* Use native packing for speed. Host will resolve endian. */ + uint8_t buf[8]; /*!< Buffer accessor. */ + } ringBuf[WSF_TOKEN_RING_BUF_SIZE]; /*!< Token message ring buffer. */ + uint32_t prodIdx; /*!< Ring buffer producer index. */ + uint32_t consIdx; /*!< Ring buffer consumer index. */ +#endif +} wsfTraceCb; + +#if WSF_TOKEN_ENABLED == TRUE +/*************************************************************************************************/ +/*! + * \brief Store tokenized message. + * + * \param tok Message token. + * \param param Message parameter. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfToken(uint32_t tok, uint32_t param) +{ + static uint32_t flags = 0; + + if (!wsfTraceCb.enabled) + { + return; + } + + WSF_CS_INIT(cs); + WSF_CS_ENTER(cs); + + uint32_t prodIdx = (wsfTraceCb.prodIdx + 1) & (WSF_TOKEN_RING_BUF_SIZE - 1); + + if (prodIdx != wsfTraceCb.consIdx) + { + wsfTraceCb.ringBuf[wsfTraceCb.prodIdx].v.token = tok | flags; + wsfTraceCb.ringBuf[wsfTraceCb.prodIdx].v.param = param; + wsfTraceCb.prodIdx = prodIdx; + flags = 0; + } + else + { + flags = WSF_TOKEN_FLAG_FLOW_CTRL; + } + + WSF_CS_EXIT(cs); +} + +/*************************************************************************************************/ +/*! + * \brief Service the trace ring buffer. + * + * \return TRUE if trace messages pending, FALSE otherwise. + * + * This routine is called in the main loop for a "push" type trace systems. + */ +/*************************************************************************************************/ +bool_t WsfTokenService(void) +{ + WSF_ASSERT(wsfTraceCb.sendMsgCback); + + if (wsfTraceCb.consIdx != wsfTraceCb.prodIdx) + { + /* Advance consumer counter only if write successful. */ + if (wsfTraceCb.sendMsgCback((uint8_t *)&wsfTraceCb.ringBuf[wsfTraceCb.consIdx], sizeof(wsfTraceCb.ringBuf[0]))) + { + wsfTraceCb.consIdx = (wsfTraceCb.consIdx + 1) & (WSF_TOKEN_RING_BUF_SIZE - 1); + } + return TRUE; + } + + return FALSE; +} +#endif + +#if WSF_TRACE_ENABLED == TRUE +/*************************************************************************************************/ +/*! + * \brief Create overflow message. + * + * \param pBuf Buffer to store output in. + * \param pStr Format string. + * Addition parameters variable arguments to the format string. + * + * \return Length in bytes of overflow message. + */ +/*************************************************************************************************/ +uint8_t wsfTraceOverFlowMessage(char *pBuf, const char *pStr, ...) +{ + uint8_t len; + va_list args; + + va_start(args, pStr); + + len = PrintVsn(pBuf, WSF_PRINTF_MAX_LEN, pStr, args); + + va_end(args); + + return len; +} + +/*************************************************************************************************/ +/*! + * \brief Output trace message. + * + * \param pStr Format string + * Addition parameters variable arguments to the format string. + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTrace(const char *pStr, ...) +{ + if (!wsfTraceCb.enabled) + { + /* Discard message when disabled. */ + return; + } + + if (wsfTraceCb.sendMsgCback != NULL) + { + uint32_t len; + va_list args; + /* Use heap memory to ease stack utilization. */ + static char buf[WSF_PRINTF_MAX_LEN]; + + va_start(args, pStr); + + /* Dropped message notification. */ + if (wsfTraceCb.numDropMsg) + { + static char dropMsg[] = ">>> Trace buffer overflowed; %u message(s) lost <<<\r\n"; + + len = wsfTraceOverFlowMessage(buf, dropMsg, wsfTraceCb.numDropMsg); + + if (wsfTraceCb.sendMsgCback((uint8_t *)buf, len) == FALSE) + { + wsfTraceCb.numDropMsg++; + + /* Trace I/O flow control continues. */ + return; + } + + wsfTraceCb.numDropMsg = 0; + } + + /* Format message. */ + len = PrintVsn(buf, WSF_PRINTF_MAX_LEN - WSF_TRACE_SUFFIX_LEN, pStr, args); + buf[len++] = '\r'; + buf[len++] = '\n'; + + /* Deliver message. */ + if (wsfTraceCb.sendMsgCback((uint8_t *)buf, (uint8_t)len) == FALSE) + { + /* Trace I/O flow controlled; drop message. */ + wsfTraceCb.numDropMsg = 1; + } + } +} +#endif + +/*************************************************************************************************/ +/*! + * \brief Enable trace messages. + * + * \param enable TRUE to enable, FALSE to disable + * + * \return None. + */ +/*************************************************************************************************/ +void WsfTraceEnable(bool_t enable) +{ + WSF_ASSERT(wsfTraceCb.sendMsgCback); + wsfTraceCb.enabled = enable; + +/* + * TOKEN | TRACE | Action + * 0 | 0 | No tracing of any kind + * 0 | 1 | Tracing through buffered UART + * 1 | 0 | Tokenized tracing through CHCI + * 1 | 1 | Tokenized tracing through buffered UART + */ +} + +/*************************************************************************************************/ +/*! + * \brief Register trace handler. + * + * \param traceCback Token event handler. + * + * \return None. + * + * This routine registers trace output handler. This callback is called when the trace data is + * ready for writing. + */ +/*************************************************************************************************/ +void WsfTraceRegisterHandler(WsfTraceHandler_t traceCback) +{ + wsfTraceCb.sendMsgCback = traceCback; +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bda.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/bda.c similarity index 77% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bda.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/bda.c index 7e3ccf1cd6753aa80b1b451d9bac9831a6238791..53b204bf9468e30e6135e2836cefca068f2a7f51 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bda.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/bda.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file bda.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Bluetooth device address utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Bluetooth device address utilities. */ /*************************************************************************************************/ @@ -23,8 +26,6 @@ /*************************************************************************************************/ /*! - * \fn BdaCpy - * * \brief Copy a BD address from source to destination. * * \param pDst Pointer to destination. @@ -40,8 +41,6 @@ void BdaCpy(uint8_t *pDst, const uint8_t *pSrc) /*************************************************************************************************/ /*! - * \fn BdaCmp - * * \brief Compare two BD addresses. * * \param pAddr1 First address. @@ -57,8 +56,6 @@ bool_t BdaCmp(const uint8_t *pAddr1, const uint8_t *pAddr2) /*************************************************************************************************/ /*! - * \fn BdaClr - * * \brief Set a BD address to all zeros. * * \param pDst Pointer to destination. @@ -75,8 +72,6 @@ uint8_t *BdaClr(uint8_t *pDst) /*************************************************************************************************/ /*! -* \fn BdaIsZeros -* * \brief Check if a BD address is all zeros. * * \param pAddr Pointer to address. @@ -93,8 +88,6 @@ bool_t BdaIsZeros(const uint8_t *pAddr) /*************************************************************************************************/ /*! - * \fn Bda2Str - * * \brief Convert a BD address to a string. * * \param pAddr Pointer to BD address. diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bstream.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/bstream.c similarity index 78% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bstream.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/bstream.c index 5408f771cf425fdd7948e60f6b263411f9c017e9..2d1bc5cd25f831d489e4b513d7b0e223c65f0601 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/bstream.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/bstream.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file bstream.h +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Byte stream to integer conversion functions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Byte stream to integer conversion functions. */ /*************************************************************************************************/ diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/calc128.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/calc128.c similarity index 74% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/calc128.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/calc128.c index d4a8233ad559966f6321c466b12387d5b0c1bd85..1b7d95c375e91075b745f10c6f77765bfac9fd71 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/calc128.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/calc128.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file calc128.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief 128-bit integer utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief 128-bit integer utilities. */ /*************************************************************************************************/ @@ -34,8 +37,6 @@ const uint8_t calc128Zeros[CALC128_LEN] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /*************************************************************************************************/ /*! - * \fn Calc128Cpy - * * \brief Copy a 128-bit integer from source to destination. * * \param pDst Pointer to destination. @@ -51,8 +52,6 @@ void Calc128Cpy(uint8_t *pDst, uint8_t *pSrc) /*************************************************************************************************/ /*! - * \fn Calc128Cpy64 - * * \brief Copy a 64-bit integer from source to destination. * * \param pDst Pointer to destination. @@ -68,8 +67,6 @@ void Calc128Cpy64(uint8_t *pDst, uint8_t *pSrc) /*************************************************************************************************/ /*! - * \fn Calc128Xor - * * \brief Exclusive-or two 128-bit integers and return the result in pDst. * * \param pDst Pointer to destination. diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/crc32.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/crc32.c similarity index 88% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/crc32.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/crc32.c index 10ccea40f43e8965b92858365b47c10be0ee80f5..954245995d5f0616ab0ed8669f0c1886e5b799cd 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/crc32.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/crc32.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file crc32.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief CRC-32 utilities. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2010-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief CRC-32 utilities. */ /*************************************************************************************************/ @@ -110,8 +113,6 @@ static const uint32_t crc32Table[256] = /*************************************************************************************************/ /*! - * \fn CalcCrc32 - * * \brief Calculate the CRC-32 of the given buffer. * * \param crcInit Initial value of the CRC. diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/util/fcs.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/fcs.c new file mode 100644 index 0000000000000000000000000000000000000000..027504472026fb8530daffe5231a9e6d2210e871 --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/fcs.c @@ -0,0 +1,117 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief FCS utilities (3GPP TS 27.010). + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "util/fcs.h" + +/************************************************************************************************** + Macros + **************************************************************************************************/ + +#ifndef WSF_FCS_SIZE_OPTIMIZE +/*! \brief Compile time flag for CRC code size optimization method. */ +#define WSF_FCS_SIZE_OPTIMIZE FALSE +#endif + +/************************************************************************************************** + Local Variables + **************************************************************************************************/ + +#if WSF_FCS_SIZE_OPTIMIZE == FALSE +static const uint8_t crcTable[256] = { + 0x00, 0x91, 0xE3, 0x72, 0x07, 0x96, 0xE4, 0x75, 0x0E, 0x9F, 0xED, 0x7C, 0x09, 0x98, 0xEA, 0x7B, + 0x1C, 0x8D, 0xFF, 0x6E, 0x1B, 0x8A, 0xF8, 0x69, 0x12, 0x83, 0xF1, 0x60, 0x15, 0x84, 0xF6, 0x67, + 0x38, 0xA9, 0xDB, 0x4A, 0x3F, 0xAE, 0xDC, 0x4D, 0x36, 0xA7, 0xD5, 0x44, 0x31, 0xA0, 0xD2, 0x43, + 0x24, 0xB5, 0xC7, 0x56, 0x23, 0xB2, 0xC0, 0x51, 0x2A, 0xBB, 0xC9, 0x58, 0x2D, 0xBC, 0xCE, 0x5F, + 0x70, 0xE1, 0x93, 0x02, 0x77, 0xE6, 0x94, 0x05, 0x7E, 0xEF, 0x9D, 0x0C, 0x79, 0xE8, 0x9A, 0x0B, + 0x6C, 0xFD, 0x8F, 0x1E, 0x6B, 0xFA, 0x88, 0x19, 0x62, 0xF3, 0x81, 0x10, 0x65, 0xF4, 0x86, 0x17, + 0x48, 0xD9, 0xAB, 0x3A, 0x4F, 0xDE, 0xAC, 0x3D, 0x46, 0xD7, 0xA5, 0x34, 0x41, 0xD0, 0xA2, 0x33, + 0x54, 0xC5, 0xB7, 0x26, 0x53, 0xC2, 0xB0, 0x21, 0x5A, 0xCB, 0xB9, 0x28, 0x5D, 0xCC, 0xBE, 0x2F, + 0xE0, 0x71, 0x03, 0x92, 0xE7, 0x76, 0x04, 0x95, 0xEE, 0x7F, 0x0D, 0x9C, 0xE9, 0x78, 0x0A, 0x9B, + 0xFC, 0x6D, 0x1F, 0x8E, 0xFB, 0x6A, 0x18, 0x89, 0xF2, 0x63, 0x11, 0x80, 0xF5, 0x64, 0x16, 0x87, + 0xD8, 0x49, 0x3B, 0xAA, 0xDF, 0x4E, 0x3C, 0xAD, 0xD6, 0x47, 0x35, 0xA4, 0xD1, 0x40, 0x32, 0xA3, + 0xC4, 0x55, 0x27, 0xB6, 0xC3, 0x52, 0x20, 0xB1, 0xCA, 0x5B, 0x29, 0xB8, 0xCD, 0x5C, 0x2E, 0xBF, + 0x90, 0x01, 0x73, 0xE2, 0x97, 0x06, 0x74, 0xE5, 0x9E, 0x0F, 0x7D, 0xEC, 0x99, 0x08, 0x7A, 0xEB, + 0x8C, 0x1D, 0x6F, 0xFE, 0x8B, 0x1A, 0x68, 0xF9, 0x82, 0x13, 0x61, 0xF0, 0x85, 0x14, 0x66, 0xF7, + 0xA8, 0x39, 0x4B, 0xDA, 0xAF, 0x3E, 0x4C, 0xDD, 0xA6, 0x37, 0x45, 0xD4, 0xA1, 0x30, 0x42, 0xD3, + 0xB4, 0x25, 0x57, 0xC6, 0xB3, 0x22, 0x50, 0xC1, 0xBA, 0x2B, 0x59, 0xC8, 0xBD, 0x2C, 0x5E, 0xCF +}; +#endif + +/*************************************************************************************************/ +/*! + * \fn FcsCalc + * + * \brief Calculate the FCS of the given buffer. + * + * \param len Length of the buffer. + * \param pBuf Buffer to compute the CRC. + * + * \return FCS value. + */ +/*************************************************************************************************/ +uint8_t FcsCalc(uint32_t len, const uint8_t *pBuf) +{ +#if WSF_FCS_SIZE_OPTIMIZE == FALSE + + uint8_t fcs = 0xFF; + + while (len > 0) + { + fcs = crcTable[*pBuf ^ fcs]; + pBuf++; + len--; + } + + fcs = 0xFF - fcs; + + return fcs; + +#else + + +#endif +} + +/*************************************************************************************************/ +/*! + * \fn FcsAddByte + * + * \brief Computes resultant CRC by appending one byte. + * + * \param pFcs CRC value on which to append the byte. + * \param pBuf Byte to be added to CRC computation. + * + * \return FCS value. + */ +/*************************************************************************************************/ +void FcsAddByte(uint8_t *pFcs, uint8_t byte) +{ +#if WSF_FCS_SIZE_OPTIMIZE == FALSE + *pFcs = crcTable[*pFcs ^ byte]; + + *pFcs &= 0xFF; +#else + + +#endif +} diff --git a/lib/sdk/Libraries/BTLE/wsf/sources/util/prand.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/prand.c new file mode 100644 index 0000000000000000000000000000000000000000..02aa3f2020676d847d538a2ff9e446c1f119d95e --- /dev/null +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/prand.c @@ -0,0 +1,113 @@ +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Pseudo-random number generator interface. + */ +/*************************************************************************************************/ + +#include "wsf_types.h" +#include "util/bstream.h" + +#include "util/prand.h" + +/************************************************************************************************** + Global Variables +**************************************************************************************************/ + +/*! \brief Random number generator control block. */ +static struct +{ + uint32_t rngW; + uint32_t rngX; + uint32_t rngY; + uint32_t rngZ; +} prandCb; + +/*************************************************************************************************/ +/*! + * \brief Initialize random number generator. + * + * \return None. + */ +/*************************************************************************************************/ +void PrandInit(void) +{ + /* Seed PRNG. */ + prandCb.rngW = 88675123; + prandCb.rngX = 123456789; + prandCb.rngY = 362436069; + prandCb.rngZ = 521288629; +} + +/*************************************************************************************************/ +/*! + * \brief Generate random number. + * + * \return 32-bit random number. + * + * This software implementation uses a xorshift random number generator. + * George Marsaglia (2003), "Xorshift RNGs", Journal of Statistical Software + * + * \note This routine is not a cryptographic grade random number generator. + */ +/*************************************************************************************************/ +static uint32_t prandNum(void) +{ + uint32_t t; + + t = prandCb.rngX ^ (prandCb.rngX << 11); + prandCb.rngX = prandCb.rngY; + prandCb.rngY = prandCb.rngZ; + prandCb.rngZ = prandCb.rngW; + prandCb.rngW = prandCb.rngW ^ (prandCb.rngW >> 19) ^ (t ^ (t >> 8)); + return prandCb.rngW; +} + +/*************************************************************************************************/ +/*! + * \brief Generate random data. + * + * \param pBuf Buffer. + * \param len Length of buffer in bytes. + * + * \return None. + */ +/*************************************************************************************************/ +void PrandGen(uint8_t *pBuf, uint16_t len) +{ + while (len > 0) + { + uint32_t randNum; + + randNum = prandNum(); + if (len >= 4) + { + UINT32_TO_BSTREAM(pBuf, randNum); + len -= 4; + } + else + { + while (len > 0) + { + UINT8_TO_BSTREAM(pBuf, randNum); + len -= 1; + randNum >>= 8; + } + } + } +} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/print.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/print.c similarity index 89% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/print.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/print.c index e81f602485c755b8e136167af0016fe02343bff0..391bb038096ad5c2307289ffad00009ff4b3ed9e 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/print.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/print.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file print.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Utility functions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Utility functions. */ /*************************************************************************************************/ @@ -36,8 +39,6 @@ /*************************************************************************************************/ /*! - * \fn printFmtInt - * * \brief Format an integer. * * \param pStr Storage for formatted integer. @@ -100,8 +101,6 @@ almost: /*************************************************************************************************/ /*! - * \fn printParseInt - * * \brief Parse an integer from a string. * * \param pStr String to parse. @@ -176,8 +175,6 @@ static int32_t printParseInt(const char *pStr, uint32_t *pInt, uint32_t base) /*************************************************************************************************/ /*! - * \fn PrintVsn - * * \brief Print a trace message. * * \param pStr Storage for formatted string. diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/terminal.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/terminal.c similarity index 91% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/terminal.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/terminal.c index 32c1fb92e8589647efec60c8c35021739689701f..0a9bebe3fc68c496c89ef21359cc13c34fc2dd35 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/terminal.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/terminal.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file terminal.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief Terminal handler. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief Terminal handler. */ /*************************************************************************************************/ @@ -83,8 +86,6 @@ static terminalCommand_t terminalCommandEcho = { NULL, "echo", "echo <on|off>", /*************************************************************************************************/ /*! - * \fn TerminalInit - * * \brief Initialize terminal. * * \param handlerId Handler ID for TerminalHandler(). @@ -108,8 +109,6 @@ void TerminalInit(wsfHandlerId_t handlerId) /*************************************************************************************************/ /*! - * \fn TerminalRegisterUartTxFunc - * * \brief Register the UART Tx Function for the platform. * * \return None. @@ -122,8 +121,6 @@ void TerminalRegisterUartTxFunc(terminalUartTx_t uartTxFunc) /*************************************************************************************************/ /*! - * \fn TerminalRegisterCommand - * * \brief Register command with terminal. * * \param pCommand Command. @@ -154,8 +151,6 @@ void TerminalRegisterCommand(terminalCommand_t *pCommand) /*************************************************************************************************/ /*! - * \fn terminalExecute - * * \brief Execute a received command. * * \param pBuf Command string. @@ -298,8 +293,6 @@ static void terminalExecute(char *pBuf) /*************************************************************************************************/ /*! - * \fn TerminalHandler - * * \brief Handler for terminal messages. * * \param event WSF event mask. @@ -310,6 +303,9 @@ static void terminalExecute(char *pBuf) /*************************************************************************************************/ void TerminalHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) { + /* Unused parameters */ + (void)pMsg; + if ((event & TERMINAL_EVENT_COMMAND_RX) != 0) { terminalExecute(terminalCb.buf); @@ -321,8 +317,6 @@ void TerminalHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) /*************************************************************************************************/ /*! - * \fn TerminalRx - * * \brief Called by application when a data byte is received. * * \param dataByte Received byte. @@ -345,7 +339,7 @@ void TerminalRx(uint8_t dataByte) } /* Check for delete. */ - else if (dataByte == 0x7F) + else if ((dataByte == 0x7F) || (dataByte == '\b')) { if (terminalCb.bufOffset > 0) { @@ -376,8 +370,6 @@ void TerminalRx(uint8_t dataByte) /*************************************************************************************************/ /*! - * \fn TerminalTxStr - * * \brief Called by application to transmit string. * * \param pStr String. @@ -387,13 +379,11 @@ void TerminalRx(uint8_t dataByte) /*************************************************************************************************/ void TerminalTxStr(const char *pStr) { - TerminalTx((const uint8_t *)pStr, strlen(pStr)); + TerminalTx((const uint8_t *)pStr, (uint16_t)strlen(pStr)); } /*************************************************************************************************/ /*! - * \fn TerminalTxChar - * * \brief Called by application to transmit character. * * \param c Character. @@ -408,8 +398,6 @@ void TerminalTxChar(char c) /*************************************************************************************************/ /*! - * \fn TerminalTxPrint - * * \brief Called by application to print formatted data. * * \param pStr Message format string @@ -428,13 +416,11 @@ void TerminalTxPrint(const char *pStr, ...) len = PrintVsn(buf, TERMINAL_PRINTF_MAX_LEN, pStr, args); va_end(args); - TerminalTx((uint8_t *)buf, len); + TerminalTx((uint8_t *)buf, (uint16_t)len); } /*************************************************************************************************/ /*! - * \fn terminalCommandHelpHandler - * * \brief Handler for a terminal command. * * \param argc The number of arguments passed to the command. @@ -447,6 +433,9 @@ static uint8_t terminalCommandHelpHandler(uint32_t argc, char **argv) { terminalCommand_t *pCommand = terminalCb.pFirstCommand; + /* Unused parameters */ + (void)argv; + if (argc > 1) { return TERMINAL_ERROR_TOO_MANY_ARGUMENTS; @@ -467,8 +456,6 @@ static uint8_t terminalCommandHelpHandler(uint32_t argc, char **argv) /*************************************************************************************************/ /*! - * \fn TerminalTx - * * \brief Transmit buffer on platform UART. * * \param pBuf Buffer to transmit. @@ -479,15 +466,14 @@ static uint8_t terminalCommandHelpHandler(uint32_t argc, char **argv) /*************************************************************************************************/ void TerminalTx(const uint8_t *pData, uint16_t len) { - WSF_ASSERT(terminalCb.terminalTx); - - (*terminalCb.terminalTx)(pData, len); + if (terminalCb.terminalTx) + { + (*terminalCb.terminalTx)(pData, len); + } } /*************************************************************************************************/ /*! - * \fn terminalCommandEchoHandler - * * \brief Handler for a terminal command. * * \param argc The number of arguments passed to the command. diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/wstr.c b/lib/sdk/Libraries/BTLE/wsf/sources/util/wstr.c similarity index 52% rename from lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/wstr.c rename to lib/sdk/Libraries/BTLE/wsf/sources/util/wstr.c index 9c19630c30060705cf135b633493d93f24360287..f6406a46239091f020281dade60b7aa19a89817f 100644 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/sources/util/wstr.c +++ b/lib/sdk/Libraries/BTLE/wsf/sources/util/wstr.c @@ -1,19 +1,22 @@ -/*************************************************************************************************/ -/*! - * \file wstr.c +/* Copyright (c) 2009-2019 Arm Limited + * SPDX-License-Identifier: Apache-2.0 * - * \brief String manipulation functions. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c) 2014-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. + * http://www.apache.org/licenses/LICENSE-2.0 * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************************************/ +/*! + * \brief String manipulation functions. */ /*************************************************************************************************/ @@ -23,8 +26,6 @@ /*************************************************************************************************/ /*! - * \fn WstrnCpy - * * \brief Copy a string and zero out space after the string length. * * \return none. @@ -49,8 +50,6 @@ void WstrnCpy(char *pBuf, const char *pData, uint8_t n) /*************************************************************************************************/ /*! - * \fn WStrReverseCpy - * * \brief Byte by byte reverse and copy a buffer. * * \param pBuf1 Buffer to hold reversed copy. @@ -72,8 +71,6 @@ void WStrReverseCpy(uint8_t *pBuf1, const uint8_t *pBuf2, uint16_t len) /*************************************************************************************************/ /*! - * \fn WStrReverse - * * \brief Byte by byte reverse a buffer. * * \param pBuf Buffer to reverse. @@ -117,3 +114,82 @@ void WStrFormatHex(char *pBuf, uint32_t val, uint8_t len) val >>= 4; } } + +/*************************************************************************************************/ +/*! + * \fn WStrHexToArray + * + * \brief Convert a hex string to int array, zero out space after the string length. + * + * \param pStr Pointer to the string to convert. + * \param pBuf Pointer to destination buffer. + * \param len Size of pBuf in bytes. + * + * \return none. + */ +/*************************************************************************************************/ +void WStrHexToArray(const char *pStr, uint8_t *pBuf, uint16_t len) +{ + uint16_t i; + uint8_t val = 0; + uint8_t j = 0; + bool_t zeroing = FALSE; + + /* Skip white spaces. */ + while (*pStr == ' ' || *pStr == '\t' || *pStr == '\n' || *pStr == '\r') + { + ++pStr; + } + + /* Check for hex value format (0x or 0X). */ + if (WSTR_IS_HEX_FORMAT(pStr)) + { + pStr += 2; + } + + for (i = 0; i < len; i++) + { + if (!zeroing && *pStr == '\0') + { + zeroing = TRUE; + } + + if (zeroing) + { + *pBuf++ = 0; + } + else + { + while (j < 2) + { + if ((*pStr >= '0') && (*pStr <= '9')) + { + val = (val << (j << 2)) | (*pStr - '0'); + } + else if ((*pStr >= 'a') && (*pStr <= 'f')) + { + val = (val << (j << 2)) | (10 + (*pStr - 'a')); + } + else if ((*pStr >= 'A') && (*pStr <= 'F')) + { + val = (val << (j << 2)) | (10 + (*pStr - 'A')); + } + else + { + break; + } + + pStr++; + + /* Check if value is computed and needs to be added to destination buffer. */ + if (j++ == 1) + { + *pBuf++ = val; + } + } + + j = 0; + val = 0; + } + } +} diff --git a/lib/sdk/Libraries/Boards/Include/pb.h b/lib/sdk/Libraries/Boards/Include/pb.h index 5d369129bdb08cca72a4f0a41ad5163c6e27f8aa..9b911526a58678bc51389afd426b781499fac0e6 100644 --- a/lib/sdk/Libraries/Boards/Include/pb.h +++ b/lib/sdk/Libraries/Boards/Include/pb.h @@ -94,6 +94,22 @@ typedef void (*pb_callback)(void *pb); */ int PB_RegisterCallback(unsigned int pb, pb_callback callback); +/** + * @brief Register or Unregister a callback handler for rising and falling events on the @p pb push button. + * @details + * - Calling this function with a pointer to a function @p callback, configures the pushbutton @p pb and enables the + * interrupt to handle the push button events. + * - Calling this function with a <tt>NULL</tt> pointer will disable the interrupt and unregister the + * callback function. + * @p pb must be a value between 0 and \c num_pbs. + * + * @param pb push button index to receive event callbacks. + * @param callback Callback function pointer of type @c pb_callback + * @return #E_NO_ERROR if configured and callback registered successfully. + * @return "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful. + */ +int PB_RegisterRiseFallCallback(unsigned int pb, pb_callback callback); + /** * @brief Enable a callback interrupt. * @note PB_RegisterCallback must be called prior to enabling the callback interrupt. diff --git a/lib/sdk/Libraries/Boards/Source/pb.c b/lib/sdk/Libraries/Boards/Source/pb.c index 84e028c0f45b4e0a20d047cea8ebb408510217be..2761f5ca5b81738f6d928df7938ccfd1481dae6b 100644 --- a/lib/sdk/Libraries/Boards/Source/pb.c +++ b/lib/sdk/Libraries/Boards/Source/pb.c @@ -79,6 +79,28 @@ int PB_RegisterCallback(unsigned int pb, pb_callback callback) return E_NO_ERROR; } +/******************************************************************************/ +int PB_RegisterRiseFallCallback(unsigned int pb, pb_callback callback) +{ + MXC_ASSERT(pb < num_pbs); + + if (callback) { + // Register callback + GPIO_RegisterCallback(&pb_pin[pb], callback, (void*)pb); + + // Configure and enable interrupt + GPIO_IntConfig(&pb_pin[pb], GPIO_INT_EDGE, GPIO_INT_BOTH); + GPIO_IntEnable(&pb_pin[pb]); + NVIC_EnableIRQ((IRQn_Type)MXC_GPIO_GET_IRQ(pb_pin[pb].port)); + } else { + // Disable interrupt and clear callback + GPIO_IntDisable(&pb_pin[pb]); + GPIO_RegisterCallback(&pb_pin[pb], NULL, NULL); + } + + return E_NO_ERROR; +} + //****************************************************************************** void GPIO0_IRQHandler(void) { diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/adc_regs.h b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/adc_regs.h index d89794ebfc6cd96a488e4c997e64cfff4bee8602..99b3fec5c10ea5b22967d0cf1c5e76efece886f3 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/adc_regs.h +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/adc_regs.h @@ -122,8 +122,8 @@ typedef struct { #define MXC_F_ADC_CTRL_REFBUF_PWR_POS 3 /**< CTRL_REFBUF_PWR Position */ #define MXC_F_ADC_CTRL_REFBUF_PWR ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REFBUF_PWR_POS)) /**< CTRL_REFBUF_PWR Mask */ - #define MXC_F_ADC_CTRL_CHGPUMP_PWR_POS 4 /**< CTRL_CHGPUMP_PWR Position */ - #define MXC_F_ADC_CTRL_CHGPUMP_PWR ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_CHGPUMP_PWR_POS)) /**< CTRL_CHGPUMP_PWR Mask */ + #define MXC_F_ADC_CTRL_REF_SEL_POS 4 /**< CTRL_REF_SEL Position */ + #define MXC_F_ADC_CTRL_REF_SEL ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REF_SEL_POS)) /**< CTRL_REF_SEL Mask */ #define MXC_F_ADC_CTRL_REF_SCALE_POS 8 /**< CTRL_REF_SCALE Position */ #define MXC_F_ADC_CTRL_REF_SCALE ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REF_SCALE_POS)) /**< CTRL_REF_SCALE Mask */ @@ -131,9 +131,6 @@ typedef struct { #define MXC_F_ADC_CTRL_SCALE_POS 9 /**< CTRL_SCALE Position */ #define MXC_F_ADC_CTRL_SCALE ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_SCALE_POS)) /**< CTRL_SCALE Mask */ - #define MXC_F_ADC_CTRL_REF_SEL_POS 10 /**< CTRL_REF_SEL Position */ - #define MXC_F_ADC_CTRL_REF_SEL ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_REF_SEL_POS)) /**< CTRL_REF_SEL Mask */ - #define MXC_F_ADC_CTRL_CLK_EN_POS 11 /**< CTRL_CLK_EN Position */ #define MXC_F_ADC_CTRL_CLK_EN ((uint32_t)(0x1UL << MXC_F_ADC_CTRL_CLK_EN_POS)) /**< CTRL_CLK_EN Mask */ diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/gcr_regs.h b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/gcr_regs.h index 33027d66f954bbfd9029b2031d738554728f01dd..0c2d79cfe93cababc9b295912c9f271ed7e486bd 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/gcr_regs.h +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/gcr_regs.h @@ -931,8 +931,41 @@ typedef struct { * @brief ECC IRQ Enable Register * @{ */ - #define MXC_F_GCR_ECCIRQEN_ECCERAD_POS 0 /**< ECCIRQEN_ECCERAD Position */ - #define MXC_F_GCR_ECCIRQEN_ECCERAD ((uint32_t)(0x7FFFFFFFUL << MXC_F_GCR_ECCIRQEN_ECCERAD_POS)) /**< ECCIRQEN_ECCERAD Mask */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM0ECCEN_POS 0 /**< ECCIRQEN_SYSRAM0ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM0ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM0ECCEN_POS)) /**< ECCIRQEN_SYSRAM0ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM1ECCEN_POS 1 /**< ECCIRQEN_SYSRAM1ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM1ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM1ECCEN_POS)) /**< ECCIRQEN_SYSRAM1ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM2ECCEN_POS 2 /**< ECCIRQEN_SYSRAM2ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM2ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM2ECCEN_POS)) /**< ECCIRQEN_SYSRAM2ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM3ECCEN_POS 3 /**< ECCIRQEN_SYSRAM3ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM3ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM3ECCEN_POS)) /**< ECCIRQEN_SYSRAM3ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM4ECCEN_POS 4 /**< ECCIRQEN_SYSRAM4ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM4ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM4ECCEN_POS)) /**< ECCIRQEN_SYSRAM4ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM5ECCEN_POS 5 /**< ECCIRQEN_SYSRAM5ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM5ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM5ECCEN_POS)) /**< ECCIRQEN_SYSRAM5ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_SYSRAM6ECCEN_POS 6 /**< ECCIRQEN_SYSRAM6ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_SYSRAM6ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_SYSRAM6ECCEN_POS)) /**< ECCIRQEN_SYSRAM6ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_IC0ECCEN_POS 8 /**< ECCIRQEN_IC0ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_IC0ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_IC0ECCEN_POS)) /**< ECCIRQEN_IC0ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_IC1ECCEN_POS 9 /**< ECCIRQEN_IC1ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_IC1ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_IC1ECCEN_POS)) /**< ECCIRQEN_IC1ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_ICXIPECCEN_POS 10 /**< ECCIRQEN_ICXIPECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_ICXIPECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_ICXIPECCEN_POS)) /**< ECCIRQEN_ICXIPECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_FL0ECCEN_POS 11 /**< ECCIRQEN_FL0ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_FL0ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_FL0ECCEN_POS)) /**< ECCIRQEN_FL0ECCEN Mask */ + + #define MXC_F_GCR_ECCIRQEN_FL1ECCEN_POS 12 /**< ECCIRQEN_FL1ECCEN Position */ + #define MXC_F_GCR_ECCIRQEN_FL1ECCEN ((uint32_t)(0x1UL << MXC_F_GCR_ECCIRQEN_FL1ECCEN_POS)) /**< ECCIRQEN_FL1ECCEN Mask */ /**@} end of group GCR_ECCIRQEN_Register */ @@ -942,8 +975,23 @@ typedef struct { * @brief ECC Error Address Register * @{ */ - #define MXC_F_GCR_ECCERRAD_ECCERAD_POS 0 /**< ECCERRAD_ECCERAD Position */ - #define MXC_F_GCR_ECCERRAD_ECCERAD ((uint32_t)(0x7FFFFFFFUL << MXC_F_GCR_ECCERRAD_ECCERAD_POS)) /**< ECCERRAD_ECCERAD Mask */ + #define MXC_F_GCR_ECCERRAD_DATARAMADDR_POS 0 /**< ECCERRAD_DATARAMADDR Position */ + #define MXC_F_GCR_ECCERRAD_DATARAMADDR ((uint32_t)(0x1FFFUL << MXC_F_GCR_ECCERRAD_DATARAMADDR_POS)) /**< ECCERRAD_DATARAMADDR Mask */ + + #define MXC_F_GCR_ECCERRAD_DATARAMBANK_POS 14 /**< ECCERRAD_DATARAMBANK Position */ + #define MXC_F_GCR_ECCERRAD_DATARAMBANK ((uint32_t)(0x1UL << MXC_F_GCR_ECCERRAD_DATARAMBANK_POS)) /**< ECCERRAD_DATARAMBANK Mask */ + + #define MXC_F_GCR_ECCERRAD_DATARAMERR_POS 15 /**< ECCERRAD_DATARAMERR Position */ + #define MXC_F_GCR_ECCERRAD_DATARAMERR ((uint32_t)(0x1UL << MXC_F_GCR_ECCERRAD_DATARAMERR_POS)) /**< ECCERRAD_DATARAMERR Mask */ + + #define MXC_F_GCR_ECCERRAD_TAGRAMADDR_POS 16 /**< ECCERRAD_TAGRAMADDR Position */ + #define MXC_F_GCR_ECCERRAD_TAGRAMADDR ((uint32_t)(0x1FFFUL << MXC_F_GCR_ECCERRAD_TAGRAMADDR_POS)) /**< ECCERRAD_TAGRAMADDR Mask */ + + #define MXC_F_GCR_ECCERRAD_TAGRAMBANK_POS 30 /**< ECCERRAD_TAGRAMBANK Position */ + #define MXC_F_GCR_ECCERRAD_TAGRAMBANK ((uint32_t)(0x1UL << MXC_F_GCR_ECCERRAD_TAGRAMBANK_POS)) /**< ECCERRAD_TAGRAMBANK Mask */ + + #define MXC_F_GCR_ECCERRAD_TAGRAMERR_POS 31 /**< ECCERRAD_TAGRAMERR Position */ + #define MXC_F_GCR_ECCERRAD_TAGRAMERR ((uint32_t)(0x1UL << MXC_F_GCR_ECCERRAD_TAGRAMERR_POS)) /**< ECCERRAD_TAGRAMERR Mask */ /**@} end of group GCR_ECCERRAD_Register */ @@ -963,9 +1011,11 @@ typedef struct { #define MXC_F_GCR_BTLELDOCN_LDOWOVSEL ((uint32_t)(0x3UL << MXC_F_GCR_BTLELDOCN_LDOWOVSEL_POS)) /**< BTLELDOCN_LDOWOVSEL Mask */ #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_7 ((uint32_t)0x0UL) /**< BTLELDOCN_LDOWOVSEL_0_7 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWOVSEL_0_7 (MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_7 << MXC_F_GCR_BTLELDOCN_LDOWOVSEL_POS) /**< BTLELDOCN_LDOWOVSEL_0_7 Setting */ - #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_9 ((uint32_t)0x1UL) /**< BTLELDOCN_LDOWOVSEL_0_9 Value */ + #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_85 ((uint32_t)0x1UL) /**< BTLELDOCN_LDOWOVSEL_0_85 Value */ + #define MXC_S_GCR_BTLELDOCN_LDOWOVSEL_0_85 (MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_85 << MXC_F_GCR_BTLELDOCN_LDOWOVSEL_POS) /**< BTLELDOCN_LDOWOVSEL_0_85 Setting */ + #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_9 ((uint32_t)0x2UL) /**< BTLELDOCN_LDOWOVSEL_0_9 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWOVSEL_0_9 (MXC_V_GCR_BTLELDOCN_LDOWOVSEL_0_9 << MXC_F_GCR_BTLELDOCN_LDOWOVSEL_POS) /**< BTLELDOCN_LDOWOVSEL_0_9 Setting */ - #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_1_1 ((uint32_t)0x2UL) /**< BTLELDOCN_LDOWOVSEL_1_1 Value */ + #define MXC_V_GCR_BTLELDOCN_LDOWOVSEL_1_1 ((uint32_t)0x3UL) /**< BTLELDOCN_LDOWOVSEL_1_1 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWOVSEL_1_1 (MXC_V_GCR_BTLELDOCN_LDOWOVSEL_1_1 << MXC_F_GCR_BTLELDOCN_LDOWOVSEL_POS) /**< BTLELDOCN_LDOWOVSEL_1_1 Setting */ #define MXC_F_GCR_BTLELDOCN_LDOWEN_POS 4 /**< BTLELDOCN_LDOWEN Position */ @@ -978,9 +1028,11 @@ typedef struct { #define MXC_F_GCR_BTLELDOCN_LDOWVSEL ((uint32_t)(0x3UL << MXC_F_GCR_BTLELDOCN_LDOWVSEL_POS)) /**< BTLELDOCN_LDOWVSEL Mask */ #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_7 ((uint32_t)0x0UL) /**< BTLELDOCN_LDOWVSEL_0_7 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWVSEL_0_7 (MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_7 << MXC_F_GCR_BTLELDOCN_LDOWVSEL_POS) /**< BTLELDOCN_LDOWVSEL_0_7 Setting */ - #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_9 ((uint32_t)0x1UL) /**< BTLELDOCN_LDOWVSEL_0_9 Value */ + #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_85 ((uint32_t)0x1UL) /**< BTLELDOCN_LDOWVSEL_0_85 Value */ + #define MXC_S_GCR_BTLELDOCN_LDOWVSEL_0_85 (MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_85 << MXC_F_GCR_BTLELDOCN_LDOWVSEL_POS) /**< BTLELDOCN_LDOWVSEL_0_85 Setting */ + #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_9 ((uint32_t)0x2UL) /**< BTLELDOCN_LDOWVSEL_0_9 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWVSEL_0_9 (MXC_V_GCR_BTLELDOCN_LDOWVSEL_0_9 << MXC_F_GCR_BTLELDOCN_LDOWVSEL_POS) /**< BTLELDOCN_LDOWVSEL_0_9 Setting */ - #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_1_1 ((uint32_t)0x2UL) /**< BTLELDOCN_LDOWVSEL_1_1 Value */ + #define MXC_V_GCR_BTLELDOCN_LDOWVSEL_1_1 ((uint32_t)0x3UL) /**< BTLELDOCN_LDOWVSEL_1_1 Value */ #define MXC_S_GCR_BTLELDOCN_LDOWVSEL_1_1 (MXC_V_GCR_BTLELDOCN_LDOWVSEL_1_1 << MXC_F_GCR_BTLELDOCN_LDOWVSEL_POS) /**< BTLELDOCN_LDOWVSEL_1_1 Setting */ #define MXC_F_GCR_BTLELDOCN_LDOBYP_POS 8 /**< BTLELDOCN_LDOBYP Position */ diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h index 4ca88ac77a4d4898feaab469f57b03965786041d..d6ce94c482f92c64954133495c7e9c51433c7be5 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h @@ -29,8 +29,8 @@ * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. * - * $Date: 2019-03-01 20:40:05 +0000 (Fri, 01 Mar 2019) $ - * $Revision: 41358 $ + * $Date: 2019-04-26 16:05:18 -0500 (Fri, 26 Apr 2019) $ + * $Revision: 42983 $ * ******************************************************************************/ @@ -226,7 +226,7 @@ typedef enum { #define MXC_INFO_MEM_BASE MXC_INFO0_MEM_BASE #define MXC_INFO_MEM_SIZE 0x00004000UL #define MXC_SRAM_MEM_BASE 0x20000000UL -#define MXC_SRAM_MEM_SIZE 0x000A0000UL +#define MXC_SRAM_MEM_SIZE 0x0008C000UL #define MXC_XIP_DATA_MEM_BASE 0x80000000UL #define MXC_XIP_DATA_MEM_SIZE 0x20000000UL diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.svd b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.svd index ee03cb630f5d90a2008a84a4be5df43c30d9bc84..746eef1e03d817b229536231cd41097e0acb5893 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.svd +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.svd @@ -64,8 +64,8 @@ <access>read-write</access> </field> <field> - <name>chgpump_pwr</name> - <description>ADC Charge Pump Power Up</description> + <name>ref_sel</name> + <description>ADC Reference (VRef) Select (INTERNAL ONLY)</description> <bitRange>[4:4]</bitRange> <access>read-write</access> </field> @@ -81,12 +81,6 @@ <bitRange>[9:9]</bitRange> <access>read-write</access> </field> - <field> - <name>ref_sel</name> - <description>ADC Reference (VRef) Select (INTERNAL ONLY)</description> - <bitRange>[10:10]</bitRange> - <access>read-write</access> - </field> <field> <name>clk_en</name> <description>ADC Clock Enable</description> @@ -96,19 +90,111 @@ <field> <name>ch_sel</name> <description>ADC Channel Select</description> - <bitRange>[15:12]</bitRange> + <bitRange>[16:12]</bitRange> <access>read-write</access> + <enumeratedValues> + <enumeratedValue> + <name>AIN0</name> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN1</name> + <value>1</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN2</name> + <value>2</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN3</name> + <value>3</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN4</name> + <value>4</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN5</name> + <value>5</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN6</name> + <value>6</value> + </enumeratedValue> + <enumeratedValue> + <name>AIN7</name> + <value>7</value> + </enumeratedValue> + <enumeratedValue> + <name>VcoreA</name> + <value>8</value> + </enumeratedValue> + <enumeratedValue> + <name>VcoreB</name> + <value>9</value> + </enumeratedValue> + <enumeratedValue> + <name>Vrxout</name> + <value>10</value> + </enumeratedValue> + <enumeratedValue> + <name>Vtxout</name> + <value>11</value> + </enumeratedValue> + <enumeratedValue> + <name>VddA</name> + <value>12</value> + </enumeratedValue> + <enumeratedValue> + <name>VddB</name> + <description>VddB/4</description> + <value>13</value> + </enumeratedValue> + <enumeratedValue> + <name>Vddio</name> + <description>Vddio/4</description> + <value>14</value> + </enumeratedValue> + <enumeratedValue> + <name>Vddioh</name> + <description>Vddioh/4</description> + <value>15</value> + </enumeratedValue> + <enumeratedValue> + <name>VregI</name> + <description>VregI/4</description> + <value>16</value> + </enumeratedValue> + </enumeratedValues> </field> <field> - <name>adc_xref</name> - <description>Enable Use of ADC External Reference</description> - <bitRange>[16:16]</bitRange> + <name>adc_divsel</name> + <description>Scales the external inputs, all inputs are scaled the same</description> + <bitRange>[18:17]</bitRange> <access>read-write</access> + <enumeratedValues> + <enumeratedValue> + <name>DIV1</name> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>DIV2</name> + <value>1</value> + </enumeratedValue> + <enumeratedValue> + <name>DIV3</name> + <value>2</value> + </enumeratedValue> + <enumeratedValue> + <name>DIV4</name> + <value>3</value> + </enumeratedValue> + </enumeratedValues> </field> <field> <name>data_align</name> <description>ADC Data Alignment Select</description> - <bitRange>[17:17]</bitRange> + <bitRange>[20:20]</bitRange> <access>read-write</access> </field> </fields> @@ -291,7 +377,7 @@ <addressOffset>0x00</addressOffset> <fields> <field> - <name>SYSRAMECCEN</name> + <name>SYSRAM0ECCEN</name> <description>ECC System RAM Enable.</description> <bitOffset>0</bitOffset> <bitWidth>1</bitWidth> @@ -308,6 +394,96 @@ </enumeratedValue> </enumeratedValues> </field> + <field> + <name>SYSRAM1ECCEN</name> + <description>ECC System RAM Enable.</description> + <bitOffset>1</bitOffset> + <bitWidth>1</bitWidth> + <enumeratedValues> + <enumeratedValue> + <name>dis</name> + <description>disabled.</description> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>en</name> + <description>enabled.</description> + <value>1</value> + </enumeratedValue> + </enumeratedValues> + </field> + <field> + <name>SYSRAM2ECCEN</name> + <description>ECC System RAM Enable.</description> + <bitOffset>2</bitOffset> + <bitWidth>1</bitWidth> + <enumeratedValues> + <enumeratedValue> + <name>dis</name> + <description>disabled.</description> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>en</name> + <description>enabled.</description> + <value>1</value> + </enumeratedValue> + </enumeratedValues> + </field> + <field> + <name>SYSRAM3ECCEN</name> + <description>ECC System RAM Enable.</description> + <bitOffset>3</bitOffset> + <bitWidth>1</bitWidth> + <enumeratedValues> + <enumeratedValue> + <name>dis</name> + <description>disabled.</description> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>en</name> + <description>enabled.</description> + <value>1</value> + </enumeratedValue> + </enumeratedValues> + </field> + <field> + <name>SYSRAM4ECCEN</name> + <description>ECC System RAM Enable.</description> + <bitOffset>4</bitOffset> + <bitWidth>1</bitWidth> + <enumeratedValues> + <enumeratedValue> + <name>dis</name> + <description>disabled.</description> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>en</name> + <description>enabled.</description> + <value>1</value> + </enumeratedValue> + </enumeratedValues> + </field> + <field> + <name>SYSRAM5ECCEN</name> + <description>ECC System RAM Enable.</description> + <bitOffset>5</bitOffset> + <bitWidth>1</bitWidth> + <enumeratedValues> + <enumeratedValue> + <name>dis</name> + <description>disabled.</description> + <value>0</value> + </enumeratedValue> + <enumeratedValue> + <name>en</name> + <description>enabled.</description> + <value>1</value> + </enumeratedValue> + </enumeratedValues> + </field> <field> <name>IC0ECCEN</name> <description>Icache0 ECC Enable.</description> @@ -2918,7 +3094,458 @@ </cluster> </registers> </peripheral> -<!--DMA DMA Controller Fully programmable, chaining capable DMA channels.--> +<!--DMA DMA Controller Fully programmable, chaining capable DMA channels.--> + <peripheral> + <name>DVS</name> + <description>Dynamic Voltage Scaling</description> + <prependToName>DVS_</prependToName> + <baseAddress>0x40004800</baseAddress> + <addressBlock> + <offset>0x00</offset> + <size>0x0030</size> + <usage>registers</usage> + </addressBlock> + <interrupt> + <name>DVS</name> + <description>Dynamic Voltage Scaling Interrupt</description> + <value>83</value> + </interrupt> + <registers> + <register> + <name>CTL</name> + <description>Control Register</description> + <addressOffset>0x00</addressOffset> + <fields> + <field> + <name>MON_ENA</name> + <description>Enable the DVS monitoring circuit</description> + <bitOffset>0</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_ENA</name> + <description>Enable the power supply adjustment based on measurements</description> + <bitOffset>1</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PS_FB_DIS</name> + <description>Power Supply Feedback Disable</description> + <bitOffset>2</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>CTRL_TAP_ENA</name> + <description>Use the TAP Select for automatic adjustment or monitoring</description> + <bitOffset>3</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PROP_DLY</name> + <description>Additional delay to monitor lines</description> + <bitOffset>4</bitOffset> + <bitWidth>2</bitWidth> + </field> + <field> + <name>MON_ONESHOT</name> + <description>Measure delay once</description> + <bitOffset>6</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>GO_DIRECT</name> + <description>Operate in automatic mode or move directly</description> + <bitOffset>7</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>DIRECT_REG</name> + <description>Step incrementally to target voltage</description> + <bitOffset>8</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PRIME_ENA</name> + <description>Include a delay line priming signal before monitoring</description> + <bitOffset>9</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>LIMIT_IE</name> + <description>Enable Limit Error Interrupt</description> + <bitOffset>10</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>RANGE_IE</name> + <description>Enable Range Error Interrupt</description> + <bitOffset>11</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_IE</name> + <description>Enable Adjustment Error Interrupt</description> + <bitOffset>12</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>REF_SEL</name> + <description>Select TAP used for voltage adjustment</description> + <bitOffset>13</bitOffset> + <bitWidth>4</bitWidth> + </field> + <field> + <name>INC_VAL</name> + <description>Step size to increment voltage when in automatic mode</description> + <bitOffset>17</bitOffset> + <bitWidth>3</bitWidth> + </field> + <field> + <name>DVS_PS_APB_DIS</name> + <description>Prevent the application code from adjusting Vcore</description> + <bitOffset>20</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>DVS_HI_RANGE_ANY</name> + <description>Any high range signal from a delay line will cause a voltage adjustment</description> + <bitOffset>21</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FB_TO_IE</name> + <description>Enable Voltage Adjustment Timeout Interrupt</description> + <bitOffset>22</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FC_LV_IE</name> + <description>Enable Low Voltage Interrupt</description> + <bitOffset>23</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PD_ACK_ENA</name> + <description>Prevent DVS from ack'ing a request to enter a low power mode until in the idle state</description> + <bitOffset>24</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_ABORT</name> + <description>Causes the DVS to enter the idle state immediately on a request to enter a low power mode</description> + <bitOffset>25</bitOffset> + <bitWidth>1</bitWidth> + </field> + </fields> + </register> + <register> + <name>STAT</name> + <description>Status Fields</description> + <addressOffset>0x04</addressOffset> + <resetValue>0x00000000</resetValue> + <fields> + <field> + <name>DVS_STATE</name> + <description>State machine state</description> + <bitOffset>0</bitOffset> + <bitWidth>4</bitWidth> + </field> + <field> + <name>ADJ_UP_ENA</name> + <description>DVS Raising voltage</description> + <bitOffset>4</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_DWN_ENA</name> + <description>DVS Lowering voltage</description> + <bitOffset>5</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_ACTIVE</name> + <description>Adjustment to a Direct Voltage</description> + <bitOffset>6</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>CTR_TAP_OK</name> + <description>Tap Enabled and the Tap is withing Hi/Low limits</description> + <bitOffset>7</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>CTR_TAP_SEL</name> + <description>Status of selected center tap delay line detect output</description> + <bitOffset>8</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SLOW_TRIP_DET</name> + <description>Provides the current combined status of all selected Low Range delay lines</description> + <bitOffset>9</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FAST_TRIP_DET</name> + <description>Provides the current combined status of all selected High Range delay lines</description> + <bitOffset>10</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PS_IN_RANGE</name> + <description>Indicates if the power supply is in range</description> + <bitOffset>11</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>PS_VCNTR</name> + <description>Voltage Count value sent to the power supply</description> + <bitOffset>12</bitOffset> + <bitWidth>7</bitWidth> + </field> + <field> + <name>MON_DLY_OK</name> + <description>Indicates the monitor delay count is at 0</description> + <bitOffset>19</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_DLY_OK</name> + <description>Indicates the adjustment delay count is at 0</description> + <bitOffset>20</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>LO_LIMIT_DET</name> + <description>Power supply voltage counter is at low limit</description> + <bitOffset>21</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>HI_LIMIT_DET</name> + <description>Power supply voltage counter is at high limit</description> + <bitOffset>22</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>VALID_TAP</name> + <description>At least one delay line has been enabled</description> + <bitOffset>23</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>LIMIT_ERR</name> + <description>Interrupt flag that indicates a voltage count is at/beyond manufacturer limits</description> + <bitOffset>24</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>RANGE_ERR</name> + <description>Interrupt flag that indicates a tap has an invalid value</description> + <bitOffset>25</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ADJ_ERR</name> + <description>Interrupt flag that indicates up and down adjustment requested simultaneously</description> + <bitOffset>26</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>REF_SEL_ERR</name> + <description>Indicates the ref select register bit is out of range</description> + <bitOffset>27</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>REF_SEL_ERR</name> + <description>Indicates the ref select register bit is out of range</description> + <bitOffset>27</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FB_TO_ERR</name> + <description>Interrupt flag that indicates a timeout while adjusting the voltage</description> + <bitOffset>28</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FB_TO_ERR_S</name> + <description>Interrupt flag that mirror FB_TO_ERR and is write one clear</description> + <bitOffset>29</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FC_LV_DET_INT</name> + <description>Interrupt flag that indicates the power supply voltage requested is below the low threshold</description> + <bitOffset>30</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FC_LV_DET_S</name> + <description>Interrupt flag that mirrors FC_LV_DET_INT</description> + <bitOffset>31</bitOffset> + <bitWidth>1</bitWidth> + </field> + </fields> + </register> + <register> + <name>DIRECT</name> + <description>Direct control of target voltage</description> + <addressOffset>0x08</addressOffset> + <fields> + <field> + <name>VOLTAGE</name> + <description>Sets the target power supply value</description> + <bitOffset>0</bitOffset> + <bitWidth>7</bitWidth> + </field> + </fields> + </register> + <register> + <name>MON</name> + <description>Monitor Delay</description> + <addressOffset>0x00C</addressOffset> + <fields> + <field> + <name>DLY</name> + <description>Number of prescaled clocks between delay line samples</description> + <bitOffset>0</bitOffset> + <bitWidth>24</bitWidth> + </field> + <field> + <name>PRE</name> + <description>Number of clocks before DVS_MON_DLY is decremented</description> + <bitOffset>24</bitOffset> + <bitWidth>8</bitWidth> + </field> + </fields> + </register> + <register> + <name>ADJ_UP</name> + <description>Up Delay Register</description> + <addressOffset>0x010</addressOffset> + <fields> + <field> + <name>DLY</name> + <description>Number of prescaled clocks between updates of the adjustment delay counter</description> + <bitOffset>0</bitOffset> + <bitWidth>16</bitWidth> + </field> + <field> + <name>PRE</name> + <description>Number of clocks before DVS_ADJ_UP_DLY is decremented</description> + <bitOffset>16</bitOffset> + <bitWidth>8</bitWidth> + </field> + </fields> + </register> + <register> + <name>ADJ_DWN</name> + <description>Down Delay Register</description> + <addressOffset>0x014</addressOffset> + <fields> + <field> + <name>DLY</name> + <description>Number of prescaled clocks between updates of the adjustment delay counter</description> + <bitOffset>0</bitOffset> + <bitWidth>16</bitWidth> + </field> + <field> + <name>PRE</name> + <description>Number of clocks before DVS_ADJ_DWN_DLY is decremented</description> + <bitOffset>16</bitOffset> + <bitWidth>8</bitWidth> + </field> + </fields> + </register> + <register> + <name>THRES_CMP</name> + <description>Up Delay Register</description> + <addressOffset>0x018</addressOffset> + <fields> + <field> + <name>VCNTR_THRES_CNT</name> + <description>Value used to determine 'low voltage' range</description> + <bitOffset>0</bitOffset> + <bitWidth>7</bitWidth> + </field> + <field> + <name>VCNTR_THRES_MASK</name> + <description>Mask applied to threshold and vcount to determine if the device is in a low voltage range</description> + <bitOffset>8</bitOffset> + <bitWidth>7</bitWidth> + </field> + </fields> + </register> + <register> + <dim>5</dim> + <dimIncrement>5</dimIncrement> + <dimIndex>0,1,2,3,4</dimIndex> + <name>TAP_SEL</name> + <description>DVS Tap Select Register</description> + <addressOffset>0x1C</addressOffset> + <fields> + <field> + <name>LO</name> + <description>Select delay line tap for lower bound of auto adjustment</description> + <bitOffset>0</bitOffset> + <bitWidth>5</bitWidth> + </field> + <field> + <name>LO_TAP_STAT</name> + <description>Returns last delay line tap value</description> + <bitOffset>5</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>CTR_TAP_STAT</name> + <description>Returns last delay line tap value</description> + <bitOffset>6</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>HI_TAP_STAT</name> + <description>Returns last delay line tap value</description> + <bitOffset>7</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>HI</name> + <description>Selects delay line tap for high point of auto adjustment</description> + <bitOffset>8</bitOffset> + <bitWidth>5</bitWidth> + </field> + <field> + <name>CTR</name> + <description>Selects delay line tap for center point of auto adjustment</description> + <bitOffset>16</bitOffset> + <bitWidth>5</bitWidth> + </field> + <field> + <name>COARSE</name> + <description>Selects delay line tap for coarse or fixed delay portion of the line</description> + <bitOffset>24</bitOffset> + <bitWidth>3</bitWidth> + </field> + <field> + <name>DET_DLY</name> + <description>Number of HCLK between delay line launch and sampling</description> + <bitOffset>29</bitOffset> + <bitWidth>2</bitWidth> + </field> + <field> + <name>DELAY_ACT</name> + <description>Set if the delay is active</description> + <bitOffset>31</bitOffset> + <bitWidth>1</bitWidth> + </field> + </fields> + </register> + </registers> + </peripheral> +<!--DVS Dynamic Voltage Scaling--> <peripheral> <name>FLC</name> <description>Flash Memory Control.</description> @@ -5037,10 +5664,76 @@ <addressOffset>0x6C</addressOffset> <fields> <field> - <name>ECCERAD</name> - <description>ECC Error Address. This register content the failing address when ecc error occur.</description> + <name>SYSRAM0ECCEN</name> + <description>ECC System RAM0 Error Interrup Enable</description> <bitOffset>0</bitOffset> - <bitWidth>31</bitWidth> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM1ECCEN</name> + <description>ECC System RAM1 Error Interrup Enable</description> + <bitOffset>1</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM2ECCEN</name> + <description>ECC System RAM2 Error Interrup Enable</description> + <bitOffset>2</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM3ECCEN</name> + <description>ECC System RAM3 Error Interrup Enable</description> + <bitOffset>3</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM4ECCEN</name> + <description>ECC System RAM4 Error Interrup Enable</description> + <bitOffset>4</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM5ECCEN</name> + <description>ECC System RAM5 Error Interrup Enable</description> + <bitOffset>5</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>SYSRAM6ECCEN</name> + <description>ECC System RAM6 Error Interrup Enable</description> + <bitOffset>6</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>IC0ECCEN</name> + <description>ECC Icache0 Error Interrup Enable</description> + <bitOffset>8</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>IC1ECCEN</name> + <description>ECC Icache1 Error Interrup Enable</description> + <bitOffset>9</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>ICXIPECCEN</name> + <description>ECC IcacheXIP Error Interrup Enable</description> + <bitOffset>10</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FL0ECCEN</name> + <description>ECC Flash0 NError Interrup Enable</description> + <bitOffset>11</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>FL1ECCEN</name> + <description>ECC Flash1 NError Interrup Enable</description> + <bitOffset>12</bitOffset> + <bitWidth>1</bitWidth> </field> </fields> </register> @@ -5050,10 +5743,40 @@ <addressOffset>0x70</addressOffset> <fields> <field> - <name>ECCERAD</name> - <description>ECC Error Address. This register content the failing address when ecc error occur.</description> + <name>DATARAMADDR</name> + <description>ECC Error Address.Data Ram Address.</description> <bitOffset>0</bitOffset> - <bitWidth>31</bitWidth> + <bitWidth>13</bitWidth> + </field> + <field> + <name>DATARAMBANK</name> + <description>ECC Error Address.Data Error Bank.</description> + <bitOffset>14</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>DATARAMERR</name> + <description>ECC Error Address.Data Ram Error.</description> + <bitOffset>15</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>TAGRAMADDR</name> + <description>ECC Error Address.Tag Ram Address.</description> + <bitOffset>16</bitOffset> + <bitWidth>13</bitWidth> + </field> + <field> + <name>TAGRAMBANK</name> + <description>ECC Error Address.Tag Ram Bank.</description> + <bitOffset>30</bitOffset> + <bitWidth>1</bitWidth> + </field> + <field> + <name>TAGRAMERR</name> + <description>ECC Error Address.Tag Ram Error.</description> + <bitOffset>31</bitOffset> + <bitWidth>1</bitWidth> </field> </fields> </register> @@ -5109,15 +5832,20 @@ <description>0.7V</description> <value>0</value> </enumeratedValue> + <enumeratedValue> + <name>0_85</name> + <description>0.85V</description> + <value>1</value> + </enumeratedValue> <enumeratedValue> <name>0_9</name> <description>0.9V</description> - <value>1</value> + <value>2</value> </enumeratedValue> <enumeratedValue> <name>1_1</name> <description>1.1V</description> - <value>2</value> + <value>3</value> </enumeratedValue> </enumeratedValues> </field> @@ -5168,15 +5896,20 @@ <description>0.7V</description> <value>0</value> </enumeratedValue> + <enumeratedValue> + <name>0_85</name> + <description>0.85V</description> + <value>1</value> + </enumeratedValue> <enumeratedValue> <name>0_9</name> <description>0.9V</description> - <value>1</value> + <value>2</value> </enumeratedValue> <enumeratedValue> <name>1_1</name> <description>1.1V</description> - <value>2</value> + <value>3</value> </enumeratedValue> </enumeratedValues> </field> @@ -9589,24 +10322,6 @@ </enumeratedValue> </enumeratedValues> </field> - <field> - <name>PORVDDCMD</name> - <description>VDDC(VCore) Power-On Reset Monitor Disable. This bit controls the Power-On Reset monitor on VDDC supply in DeepSleep and BACKUP mode.</description> - <bitOffset>12</bitOffset> - <bitWidth>1</bitWidth> - <enumeratedValues> - <enumeratedValue> - <name>dis</name> - <description>Disabled.</description> - <value>0</value> - </enumeratedValue> - <enumeratedValue> - <name>en</name> - <description>Enabled.</description> - <value>1</value> - </enumeratedValue> - </enumeratedValues> - </field> <field> <name>VDDCMD</name> <description>VDDC(Vcore) Monitor Disable. This bit controls the power monitor on the VCore supply in all operating modes.</description> diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/mcr_regs.h b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/mcr_regs.h index 1bcf877637ce8b1793e0874246ab42dce2b71454..efabd1eea28e17bdf8e64eecff2ee419d78b52e1 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/mcr_regs.h +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/mcr_regs.h @@ -113,8 +113,23 @@ typedef struct { * @brief ECC Enable Register * @{ */ - #define MXC_F_MCR_ECCEN_SYSRAMECCEN_POS 0 /**< ECCEN_SYSRAMECCEN Position */ - #define MXC_F_MCR_ECCEN_SYSRAMECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAMECCEN_POS)) /**< ECCEN_SYSRAMECCEN Mask */ + #define MXC_F_MCR_ECCEN_SYSRAM0ECCEN_POS 0 /**< ECCEN_SYSRAM0ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM0ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM0ECCEN_POS)) /**< ECCEN_SYSRAM0ECCEN Mask */ + + #define MXC_F_MCR_ECCEN_SYSRAM1ECCEN_POS 1 /**< ECCEN_SYSRAM1ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM1ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM1ECCEN_POS)) /**< ECCEN_SYSRAM1ECCEN Mask */ + + #define MXC_F_MCR_ECCEN_SYSRAM2ECCEN_POS 2 /**< ECCEN_SYSRAM2ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM2ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM2ECCEN_POS)) /**< ECCEN_SYSRAM2ECCEN Mask */ + + #define MXC_F_MCR_ECCEN_SYSRAM3ECCEN_POS 3 /**< ECCEN_SYSRAM3ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM3ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM3ECCEN_POS)) /**< ECCEN_SYSRAM3ECCEN Mask */ + + #define MXC_F_MCR_ECCEN_SYSRAM4ECCEN_POS 4 /**< ECCEN_SYSRAM4ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM4ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM4ECCEN_POS)) /**< ECCEN_SYSRAM4ECCEN Mask */ + + #define MXC_F_MCR_ECCEN_SYSRAM5ECCEN_POS 5 /**< ECCEN_SYSRAM5ECCEN Position */ + #define MXC_F_MCR_ECCEN_SYSRAM5ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_SYSRAM5ECCEN_POS)) /**< ECCEN_SYSRAM5ECCEN Mask */ #define MXC_F_MCR_ECCEN_IC0ECCEN_POS 8 /**< ECCEN_IC0ECCEN Position */ #define MXC_F_MCR_ECCEN_IC0ECCEN ((uint32_t)(0x1UL << MXC_F_MCR_ECCEN_IC0ECCEN_POS)) /**< ECCEN_IC0ECCEN Mask */ diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/pwrseq_regs.h b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/pwrseq_regs.h index 77a6e2e5feb7eac9a2bdef2da31d1bc7d6705bb7..cc31a65b3a6e1d79028109fa479d69c6bafac1d1 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/pwrseq_regs.h +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Include/pwrseq_regs.h @@ -177,9 +177,6 @@ typedef struct { #define MXC_F_PWRSEQ_LPCN_BGOFF_POS 11 /**< LPCN_BGOFF Position */ #define MXC_F_PWRSEQ_LPCN_BGOFF ((uint32_t)(0x1UL << MXC_F_PWRSEQ_LPCN_BGOFF_POS)) /**< LPCN_BGOFF Mask */ - #define MXC_F_PWRSEQ_LPCN_PORVDDCMD_POS 12 /**< LPCN_PORVDDCMD Position */ - #define MXC_F_PWRSEQ_LPCN_PORVDDCMD ((uint32_t)(0x1UL << MXC_F_PWRSEQ_LPCN_PORVDDCMD_POS)) /**< LPCN_PORVDDCMD Mask */ - #define MXC_F_PWRSEQ_LPCN_VDDCMD_POS 20 /**< LPCN_VDDCMD Position */ #define MXC_F_PWRSEQ_LPCN_VDDCMD ((uint32_t)(0x1UL << MXC_F_PWRSEQ_LPCN_VDDCMD_POS)) /**< LPCN_VDDCMD Mask */ diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/backup_max32665.S b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/backup_max32665.S new file mode 100644 index 0000000000000000000000000000000000000000..d6b00595ad224cb4fbef9298da96e1d95365c2ce --- /dev/null +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/backup_max32665.S @@ -0,0 +1,61 @@ + /******************************************************************************* + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + * $Date: 2018-11-06 14:29:25 -0600 (Tue, 06 Nov 2018) $ + * $Revision: 38979 $ + * + ******************************************************************************/ + + .syntax unified + .arch armv7-m + .text + .thumb + .thumb_func + .align 2 + .globl Backup_Handler + .type Backup_Handler %function +Backup_Handler: + /* Wait for VregB to reach its setpoint */ + LDR R0, =0x40004400 +buck_wait: + LDR R1, [R0, #64] + LSLS R1, R1, #30 + BPL.N buck_wait + /* Switch back to VcoreB */ + LDR R0, =0x40006C00 + LDR R1, [R0, #16] + BIC.W R1, R1, #6 + STR R1, [R0, #16] + /* Jump to Reset_Handler */ + LDR R0, =0x4000684C + LDR R1, [R0] + BX R1 + \ No newline at end of file diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/gcc.mk b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/gcc.mk index 2468533e6b6f063c7da578dda688658cde06a961..8a9be5429d305c98722a38bba23d232c19787957 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/gcc.mk +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/gcc.mk @@ -29,8 +29,8 @@ # property whatsoever. Maxim Integrated Products, Inc. retains all # ownership rights. # - # $Date: 2019-03-25 20:35:15 +0000 (Mon, 25 Mar 2019) $ - # $Revision: 41849 $ + # $Date: 2019-04-24 16:56:03 -0500 (Wed, 24 Apr 2019) $ + # $Revision: 42914 $ # ############################################################################### @@ -120,6 +120,9 @@ endif ifneq "$(STACK_SIZE)" "" AFLAGS+=-D__STACK_SIZE=$(STACK_SIZE) endif +ifneq "$(SRAM_SIZE)" "" +AFLAGS+=-D__SRAM_SIZE=$(SRAM_SIZE) +endif AFLAGS+=$(PROJ_AFLAGS) ifeq "$(MXC_OPTIMIZE_CFLAGS)" "" diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.ld b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.ld index 791899b152df0e6410e7026ce2a143197c1b2d1d..65eb1c59991e5816ba3ae49f76648d714fc61637 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.ld +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.ld @@ -34,13 +34,36 @@ * ******************************************************************************/ + +/* Allocate space if SDMA_SIZE is defined at the start of SRAM*/ +SRAM_ORIGIN = 0x20000000; +SDMA_LEN = DEFINED(SDMA_SIZE) ? SDMA_SIZE : 0; +OTP_LEN = DEFINED(SDMA_SIZE) ? 0x40 : 0; +SHARED_LEN = DEFINED(SDMA_SIZE) ? 1k : 0; +SHARED_LEN_HALF = SHARED_LEN / 2; + +OTP_ADDR = SRAM_ORIGIN; +SHARED_ADDR = OTP_ADDR + OTP_LEN; +SDMA_ADDR = SHARED_ADDR + SHARED_LEN; +SRAM_ADDR = SDMA_ADDR + SDMA_LEN; + +/* Give leftover SRAM to the SRAM memory region */ +/* SRAM_SIZE must be defined */ +SRAM_LEN = SRAM_SIZE - OTP_LEN - SHARED_LEN - SDMA_LEN; + /* SPID and SPIX Sections here are maximum possible sizes */ /* If used, they should be adjusted for the external Flash/RAM size */ MEMORY { - SPIX (rx) : ORIGIN = 0x08000000, LENGTH = 128M - FLASH (rx) : ORIGIN = 0x10010000, LENGTH = 960k - SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512k - SPID (r) : ORIGIN = 0x80000000, LENGTH = 512M + SPIX (rx) : ORIGIN = 0x08000000, LENGTH = 128M + FLASH (rx) : ORIGIN = 0x10010000, LENGTH = 960k + + OTP (rwx) : ORIGIN = OTP_ADDR, LENGTH = OTP_LEN + ARM_SHARED(rwx) : ORIGIN = SHARED_ADDR, LENGTH = SHARED_LEN_HALF + SDMA_SHARED(rwx): ORIGIN = SHARED_ADDR + SHARED_LEN_HALF, LENGTH = SHARED_LEN_HALF + SDMA (rwx) : ORIGIN = SDMA_ADDR, LENGTH = SDMA_LEN + + SRAM (rwx) : ORIGIN = SRAM_ADDR, LENGTH = SRAM_LEN + SPID (rw) : ORIGIN = 0x80000000, LENGTH = 512M } SECTIONS { @@ -111,6 +134,39 @@ SECTIONS { } > SRAM AT>FLASH __load_data = LOADADDR(.data); + .otp (NOLOAD) : + { + _otp = ALIGN(., 4); + *(.otp*) /*Copy of OTP memory*/ + + _eotp = ALIGN(., 4); + } > OTP + + .arm_shared (NOLOAD) : + { + _arm_shared = ALIGN(., 4); + *(.arm_shared*) /*Shared memory section*/ + + _earm_shared = ALIGN(., 4); + } > ARM_SHARED + + .sdma_shared (NOLOAD) : + { + _sdma_shared = ALIGN(., 4); + *(.sdma_shared*) /*Shared memory section*/ + + _esdma_shared = ALIGN(., 4); + } > SDMA_SHARED + + .sdma : + { + _sdma = ALIGN(., 4); + *(.sdma_code*) /*SDMA Code*/ + + _esdma = ALIGN(., 4); + } > SDMA AT>FLASH + __load_sdma = LOADADDR(.sdma); + .bss : { . = ALIGN(4); diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.mk b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.mk index 79d15549de61232fe35ac5c165a003d88666a69c..3f8ae029cad0c9c60ade60667705303c09e40bbc 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.mk +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/max32665.mk @@ -55,6 +55,11 @@ ifeq "$(ENTRY)" "" ENTRY=Reset_Handler endif +# Default is 560kB, use 448kB if ECC is enabled +ifeq "$(SRAM_SIZE)" "" +SRAM_SIZE=0x8C000 +endif + # Default TARGET_REVISION # "A1" in ASCII ifeq "$(TARGET_REV)" "" @@ -64,6 +69,7 @@ endif # Add target specific CMSIS source files ifneq (${MAKECMDGOALS},lib) SRCS += ${STARTUPFILE} +SRCS += backup_max32665.S SRCS += heap.c SRCS += system_max32665.c endif diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/startup_max32665.S b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/startup_max32665.S index b177ef62b4ccad862588d2fbcab0dc77362c8326..f9a08b05916dbfc4cbf28cf8c1abdcc1ba03a352 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/startup_max32665.S +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/GCC/startup_max32665.S @@ -39,6 +39,22 @@ .section .stack .align 3 + + /* Default SRAM size is 560kB, use 448kB if ECC enabled */ + .globl SRAM_SIZE +#ifdef __SRAM_SIZE + .equ SRAM_SIZE, __SRAM_SIZE +#else + /* 560kB */ + .equ SRAM_SIZE, 0x8C000 +#endif + + /* Define SDMA_SIZE to enable the loading of the SDMA image */ +#ifdef __SDMA_SIZE + .global SDMA_SIZE + .equ SDMA_SIZE, __SDMA_SIZE +#endif + .globl Stack_Size #ifdef __STACK_SIZE .equ Stack_Size, __STACK_SIZE @@ -238,6 +254,40 @@ Reset_Handler: .LC1: #endif +#ifdef __SDMA_SIZE +/* Loop to copy data from read only SDMA memory to RAM. The ranges + * of copy from/to are specified by following symbols evaluated in + * linker script. + * __load_sdma: Where data sections are saved. + * _sdma /_esdma: RAM address range that data should be + * copied to. Both must be aligned to 4 bytes boundary. */ + + ldr r1, =__load_sdma + ldr r2, =_sdma + ldr r3, =_esdma + +#if 0 +/* Here are two copies of loop implemenations. First one favors code size + * and the second one favors performance. Default uses the first one. + * Change to "#if 0" to use the second one */ +.LC0_sdma: + cmp r2, r3 + ittt lt + ldrlt r0, [r1], #4 + strlt r0, [r2], #4 + blt .LC0_sdma +#else + subs r3, r2 + ble .LC1_sdma +.LC0_sdma: + subs r3, #4 + ldr r0, [r1, r3] + str r0, [r2, r3] + bgt .LC0_sdma +.LC1_sdma: +#endif +#endif + /* * Loop to zero out BSS section, which uses following symbols * in linker script: diff --git a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c index dde0ca3b5f8f7a51ecf98769a647e07adb958256..569913e28af4439a31babb26ab84e558ef1bc7ac 100644 --- a/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c +++ b/lib/sdk/Libraries/CMSIS/Device/Maxim/MAX32665/Source/system_max32665.c @@ -42,6 +42,7 @@ #include "gcr_regs.h" #include "icc_regs.h" #include "pwrseq_regs.h" +#include "simo_regs.h" // Backup mode entry point extern void Reset_Handler(void); @@ -49,7 +50,7 @@ extern void Reset_Handler(void); extern void (* const __isr_vector[])(void); // Part defaults to HIRC/2 out of reset -uint32_t SystemCoreClock = HIRC_FREQ >> 1; +uint32_t SystemCoreClock = HIRC_FREQ >> 1; __weak void SystemCoreClockUpdate(void) { @@ -121,16 +122,16 @@ __weak void SystemInit(void) * table in flash. Initially, VTOR points to the ROM's table. */ SCB->VTOR = (unsigned long)&__isr_vector; - - // Switch to fast clock on startup - MXC_GCR->clkcn &= ~(MXC_S_GCR_CLKCN_PSC_DIV128); - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_HIRC96M_EN; - while (!(MXC_GCR->clkcn & MXC_F_GCR_CLKCN_HIRC96M_RDY)); - MXC_SETFIELD(MXC_GCR->clkcn, MXC_F_GCR_CLKCN_CLKSEL, MXC_S_GCR_CLKCN_CLKSEL_HIRC96); - - // Wait for clock switch and disable unused clocks - while (!(MXC_GCR->clkcn & MXC_F_GCR_CLKCN_CKRDY)); - MXC_GCR->clkcn &= ~(MXC_F_GCR_CLKCN_HIRC_EN); + + /* We'd like to switch to the fast clock, but can only do so if the + * core's operating voltage (VregO_B) is high enough to support it + * Otherwise, we need to remain on the slow clock + */ + if((MXC_SIMO->vrego_b > 48) && (MXC_SIMO->buck_out_ready & 0x2)) { + // Switch to fast clock on startup + MXC_GCR->clkcn &= ~(MXC_S_GCR_CLKCN_PSC_DIV128); + SYS_Clock_Select(SYS_CLOCK_HIRC96, MXC_TMR0); + } /* Enable FPU on Cortex-M4, which occupies coprocessor slots 10 & 11 * Grant full access, per "Table B3-24 CPACR bit assignments". @@ -209,5 +210,6 @@ void $Sub$$__main_after_scatterload(void) { SystemInit(); $Super$$__main_after_scatterload(); + while(1); } #endif /* __CC_ARM */ diff --git a/lib/sdk/Libraries/CMSIS/Include/core_rv32.h b/lib/sdk/Libraries/CMSIS/Include/core_rv32.h new file mode 100644 index 0000000000000000000000000000000000000000..bde424aa4e910c47d855d6f221eef1b085004976 --- /dev/null +++ b/lib/sdk/Libraries/CMSIS/Include/core_rv32.h @@ -0,0 +1,419 @@ +/**************************************************************************//** + * @file core_cm4.h + * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File + * @version V3.20 + * @date 25. February 2013 + * + * @note + * + ******************************************************************************/ +/* Copyright (c) 2009 - 2013 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form 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. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND 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. + ---------------------------------------------------------------------------*/ + + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef __CORE_CM4_H_GENERIC +#define __CORE_CM4_H_GENERIC + +/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.<br> + Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br> + Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.<br> + Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** \ingroup Cortex_M4 + @{ + */ + +/* CMSIS CM4 definitions */ +#define __CM4_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | \ + __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ + +#define __CORTEX_M (0x04) /*!< Cortex-M Core */ + + +#if defined ( __CC_ARM ) +// #define __ASM __asm /*!< asm keyword for ARM Compiler */ +// #define __INLINE __inline /*!< inline keyword for ARM Compiler */ + #define __STATIC_INLINE static __inline + +#elif defined ( __ICCARM__ ) +// #define __ASM __asm /*!< asm keyword for IAR Compiler */ +// #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ + #define __STATIC_INLINE static inline + +#elif defined ( __TMS470__ ) +// #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __GNUC__ ) +// #define __ASM __asm /*!< asm keyword for GNU Compiler */ +// #define __INLINE inline /*!< inline keyword for GNU Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __TASKING__ ) +// #define __ASM __asm /*!< asm keyword for TASKING Compiler */ +// #define __INLINE inline /*!< inline keyword for TASKING Compiler */ + #define __STATIC_INLINE static inline + +#endif + +/** __FPU_USED indicates whether an FPU is used or not. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __TMS470__ ) + #if defined __TI_VFP_SUPPORT__ + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if (__FPU_PRESENT == 1) + #define __FPU_USED 1 + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0 + #endif + #else + #define __FPU_USED 0 + #endif +#endif + +#include <stdint.h> /* standard types definitions */ +//#include <core_cmInstr.h> /* Core Instruction Access */ +//#include <core_cmFunc.h> /* Core Function Access */ +//#include <core_cm4_simd.h> /* Compiler specific SIMD Intrinsics */ + +#endif /* __CORE_CM4_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM4_H_DEPENDANT +#define __CORE_CM4_H_DEPENDANT + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM4_REV + #define __CM4_REV 0x0000 + #warning "__CM4_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0 + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0 + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 4 + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0 + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + <strong>IO Type Qualifiers</strong> are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/*@} end of group Cortex_M4 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core NVIC Register + + // MLB - These have been purged from RISC V + - Core Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + * @brief Structure type to access the GCR Registers. + */ +typedef struct { + __IO uint32_t irq_enable; /**< <tt>\b 0x00:<\tt> */ + __IO uint32_t irq_pending; /**< <tt>\b 0x04:<\tt> */ + __IO uint32_t irq_set_pending; /**< <tt>\b 0x08:<\tt> */ + __IO uint32_t irq_clear_pending; /**< <tt>\b 0x0c:<\tt> */ + __IO uint32_t event_enable; /**< <tt>\b 0x10:<\tt>*/ + __IO uint32_t event_pending; /**< <tt>\b 0x14:<\tt> */ + __IO uint32_t event_set_pending; /**< <tt>\b 0x18:<\tt> */ + __IO uint32_t event_clear_pending; /**< <tt>\b 0x1C:<\tt> */ + __IO uint32_t sleep_ctrl; /**< <tt>\b 0x20:<\tt> */ + __IO uint32_t sleep_status; /**< <tt>\b 0x24:<\tt> */ + } mxc_event_regs_t; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ +#define MXC_BASE_EVENT ((uint32_t)0xE5000000UL) +#define MXC_EVENT ((mxc_event_regs_t *)MXC_BASE_EVENT) + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + + // MLB - These have been purged in RISC V + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +/** \brief Enable External Interrupt + + The function enables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) +{ + // MLB - Moved global enable into __enable_irq + // handled event specific enable here + MXC_EVENT->irq_enable |= 1 << IRQn; +} + + +/** \brief Disable External Interrupt + + The function disables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) +{ + // MLB - Moved Global Disable into __disable_irq + // handled event specific interrupt here + MXC_EVENT->irq_enable &= ~(1 << IRQn); +} + +__STATIC_INLINE void __enable_irq() +{ + // MLB - Moved global interrupt enable from NVIC_EnableIRQ + int mstatus; + asm volatile ("csrr %0, mstatus": "=r" (mstatus)); + mstatus |= 0x08; + asm volatile ("csrw mstatus, %0" : /* no output */ : "r" (mstatus)); +} + +__STATIC_INLINE void __disable_irq() +{ + // MLB - Moved global interrupt enable from NVIC_DisableIRQ + int mstatus; + asm volatile ("csrr %0, mstatus": "=r" (mstatus)); + mstatus &= ~0x08; + asm volatile ("csrw mstatus, %0" : /* no output */ : "r" (mstatus)); +} + +/** \brief Get Pending Interrupt + + The function reads the pending register in the NVIC and returns the pending bit + for the specified interrupt. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + */ +__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + return(0);//((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */ +} + + +/** \brief Set Pending Interrupt + + The function sets the pending bit of an external interrupt. + + \param [in] IRQn Interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + //NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */ +} + + +/** \brief Clear Pending Interrupt + + The function clears the pending bit of an external interrupt. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + //NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */ +} + + +/** \brief Get Active Interrupt + + The function reads the active register in NVIC and returns the active bit. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + */ +__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) +{ + return(0); //((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */ +} + +/** \brief System Reset + + The function initiates a system reset request to reset the MCU. + */ +__STATIC_INLINE void NVIC_SystemReset(void) +{ + //__DSB(); /* Ensure all outstanding memory accesses included + // buffered write are completed before reset */ + // SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | + // (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + // SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */ + //__DSB(); /* Ensure completion of memory access */ + while(1); /* wait until reset */ +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/*@} end of CMSIS_core_DebugFunctions */ + +#endif /* __CORE_CM4_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ + +#ifdef __cplusplus +} +#endif diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/dma.h b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/dma.h index 4009126cd3093e8904afa8c09a71fefe3993ac3f..f34218417e9988b5e34caf204fafbb9dbb6a51ab 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/dma.h +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/dma.h @@ -138,9 +138,12 @@ typedef enum { /** @brief DMA transfer data width */ typedef enum { - DMA_WIDTH_BYTE = MXC_S_DMA_CFG_SRCWD_BYTE, /**< DMA transfer in bytes */ - DMA_WIDTH_HALFWORD = MXC_S_DMA_CFG_SRCWD_HALFWORD, /**< DMA transfer in 16-bit half-words */ - DMA_WIDTH_WORD = MXC_S_DMA_CFG_SRCWD_WORD, /**< DMA transfer in 32-bit words */ + /* Using the '_V_' define instead of the '_S_' since these same values will be used to + specify the DSTWD also. The API functions will shift the value the correct amount + prior to writing the cfg register. */ + DMA_WIDTH_BYTE = MXC_V_DMA_CFG_SRCWD_BYTE, /**< DMA transfer in bytes */ + DMA_WIDTH_HALFWORD = MXC_V_DMA_CFG_SRCWD_HALFWORD, /**< DMA transfer in 16-bit half-words */ + DMA_WIDTH_WORD = MXC_V_DMA_CFG_SRCWD_WORD, /**< DMA transfer in 32-bit words */ } dma_width_t; /** @brief Convenience defines for options */ diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/i2c.h b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/i2c.h index 05b39557d7acdf5af5f02cfb27889a6d2b36015a..263725ca5b650035df20d081c1c648208efff1ee 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/i2c.h +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/i2c.h @@ -229,5 +229,21 @@ void I2C_DrainTX(mxc_i2c_regs_t *i2c); */ int I2C_AbortAsync(i2c_req_t *req); +/** + * @brief Enable and Set Timeout + * + * @param i2c pointer to I2C regs + * @param[in] us micro seconds to delay + * + * @return E_NO_ERROR or E_BAD_PARAM if delay is to long. + */ +int I2C_SetTimeout(mxc_i2c_regs_t *i2c, int us); + +/** + * @brief clear and disable timeout + * + * @param i2c pointer to I2C regs + */ +void I2C_ClearTimeout(mxc_i2c_regs_t *i2c); /**@} end of group i2c */ -#endif /* _I2C_H_ */ \ No newline at end of file +#endif /* _I2C_H_ */ diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/lp.h b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/lp.h index 9784c1e8380679f05d27dc06e7fe065cc3f5dbeb..574527703125549a4bb278b7d15cfcca3ef1f8a3 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Include/lp.h +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Include/lp.h @@ -56,6 +56,14 @@ extern "C" { * @ingroup periphlibs * @{ */ + +typedef enum { + RETAIN_NONE= MXC_S_PWRSEQ_LPCN_RAMRET_DIS, + RETAIN_32k = MXC_S_PWRSEQ_LPCN_RAMRET_EN1, + RETAIN_64k = MXC_S_PWRSEQ_LPCN_RAMRET_EN2, + RETAIN_ALL = MXC_S_PWRSEQ_LPCN_RAMRET_EN3, +} ram_retained_t; + /** * @brief Enables the selected GPIO port and its selected pins to wake up the device from any low power mode. * Call this function multiple times to enable pins on multiple ports. This function does not configure @@ -343,6 +351,12 @@ void LP_PowerFailMonitorEnable(void); */ void LP_PowerFailMonitorDisable(void); +/** + * @brief Enables the selected amount of RAM retention in backup mode + * Using any RAM retention removes the ability to shut down VcoreB + */ +void LP_SetRAMRetention(ram_retained_t ramRetained); + /** * @brief Places the device into SLEEP mode. This function returns once any interrupt occurs. */ @@ -356,8 +370,12 @@ void LP_EnterDeepSleepMode(void); /** * @brief Places the device into BACKUP mode. CPU state is not maintained in this mode, so this function never returns. * Instead, the device will restart once an RTC or external interrupt occur. + * @param func Function that backup mode returns to, if null, the part will return to Reset_Handler + * @note When returning from backup mode, depending on the RAM retention settings the processor + * could have no state information. It will not have a valid stack pointer. + * This function also uses MXC_PWRSEQ->gp0 and gp1. */ -void LP_EnterBackupMode(void); +void LP_EnterBackupMode(void* func(void)); /** * @brief Places the device into Shutdown mode. CPU state is not maintained in this mode, so this function never returns. diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/adc.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/adc.c index 8347d262b0610c68a1ea2f5010b3babff5941539..1fe9001bf1928dde72dbac82a71e132b3b83e103 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/adc.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/adc.c @@ -118,7 +118,6 @@ int ADC_Init(unsigned divisor, const sys_cfg_adc_t* sys_cfg) // Power up the ADC MXC_ADC->ctrl |= MXC_F_ADC_CTRL_PWR; MXC_ADC->ctrl |= MXC_F_ADC_CTRL_REFBUF_PWR; - MXC_ADC->ctrl |= MXC_F_ADC_CTRL_CHGPUMP_PWR; while ((MXC_ADC->intr & MXC_F_ADC_INTR_REF_READY_IF)>>MXC_F_ADC_INTR_REF_READY_IF_POS); ADC_ClearFlags(MXC_F_ADC_INTR_REF_READY_IF); diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/dma.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/dma.c index 6e40dd791661f83b36086efa7a724f60ebae7ec3..7288aad8f9054a57f06339461a9a11e04542d56f 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/dma.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/dma.c @@ -212,7 +212,9 @@ int DMA_ConfigChannel(int ch, (dstinc_en ? MXC_F_DMA_CFG_DSTINC : 0) | (chdis_inten ? MXC_F_DMA_CFG_CHDIEN : 0) | (ctz_inten ? MXC_F_DMA_CFG_CTZIEN : 0) | - prio |reqsel | tosel | pssel | srcwd | (dstwd << 2) | + prio |reqsel | tosel | pssel | + (srcwd << MXC_F_DMA_CFG_SRCWD_POS) | + (dstwd << MXC_F_DMA_CFG_DSTWD_POS) | (((burst_size - 1) << MXC_F_DMA_CFG_BRST_POS) & MXC_F_DMA_CFG_BRST)); } else { return E_BAD_PARAM; diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c index 24dcc2942e6a30c4d99d3bf6094f90e50c9f6762..e7442e7ae6d915a1f33a9549d0fcb5b0ccf63e0a 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/i2c.c @@ -342,13 +342,13 @@ int I2C_MasterWrite(mxc_i2c_regs_t *i2c, uint8_t addr, const uint8_t* data, int } // Wait for Done - while (!(i2c->int_fl0 & MXC_F_I2C_INT_FL0_DONE)) {} + while (!(i2c->int_fl0 & (MXC_F_I2C_INT_FL0_DONE | I2C_ERROR))) {} i2c->int_fl0 = MXC_F_I2C_INT_FL0_DONE; // Wait for Stop if (!restart) { - while (!(i2c->int_fl0 & MXC_F_I2C_INT_FL0_STOP)) {} + while (!(i2c->int_fl0 & (MXC_F_I2C_INT_FL0_STOP | I2C_ERROR))) {} i2c->int_fl0 = MXC_F_I2C_INT_FL0_STOP; } @@ -424,7 +424,7 @@ int I2C_MasterRead(mxc_i2c_regs_t *i2c, uint8_t addr, uint8_t* data, int len, in } // Wait for Done - while (!(i2c->int_fl0 & MXC_F_I2C_INT_FL0_DONE)) { + while (!(i2c->int_fl0 & (MXC_F_I2C_INT_FL0_DONE | I2C_ERROR))) { } @@ -432,7 +432,7 @@ int I2C_MasterRead(mxc_i2c_regs_t *i2c, uint8_t addr, uint8_t* data, int len, in // Wait for Stop if (!restart) { - while (!(i2c->int_fl0 & MXC_F_I2C_INT_FL0_STOP)) { + while (!(i2c->int_fl0 &( MXC_F_I2C_INT_FL0_STOP | I2C_ERROR))) { } @@ -1037,3 +1037,20 @@ int I2C_AbortAsync(i2c_req_t *req) return E_BAD_PARAM; } + +/* ************************************************************************* */ +int I2C_SetTimeout(mxc_i2c_regs_t *i2c, int us){ + uint32_t timeout; + timeout = (PeripheralClock/1000000) * us; + if(timeout > 0xFFFF){ + return E_BAD_PARAM; + } + i2c->timeout = timeout; + return E_NO_ERROR; +} + +/* ************************************************************************* */ +void I2C_ClearTimeout (mxc_i2c_regs_t *i2c) +{ + i2c->timeout = 0; +} diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/lp.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/lp.c index d7cb2e2e76399c1494fd0c58f6710af8935bac40..4c489e0750a03dc12e4053bf0527dbfffdf414de 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/lp.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/lp.c @@ -2,6 +2,7 @@ // FIXME: Copied from ME11, removed RAM shutdown functions, needs review // FIXME: Needs copyright header +#include <stdio.h> #include "lp.h" #include "pwrseq_regs.h" #include "mxc_errors.h" @@ -11,6 +12,9 @@ #include "tmr_utils.h" #include "mcr_regs.h" +extern void Reset_Handler(void); +extern void Backup_Handler(void); + void LP_ClearWakeStatus(void) { /* Write 1 to clear */ @@ -314,14 +318,9 @@ void LP_FastWakeupDisable(void) MXC_PWRSEQ->lpcn &= ~MXC_F_PWRSEQ_LPCN_FWKM; } -void LP_PowerFailMonitorEnable(void) -{ - MXC_PWRSEQ->lpcn &= ~MXC_F_PWRSEQ_LPCN_PORVDDCMD; -} - -void LP_PowerFailMonitorDisable(void) +void LP_SetRAMRetention(ram_retained_t ramRetained) { - MXC_PWRSEQ->lpcn |= MXC_F_PWRSEQ_LPCN_PORVDDCMD; + MXC_SETFIELD(MXC_PWRSEQ->lpcn, MXC_F_PWRSEQ_LPCN_RAMRET, ramRetained); } void LP_EnterSleepMode(void) @@ -347,10 +346,21 @@ void LP_EnterDeepSleepMode(void) __WFI(); } -void LP_EnterBackupMode(void) +void LP_EnterBackupMode(void* func(void)) { LP_ClearWakeStatus(); + MXC_PWRSEQ->gp0 = (uint32_t)(&Backup_Handler) | 1; + if(func == NULL) { + MXC_PWRSEQ->gp1 = (uint32_t)(&Reset_Handler) | 1; + } else { + MXC_PWRSEQ->gp1 = (uint32_t)(&func) | 1; + } + + // Enable the VDDCSW to ensure we have enough power to start + MXC_MCR->ctrl |= MXC_F_MCR_CTRL_VDDCSWEN; + + // Enable backup mode MXC_GCR->pm &= ~MXC_F_GCR_PM_MODE; MXC_GCR->pm |= MXC_S_GCR_PM_MODE_BACKUP; while(1); // Should never reach this line - device will jump to backup vector on exit from background mode. diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c index f081daa871f5fc2513f4266c63b8d194d75f6288..940f44a23905bf984dc8ce42ddc64033d60b30d6 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/mxc_sys.c @@ -745,7 +745,7 @@ int SYS_SPI17Y_Shutdown(mxc_spi17y_regs_t *spi) void SYS_RTC_SqwavInit(const sys_cfg_rtc_t* sys_cfg) { GPIO_Config(&gpio_cfg_rtcsqw); - + //mxc_delay(1000); MXC_MCR->outen |= MXC_F_MCR_OUTEN_SQWOUT0EN; } diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/nvic_table.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/nvic_table.c index e6418115b23f056b40d21f219820dc67a2860e93..8b947743e7b77b287e3de9d64e83ff490ea12807 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/nvic_table.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/nvic_table.c @@ -57,10 +57,10 @@ void NVIC_SetRAM(void) extern void (* const __isr_vector[])(void); #else /* should be defined in starup_<device>.S */ - extern uint32_t __isr_vector; + extern uint32_t *__isr_vector; #endif - memcpy(&ramVectorTable, &__isr_vector, sizeof(ramVectorTable)); + memcpy((void*)&ramVectorTable, (void*)&__isr_vector, sizeof(ramVectorTable)); SCB->VTOR = (uint32_t)&ramVectorTable; } diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c index c3ad9827b659f60e065e4a958c5afbfbcb329ef4..d8845700377e4e34ff7318806ab564dc811a535e 100644 --- a/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c +++ b/lib/sdk/Libraries/MAX32665PeriphDriver/Source/spi17y.c @@ -59,9 +59,9 @@ static spi17y_req_state_t states[MXC_SPI17Y_INSTANCES]; /* **** Functions **** */ static int SPI17Y_TransSetup(mxc_spi17y_regs_t *spi, spi17y_req_t *req, int master); -static int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req); -static int SPI17Y_TransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req); -static int SPI17Y_SlaveTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req); +static int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req, uint8_t async); +static int SPI17Y_TransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req, uint8_t async); +static int SPI17Y_SlaveTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req, uint8_t async); /* ************************************************************************** */ int SPI17Y_Init(mxc_spi17y_regs_t *spi, unsigned int mode, unsigned int freq, @@ -313,14 +313,14 @@ void SPI17Y_Handler(mxc_spi17y_regs_t *spi) if ((states[spi_num].req != NULL) && (flags)) { if ((spi->ctrl0 & MXC_F_SPI17Y_CTRL0_MASTER)>> MXC_F_SPI17Y_CTRL0_MASTER_POS) { do { - SPI17Y_MasterTransHandler(spi, states[spi_num].req); + SPI17Y_MasterTransHandler(spi, states[spi_num].req, 1); rx_avail = (spi->dma & MXC_F_SPI17Y_DMA_RX_FIFO_CNT) >> MXC_F_SPI17Y_DMA_RX_FIFO_CNT_POS; } while ((states[spi_num].req->rx_data != NULL) && (rx_avail > (spi->dma & MXC_F_SPI17Y_DMA_RX_FIFO_LEVEL) >>MXC_F_SPI17Y_DMA_RX_FIFO_LEVEL_POS)); } else { do { - SPI17Y_SlaveTransHandler(spi, states[spi_num].req); + SPI17Y_SlaveTransHandler(spi, states[spi_num].req, 1); rx_avail = (spi->dma & MXC_F_SPI17Y_DMA_RX_FIFO_CNT) >> MXC_F_SPI17Y_DMA_RX_FIFO_CNT_POS; } while ((states[spi_num].req->rx_data != NULL) && (rx_avail > (spi->dma & MXC_F_SPI17Y_DMA_RX_FIFO_LEVEL) >>MXC_F_SPI17Y_DMA_RX_FIFO_LEVEL_POS)); @@ -339,7 +339,7 @@ int SPI17Y_MasterTrans(mxc_spi17y_regs_t *spi,spi17y_req_t *req) } req->callback = NULL; - while (SPI17Y_MasterTransHandler(spi,req)==0) { + while (SPI17Y_MasterTransHandler(spi,req,0)==0) { } while (!(spi->int_fl & MXC_F_SPI17Y_INT_FL_M_DONE)) { @@ -359,7 +359,7 @@ int SPI17Y_SlaveTrans(mxc_spi17y_regs_t *spi, spi17y_req_t *req) } req->callback = NULL; - while (SPI17Y_SlaveTransHandler(spi,req)==0) { + while (SPI17Y_SlaveTransHandler(spi,req,0)==0) { } @@ -374,7 +374,7 @@ int SPI17Y_MasterTransAsync(mxc_spi17y_regs_t *spi, spi17y_req_t *req) return error; } - SPI17Y_MasterTransHandler(spi,req); + SPI17Y_MasterTransHandler(spi,req, 1); return E_NO_ERROR; } @@ -387,14 +387,14 @@ int SPI17Y_SlaveTransAsync(mxc_spi17y_regs_t *spi, spi17y_req_t *req) return error; } - SPI17Y_SlaveTransHandler(spi,req); + SPI17Y_SlaveTransHandler(spi,req, 1); return E_NO_ERROR; } /* ************************************************************************** */ -int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) +int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req,uint8_t async) { int retval; int spi_num; @@ -406,7 +406,7 @@ int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) spi->ctrl0 |= MXC_F_SPI17Y_CTRL0_SS_CTRL; } - retval = SPI17Y_TransHandler(spi,req); + retval = SPI17Y_TransHandler(spi,req, async); if (!states[spi_num].started) { spi->ctrl0 |= MXC_F_SPI17Y_CTRL0_START; @@ -422,14 +422,14 @@ int SPI17Y_MasterTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) } /* ************************************************************************** */ -int SPI17Y_SlaveTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) +int SPI17Y_SlaveTransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req, uint8_t async) { - return SPI17Y_TransHandler(spi,req); + return SPI17Y_TransHandler(spi,req, async); } /* ************************************************************************** */ // Returns non-zero if transactions is complete, or 0 if not. -int SPI17Y_TransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) +int SPI17Y_TransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req, uint8_t async) { unsigned tx_avail, rx_avail; @@ -576,8 +576,9 @@ int SPI17Y_TransHandler(mxc_spi17y_regs_t *spi, spi17y_req_t *req) } return 1; } - - spi->int_en = int_en; + if(async){ + spi->int_en = int_en; + } return 0; } diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/include/sec_api.h b/lib/sdk/NDALibraries/BTLE/ble-host/include/sec_api.h deleted file mode 100644 index 774a1e2f16568d401593f539218813f69543da80..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/include/sec_api.h +++ /dev/null @@ -1,253 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief AES and random number security service API. - * - * Copyright (c) 2010-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ -#ifndef SEC_API_H -#define SEC_API_H - -#include "wsf_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*! \addtogroup STACK_SECURITY_API - * \{ */ - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -/*! \brief CMAC algorithm key length */ -#define SEC_CMAC_KEY_LEN 16 - -/*! \brief CMAC algorithm result length */ -#define SEC_CMAC_HASH_LEN 16 - -/*! \brief ECC algorithm key length */ -#define SEC_ECC_KEY_LEN 32 - -/*! \brief Invalid AES Token */ -#define SEC_TOKEN_INVALID 0xFF - -/************************************************************************************************** - Data Types -**************************************************************************************************/ -/*! \brief AES Security callback parameters structure */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< \brief header */ - uint8_t *pCiphertext; /*!< \brief pointer to 16 bytes of ciphertext data */ -} secMsg_t; - -/*! \brief AES Security callback are the same as secMsg_t */ -typedef secMsg_t secAes_t; - -/*! \brief CMAC Security callback are the same as secMsg_t */ -typedef secMsg_t secCmacMsg_t; - -/*! \brief ECC Security public/private key pair */ -typedef struct -{ - uint8_t pubKey_x[SEC_ECC_KEY_LEN]; /*!< \brief x component of ECC public key */ - uint8_t pubKey_y[SEC_ECC_KEY_LEN]; /*!< \brief y component of ECC public key */ - uint8_t privKey[SEC_ECC_KEY_LEN]; /*!< \brief ecc private key */ -} secEccKey_t; - -/*! \brief ECC security DH Key shared secret */ -typedef struct -{ - uint8_t secret[SEC_ECC_KEY_LEN]; /*!< \brief DH Key Shared secret */ -} secEccSharedSec_t; - - -/*! \brief ECC Security callback parameters structure */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< \brief header */ - union - { - secEccSharedSec_t sharedSecret; /*!< \brief shared secret */ - secEccKey_t key; /*!< \brief ECC public/private key pair */ - } data; /*!< \brief ECC message data union */ -} secEccMsg_t; - - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -/** \name Security Initialization Functions - * - */ -/**@{*/ - -/*************************************************************************************************/ -/*! - * \brief Initialize the security service. This function should only be called once - * upon system initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void SecInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize the random number service. This function should only be called once - * upon system initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void SecRandInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize the AES service. This function should only be called once - * upon system initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void SecAesInit(void); - -/*************************************************************************************************/ -/*! - * \brief Called to initialize CMAC security. This function should only be called once - * upon system initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void SecCmacInit(void); - -/*************************************************************************************************/ -/*! - * \brief Called to initialize ECC security. This function should only be called once - * upon system initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void SecEccInit(void); - -/**@}*/ - -/** \name Security AES and CMAC Functions - * - */ -/**@{*/ - -/*************************************************************************************************/ -/*! - * \brief Execute an AES calculation. When the calculation completes, a WSF message will be - * sent to the specified handler. This function returns a token value that - * the client can use to match calls to this function with messages. - * - * \param pKey Pointer to 16 byte key. - * \param pPlaintext Pointer to 16 byte plaintext. - * \param handlerId WSF handler ID. - * \param param Client-defined parameter returned in message. - * \param event Event for client's WSF handler. - * - * \return Token value. - */ -/*************************************************************************************************/ -uint8_t SecAes(uint8_t *pKey, uint8_t *pPlaintext, wsfHandlerId_t handlerId, - uint16_t param, uint8_t event); - -/*************************************************************************************************/ -/*! - * \brief Execute the CMAC algorithm. - * - * \param pKey Key used in CMAC operation. - * \param pPlaintext Data to perform CMAC operation over - * \param textLen Size of pPlaintext in bytes. - * \param handlerId WSF handler ID for client. - * \param param Optional parameter sent to client's WSF handler. - * \param event Event for client's WSF handler. - * - * \return TRUE if successful, else FALSE. - */ -/*************************************************************************************************/ -bool_t SecCmac(const uint8_t *pKey, uint8_t *pPlaintext, uint8_t textLen, wsfHandlerId_t handlerId, - uint16_t param, uint8_t event); - -/**@}*/ - -/** \name Security ECC Functions - * - */ -/**@{*/ - -/*************************************************************************************************/ -/*! - * \brief Generate an ECC key. - * - * \param handlerId WSF handler ID for client. - * \param param Optional parameter sent to client's WSF handler. - * \param event Event for client's WSF handler. - * - * \return TRUE if successful, else FALSE. - */ -/*************************************************************************************************/ -bool_t SecEccGenKey(wsfHandlerId_t handlerId, uint16_t param, uint8_t event); - -/*************************************************************************************************/ -/*! - * \brief Generate an ECC key. - * - * \param pKey ECC Key structure. - * \param handlerId WSF handler ID for client. - * \param param Optional parameter sent to client's WSF handler. - * \param event Event for client's WSF handler. - * - * \return TRUE if successful, else FALSE. - */ -/*************************************************************************************************/ -bool_t SecEccGenSharedSecret(secEccKey_t *pKey, wsfHandlerId_t handlerId, uint16_t param, uint8_t event); - -/**@}*/ - -/** \name Security Random Number Generator Functions - * - */ -/**@{*/ - -/*************************************************************************************************/ -/*! - * \brief This function returns up to 16 bytes of random data to a buffer provided by the - * client. - * - * \param pRand Pointer to returned random data. - * \param randLen Length of random data. - * - * \return None. - */ -/*************************************************************************************************/ -void SecRand(uint8_t *pRand, uint8_t randLen); - -/**@}*/ - -/*! \} */ /* STACK_SECURITY_API */ - -#ifdef __cplusplus -}; -#endif - -#endif /* SEC_API_H */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd.c deleted file mode 100644 index f2f37e87c63b952cb023d24f03c6ff2871653fc9..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd.c +++ /dev/null @@ -1,748 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI command module. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_queue.h" -#include "wsf_timer.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "hci_cmd.h" -#include "hci_tr.h" -#include "hci_api.h" -#include "hci_main.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \brief HCI disconnect command. - */ -/*************************************************************************************************/ -void HciDisconnectCmd(uint16_t handle, uint8_t reason) -{ - LlDisconnect(handle, reason); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE add device white list command. - */ -/*************************************************************************************************/ -void HciLeAddDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr) -{ - LlAddDeviceToWhitelist(addrType, pAddr); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE clear white list command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeClearWhiteListCmd(void) -{ - LlClearWhitelist(); -} - -/*************************************************************************************************/ -/*! - * \brief HCI connection update command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeConnUpdateCmd(uint16_t handle, hciConnSpec_t *pConnSpec) -{ - LlConnUpdate(handle, (LlConnSpec_t *)pConnSpec); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE random command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRandCmd(void) -{ - hciLeRandCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_RAND_CMD_CMPL_CBACK_EVT; - evt.hdr.status = HCI_SUCCESS; - - evt.status = HCI_SUCCESS; - - LlGetRandNum(evt.randNum); - - hciCb.secCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read advertising TX power command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadAdvTXPowerCmd(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read buffer size command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadBufSizeCmd(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read channel map command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadChanMapCmd(uint16_t handle) -{ - hciReadChanMapCmdCmplEvt_t evt; - - evt.hdr.param = handle; - evt.hdr.event = HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlGetChannelMap(handle, evt.chanMap); - - evt.handle = handle; - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read local supported feautre command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadLocalSupFeatCmd(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read remote feature command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadRemoteFeatCmd(uint16_t handle) -{ - LlReadRemoteFeat(handle); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read supported states command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadSupStatesCmd(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read white list size command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadWhiteListSizeCmd(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE remove device white list command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRemoveDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr) -{ - LlRemoveDeviceFromWhitelist(addrType, pAddr); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set advanced enable command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetAdvEnableCmd(uint8_t enable) -{ - LlAdvEnable(enable); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set advertising data command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetAdvDataCmd(uint8_t len, uint8_t *pData) -{ - LlSetAdvData(len, pData); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set advertising parameters command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetAdvParamCmd(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, - uint8_t ownAddrType, uint8_t peerAddrType, uint8_t *pPeerAddr, - uint8_t advChanMap, uint8_t advFiltPolicy) -{ - LlSetAdvParam(advIntervalMin, - advIntervalMax, - advType, - ownAddrType, - peerAddrType, - pPeerAddr, - advChanMap, - advFiltPolicy); -} - -/*************************************************************************************************/ -/*! - * \fn HciLeSetHostChanClassCmd - * - * \brief HCI set host channel class command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetHostChanClassCmd(uint8_t *pChanMap) -{ - LlSetChannelMap(pChanMap); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set random address command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetRandAddrCmd(uint8_t *pAddr) -{ - LlSetRandAddr(pAddr); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set scan response data. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetScanRespDataCmd(uint8_t len, uint8_t *pData) -{ - LlSetScanRespData(len, pData); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read BD address command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadBdAddrCmd(void) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI read buffer size command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadBufSizeCmd(void) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI read local supported feature command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadLocalSupFeatCmd(void) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI read local version info command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadLocalVerInfoCmd(void) -{ - hciReadLocalVerInfo_t evt; - - LlGetVersion(&evt.manufacturerName, &evt.hciVersion, &evt.hciRevision); - - evt.hdr.param = 0; - evt.hdr.event = HCI_READ_LOCAL_VER_INFO_CMPL_CBACK_EVT; - evt.hdr.status = HCI_SUCCESS; - evt.status = HCI_SUCCESS; - evt.lmpVersion = evt.hciVersion; /* LMP_Version */ - evt.lmpSubversion = evt.hciRevision; /* LMP_Subversion */ - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read remote version info command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadRemoteVerInfoCmd(uint16_t handle) -{ - LlReadRemoteVerInfo(handle); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read RSSI command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadRssiCmd(uint16_t handle) -{ - hciReadRssiCmdCmplEvt_t evt; - - evt.hdr.param = handle; - evt.hdr.event = HCI_READ_RSSI_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlGetRssi(handle, &evt.rssi); - - evt.handle = handle; - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read Tx power level command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadTxPwrLvlCmd(uint16_t handle, uint8_t type) -{ - hciReadTxPwrLvlCmdCmplEvt_t evt; - - evt.hdr.param = handle; - evt.hdr.event = HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlGetTxPowerLevel(handle, type, &evt.pwrLvl); - - evt.handle = handle; - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI reset command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciResetCmd(void) -{ - LlReset(); -} - -/*************************************************************************************************/ -/*! - * \fn HciLeAddDeviceToResolvingListCmd - * - * \brief HCI add device to resolving list command. - * - * \param peerAddrType Peer identity address type. - * \param pPeerIdentityAddr Peer identity address. - * \param pPeerIrk Peer IRK. - * \param pLocalIrk Local IRK. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeAddDeviceToResolvingListCmd(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr, - const uint8_t *pPeerIrk, const uint8_t *pLocalIrk) -{ - hciLeAddDevToResListCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_ADD_DEV_TO_RES_LIST_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlAddDeviceToResolvingList(peerAddrType, pPeerIdentityAddr, pPeerIrk, pLocalIrk); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI remove device from resolving list command. - * - * \param peerAddrType Peer identity address type. - * \param pPeerIdentityAddr Peer identity address. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRemoveDeviceFromResolvingList(uint8_t peerAddrType, const uint8_t *pPeerIdentityAddr) -{ - hciLeRemDevFromResListCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_REM_DEV_FROM_RES_LIST_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlRemoveDeviceFromResolvingList(peerAddrType, pPeerIdentityAddr); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI clear resolving list command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeClearResolvingList(void) -{ - hciLeClearResListCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_CLEAR_RES_LIST_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlClearResolvingList(); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read resolving list command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadResolvingListSize(void) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI read peer resolvable address command. - * - * \param addrType Peer identity address type. - * \param pIdentityAddr Peer identity address. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadPeerResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) -{ - hciLeReadPeerResAddrCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_READ_PEER_RES_ADDR_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlReadPeerResolvableAddr(addrType, pIdentityAddr, evt.peerRpa); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI read local resolvable address command. - * - * \param addrType Peer identity address type. - * \param pIdentityAddr Peer identity address. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadLocalResolvableAddr(uint8_t addrType, const uint8_t *pIdentityAddr) -{ - hciLeReadLocalResAddrCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_READ_LOCAL_RES_ADDR_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlReadLocalResolvableAddr(addrType, pIdentityAddr, evt.localRpa); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI enable or disable address resolution command. - * - * \param enable Set to TRUE to enable address resolution or FALSE to disable address - * resolution. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetAddrResolutionEnable(uint8_t enable) -{ - hciLeSetAddrResEnableCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_SET_ADDR_RES_ENABLE_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlSetAddrResolutionEnable(enable); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI set resolvable private address timeout command. - * - * \param rpaTimeout Timeout measured in seconds. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetResolvablePrivateAddrTimeout(uint16_t rpaTimeout) -{ - LlSetResolvablePrivateAddrTimeout(rpaTimeout); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set privacy mode command. - * - * \param peerAddrType Peer identity address type. - * \param pPeerAddr Peer identity address. - * \param mode Privacy mode. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetPrivacyModeCmd(uint8_t addrType, uint8_t *pAddr, uint8_t mode) -{ - LlSetPrivacyMode(addrType, pAddr, mode); -} - -/*************************************************************************************************/ -/*! - * \brief HCI vencor specific command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVendorSpecificCmd(uint16_t opcode, uint8_t len, uint8_t *pData) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI Remote Connection Parameter Request Reply. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRemoteConnParamReqReply(uint16_t handle, uint16_t intervalMin, uint16_t intervalMax, uint16_t latency, - uint16_t timeout, uint16_t minCeLen, uint16_t maxCeLen) -{ - LlConnSpec_t connSpec; - - connSpec.connIntervalMax = intervalMax; - connSpec.connIntervalMin = intervalMin; - connSpec.connLatency = latency; - connSpec.maxCeLen = maxCeLen; - connSpec.minCeLen = minCeLen; - connSpec.supTimeout = timeout; - - LlRemoteConnParamReqReply(handle, &connSpec); -} - -/*************************************************************************************************/ -/*! - * \brief HCI Remote Connection Parameter Request Negative Reply. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason) -{ - LlRemoteConnParamReqNegReply(handle, reason); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Set Data Length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetDataLen(uint16_t handle, uint16_t txOctets, uint16_t txTime) -{ - LlSetDataLen(handle, txOctets, txTime); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Read Default Data Length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadDefDataLen(void) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Write Default Data Length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeWriteDefDataLen(uint16_t suggestedMaxTxOctets, uint16_t suggestedMaxTxTime) -{ - LlWriteDefaultDataLen(suggestedMaxTxOctets, suggestedMaxTxTime); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Read Local P-256 Public Key. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadLocalP256PubKey(void) -{ - LlGenerateP256KeyPair(); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Generate DH Key. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeGenerateDHKey(uint8_t *pPubKeyX, uint8_t *pPubKeyY) -{ - LlGenerateDhKey(pPubKeyX, pPubKeyY); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE Read Maximum Data Length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadMaxDataLen(void) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI read authenticated payload timeout command. - * - * \param handle Connection handle. - * - * \return None. - */ -/*************************************************************************************************/ -void HciReadAuthPayloadTimeout(uint16_t handle) -{ - /* not used */ -} - -/*************************************************************************************************/ -/*! - * \brief HCI write authenticated payload timeout command. - * - * \param handle Connection handle. - * \param timeout Timeout value. - * - * \return None. - */ -/*************************************************************************************************/ -void HciWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout) -{ - hciWriteAuthPayloadToCmdCmplEvt_t evt; - - evt.status = LlWriteAuthPayloadTimeout(handle, timeout); - evt.hdr.event = HCI_WRITE_AUTH_PAYLOAD_TO_CMD_CMPL_CBACK_EVT; - evt.handle = handle; - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_ae.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_ae.c deleted file mode 100644 index 4af2f7aaa4cbe43858a9a81d0a0b63800fa33f25..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_ae.c +++ /dev/null @@ -1,318 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI Advertising Extensions (AE) command module. - * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_msg.h" -#include "util/bstream.h" -#include "hci_cmd.h" -#include "hci_api.h" -#include "hci_main.h" -#include "hci_core.h" -#include "wsf_assert.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \brief HCI LE set advertising set random device address command. - * - * \param advHandle Advertising handle. - * \param pAddr Random device address. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetAdvSetRandAddrCmd(uint8_t advHandle, const uint8_t *pAddr) -{ - //LlSetAdvSetRandAddr(advHandle, pAddr); // TODO: Implement LlSetAdvSetRandAddr(advHandle, pAddr) -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set extended advertising parameters command. - * - * \param advHandle Advertising handle. - * \param pExtAdvParam Extended advertising parameters. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetExtAdvParamCmd(uint8_t advHandle, hciExtAdvParam_t *pExtAdvParam) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetExtAdvParam(advHandle, (LlExtAdvParam_t *)pExtAdvParam); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set extended advertising data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param fragPref Fragment preference. - * \param len Data buffer length. - * \param pData Advertising data buffer. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetExtAdvDataCmd(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, - const uint8_t *pData) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetExtAdvData(advHandle, op, fragPref, len, pData); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set extended scan response data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param fragPref Fragment preference. - * \param len Data buffer length. - * \param pData Scan response data buffer. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetExtScanRespDataCmd(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, - const uint8_t *pData) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetExtScanRespData(advHandle, op, fragPref, len, pData); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set extended advertising enable command. - * - * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. - * \param numSets Number of advertising sets. - * \param pEnableParam Advertising enable parameter array. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetExtAdvEnableCmd(uint8_t enable, uint8_t numSets, hciExtAdvEnableParam_t *pEnableParam) -{ - LlExtAdvEnable(enable, numSets, (LlExtAdvEnableParam_t *)pEnableParam); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read maximum advertising data length command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadMaxAdvDataLen(void) -{ - LlReadMaxAdvDataLen(&hciCoreCb.maxAdvDataLen); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read number of supported advertising sets command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeReadNumSupAdvSets(void) -{ - LlReadNumSupAdvSets(&hciCoreCb.numSupAdvSets); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE remove advertising set command. - * - * \param advHandle Advertising handle. - * - * \return Status error code. - */ -/*************************************************************************************************/ -void HciLeRemoveAdvSet(uint8_t advHandle) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlRemoveAdvSet(advHandle); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE clear advertising sets command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeClearAdvSets(void) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlClearAdvSets(); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set periodic advertising parameters command. - * - * \param advHandle Advertising handle. - * \param advIntervalMin Periodic advertising interval minimum. - * \param advIntervalMax Periodic advertising interval maximum. - * \param advProps Periodic advertising properties. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetPerAdvParamCmd(uint8_t advHandle, uint16_t advIntervalMin, uint16_t advIntervalMax, - uint16_t advProps) -{ - LlPerAdvParam_t perAdvParam; - uint8_t status; - - perAdvParam.perAdvInterMin = advIntervalMin; - perAdvParam.perAdvInterMax = advIntervalMax; - perAdvParam.perAdvProp = advProps; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetPeriodicAdvParam(advHandle, &perAdvParam); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set periodic advertising data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param len Data buffer length. - * \param pData Advertising data buffer. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetPerAdvDataCmd(uint8_t advHandle, uint8_t op, uint8_t len, const uint8_t *pData) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetPeriodicAdvData(advHandle, op, len, pData); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE set periodic advertising enable command. - * - * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. - * \param advHandle Advertising handle. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetPerAdvEnableCmd(uint8_t enable, uint8_t advHandle) -{ - LlSetPeriodicAdvEnable(advHandle, enable); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read transmit power command. - * - * \return None. - * - * \todo Implement LlReadTxPower(). - */ -/*************************************************************************************************/ -void HciLeReadTxPower(void) -{ - /* TODO: Send the levels in an event */ - int8_t minTxPower, maxTxPower; - LlReadTxPower(&minTxPower, &maxTxPower); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE read RF path compensation command. - * - * \return None. - * - * \todo Implement LlReadRfPathComp(). - */ -/*************************************************************************************************/ -void HciLeReadRfPathComp(void) -{ - /* TODO: Send the levels in an event */ - int16_t txPathComp, rxPathComp; - LlReadRfPathComp(&txPathComp, &rxPathComp); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE write RF path compensation command. - * - * \param txPathComp RF transmit path compensation value. - * \param rxPathComp RF receive path compensation value. - * - * \return None. - * - * \todo Implement LlWriteRfPathComp(). - */ -/*************************************************************************************************/ -void HciLeWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp) -{ - LlWriteRfPathComp(txPathComp, rxPathComp); -} - diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_enc.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_enc.c deleted file mode 100644 index e30950b3cf7adb966aa99a847c8822288c2ee177..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_enc.c +++ /dev/null @@ -1,92 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI command module. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_assert.h" -#include "wsf_queue.h" -#include "wsf_timer.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "util/calc128.h" -#include "hci_cmd.h" -#include "hci_tr.h" -#include "hci_api.h" -#include "hci_main.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \brief HCI LE encrypt command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeEncryptCmd(uint8_t *pKey, uint8_t *pData) -{ - hciLeEncryptCmdCmplEvt_t evt; - uint8_t status; - (void)status; - - status = LlEncrypt(pKey, pData); - WSF_ASSERT(status == LL_SUCCESS); - evt.hdr.event = HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT; - evt.status = evt.hdr.status = status; - Calc128Cpy(evt.data, pData); - hciCb.secCback((hciEvt_t *) &evt); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE long term key request negative reply command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeLtkReqNegReplCmd(uint16_t handle) -{ - LlLtkReqNegReply(handle); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE long term key request reply command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeLtkReqReplCmd(uint16_t handle, uint8_t *pKey) -{ - LlLtkReqReply(handle, pKey); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE start encryption command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeStartEncryptionCmd(uint16_t handle, uint8_t *pRand, uint16_t diversifier, uint8_t *pKey) -{ - LlStartEncryption(handle, pRand, diversifier, pKey); -} - diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master.c deleted file mode 100644 index 1fe928ce956d8376eab8b9d3345e843d4616fb7a..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master.c +++ /dev/null @@ -1,107 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI command module for master. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_assert.h" -#include "wsf_queue.h" -#include "wsf_timer.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "hci_cmd.h" -#include "hci_tr.h" -#include "hci_api.h" -#include "hci_main.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \brief HCI LE set scan enable command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetScanEnableCmd(uint8_t enable, uint8_t filterDup) -{ - LlScanEnable(enable, filterDup); -} - -/*************************************************************************************************/ -/*! - * \brief HCI set scan parameters command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetScanParamCmd(uint8_t scanType, uint16_t scanInterval, uint16_t scanWindow, - uint8_t ownAddrType, uint8_t scanFiltPolicy) -{ - LlScanParam_t param; - uint8_t status; - (void)status; - - param.scanType = scanType; - param.scanInterval = scanInterval; - param.scanWindow = scanWindow; - param.ownAddrType = ownAddrType; - param.scanFiltPolicy = scanFiltPolicy; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetScanParam(¶m); - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE create connection command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeCreateConnCmd(uint16_t scanInterval, uint16_t scanWindow, uint8_t filterPolicy, - uint8_t peerAddrType, uint8_t *pPeerAddr, uint8_t ownAddrType, - hciConnSpec_t *pConnSpec) -{ - LlInitParam_t initParam; - - initParam.scanInterval = scanInterval; - initParam.scanWindow = scanWindow; - initParam.filterPolicy = filterPolicy; - initParam.ownAddrType = ownAddrType; - initParam.peerAddrType = peerAddrType; - initParam.pPeerAddr = pPeerAddr; - - LlCreateConn(&initParam, (LlConnSpec_t *)pConnSpec); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE create connection cancel command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeCreateConnCancelCmd(void) -{ - LlCreateConnCancel(); -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master_ae.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master_ae.c deleted file mode 100644 index 03cc35bef61c214d5b4293141a446bf1ac2dfcd1..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_master_ae.c +++ /dev/null @@ -1,292 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI Advertising Extensions (AE) command module for master. - * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include <limits.h> -#include "wsf_types.h" -#include "wsf_assert.h" -#include "wsf_queue.h" -#include "wsf_timer.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "hci_cmd.h" -#include "hci_tr.h" -#include "hci_api.h" -#include "hci_main.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \brief HCI LE set extended scanning parameters command. - * - * \param ownAddrType Address type used by this device. - * \param scanFiltPolicy Scan filter policy. - * \param scanPhys Scanning PHYs. - * \param pScanParam Scanning parameter array. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetExtScanParamCmd( - uint8_t ownAddrType, - uint8_t scanFiltPolicy, - uint8_t scanPhys, - hciExtScanParam_t *pScanParam) -{ - LlExtScanParam_t param; - uint8_t status; - - uint8_t scanPhysIndex; - uint8_t scanPhysBit; - - hciExtScanParam_t * pScanParamIter; - - WSF_ASSERT((sizeof(scanPhys) * CHAR_BIT) >= LL_MAX_NUM_PHYS); - - param.ownAddrType = ownAddrType; - param.scanFiltPolicy = scanFiltPolicy; - - pScanParamIter = pScanParam; - for (scanPhysIndex = 0, scanPhysBit = 1; - scanPhysIndex < LL_MAX_NUM_PHYS; - scanPhysIndex ++, scanPhysBit <<= 1) - { - if ((scanPhys & scanPhysBit) == 0) - { - param.phys[scanPhysIndex] = FALSE; - memset(¶m.phyParam[scanPhysIndex], - '\0', - sizeof(param.phyParam[scanPhysIndex])); - } - else - { - param.phys[scanPhysIndex] = TRUE; - param.phyParam[scanPhysIndex].scanType = pScanParamIter->scanType; - param.phyParam[scanPhysIndex].scanInterval = pScanParamIter->scanInterval; - param.phyParam[scanPhysIndex].scanWindow = pScanParamIter->scanWindow; - pScanParamIter++; - } - } - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlSetExtScanParam((LlExtScanParam_t *)¶m); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE extended scan enable command. - * - * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. - * \param filterDup Set to TRUE to filter duplicates. - * \param duration Duration. - * \param period Period. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeExtScanEnableCmd(uint8_t enable, uint8_t filterDup, uint16_t duration, uint16_t period) -{ - LlExtScanEnable(enable, filterDup, duration, period); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE extended create connection command. - * - * \param pInitParam Initiating parameters. - * \param pScanParam Initiating scan parameters. - * \param pConnSpec Connection specification. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeExtCreateConnCmd(hciExtInitParam_t *pInitParam, hciExtInitScanParam_t *pScanParam, - hciConnSpec_t *pConnSpec) -{ - uint8_t status; - (void)status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlExtCreateConn( - (LlExtInitParam_t *)pInitParam, - (LlExtInitScanParam_t *)pScanParam, - (LlConnSpec_t *)pConnSpec); - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE periodic advertising create sync command. - * - * \param filterPolicy Filter policy. - * \param advSid Advertising SID. - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param skip Number of periodic advertising packets that can be skipped after - * successful receive. - * \param syncTimeout Synchronization timeout. - * \param unused Reserved for future use (must be zero). - * - * \return None. - */ -/*************************************************************************************************/ -void HciLePerAdvCreateSyncCmd(uint8_t filterPolicy, uint8_t advSid, uint8_t advAddrType, - uint8_t *pAdvAddr, uint16_t skip, uint16_t syncTimeout, uint8_t unused) -{ - LlPerAdvCreateSyncCmd_t param; - uint8_t status; - (void)status; - - param.filterPolicy = filterPolicy; - param.advSID = advSid; - param.advAddrType = advAddrType; - param.pAdvAddr = pAdvAddr; - param.skip = skip; - param.syncTimeOut = syncTimeout; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlPeriodicAdvCreateSync(¶m); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE periodic advertising create sync cancel command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLePerAdvCreateSyncCancelCmd(void) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlPeriodicAdvCreateSyncCancel(); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE periodic advertising terminate sync command. - * - * \param syncHandle Sync handle. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLePerAdvTerminateSyncCmd(uint16_t syncHandle) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlPeriodicAdvTerminateSync(syncHandle); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE add device to periodic advertiser list command. - * - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param advSid Advertising SID. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeAddDeviceToPerAdvListCmd(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) -{ - LlDevicePerAdvList_t param; - uint8_t status; - - param.advAddrType = advAddrType; - param.pAdvAddr = pAdvAddr; - param.advSID = advSid; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlAddDeviceToPeriodicAdvList(¶m); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE remove device from periodic advertiser list command. - * - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param advSid Advertising SID. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeRemoveDeviceFromPerAdvListCmd(uint8_t advAddrType, uint8_t *pAdvAddr, uint8_t advSid) -{ - LlDevicePerAdvList_t param; - uint8_t status; - - param.advAddrType = advAddrType; - param.pAdvAddr = pAdvAddr; - param.advSID = advSid; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlRemoveDeviceFromPeriodicAdvList(¶m); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} - -/*************************************************************************************************/ -/*! - * \brief HCI LE clear periodic advertiser list command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeClearPerAdvListCmd(void) -{ - uint8_t status; - - /* return value used when asserts are enabled */ - /* coverity[returned_value] */ - status = LlClearPeriodicAdvList(); - (void)status; - - WSF_ASSERT(status == LL_SUCCESS); -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_phy.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_phy.c deleted file mode 100644 index d7156ff39b261fbef1b36bd018cb6881dbaf69f1..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_cmd_phy.c +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI PHY command module. - * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_msg.h" -#include "util/bstream.h" -#include "hci_cmd.h" -#include "hci_api.h" -#include "hci_main.h" - -#include "ll_api.h" - -/*************************************************************************************************/ -/*! -* \brief HCI read PHY command. -* -* \return None. -*/ -/*************************************************************************************************/ -void HciLeReadPhyCmd(uint16_t handle) -{ - hciLeReadPhyCmdCmplEvt_t evt; - - evt.hdr.param = handle; - evt.hdr.event = HCI_LE_READ_PHY_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlReadPhy(handle, &evt.txPhy, &evt.rxPhy); - - evt.handle = handle; - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! -* \brief HCI set default PHY command. -* -* \return None. -*/ -/*************************************************************************************************/ -void HciLeSetDefaultPhyCmd(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys) -{ - hciLeSetDefPhyCmdCmplEvt_t evt; - - evt.hdr.param = 0; - evt.hdr.event = HCI_LE_SET_DEF_PHY_CMD_CMPL_CBACK_EVT; - evt.hdr.status = LlSetDefaultPhy(allPhys, txPhys, rxPhys); - - evt.status = evt.hdr.status; - - hciCb.evtCback((hciEvt_t *)&evt); -} - -/*************************************************************************************************/ -/*! -* \brief HCI set PHY command. -* -* \return None. -*/ -/*************************************************************************************************/ -void HciLeSetPhyCmd(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions) -{ - LlSetPhy(handle, allPhys, txPhys, rxPhys, phyOptions); -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.c deleted file mode 100644 index 05fe439955a2caeee4a50898d7e3b0b0128bf86e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.c +++ /dev/null @@ -1,622 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI core platform-specific module single-chip. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "util/bda.h" -#include "util/bstream.h" -#include "hci_core.h" -#include "hci_tr.h" -#include "hci_cmd.h" -#include "hci_evt.h" -#include "hci_api.h" -#include "hci_main.h" - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -/************************************************************************************************** - Local Variables -**************************************************************************************************/ - -static uint32_t hciEvtMask; /* Controller Event Mask */ -static uint32_t hciLeEvtMask; /* Controller LE Event Mask */ -static bool_t hciEvtMaskMeta; /* Controller Meta bit Event Mask */ - -/*************************************************************************************************/ -/*! - * \brief HCI core initialization. - * - * \return None. - */ -/*************************************************************************************************/ -void hciCoreInit(void) -{ - LlEvtRegister(hciCoreEvtProcessLlEvt); - LlAclRegister(hciCoreNumCmplPkts, hciCoreAclRecvPending); - - /* synchronize with LL */ - hciCoreCb.numBufs = LlGetAclTxBufs(); - hciCoreCb.availBufs = LlGetAclTxBufs(); - hciCoreCb.bufSize = LlGetAclMaxSize(); - hciCoreCb.leSupFeat = HciGetLeSupFeat(); - - /* if LL Privacy is supported by Controller and included */ - if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_PRIVACY) && - (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_PRIVACY)) - { - LlReadResolvingListSize(&hciCoreCb.resListSize); - } - else - { - hciCoreCb.resListSize = 0; - } - - /* if LE Extended Advertising is supported by Controller and included */ - if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_EXT_ADV) && - (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_EXT_ADV)) - { - LlReadMaxAdvDataLen(&hciCoreCb.maxAdvDataLen); - LlReadNumSupAdvSets(&hciCoreCb.numSupAdvSets); - } - else - { - hciCoreCb.maxAdvDataLen = 0; - hciCoreCb.numSupAdvSets = 0; - } - - /* set the event masks to the default events */ - hciEvtMask = ((0x1 << LL_RESET_CNF) | - (0x1 << LL_ADV_ENABLE_CNF) | - (0x1 << LL_SCAN_ENABLE_CNF) | - (0x1 << LL_DISCONNECT_IND) | - (0x1 << LL_READ_REMOTE_VER_INFO_CNF) | - (0x1 << LL_ENC_CHANGE_IND) | - (0x1 << LL_ENC_KEY_REFRESH_IND) | - (0x1 << LL_EXT_ADV_ENABLE_CNF) | - (0x1 << LL_ADV_SET_TERM_IND) | - (0x1 << LL_PER_ADV_ENABLE_CNF) | - (0x1 << LL_ERROR_IND)); - - hciLeEvtMask = ((0x1 << LL_CONN_IND) | - (0x1 << LL_ADV_REPORT_IND) | - (0x1 << LL_CONN_UPDATE_IND) | - (0x1 << LL_READ_REMOTE_FEAT_CNF) | - (0x1 << LL_LTK_REQ_IND)); - - hciEvtMaskMeta = 0; -} - -/*************************************************************************************************/ -/*! - * \brief Process received HCI events. - * - * \param pEvt Buffer containing LL event. - * - * \return Always TRUE. - */ -/*************************************************************************************************/ -bool_t hciCoreEvtProcessLlEvt(LlEvt_t *pEvt) -{ - LlEvt_t *pMsg; - uint8_t msgLen = sizeof(LlEvt_t); - - /* Check to see if the event is unmasked */ - if ((hciEvtMask & (0x1 << pEvt->hdr.event)) || (hciEvtMaskMeta && (hciLeEvtMask & (0x1 << pEvt->hdr.event)))) - { - switch (pEvt->hdr.event) - { - case LL_EXT_ADV_REPORT_IND: - msgLen += pEvt->extAdvReportInd.len; - break; - - case LL_ADV_REPORT_IND: - msgLen += pEvt->advReportInd.len; - break; - - default: - break; - } - - if ((pMsg = WsfMsgAlloc(msgLen)) != NULL) - { - /* copy event to message buffer */ - memcpy(pMsg, pEvt, sizeof(LlEvt_t)); - - switch (pEvt->hdr.event) - { - case LL_ADV_REPORT_IND: - pMsg->advReportInd.pData = (uint8_t *) (pMsg+1); - memcpy(pMsg->advReportInd.pData, pEvt->advReportInd.pData, pEvt->advReportInd.len); - break; - - case LL_EXT_ADV_REPORT_IND: - pMsg->extAdvReportInd.pData = (uint8_t *) (pMsg+1); - memcpy((uint8_t *)pMsg->extAdvReportInd.pData, pEvt->extAdvReportInd.pData, pEvt->extAdvReportInd.len); - break; - - default: - break; - } - - WsfMsgEnq(&hciCb.rxQueue, HCI_EVT_TYPE, pMsg); - WsfSetEvent(hciCb.handlerId, HCI_EVT_RX); - } - } - else - { - /* The event is masked. For some events, the LL must be notified or other action taken. */ - switch (pEvt->hdr.event) - { - case LL_ENH_CONN_IND: - /* If Enhanced Connection Complete is masked, send Connection Complete instead. */ - if ((pMsg = WsfMsgAlloc(sizeof(*pMsg))) != NULL) - { - /* copy event to message buffer */ - memcpy(pMsg, pEvt, sizeof(LlEvt_t)); - - pMsg->hdr.event = LL_CONN_IND; - - WsfMsgEnq(&hciCb.rxQueue, HCI_EVT_TYPE, pMsg); - WsfSetEvent(hciCb.handlerId, HCI_EVT_RX); - } - break; - case LL_REM_CONN_PARAM_IND: - LlRemoteConnParamReqNegReply(pEvt->hdr.param, LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE); - break; - case LL_LTK_REQ_IND: - LlLtkReqNegReply(pEvt->hdr.param); - break; - } - } - - return TRUE; -} - -/*************************************************************************************************/ -/*! - * \brief LL ACL receive buffer pending handler. - * - * \param handle Connection handle. - * \param numBufs Number of buffers completed. - * - * \return None. - */ -/*************************************************************************************************/ -void hciCoreAclRecvPending(uint16_t handle, uint8_t numBufs) -{ - uint8_t *pBuf; - - while ((pBuf = LlRecvAclData()) != NULL) - { - WsfMsgEnq(&hciCb.rxQueue, HCI_ACL_TYPE, pBuf); - LlRecvAclDataComplete(1); - } - - WsfSetEvent(hciCb.handlerId, HCI_EVT_RX); -} - -/*************************************************************************************************/ -/*! - * \brief Handle an HCI Number of Completed Packets event. - * - * \param pMsg Message containing the HCI Number of Completed Packets event. - * - * \return None. - */ -/*************************************************************************************************/ -void hciCoreNumCmplPkts(uint16_t handle, uint8_t numBufs) -{ - hciCoreConn_t *pConn; - - if ((pConn = hciCoreConnByHandle(handle)) != NULL) - { - /* decrement outstanding buffer count to controller */ - pConn->outBufs -= (uint8_t) numBufs; - - /* decrement queued buffer count for this connection */ - pConn->queuedBufs -= (uint8_t) numBufs; - - /* call flow control callback */ - if (pConn->flowDisabled && pConn->queuedBufs <= hciCoreCb.aclQueueLo) - { - pConn->flowDisabled = FALSE; - (*hciCb.flowCback)(handle, FALSE); - } - - /* service TX data path */ - hciCoreTxReady(numBufs); - } -} - -/*************************************************************************************************/ -/*! - * \brief WSF event handler for core HCI. - * - * \param event WSF event mask. - * \param pMsg WSF message. - * - * \return None. - */ -/*************************************************************************************************/ -void HciCoreHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) -{ - uint8_t *pBuf; - wsfHandlerId_t handlerId; - - /* Handle events */ - if (event & HCI_EVT_RX) - { - /* Process rx queue */ - while ((pBuf = WsfMsgDeq(&hciCb.rxQueue, &handlerId)) != NULL) - { - /* Handle incoming HCI events */ - if (handlerId == HCI_EVT_TYPE) - { - /* Parse/process events */ - hciEvtProcessMsg(pBuf); - - /* Free buffer */ - WsfMsgFree(pBuf); - } - /* Handle ACL data */ - else - { - /* Reassemble */ - if ((pBuf = hciCoreAclReassembly(pBuf)) != NULL) - { - /* Call ACL callback; client will free buffer */ - hciCb.aclCback(pBuf); - } - } - } - } -} - -/*************************************************************************************************/ -/*! - * \brief Return a pointer to the BD address of this device. - * - * \return Pointer to the BD address. - */ -/*************************************************************************************************/ -uint8_t *HciGetBdAddr(void) -{ - return hciCoreCb.bdAddr; -} - -/*************************************************************************************************/ -/*! - * \brief Return the white list size. - * - * \return White list size. - */ -/*************************************************************************************************/ -uint8_t HciGetWhiteListSize(void) -{ - return LlGetWhitelistSize(); -} - -/*************************************************************************************************/ -/*! - * \brief Return the advertising transmit power. - * - * \return Advertising transmit power. - */ -/*************************************************************************************************/ -int8_t HciGetAdvTxPwr(void) -{ - int8_t advTxPwr = 0; - LlGetAdvTxPower(&advTxPwr); - return advTxPwr; -} - -/*************************************************************************************************/ -/*! - * \brief Return the ACL buffer size supported by the controller. - * - * \return ACL buffer size. - */ -/*************************************************************************************************/ -uint16_t HciGetBufSize(void) -{ - return hciCoreCb.bufSize; -} - -/*************************************************************************************************/ -/*! - * \brief Return the number of ACL buffers supported by the controller. - * - * \return Number of ACL buffers. - */ -/*************************************************************************************************/ -uint8_t HciGetNumBufs(void) -{ - return hciCoreCb.numBufs; -} - -/*************************************************************************************************/ -/*! - * \brief Return the states supported by the controller. - * - * \return Pointer to the supported states array. - */ -/*************************************************************************************************/ -uint8_t *HciGetSupStates(void) -{ - static uint8_t supStates[8]; - - LlGetSupStates(supStates); - - return supStates; -} - -/*************************************************************************************************/ -/*! - * \brief Return the LE supported features supported by the controller. - * - * \return Supported features. - */ -/*************************************************************************************************/ -uint16_t HciGetLeSupFeat(void) -{ - uint16_t supFeat; - uint8_t feat[HCI_LE_STATES_LEN]; - - LlGetFeatures(feat); - - BYTES_TO_UINT16(supFeat, feat); - - return supFeat; -} - -/*************************************************************************************************/ -/*! - * \brief Get the maximum reassembled RX ACL packet length. - * - * \return ACL packet length. - */ -/*************************************************************************************************/ -uint16_t HciGetMaxRxAclLen(void) -{ - return hciCoreCb.maxRxAclLen; -} - -/*************************************************************************************************/ -/*! - * \brief Return the resolving list size. - * - * \return resolving list size. - */ -/*************************************************************************************************/ -uint8_t HciGetResolvingListSize(void) -{ - return hciCoreCb.resListSize; -} - -/*************************************************************************************************/ -/*! -* \brief Whether LL Privacy is supported. -* -* \return TRUE if LL Privacy is supported. FALSE, otherwise. -*/ -/*************************************************************************************************/ -bool_t HciLlPrivacySupported(void) -{ - return (hciCoreCb.resListSize > 0) ? TRUE : FALSE; -} - -/*************************************************************************************************/ -/*! -* \brief Get the maximum advertisement (or scan response) data length supported by the Controller. -* -* \return Maximum advertisement data length. -*/ -/*************************************************************************************************/ -uint16_t HciGetMaxAdvDataLen(void) -{ - return hciCoreCb.maxAdvDataLen; -} - -/*************************************************************************************************/ -/*! -* \brief Get the maximum number of advertising sets supported by the Controller. -* -* \return Maximum number of advertising sets. -*/ -/*************************************************************************************************/ -uint8_t HciGetNumSupAdvSets(void) -{ - return hciCoreCb.numSupAdvSets; -} - -/*************************************************************************************************/ -/*! -* \brief Whether LE Advertising Extensions is supported. -* -* \return TRUE if LE Advertising Extensions is supported. FALSE, otherwise. -*/ -/*************************************************************************************************/ -bool_t HciLeAdvExtSupported(void) -{ - return (hciCoreCb.numSupAdvSets > 0) ? TRUE : FALSE; -} - -/*************************************************************************************************/ -/*! - * \fn HciLeSetEventMaskCmd - * - * \brief HCI LE set event mask command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciLeSetEventMaskCmd(uint8_t *pLeEventMask) -{ - // Translate the HCI_EVT_MASK_LE to the LL Events - if (pLeEventMask[0] & HCI_EVT_MASK_LE_CONN_CMPL_EVT) { - hciLeEvtMask |= (0x1 << LL_CONN_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_CONN_IND); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_ADV_REPORT_EVT) { - hciLeEvtMask |= (0x1 << LL_ADV_REPORT_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_ADV_REPORT_IND); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT) { - hciLeEvtMask |= (0x1 << LL_CONN_UPDATE_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_CONN_UPDATE_IND); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT) { - hciLeEvtMask |= (0x1 << LL_READ_REMOTE_FEAT_CNF); - } else { - hciLeEvtMask &= ~(0x1 << LL_READ_REMOTE_FEAT_CNF); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_LTK_REQ_EVT) { - hciLeEvtMask |= (0x1 << LL_LTK_REQ_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_LTK_REQ_IND); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_REMOTE_CONN_PARAM_REQ_EVT) { - hciLeEvtMask |= (0x1 << LL_REM_CONN_PARAM_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_REM_CONN_PARAM_IND); - } - if (pLeEventMask[0] & HCI_EVT_MASK_LE_DATA_LEN_CHANGE_EVT) { - hciLeEvtMask |= (0x1 << LL_DATA_LEN_CHANGE_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_DATA_LEN_CHANGE_IND); - } - if (pLeEventMask[1] & HCI_EVT_MASK_LE_ENHANCED_CONN_CMPL_EVT) { - hciLeEvtMask |= (0x1 << LL_ENH_CONN_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_ENH_CONN_IND); - } - if (pLeEventMask[1] & HCI_EVT_MASK_LE_DIRECT_ADV_REPORT_EVT) { - hciLeEvtMask |= (0x1 << LL_DIR_ADV_REPORT_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_DIR_ADV_REPORT_IND); - } - if (pLeEventMask[1] & HCI_EVT_MASK_LE_EXT_ADV_REPORT_EVT) { - hciLeEvtMask |= (0x1 << LL_EXT_ADV_REPORT_IND); - } else { - hciLeEvtMask &= ~(0x1 << LL_EXT_ADV_REPORT_IND); - } - if (pLeEventMask[1] & HCI_EVT_MASK_LE_EXT_ADV_REPORT_EVT) { - hciLeEvtMask |= (0x1 << LL_EXT_SCAN_ENABLE_CNF); - } else { - hciLeEvtMask &= ~(0x1 << LL_EXT_SCAN_ENABLE_CNF); - } -} - -/*************************************************************************************************/ -/*! - * \fn HciSetEventMaskCmd - * - * \brief HCI set event mask command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciSetEventMaskCmd(uint8_t *pEventMask) -{ - // Translate the HCI_EVT_MASK to the LL Events - if (pEventMask[0] & HCI_EVT_MASK_DISCONNECT_CMPL) { - hciEvtMask |= (0x1 << LL_DISCONNECT_IND); - } else { - hciEvtMask &= ~(0x1 << LL_DISCONNECT_IND); - } - if (pEventMask[0] & HCI_EVT_MASK_ENC_CHANGE) { - hciEvtMask |= (0x1 << LL_ENC_CHANGE_IND); - } else { - hciEvtMask &= ~(0x1 << LL_ENC_CHANGE_IND); - } - if (pEventMask[1] & HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL) { - hciEvtMask |= (0x1 << LL_READ_REMOTE_VER_INFO_CNF); - } else { - hciEvtMask &= ~(0x1 << LL_READ_REMOTE_VER_INFO_CNF); - } - if (pEventMask[1] & HCI_EVT_MASK_HW_ERROR) { - hciEvtMask |= (0x1 << LL_ERROR_IND); - } else { - hciEvtMask &= ~(0x1 << LL_ERROR_IND); - } - if (pEventMask[5] & HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL) { - hciEvtMask |= (0x1 << LL_ENC_KEY_REFRESH_IND); - } else { - hciEvtMask &= ~(0x1 << LL_ENC_KEY_REFRESH_IND); - } - if (pEventMask[7] & HCI_EVT_MASK_LE_META) { - hciEvtMaskMeta = 1; - } else { - hciEvtMaskMeta = 0; - } -} - -/*************************************************************************************************/ -/*! - * \fn HciSetEventMaskPage2Cmd - * - * \brief HCI set event mask Page 2 command. - * - * \return None. - */ -/*************************************************************************************************/ -void HciSetEventMaskPage2Cmd(uint8_t *pEventMask) -{ - // Translate the HCI_EVT_MASK to the LL Events - if (pEventMask[2] & HCI_EVT_MASK_AUTH_PAYLOAD_TIMEOUT) { - hciEvtMask |= (0x1 << LL_AUTH_PAYLOAD_TIMEOUT_IND); - } else { - hciEvtMask &= ~(0x1 << LL_AUTH_PAYLOAD_TIMEOUT_IND); - } -} - -/*************************************************************************************************/ -/*! - * \fn HciGetLeSugDataLenCmd - * - * \brief Returns the suggested maximum TX octets and time. - * - * \return Status code. - */ -/*************************************************************************************************/ -void HciLeGetDefDataLen(uint16_t *txOctets, uint16_t *txTime) -{ - LlReadDefaulTxDataLen(txOctets, txTime); -} - -/*************************************************************************************************/ -/*! - * \fn HciGetLeMaxDataLenCmd - * - * \brief Returns the maximum TX and RX octets and time - * - * \return Status code. - */ -/*************************************************************************************************/ -void HciLeGetMaxDataLen(uint16_t *txOctets, uint16_t *txTime, uint16_t *rxOctets, uint16_t *rxTime) -{ - LlReadMaximumDataLen(txOctets, txTime, rxOctets, rxTime); -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.h b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.h deleted file mode 100644 index 4fee7a12c5c4aac1cd3dfd4f7d630f7d1f96562c..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_core_ps.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI core platform-specific interfaces for for single-chip. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ -#ifndef HCI_CORE_PS_H -#define HCI_CORE_PS_H - -#include "ll_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -void hciCoreNumCmplPkts(uint16_t handle, uint8_t numBufs); -bool_t hciCoreEvtProcessLlEvt(LlEvt_t *pEvt); -void hciCoreAclRecvPending(uint16_t handle, uint8_t numBufs); - -#ifdef __cplusplus -}; -#endif - -#endif /* HCI_CORE_PS_H */ diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_evt.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_evt.c deleted file mode 100644 index 506bcf0ce986d141ba7e09ab57413c18974b3364..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_evt.c +++ /dev/null @@ -1,209 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI event module. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_buf.h" -#include "wsf_msg.h" -#include "wsf_trace.h" -#include "wsf_assert.h" -#include "util/bstream.h" -#include "hci_api.h" -#include "hci_main.h" -#include "hci_evt.h" -#include "hci_cmd.h" -#include "hci_core.h" -#include "ll_api.h" - -/************************************************************************************************** - Local Variables -**************************************************************************************************/ - -/*! LL event to HCI callback event lookup table. */ -static const uint8_t hciEvtLookup[] = -{ - HCI_HW_ERROR_CBACK_EVT, /* LL_ERROR_IND */ - /* --- Core Spec 4.0 --- */ - HCI_RESET_SEQ_CMPL_CBACK_EVT, /* LL_RESET_CNF */ - HCI_LE_ADV_REPORT_CBACK_EVT, /* LL_ADV_REPORT_IND */ - HCI_LE_ADV_ENABLE_CMPL_CBACK_EVT, /* LL_ADV_ENABLE_CNF */ - HCI_LE_SCAN_ENABLE_CMPL_CBACK_EVT, /* LL_SCAN_ENABLE_CNF */ - HCI_LE_CONN_CMPL_CBACK_EVT, /* LL_CONN_IND */ - HCI_DISCONNECT_CMPL_CBACK_EVT, /* LL_DISCONNECT_IND */ - HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT, /* LL_CONN_UPDATE_IND */ - HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT, /* LL_CREATE_CONN_CANCEL_CNF */ - HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT, /* LL_READ_REMOTE_VER_INFO_CNF */ - HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT, /* LL_READ_REMOTE_FEAT_CNF */ - HCI_ENC_CHANGE_CBACK_EVT, /* LL_ENC_CHANGE_IND */ - HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT, /* LL_ENC_KEY_REFRESH_IND */ - HCI_LE_LTK_REQ_CBACK_EVT, /* LL_LTK_REQ_IND */ - HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT, /* LL_LTK_REQ_NEG_REPLY_CNF */ - HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT, /* LL_LTK_REQ_REPLY_CNF */ - /* --- Core Spec 4.2 --- */ - HCI_LE_REM_CONN_PARAM_REQ_CBACK_EVT, /* LL_REM_CONN_PARAM_IND */ - HCI_AUTH_PAYLOAD_TO_EXPIRED_CBACK_EVT, /* LL_AUTH_PAYLOAD_TIMEOUT_IND */ - HCI_LE_DATA_LEN_CHANGE_CBACK_EVT, /* LL_DATA_LEN_CHANGE_IND */ - HCI_LE_READ_LOCAL_P256_PUB_KEY_CMPL_CBACK_EVT, /* LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND */ - HCI_LE_GENERATE_DHKEY_CMPL_CBACK_EVT, /* LL_GENERATE_DHKEY_CMPL_IND */ - 0, /* LL_SCAN_REPORT_IND */ - HCI_LE_ENHANCED_CONN_CMPL_CBACK_EVT, /* LL_ENH_CONN_IND */ - HCI_LE_ADV_REPORT_CBACK_EVT, /* LL_DIR_ADV_REPORT_IND */ - /* --- Core Spec 5.0 --- */ - HCI_LE_PHY_UPDATE_CMPL_CBACK_EVT, /* LL_PHY_UPDATE_IND */ - HCI_LE_EXT_ADV_REPORT_CBACK_EVT, /* LL_EXT_ADV_REPORT_IND */ - HCI_LE_EXT_SCAN_ENABLE_CMPL_CBACK_EVT, /* LL_EXT_SCAN_ENABLE_CNF */ - HCI_LE_SCAN_TIMEOUT_CBACK_EVT, /* LL_SCAN_TIMEOUT_IND */ - HCI_LE_SCAN_REQ_RCVD_CBACK_EVT, /* LL_SCAN_REQ_RCVD_IND */ - HCI_LE_EXT_ADV_ENABLE_CMPL_CBACK_EVT, /* LL_EXT_ADV_ENABLE_CNF */ - HCI_LE_ADV_SET_TERM_CBACK_EVT, /* LL_ADV_SET_TERM_IND */ - HCI_LE_PER_ADV_ENABLE_CMPL_CBACK_EVT, /* LL_PER_ADV_ENABLE_CNF */ - HCI_LE_PER_ADV_SYNC_EST_CBACK_EVT, /* LL_PER_ADV_SYNC_ESTD_IND */ - HCI_LE_PER_ADV_SYNC_LOST_CBACK_EVT, /* LL_PER_ADV_SYNC_LOST_IND */ - HCI_LE_PER_ADV_REPORT_CBACK_EVT, /* LL_PER_ADV_REPORT_IND */ - HCI_LE_CH_SEL_ALGO_CBACK_EVT /* LL_CH_SEL_ALGO_IND */ -}; - -/* Create compile time error if HCI callback event table in hci_evt.c does not match ll_api.h. */ -WSF_CT_ASSERT(((sizeof(hciEvtLookup)/sizeof(hciEvtLookup[0])) == (LL_API_EVENT_COUNT))); - -/*************************************************************************************************/ -/*! - * \brief Process received HCI events. - * - * \param pEvt Buffer containing HCI event. - * - * \return None. - */ -/*************************************************************************************************/ -void hciEvtProcessMsg(uint8_t *pEvt) -{ - LlEvt_t *pMsg = (LlEvt_t *)pEvt; - - uint8_t event = pMsg->hdr.event; - - /* convert hci event code to internal event code and perform special handling */ - switch (event) - { - case LL_RESET_CNF: - /* restore event masks */ - HciSetEventMaskCmd((uint8_t *) hciEventMask); - HciLeSetEventMaskCmd((uint8_t *) hciLeEventMask); - HciSetEventMaskPage2Cmd((uint8_t *)hciEventMaskPage2); - - /* restore LL state */ - LlGetBdAddr(hciCoreCb.bdAddr); - - /* if LE Data Packet Length Extensions is supported by Controller and included */ - if ((HciGetLeSupFeat() & HCI_LE_SUP_FEAT_DATA_LEN_EXT) && - (hciLeSupFeatCfg & HCI_LE_SUP_FEAT_DATA_LEN_EXT)) - { - uint16_t maxTxOctets; - uint16_t maxTxTime; - uint16_t maxRxOctets; - uint16_t maxRxTime; - - LlReadMaximumDataLen(&maxTxOctets, &maxTxTime, &maxRxOctets, &maxRxTime); - - /* Use Controller's maximum supported payload octets and packet duration times - * for transmission as Host's suggested values for maximum transmission number - * of payload octets and maximum packet transmission time for new connections. - */ - LlWriteDefaultDataLen(maxTxOctets, maxTxTime); - } - - /* reset internals */ - hciCoreCb.availBufs = hciCoreCb.numBufs; - if (hciCb.secCback) - { - HciLeRandCmd(); - HciLeRandCmd(); - } - hciCb.resetting = FALSE; - - /* propagate reset */ - pMsg->hdr.event = HCI_RESET_SEQ_CMPL_CBACK_EVT; - hciCb.evtCback((hciEvt_t *)pMsg); - break; - - case LL_GENERATE_DHKEY_CMPL_IND: - case LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND: - if (hciCb.secCback) - { - pMsg->hdr.event = hciEvtLookup[pMsg->hdr.event]; - hciCb.secCback((hciEvt_t *)pMsg); - } - break; - - case LL_CONN_IND: - case LL_ENH_CONN_IND: - /* if connection created successfully */ - if (pMsg->hdr.status == LL_SUCCESS) - { - hciCoreConnOpen(pMsg->connInd.handle); - } - /* fall through */ - - case LL_ERROR_IND: - case LL_ADV_REPORT_IND: - case LL_DIR_ADV_REPORT_IND: - case LL_DISCONNECT_IND: - case LL_CONN_UPDATE_IND: - case LL_REM_CONN_PARAM_IND: - case LL_CREATE_CONN_CANCEL_CNF: - case LL_READ_REMOTE_VER_INFO_CNF: - case LL_READ_REMOTE_FEAT_CNF: - case LL_ENC_CHANGE_IND: - case LL_ENC_KEY_REFRESH_IND: - case LL_LTK_REQ_IND: - case LL_LTK_REQ_NEG_REPLY_CNF: - case LL_LTK_REQ_REPLY_CNF: - case LL_AUTH_PAYLOAD_TIMEOUT_IND: - case LL_DATA_LEN_CHANGE_IND: - case LL_PHY_UPDATE_IND: - case LL_EXT_ADV_REPORT_IND: - case LL_SCAN_TIMEOUT_IND: - case LL_SCAN_REQ_RCVD_IND: - case LL_ADV_SET_TERM_IND: - case LL_SCAN_ENABLE_CNF: - case LL_ADV_ENABLE_CNF: - case LL_EXT_SCAN_ENABLE_CNF: - case LL_EXT_ADV_ENABLE_CNF: - case LL_PER_ADV_ENABLE_CNF: - case LL_PER_ADV_SYNC_ESTD_IND: - case LL_PER_ADV_SYNC_LOST_IND: - case LL_PER_ADV_REPORT_IND: - case LL_CH_SEL_ALGO_IND: - - /* lookup HCI event callback code */ - pMsg->hdr.event = hciEvtLookup[pMsg->hdr.event]; - - /* Note: HCI and LL event structures identical, no translation needed */ - hciCb.evtCback((hciEvt_t *)pMsg); - - if (event == LL_DISCONNECT_IND) - { - hciCoreConnClose(pMsg->disconnectInd.handle); - } - - break; - - default: - break; - } -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_tr.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_tr.c deleted file mode 100644 index e557b012b7cbc5dc05be7f8e569cd0f908ecab86..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_tr.c +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file hci_tr.c - * - * \brief HCI transport module. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2011 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include <string.h> -#include "wsf_types.h" -#include "wsf_msg.h" -#include "util/bstream.h" -#include "hci_api.h" -#include "hci_core.h" -#include "hci_tr.h" -#include "ll_api.h" - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -#ifndef BB_PDU_TAILROOM -#define BB_PDU_TAILROOM 0 -#endif - -/*************************************************************************************************/ -/*! - * \fn hciTrSendAclData - * - * \brief Send a complete HCI ACL packet to the transport. - * - * \param pContext Connection context. - * \param pData WSF msg buffer containing an ACL packet. - * - * \return None. - */ -/*************************************************************************************************/ -void hciTrSendAclData(void *pContext, uint8_t *pData) -{ - uint16_t len; - uint8_t *p; - - /* get 16-bit length */ - BYTES_TO_UINT16(len, (pData + 2)) - len += HCI_ACL_HDR_LEN; - - /* allocate LL buffer */ - if ((p = WsfMsgAlloc(len + BB_PDU_TAILROOM)) != NULL) - { - /* copy data */ - memcpy(p, pData, len); - - /* send to LL */ - LlSendAclData(p); - - /* free HCI buffer */ - hciCoreTxAclComplete(pContext, pData); - } -} diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs.c deleted file mode 100644 index c410871011fbd61aab181e529ffe56552da68c4c..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs.c +++ /dev/null @@ -1,91 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file hci_vs.c - * - * \brief HCI vendor specific functions for single-chip. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2011 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_msg.h" -#include "hci_api.h" -#include "ll_api.h" - -/*************************************************************************************************/ -/*! - * \fn hciCoreResetStart - * - * \brief Start the HCI reset sequence. - * - * \return None. - */ -/*************************************************************************************************/ -void hciCoreResetStart(void) -{ - /* send an HCI Reset command to start the sequence */ - HciResetCmd(); -} - -/*************************************************************************************************/ -/*! - * \fn HciVsInit - * - * \brief Vendor-specific controller initialization function. - * - * \param param Vendor-specific parameter. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsInit(uint8_t param) -{ - /* unused */ -} - -/*************************************************************************************************/ -/*! - * \fn HciVsSetFeatures - * - * \brief Set the features set for the controller. - * - * \param features Pointer to new feature set buffer. Should be 8 bytes in length. - * \param featuresMask Pointer to new feature mask set buffer. Should be 8 bytes in length. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsSetFeatures(const uint8_t *features, const uint8_t *featuresMask) -{ - LlSetFeatures(features, featuresMask); -} - -/*************************************************************************************************/ -/*! - * \fn HciVsSetPower - * - * \brief Vendor-specific set power level. - * - * \param param power level in dBm. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsSetTxPower(int8_t power) -{ - LlSetTxPower(power); -} - diff --git a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs_ae.c b/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs_ae.c deleted file mode 100644 index d261c312c5a75e3b5c9d8bc0d41bb1ad07ee63a0..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/ble-host/sources/hci/exactle/hci_vs_ae.c +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief HCI vendor specific AE functions for single-chip. - * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "util/bstream.h" -#include "hci_core.h" - -/*************************************************************************************************/ -/*! - * \brief Vendor-specific controller AE initialization function. - * - * \param param Vendor-specific parameter. - * - * \return None. - */ -/*************************************************************************************************/ -void HciVsAeInit(uint8_t param) -{ - /* unused */ -} diff --git a/lib/sdk/NDALibraries/BTLE/btle.mk b/lib/sdk/NDALibraries/BTLE/btle.mk deleted file mode 100644 index a6e856ca52c87bf98a84b8ab6601591c83b8e910..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/btle.mk +++ /dev/null @@ -1,224 +0,0 @@ -################################################################################ -# Copyright (C) 2014 Maxim Integrated Products, Inc., All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES -# OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of Maxim Integrated -# Products, Inc. shall not be used except as stated in the Maxim Integrated -# Products, Inc. Branding Policy. -# -# The mere transfer of this software does not imply any licenses -# of trade secrets, proprietary technology, copyrights, patents, -# trademarks, maskwork rights, or any other form of intellectual -# property whatsoever. Maxim Integrated Products, Inc. retains all -# ownership rights. -# -# $Id: btle.mk 36944 2018-08-13 23:37:01Z zach.metzinger $ -# -################################################################################ - -################################################################################ -# This file can be included in a project makefile to add BLE libraries -################################################################################ - -export CORDIO_DIR := ${abspath ${CORDIO_DIR}} - -# Add to libraries list -LIBS += $(CORDIO_DIR)/lib/GCC/cordiolib.a -LIBS += $(CORDIO_DIR)/lib/GCC/libmaclib.a - -# Add to include directory list -IPATH += ${CORDIO_DIR}/ble-host/include -IPATH += ${CORDIO_DIR}/ble-host/sources/hci/exactle -IPATH += ${CORDIO_DIR}/ble-host/sources/hci/max32565 -IPATH += ${CORDIO_DIR}/ble-host/sources/sec/common -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/att -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/cfg -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/dm -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/hci -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/l2c -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/smp -IPATH += ${CORDIO_DIR}/ble-profiles/include/app -IPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/ -IPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/app -IPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/ -IPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/include -IPATH += ${CORDIO_DIR}/ble-profiles/sources/services -IPATH += ${CORDIO_DIR}/controller/sources/config -IPATH += ${CORDIO_DIR}/controller/sources/config/max32565 -IPATH += ${CORDIO_DIR}/controller/sources/config/max32665 -IPATH += ${CORDIO_DIR}/controller/sources/config/me05 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/control/pan -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/max32565 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/max32565/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/me99 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/me99/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/max32665 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/max32665/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/me99 -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/me99/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/include -IPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/shared -IPATH += ${CORDIO_DIR}/controller/sources/debug -IPATH += ${CORDIO_DIR}/controller/sources/llc/ble -IPATH += ${CORDIO_DIR}/controller/sources/llc/shared -IPATH += ${CORDIO_DIR}/controller/sources/mac/bb/imec -IPATH += ${CORDIO_DIR}/controller/sources/mac/ble/include -IPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lctr -IPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci -IPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci/include -IPATH += ${CORDIO_DIR}/controller/sources/mac/ble/ll -IPATH += ${CORDIO_DIR}/controller/sources/mac/cfg -IPATH += ${CORDIO_DIR}/controller/sources/mac/include -IPATH += ${CORDIO_DIR}/controller/sources/mac/sch -IPATH += ${CORDIO_DIR}/platform/bt4/img -IPATH += ${CORDIO_DIR}/platform/bt4/include -IPATH += ${CORDIO_DIR}/platform/bt4/sources/app -IPATH += ${CORDIO_DIR}/platform/bt4/sources/board/CMSIS/Device/SMD/TC/Include -IPATH += ${CORDIO_DIR}/platform/bt4/sources/board/CMSIS/Include -IPATH += ${CORDIO_DIR}/platform/bt4/sources/hci -IPATH += ${CORDIO_DIR}/platform/bt4/sources/llc/include -IPATH += ${CORDIO_DIR}/platform/bt4/sources/ota -IPATH += ${CORDIO_DIR}/platform/bt4/tools/fwupdater -IPATH += ${CORDIO_DIR}/platform/common/include -IPATH += ${CORDIO_DIR}/projects/ble-apps/ota-boot -IPATH += ${CORDIO_DIR}/uECC -IPATH += ${CORDIO_DIR}/wsf/baremetal/sources -IPATH += ${CORDIO_DIR}/wsf/common/include -IPATH += ${CORDIO_DIR}/wsf/common/include/util - -# Add to source directory list -VPATH += ${CORDIO_DIR}/ble-host/sources/hci/common -VPATH += ${CORDIO_DIR}/ble-host/sources/hci/exactle -VPATH += ${CORDIO_DIR}/ble-host/sources/hci/max32565 -VPATH += ${CORDIO_DIR}/ble-host/sources/sec/common -VPATH += ${CORDIO_DIR}/ble-host/sources/sec/uecc -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/att -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/cfg -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/dm -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/hci -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/l2c -VPATH += ${CORDIO_DIR}/ble-host/sources/stack/smp -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/app -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/app/common -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/cycling -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/datc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/dats -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/fit -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/gluc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/hidapp -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/medc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/meds -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/sensor -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/tag -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/uribeacon -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/watch -VPATH += ${CORDIO_DIR}/ble-profiles/sources/apps/wdxs -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/anpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/bas -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/blpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/blps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/cpp -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/cscp -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/dis -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/fmpl -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/gap -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/gatt -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/glpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/glps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/hid -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/hrpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/hrps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/htpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/htps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/paspc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/plxpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/plxps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/rscp -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/scpps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/sensor -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/tipc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/udsc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/uribeacon -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/wdxc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/wdxs -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/wpc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/wspc -VPATH += ${CORDIO_DIR}/ble-profiles/sources/profiles/wsps -VPATH += ${CORDIO_DIR}/ble-profiles/sources/services -VPATH += ${CORDIO_DIR}/controller/sources/dbb/control/pan -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/max32565 -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g/afe/me99 -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5 -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/max32665 -VPATH += ${CORDIO_DIR}/controller/sources/dbb/prot/ble/pan2g5/afe/me99 -VPATH += ${CORDIO_DIR}/controller/sources/debug -VPATH += ${CORDIO_DIR}/controller/sources/llc/ble -VPATH += ${CORDIO_DIR}/controller/sources/llc/shared -VPATH += ${CORDIO_DIR}/controller/sources/mac/bb/imec -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lctr -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci/generic -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci/imec -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci/max32565 -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lhci/max32665 -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/ll -VPATH += ${CORDIO_DIR}/controller/sources/mac/ble/lmgr -VPATH += ${CORDIO_DIR}/controller/sources/mac/sch -VPATH += ${CORDIO_DIR}/platform/bt4/sources/app -VPATH += ${CORDIO_DIR}/platform/bt4/sources/board -VPATH += ${CORDIO_DIR}/platform/bt4/sources/board/CMSIS/Device/SMD/TC/Source -VPATH += ${CORDIO_DIR}/platform/bt4/sources/board/CMSIS/Device/SMD/TC/Source/GCC -VPATH += ${CORDIO_DIR}/platform/bt4/sources/hci -VPATH += ${CORDIO_DIR}/platform/bt4/sources/llc/cordio-tc2 -VPATH += ${CORDIO_DIR}/platform/bt4/sources/llc/generic -VPATH += ${CORDIO_DIR}/platform/bt4/sources/ota -VPATH += ${CORDIO_DIR}/platform/bt4/tools/fwupdater -VPATH += ${CORDIO_DIR}/platform/common/sources/bb/ble -VPATH += ${CORDIO_DIR}/platform/common/sources/chci -VPATH += ${CORDIO_DIR}/platform/common/sources/ll -VPATH += ${CORDIO_DIR}/platform/common/sources/prand -VPATH += ${CORDIO_DIR}/platform/max32565/sources -VPATH += ${CORDIO_DIR}/platform/max32665/sources -VPATH += ${CORDIO_DIR}/projects/ble-apps/cycling -VPATH += ${CORDIO_DIR}/projects/ble-apps/datc -VPATH += ${CORDIO_DIR}/projects/ble-apps/dats -VPATH += ${CORDIO_DIR}/projects/ble-apps/fit -VPATH += ${CORDIO_DIR}/projects/ble-apps/hidapp -VPATH += ${CORDIO_DIR}/projects/ble-apps/medc -VPATH += ${CORDIO_DIR}/projects/ble-apps/meds -VPATH += ${CORDIO_DIR}/projects/ble-apps/ota-boot -VPATH += ${CORDIO_DIR}/projects/ble-apps/tag -VPATH += ${CORDIO_DIR}/projects/ble-apps/uribeacon -VPATH += ${CORDIO_DIR}/projects/ble-apps/watch -VPATH += ${CORDIO_DIR}/uECC -VPATH += ${CORDIO_DIR}/wsf/baremetal/sources -VPATH += ${CORDIO_DIR}/wsf/common/sources/util - -SRCS += $(sort $(wildcard ${CORDIO_DIR}/ble-host/sources/hci/exactle/*.c)) -IPATH += ${CORDIO_DIR}/ble-host/sources/stack/hci -VPATH += ${CORDIO_DIR}/ble-host/sources/hci/exactle diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/cfg/cfg_mac.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/cfg/cfg_mac.h deleted file mode 100644 index 604af096fe0f158531c067fc2bb2b7806ce79f7c..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/cfg/cfg_mac.h +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief MAC system configuration. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#ifndef CFG_MAC_H -#define CFG_MAC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -/*** BLE LL ***/ - -#ifndef LL_MAX_CONN -#define LL_MAX_CONN 5 /*!< Maximum number of connections. */ -#endif - -#ifndef LL_NUM_BUFS -#define LL_NUM_BUFS 4 /*!< Default number of buffers. */ -#endif - -#ifndef LL_NUM_ADV_FILT -#define LL_NUM_ADV_FILT 4 /*!< Table size for advertising filter. */ -#endif - -#ifndef LL_ADV_FILT_TIMEOUT -#define LL_ADV_FILT_TIMEOUT 0x8000 /*!< Advertising filter timeout in 0.625 ms units. */ -#endif - -#ifndef LL_NUM_WL_ENTRIES -#define LL_NUM_WL_ENTRIES 8 /*!< Maximum number of white list entries, 0xFF is highest setting */ -#endif - -#ifndef LL_NUM_ADDR_RES_LIST_ENTRIES -#define LL_NUM_ADDR_RES_LIST_ENTRIES 8 /*!< Number of entries in the Address Resolution List */ -#endif - -#ifndef LL_API_PARAM_CHECK -#define LL_API_PARAM_CHECK 1 /*!< Check API parameters. */ -#endif - -#ifndef LL_COMP_ID -#define LL_COMP_ID 0x058B /*!< Company ID (Maxim Integrated Products). */ -#endif - -#ifndef LL_IMPL_REV -#define LL_IMPL_REV 0x0000 /*!< Implementation revision number. */ -#endif - -#ifndef LL_ENABLE_VS -#define LL_ENABLE_VS 1 /*!< Enable vendor specific command processing. */ -#endif - -#ifndef LL_ENABLE_WW -#define LL_ENABLE_WW 1 /*!< Window widening enable. Disable for diagnostics only. */ -#endif - -#ifndef LL_ENABLE_ADV_DLY -#define LL_ENABLE_ADV_DLY 1 /*!< Enable advertising delay. Disable for diagnostics only. */ -#endif - -#ifndef LL_ENABLE_SLV_LATENCY -#define LL_ENABLE_SLV_LATENCY 1 /*!< Enable slave latency. Disable for diagnostics only. */ -#endif - -#ifndef LL_NUM_ADV_SETS -#define LL_NUM_ADV_SETS 1 /*!< Number of advertising sets supported by the Controller. */ -#endif - -#ifndef LL_AUX_FRAME_SPACE -#define LL_AUX_FRAME_SPACE (3 * 300) /*!< AUX Frame Space, where T_MAFS is 300 usec*/ -#endif - -#ifndef LL_ADV_SCAN_RSP_DATA_LEN -#define LL_ADV_SCAN_RSP_DATA_LEN 1000 /*!< Advertising (or scan response) data length supported by the Controller. */ -#endif - -#ifndef LL_FRAG_PREFERED_DATA_LEN -#define LL_FRAG_PREFERED_DATA_LEN 31 /*!< Advertising (or scan response) data length when Controller prefer to fragment all Host advertising data. */ -#endif - -#ifndef LL_NO_FRAG_PREFERED_DATA_LEN -#define LL_NO_FRAG_PREFERED_DATA_LEN 191 /*!< Advertising (or scan response) data length when Controller does not prefer to fragment all Host advertising data. */ - /*!< 254 - 63 = 191 (Payload: 1-255 octets -> ExtendedHeaderLength(6bits) + AdvMode(2 bits) + Extended Header(0-63 octets) + AdvData(0-254 octets)) */ -#endif - -#ifndef LL_MAX_TX_TIME -#define LL_MAX_TX_TIME LL_MAX_DATA_TIME_ABS_MAX /*!< Maximum number of microseconds the device will transmit a PDU */ -#endif - -#ifndef LL_MAX_TX_OCTETS -#define LL_MAX_TX_OCTETS LL_MAX_DATA_LEN_ABS_MAX /*!< Maximum number of bytes the device will transmit in a PDU */ -#endif - -#ifndef LL_MAX_RX_TIME -#define LL_MAX_RX_TIME LL_MAX_DATA_TIME_ABS_MAX /*!< Maximum number of microseconds the device will receive a PDU */ -#endif - -#ifndef LL_MAX_RX_OCTETS -#define LL_MAX_RX_OCTETS LL_MAX_DATA_LEN_ABS_MAX /*!< Maximum number of bytes the device will receive in a PDU */ -#endif - -#ifndef LL_DEF_TX_TIME -#define LL_DEF_TX_TIME 0x148 /*!< Specified default maximum number of microseconds the device will transmit a PDU */ -#endif - -#ifndef LL_DEF_TX_OCTETS -#define LL_DEF_TX_OCTETS 0x1B /*!< Specified default maximum number of bytes the device will transmit in a PDU */ -#endif - -#ifndef LL_MIN_TX_POWER -#define LL_MIN_TX_POWER -10 /*!< Minimum supported TX power level, in dBm */ -#endif - -#ifndef LL_MAX_TX_POWER -#define LL_MAX_TX_POWER 4 /*!< Maximum supported TX power level, in dBm */ -#endif - -/*** Scheduler ***/ - -#ifndef SCH_SETUP_DELAY -#define SCH_SETUP_DELAY 100 /*!< Setup delay for initial operation in BB ticks. */ -#endif - -/*** Baseband ***/ - -#ifndef BB_FIXED_PKT_LEN -#define BB_FIXED_PKT_LEN 0 /*!< Fixed packet length required for BB receive buffers (0 to disable). */ -#endif - -#ifndef BB_INTER_ADV_DELAY -#define BB_INTER_ADV_DELAY 320 /*! Delay between advertising channel operations. (320 = 200 us) */ -#endif - -#ifndef BB_SLEEP_CLK_ACCURACY -#define BB_SLEEP_CLK_ACCURACY 200 /*! Sleep clock accuracy in PPM units. */ -#endif - -#ifdef __cplusplus -}; -#endif - -#endif /* CFG_MAC_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_api.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_api.h deleted file mode 100644 index 2d74cf61622afb7105ab4674d285f890825a70f4..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_api.h +++ /dev/null @@ -1,290 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Baseband interface file. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - * - * \addtogroup BB_API Baseband (BB) API - * \{ - * - * The baseband porting layer is a protocol independent BB + radio abstraction layer. It allows - * the simultaneous operation of protocol specific schedulers to transport packets across each - * medium via a single multi-protocol baseband. This interface describes operations for the - * following protocols: - * - * - Bluetooth low energy: advertising and connections - * - ZigBee/802.15.4 (TBD) - * - BAN/802.15.6 (TBD) - * - * \dot - * digraph - * { - * node [shape=record, width=1.0, height=0.5, fontname=Helvetica, fontsize=8]; - * - * ble [label="BLE\nlink layer", style=filled, fillcolor=lightgray]; - * zigbee [label="802.15.4\nMAC", style=filled, fillcolor=lightgray]; - * ban [label="802.15.6\nMAC", style=filled, fillcolor=lightgray]; - * sch [label="Multi-protocol\nscheduler", style=filled, fillcolor=lightgray]; - * bb_drv [label="{ BB porting layer | BB specific driver }"]; - * bb_hw [label="BB hardware", style=filled, fillcolor=dimgray]; - * - * ble -> sch; - * ble -> bb_drv; - * zigbee -> sch; - * zigbee -> bb_drv; - * ban -> sch; - * ban -> bb_drv; - * sch -> bb_drv; - * bb_drv -> bb_hw [style=dashed]; - * } - * \enddot - * - * \defgroup BB_API_INIT Initialization - * \defgroup BB_API_BOD Baseband Operation Descriptors (BOD) - * \defgroup BB_API_CTRL Control interface - * \defgroup BB_API_TIME Time interface - * \defgroup BB_API_BLE Bluetooth LE Protocol - * - * \} - */ -/*************************************************************************************************/ - -#ifndef BB_API_H -#define BB_API_H - -#include "wsf_types.h" -#include "cfg_mac.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Constants -**************************************************************************************************/ - -/*! \addtogroup BB_API_BOD - * \{ */ - -/*! \brief Protocol types */ -enum -{ - BB_PROT_NONE, /*!< Non-protocol specific operation. */ - BB_PROT_BLE, /*!< Bluetooth Low Energy. */ - BB_PROT_PRBS15, /*!< Enable the continuous PRBS15 transmit sequence. */ -}; - -/*! \brief PHY codes */ -enum -{ - BB_PHY_1M = 1, /*!< 1M PHY. */ - BB_PHY_2M = 2, /*!< 2M PHY. */ - BB_PHY_S8 = 3, /*!< Coded S8 PHY. */ - BB_PHY_S2 = 4, /*!< Coded S2 PHY. */ -}; - -/*! \brief Status codes */ -enum -{ - BB_STATUS_SUCCESS, /*!< Operation successful. */ - BB_STATUS_FAILED, /*!< General failure. */ - BB_STATUS_RX_TIMEOUT, /*!< Receive packet timeout. */ - BB_STATUS_CRC_FAILED, /*!< Receive packet with CRC verification failed. */ - BB_STATUS_DECRYPT_FAILED, /*!< Receive packet with decryption verification failed. */ -}; - -/*! \} */ /* BB_API_BOD */ - -/************************************************************************************************** - Data Types -**************************************************************************************************/ - -/*! \addtogroup BB_API_BOD - * \{ */ - -/* Forward definition of BOD. */ -struct BbOpDesc_tag; - -/*! \brief Event type. */ -enum -{ - BB_EVENT_BEGIN_BOD, /*!< Beginning of BOD event. */ - BB_EVENT_END_BOD /*!< End of BOD event. */ -}; - -/*! \brief BB event callback signature. */ -typedef void (*BbEventCback_t)(struct BbOpDesc_tag *pBod, uint8_t event); - -/*! \brief BOD operation callback signature. */ -typedef void (*BbBodCback_t)(struct BbOpDesc_tag *pBod); - -/*! \} */ /* BB_API_BOD */ - -/*! \addtogroup BB_API_BOD - * \{ */ - -/* Forward protocol data definitions. */ -struct BbBleData_tag; - -/*! \brief Baseband operation descriptor (BOD). */ -typedef struct BbOpDesc_tag -{ - struct BbOpDesc_tag *pPrev; /*!< Previous BOD. */ - struct BbOpDesc_tag *pNext; /*!< Next BOD. */ - - uint32_t due; /*!< Absolute clock due time. */ - uint32_t interval; /*!< Interval assigned by scheduler. */ - - uint32_t minDuration; /*!< Minimum duration of operation. */ - uint32_t maxDuration; /*!< Maximum duration of operation. */ - uint32_t duration; /*!< duration allocated by scheduler. */ - - uint8_t protId; /*!< Protocol type. */ - uint8_t phy; /*!< PHY to use for this operation. */ - - uint8_t priority; /*!< Priority of operation for scheduling. */ - uint8_t basePriority; /*!< Base priority of operation for scheduling. */ - - BbBodCback_t beginCback; /*!< Beginning of BOD callback. */ - BbBodCback_t preemptCback; /*!< Preempt BOD callback. */ - BbBodCback_t endCback; /*!< End of BOD callback. */ - - void *pCtx; /*!< Client defined context. */ - - union - { - struct BbBleData_tag *pBle; /*!< BLE operation data. */ - } prot; /*!< Protocol specific data. */ -} BbOpDesc_t; - -/*! \} */ /* BB_API_BOD */ - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -/*! \addtogroup BB_API_INIT - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Initialize the BB. - * - * \return None. - * - * Initialize baseband resources. - */ -/*************************************************************************************************/ -void BbInit(void); - -/*************************************************************************************************/ -/*! - * \brief Register operation completion handler. - * - * \param eventCback Event callback. - * - * \return None. - * - * Initialize baseband resources. - */ -/*************************************************************************************************/ -void BbRegister(BbEventCback_t eventCback); - -/*! \} */ /* BB_API_INIT */ - -/*! \addtogroup BB_API_CTRL - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Start BB processing of given protocol. - * - * \param protId Protocol ID. - * - * \return None. - * - * Enable BB and start processing the list of BODs. - */ -/*************************************************************************************************/ -void BbStart(uint8_t protId); - -/*************************************************************************************************/ -/*! - * \brief Stop BB processing of given protocol. - * - * \param protId Protocol ID. - * - * Disable BB processing of BODs. - */ -/*************************************************************************************************/ -void BbStop(uint8_t protId); - -/*************************************************************************************************/ -/*! - * \brief Execute BOD. - * - * \param pBod Pointer to the BOD to execute. - * - * \return None. - * - * Execute the protocol specific BOD handler. - */ -/*************************************************************************************************/ -void BbExecuteBod(BbOpDesc_t *pBod); - -/*************************************************************************************************/ -/*! - * \brief Preempt BOD. - * - * \param pBod Pointer to the BOD to preempt. - * - * \return None. - * - * Preempt a BOD that has been started but the due time has not yet occurred. - */ -/*************************************************************************************************/ -void BbPreemptBod(BbOpDesc_t *pBod); - -/*************************************************************************************************/ -/*! - * \brief Cancel current executing BOD. - * - * \return None. - * - * \note This function is expected to be called during the execution context of the - * current executing BOD. - */ -/*************************************************************************************************/ -void BbCancelBod(void); - -/*************************************************************************************************/ -/*! - * \brief Get the amount of time until the current operation is due. - * - * \return Tick count until the current operation is due. Returns maximum value if no - * operation is in progress. - */ -/*************************************************************************************************/ -uint32_t BbGetTimeUntilNextDue(void); - -/*! \} */ /* BB_API_CTRL */ - -#ifdef __cplusplus -}; -#endif - -#endif /* BB_API_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_crypto.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_crypto.h deleted file mode 100644 index b9ca3ffe1ebf5f513ce7c5dad0cd3993817ba78d..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_crypto.h +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2016 Maxim Integrated Products, Inc., All rights Reserved. -* -* This software is protected by copyright laws of the United States and -* of foreign countries. This material may also be protected by patent laws -* and technology transfer regulations of the United States and of foreign -* countries. This software is furnished under a license agreement and/or a -* nondisclosure agreement and may only be used or reproduced in accordance -* with the terms of those agreements. Dissemination of this information to -* any party or parties not specified in the license agreement and/or -* nondisclosure agreement is expressly prohibited. -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES -* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -* Except as contained in this notice, the name of Maxim Integrated -* Products, Inc. shall not be used except as stated in the Maxim Integrated -* Products, Inc. Branding Policy. -* -* The mere transfer of this software does not imply any licenses -* of trade secrets, proprietary technology, copyrights, patents, -* trademarks, maskwork rights, or any other form of intellectual -* property whatsoever. Maxim Integrated Products, Inc. retains all -* ownership rights. -******************************************************************************* -*/ - -#ifndef _BB_CRYPTO_H_ -#define _BB_CRYPTO_H_ - -#define DIR_SLAVE_TO_MASTER 0 -#define DIR_MASTER_TO_SLAVE 1 - -void bbCryptoSetKeyIV(uint8_t *pKey, uint8_t *pIV); -void bbCryptoSetTxParams(uint64_t packetCounter, int packetLength, int AAD, int direction); -void bbCryptoSetTxPacketLengthZero(); -void bbCryptoSetRxParams(uint64_t packetCounter, int direction); -void bbCryptoEnableTx(void); -void bbCryptoDisableTx(void); -void bbCryptoEnableRx(void); -void bbCryptoDisableRx(void); - -#endif /* _BB_CRYPTO_H_ */ - diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_drv.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_drv.h deleted file mode 100644 index f72e71d2e54aec402c34eb152df2bb013f16ae8e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/bb_drv.h +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Baseband driver interface file. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#ifndef BB_DRV_H -#define BB_DRV_H - -#include "wsf_types.h" -#include "cfg_mac.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -/*! \addtogroup BB_DRV_INIT - * \{ - * This section contains driver routines which initializes as well as enables the sleep mode - * of the BB hardware. - */ - -void BbDrvInit(void); -void BbDrvEnable(uint8_t protId); -void BbDrvDisable(uint8_t protId); - -/*! \} */ /* BB_DRV_INIT */ - -/*! \addtogroup BB_DRV_CLOCK - * \{ - * This section contains driver routines related to the BB clock, packet time stamping and - * time to BB clock tick utilities. - */ - -uint32_t BbDrvGetCurrentTime(void); -uint16_t BbDrvGetSleepClockAccuracy(void); -uint32_t BbDrvGetStartTimestamp(void); -uint32_t BbDrvGetEndTimestamp(void); -uint32_t BbDrvConvertUsToTicks(uint32_t us); -uint32_t BbDrvConvertTicksToUs(uint32_t ticks); - -/*! \} */ /* BB_DRV_CLOCK */ - -#ifdef __cplusplus -}; -#endif - -#endif /* BB_DRV_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_api.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_api.h deleted file mode 100644 index ed916d03f70402ce67d5f6e1d56993c04cd60be4..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_api.h +++ /dev/null @@ -1,2323 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Link layer interface file. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - * - * \addtogroup LL_API Link Layer (LL) API - * \{ - * - * The LL subsystem implements the Link Layer as defined in the Bluetooth core specification. - * The LL API is designed to be compatible with the standard HCI specification for low energy - * controllers. In addition, the LL API is designed to interface efficiently to the HCI layer - * API of Wicentric's host stack. - * - * \defgroup LL_API_INIT Initialization and Reset - * \defgroup LL_API_PARAM Parameter Interface - * \defgroup LL_API_CTRL Link Control Interface - * \defgroup LL_API_DATA Data Interface - * \defgroup LL_API_CBACK Callback Data Types - * \defgroup LL_API_TEST Test Mode Interface - * \defgroup LL_API_SCENARIOS Scenarios - * - * \} - */ -/*************************************************************************************************/ - -#ifndef LL_API_H -#define LL_API_H - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bda.h" -#include "cfg_mac.h" -#include "ll_defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -#define LL_FEAT_LEN 8 /*!< Length of features byte array */ -#define LL_RAND_LEN 8 /*!< Length of random number */ - -/************************************************************************************************** - Data Types -**************************************************************************************************/ - -/*! \brief The following status values are used in the LL API. */ -enum -{ - LL_SUCCESS = 0x00, - LL_ERROR_CODE_UNKNOWN_HCI_CMD = 0x01, - LL_ERROR_CODE_UNKNOWN_CONN_ID = 0x02, - LL_ERROR_CODE_HW_FAILURE = 0x03, - LL_ERROR_CODE_PAGE_TIMEOUT = 0x04, - LL_ERROR_CODE_AUTH_FAILURE = 0x05, - LL_ERROR_CODE_PIN_KEY_MISSING = 0x06, - LL_ERROR_CODE_MEM_CAP_EXCEEDED = 0x07, - LL_ERROR_CODE_CONN_TIMEOUT = 0x08, - LL_ERROR_CODE_CONN_LIMIT_EXCEEDED = 0x09, - LL_ERROR_CODE_SYNCH_CONN_LIMIT_EXCEEDED = 0x0A, - LL_ERROR_CODE_ACL_CONN_ALREADY_EXISTS = 0x0B, - LL_ERROR_CODE_CMD_DISALLOWED = 0x0C, - LL_ERROR_CODE_CONN_REJ_LIMITED_RESOURCES = 0x0D, - LL_ERROR_CODE_CONN_REJECTED_SECURITY_REASONS = 0x0E, - LL_ERROR_CODE_CONN_REJECTED_UNACCEPTABLE_BDADDR = 0x0F, - LL_ERROR_CODE_CONN_ACCEPT_TIMEOUT_EXCEEDED = 0x10, - LL_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE = 0x11, - LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS = 0x12, - LL_ERROR_CODE_REMOTE_USER_TERM_CONN = 0x13, - LL_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES = 0x14, - LL_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF = 0x15, - LL_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST = 0x16, - LL_ERROR_CODE_REPEATED_ATTEMPTS = 0x17, - LL_ERROR_CODE_PAIRING_NOT_ALLOWED = 0x18, - LL_ERROR_CODE_UNKNOWN_LMP_PDU = 0x19, - LL_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE = 0x1A, - LL_ERROR_CODE_SCO_OFFSET_REJ = 0x1B, - LL_ERROR_CODE_SCO_INTERVAL_REJ = 0x1C, - LL_ERROR_CODE_SCO_AIR_MODE_REJ = 0x1D, - LL_ERROR_CODE_INVALID_LMP_PARAMS = 0x1E, - LL_ERROR_CODE_UNSPECIFIED_ERROR = 0x1F, - LL_ERROR_CODE_UNSUPPORTED_LMP_PARAM_VAL = 0x20, - LL_ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED = 0x21, - LL_ERROR_CODE_LMP_LL_RESP_TIMEOUT = 0x22, - LL_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION = 0x23, - LL_ERROR_CODE_LMP_PDU_NOT_ALLOWED = 0x24, - LL_ERROR_CODE_ENCRYPT_MODE_NOT_ACCEPTABLE = 0x25, - LL_ERROR_CODE_LINK_KEY_CAN_NOT_BE_CHANGED = 0x26, - LL_ERROR_CODE_REQ_QOS_NOT_SUPPORTED = 0x27, - LL_ERROR_CODE_INSTANT_PASSED = 0x28, - LL_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29, - LL_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION = 0x2A, - LL_ERROR_CODE_RESERVED1 = 0x2B, - LL_ERROR_CODE_QOS_UNACCEPTABLE_PARAM = 0x2C, - LL_ERROR_CODE_QOS_REJ = 0x2D, - LL_ERROR_CODE_CHAN_ASSESSMENT_NOT_SUPPORTED = 0x2E, - LL_ERROR_CODE_INSUFFICIENT_SECURITY = 0x2F, - LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE = 0x30, - LL_ERROR_CODE_RESERVED2 = 0x31, - LL_ERROR_CODE_ROLE_SWITCH_PENDING = 0x32, - LL_ERROR_CODE_RESERVED3 = 0x33, - LL_ERROR_CODE_RESERVED_SLOT_VIOLATION = 0x34, - LL_ERROR_CODE_ROLE_SWITCH_FAILED = 0x35, - LL_ERROR_CODE_EXTENDED_INQUIRY_RESP_TOO_LARGE = 0x36, - LL_ERROR_CODE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = 0x37, - LL_ERROR_CODE_HOST_BUSY_PAIRING = 0x38, - LL_ERROR_CODE_CONN_REJ_NO_SUITABLE_CHAN_FOUND = 0x39, - LL_ERROR_CODE_CONTROLLER_BUSY = 0x3A, - LL_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL = 0x3B, - LL_ERROR_CODE_DIRECTED_ADV_TIMEOUT = 0x3C, - LL_ERROR_CODE_ADV_TIMEOUT = 0x3C, - LL_ERROR_CODE_CONN_TERM_MIC_FAILURE = 0x3D, - LL_ERROR_CODE_CONN_FAILED_TO_ESTABLISH = 0x3E, - LL_ERROR_CODE_MAC_CONN_FAILED = 0x3F, - LL_ERROR_CODE_COARSE_CLOCK_ADJUSTMENT_REJECTED = 0x40, - LL_ERROR_CODE_TYPE0_SUBMAP_NOT_DEFINED = 0x41, - LL_ERROR_CODE_UNKNOWN_ADVERTISING_IDENTIFIER = 0x42, - LL_ERROR_CODE_LIMIT_REACHED = 0x43, - LL_ERROR_CODE_OPERATION_CANCELLED_BY_HOST = 0x44 -}; - -/*! \addtogroup LL_API_PARAM - * \{ */ - -/*! \brief The features bitmask indicates the LE features supported by the LL. */ -enum -{ - LL_FEAT_ENCRYPTION = (1 << 0), /*!< Encryption supported */ - LL_FEAT_CONN_PARAM_REQ_PROC = (1 << 1), /*!< Connection Parameters Request Procedure supported */ - LL_FEAT_EXT_REJECT_IND = (1 << 2), /*!< Extended Reject Indication supported */ - LL_FEAT_SLV_INIT_FEAT_EXCH = (1 << 3), /*!< Slave-Initiated Features Exchange supported */ - LL_FEAT_LE_PING = (1 << 4), /*!< LE Ping supported */ - LL_FEAT_LE_DATA_LENGTH = (1 << 5), /*!< LE Data packet length extension supported */ - LL_FEAT_LL_PRIVACY = (1 << 6), /*!< LL Privacy supported */ - LL_FEAT_EXT_SCAN_POLICY = (1 << 7), /*!< Extended Scanner Filter Policy supported */ - LL_FEAT_LE_2M_PHY = (1 << 8), /*!< LE 2M PHY supported */ - LL_FEAT_STABLE_MODULATION_IDX_TX = (1 << 9), /*!< Stable Modulation Index - Transmitter supported */ - LL_FEAT_STABLE_MODULATION_IDX_RX = (1 << 10), /*!< Stable Modulation Index - Receiver supported */ - LL_FEAT_LE_CODED_PHY = (1 << 11), /*!< LE Coded PHY supported */ - LL_FEAT_LE_EXT_ADV = (1 << 12), /*!< LE Extended Advertising supported */ - LL_FEAT_LE_PERIODIC_ADV = (1 << 13), /*!< LE Periodic Advertising supported */ - LL_FEAT_CH_SEL_ALGO_2 = (1 << 14), /*!< Channel Selection Algorithm #2 supported */ - LL_FEAT_LE_PWR_CLASS_1 = (1 << 15), /*!< LE Power Class 1 supported */ - LL_FEAT_MIN_NUM_USED_CH_PROCEDURE = (1 << 16), /*!< Minimum Number of Used Channels Procedure supported */ - LL_FEAT_REMOTE_PK_VALID = (1 << 27) /*!< Remote Public Key Validation. Erratum 10734 */ -}; - -/*! \brief The supported state bitmask indicates the LE states supported by the LL. */ -enum -{ - LL_SUP_STATE_NON_CONN_ADV = (0x1ULL << 0), /*!< Non-connectable Advertising State supported. */ - LL_SUP_STATE_SCAN_ADV = (0x1ULL << 1), /*!< Scannable Advertising State supported. */ - LL_SUP_STATE_CONN_ADV = (0x1ULL << 2), /*!< Connectable Advertising State supported. */ - LL_SUP_STATE_DIRECT_ADV = (0x1ULL << 3), /*!< Directed Advertising State supported. */ - LL_SUP_STATE_PASS_SCAN = (0x1ULL << 4), /*!< Passive Scanning State supported. */ - LL_SUP_STATE_ACT_SCAN = (0x1ULL << 5), /*!< Active Scanning State supported. */ - LL_SUP_STATE_INIT = (0x1ULL << 6), /*!< Initiating State supported. Connection State in the Master Role supported is also supported. */ - LL_SUP_STATE_CONN_SLV = (0x1ULL << 7), /*!< Connection State in the Slave Role supported. */ - LL_SUP_STATE_NON_CONN_ADV_AND_PASS_SCAN = (0x1ULL << 8), /*!< Non-connectable Advertising State and Passive Scanning State combination supported. */ - LL_SUP_STATE_SCAN_ADV_AND_PASS_SCAN = (0x1ULL << 9), /*!< Scannable Advertising State and Passive Scanning State combination supported. */ - LL_SUP_STATE_CONN_ADV_AND_PASS_SCAN = (0x1ULL << 10), /*!< Connectable Advertising State and Passive Scanning State combination supported. */ - LL_SUP_STATE_DIRECT_ADV_AND_PASS_SCAN = (0x1ULL << 11), /*!< Directed Advertising State and Passive Scanning State combination supported. */ - LL_SUP_STATE_NON_CONN_ADV_AND_ACT_SCAN = (0x1ULL << 12), /*!< Non-connectable Advertising State and Active Scanning State combination supported. */ - LL_SUP_STATE_SCAN_ADV_AND_ACT_SCAN = (0x1ULL << 13), /*!< Scannable Advertising State and Active Scanning State combination supported. */ - LL_SUP_STATE_CONN_ADV_AND_ACT_SCAN = (0x1ULL << 14), /*!< Connectable Advertising State and Active Scanning State combination supported. */ - LL_SUP_STATE_DIRECT_ADV_ACT_SCAN = (0x1ULL << 15), /*!< Directed Advertising State and Active Scanning State combination supported. */ - LL_SUP_STATE_NON_CONN_ADV_AND_INIT = (0x1ULL << 16), /*!< Non-connectable Advertising State and Initiating State combination supported. */ - LL_SUP_STATE_SCAN_ADV_AND_INIT = (0x1ULL << 17), /*!< Scannable Advertising State and Initiating State combination supported */ - LL_SUP_STATE_NON_CONN_ADV_MST = (0x1ULL << 18), /*!< Non-connectable Advertising State and Master Role combination supported. */ - LL_SUP_STATE_SCAN_ADV_MST = (0x1ULL << 19), /*!< Scannable Advertising State and Master Role combination supported. */ - LL_SUP_STATE_NON_CONN_ADV_SLV = (0x1ULL << 20), /*!< Non-connectable Advertising State and Slave Role combination supported. */ - LL_SUP_STATE_SCAN_ADV_SLV = (0x1ULL << 21), /*!< Scannable Advertising State and Slave Role combination supported. */ - LL_SUP_STATE_PASS_SCAN_AND_INIT = (0x1ULL << 22), /*!< Passive Scanning State and Initiating State combination supported. */ - LL_SUP_STATE_ACT_SCAN_INIT = (0x1ULL << 23), /*!< Active Scanning State and Initiating State combination supported. */ - LL_SUP_STATE_PASS_SCAN_MST = (0x1ULL << 24), /*!< Passive Scanning State and Master Role combination supported. */ - LL_SUP_STATE_ACT_SCAN_MST = (0x1ULL << 25), /*!< Active Scanning State and Master Role combination supported. */ - LL_SUP_STATE_PASS_SCAN_SLV = (0x1ULL << 26), /*!< Passive Scanning state and Slave Role combination supported. */ - LL_SUP_STATE_ACT_SCAN_SLV = (0x1ULL << 27), /*!< Active Scanning state and Slave Role combination supported. */ - LL_SUP_STATE_INIT_MST = (0x1ULL << 28), /*!< Initiating State and Master Role combination supported. Master Role and Master Role combination is also supported. */ - LL_SUP_STATE_LD_DIRECT_ADV = (0x1ULL << 29), /*!< Low Duty Cycle Directed Advertising State. */ - LL_SUP_STATE_LD_DIRECT_ADV_PASS_SCAN = (0x1ULL << 30), /*!< Low Duty Cycle Directed Advertising State and Passive Scanning State. */ - LL_SUP_STATE_LD_DIRECT_ADV_ACT_SCAN = (0x1ULL << 31), /*!< Low Duty Cycle Directed Advertising State and Active Scanning State. */ - LL_SUP_STATE_CONN_ADV_INIT = (0x1ULL << 32), /*!< Connectable Advertising State and Initiating State. */ - LL_SUP_STATE_HD_DIRECT_ADV_INIT = (0x1ULL << 33), /*!< High Duty Cycle Directed Advertising State and Initiating State. */ - LL_SUP_STATE_LD_DIRECT_ADV_INIT = (0x1ULL << 34), /*!< Low Duty Cycle Directed Advertising State and Initiating State. */ - LL_SUP_STATE_CONN_ADV_MST = (0x1ULL << 35), /*!< Connectable Advertising State and Connection State (Master Role). */ - LL_SUP_STATE_HD_DIRECT_ADV_MST = (0x1ULL << 36), /*!< High Duty Cycle Directed Advertising State and Connection State (Master Role). */ - LL_SUP_STATE_LD_DIRECT_ADV_MST = (0x1ULL << 37), /*!< Low Duty Cycle Directed Advertising State and Connection State (Master Role). */ - LL_SUP_STATE_CONN_ADV_SLV = (0x1ULL << 38), /*!< Connectable Advertising State and Connection State (Slave Role). */ - LL_SUP_STATE_HD_DIRECT_ADV_SLV = (0x1ULL << 39), /*!< High Duty Cycle Directed Advertising State and Connection State (Slave Role). */ - LL_SUP_STATE_LD_DIRECT_ADV_SLV = (0x1ULL << 40), /*!< Low Duty Cycle Directed Advertising State and Connection State (Slave Role). */ - LL_SUP_STATE_INIT_SLV = (0x1ULL << 41) /*!< Initiating State and Connection State (Slave Role). */ -}; - -/*! \} */ /* LL_API_PARAM */ - -/*! \addtogroup LL_API_CTRL - * \{ */ - -/*! \brief This parameter identifies the device role. */ -enum -{ - LL_ROLE_MASTER = 0, /*!< Role is master. */ - LL_ROLE_SLAVE = 1 /*!< Role is slave. */ -}; - -/*! \brief The advertising type indicates the connectable and discoverable nature of the advertising packets transmitted by a device. */ -enum -{ - LL_ADV_CONN_UNDIRECT = 0, /*!< Connectable undirected advertising. Peer devices can scan and connect to this device. */ - LL_ADV_CONN_DIRECT_HIGH_DUTY = 1, /*!< Connectable directed advertising, high duty cycle. Only a specified peer device can connect to this device. */ - LL_ADV_DISC_UNDIRECT = 2, /*!< Discoverable undirected advertising. Peer devices can scan this device but cannot connect. */ - LL_ADV_NONCONN_UNDIRECT = 3, /*!< Non-connectable undirected advertising. Peer devices cannot scan or connect to this device. */ - LL_ADV_CONN_DIRECT_LOW_DUTY = 4, /*!< Connectable directed advertising, low duty cycle. Only a specified peer device can connect to this device. */ - LL_EXT_ADV_CONN_UNDIRECT = 5, /*!< Connectable undirected advertising. Peer devices cannot scan but can connect to this device.*/ - LL_EXT_ADV_NONCONN_DIRECT = 6, /*!< Non-connectable and non-scannable directed advertising. A specified peer device cannot scan or connect to this device. */ - LL_EXT_ADV_SCAN_DIRECT = 7, /*!< Scannable directed advertising. A specified peer device can scan but cannot connect to this device. */ - LL_EXT_PER_ADV = 8, /*!< Periodic advertising where the controller transmit ADV_EXT_IND and AUX_ADV_IND PDUs along with peridic advertising events (AUX_SYNC_IND PDU and its subordinate sets). */ - LL_PER_ADV = 9, /*!< Periodic advertising where the controller transmit peridic advertising events (AUX_SYNC_IND PDU and its subordinate sets). */ - LL_ADV_NONE = 255 /*!< For internal use only */ -}; - -/*! \brief The address type indicates whether an address is public or random. */ -enum -{ - LL_ADDR_PUBLIC = 0, /*!< Public address. */ - LL_ADDR_RANDOM = 1, /*!< Random address. */ - LL_ADDR_RES_PUBLIC = 2, /*!< Resolvable private address or public address. */ - LL_ADDR_RES_RANDOM = 3 /*!< Resolvable private address or random address. */ -}; - -/*! \brief Different types of random address by the 2 Most significant bits */ -enum -{ - LL_ADDR_RAND_NON_RESOLVE = 0x00, /*!< Random non resolvable. */ - LL_ADDR_RAND_RESOLVE = 0x40, /*!< Random resolvable. */ - LL_ADDR_RAND_STATIC = 0xC0 /*!< Random static. */ -}; - - -/*! \brief Advertising channel bit. */ -enum -{ - LL_ADV_CHAN_37_BIT = (1 << 0), /*!< Advertising channel 37. */ - LL_ADV_CHAN_38_BIT = (1 << 1), /*!< Advertising channel 38. */ - LL_ADV_CHAN_39_BIT = (1 << 2), /*!< Advertising channel 39. */ - LL_ADV_CHAN_DATA = (1 << 3), /*!< Data channels. */ - LL_ADV_CHAN_ALL = 0x7, /*!< All advertising channels. */ -}; - -/*! \brief Advertising filter policy. */ -enum -{ - LL_ADV_FILTER_NONE = 0, /*!< Scan from any device. */ - LL_ADV_FILTER_SCAN_WL_BIT = 1, /*!< Scan from White List only. */ - LL_ADV_FILTER_CONN_WL_BIT = 2, /*!< Connect from While List only. */ - LL_ADV_FILTER_WL_ONLY = 3 /*!< Scan and connect from While List only. */ -}; - -/*! \brief Type of scan. */ -enum -{ - LL_SCAN_PASSIVE = 0, /*!< Passive scanning. */ - LL_SCAN_ACTIVE = 1 /*!< Active scanning. */ -}; - -/*! \brief Scan filter policy. */ -enum -{ - LL_SCAN_FILTER_NONE = 0, /*!< Accept all advertising packets. */ - LL_SCAN_FILTER_WL_ONLY = 1, /*!< Accept from white list only. */ - LL_SCAN_FILTER_RES = 2, /*!< Accept from resolvable private addresses. */ - LL_SCAN_FILTER_RES_WL_ONLY = 3 /*!< Accept from resolvable private addresses and white list. */ -}; - -/*! \brief Master clock accuracy. */ -enum -{ - LL_MCA_500_PPM = 0x00, /*!< 500 ppm */ - LL_MCA_250_PPM = 0x01, /*!< 250 ppm */ - LL_MCA_150_PPM = 0x02, /*!< 150 ppm */ - LL_MCA_100_PPM = 0x03, /*!< 100 ppm */ - LL_MCA_75_PPM = 0x04, /*!< 75 ppm */ - LL_MCA_50_PPM = 0x05, /*!< 50 ppm */ - LL_MCA_30_PPM = 0x06, /*!< 30 ppm */ - LL_MCA_20_PPM = 0x07 /*!< 20 ppm */ -}; - -/*! \brief This data structure is used in functions LlCreateConn() and LlConnUpdate(). */ -typedef struct -{ - uint16_t connIntervalMin; /*!< Minimum connection interval. */ - uint16_t connIntervalMax; /*!< Maximum connection interval. */ - uint16_t connLatency; /*!< Connection latency. */ - uint16_t supTimeout; /*!< Supervision timeout. */ - uint16_t minCeLen; /*!< Minimum CE length. */ - uint16_t maxCeLen; /*!< Maximum CE length. */ -} LlConnSpec_t; - -/*! \brief Advertising report event types. */ -enum -{ - LL_RPT_TYPE_ADV_IND = 0x00, /*!< Connectable undirected advertising (ADV_IND). */ - LL_RPT_TYPE_ADV_DIRECT_IND = 0x01, /*!< Connectable directed advertising (ADV_DIRECT_IND). */ - LL_RPT_TYPE_ADV_SCAN_IND = 0x02, /*!< Scannable undirected advertising (ADV_SCAN_IND). */ - LL_RPT_TYPE_ADV_NONCONN_IND = 0x03, /*!< Non-connectable undirected advertising (ADV_NONCONN_IND). */ - LL_RPT_TYPE_SCAN_RSP = 0x04, /*!< Scan Response (SCAN_RSP). */ - - LL_RRT_TYPE_EXT_ADV_IND = 0x13, - LL_RRT_TYPE_EXT_ADV_DIRECT_IND = 0x15, - LL_RRT_TYPE_EXT_ADV_SCAN_IND = 0x12, - LL_RRT_TYPE_EXT_ADV_NONCONN_IND = 0x10, - LL_RRT_TYPE_EXT_ADV_SCAN_RSP_TO_ADV_IND = 0x1B, - LL_RRT_TYPE_EXT_ADV_SCAN_RSP_TO_ADV_SCAN_IND = 0x1A -}; - -/*! \brief This data structure is used in functions LlSetScanParam(). */ -typedef struct -{ - uint8_t scanType; - uint16_t scanInterval; - uint16_t scanWindow; - uint8_t ownAddrType; - uint8_t scanFiltPolicy; -} LlScanParam_t; - -/*! \brief This data structure is used in functions LlCreateConn(). */ -typedef struct -{ - uint16_t scanInterval; - uint16_t scanWindow; - uint8_t filterPolicy; - uint8_t peerAddrType; - uint8_t *pPeerAddr; - uint8_t ownAddrType; -} LlInitParam_t; - -typedef struct -{ - uint32_t perAdvInterMin; - uint32_t perAdvInterMax; - uint16_t perAdvProp; -} LlPerAdvParam_t; - -typedef struct -{ - uint8_t filterPolicy; - uint8_t advSID; - uint8_t advAddrType; - uint8_t *pAdvAddr; - uint16_t skip; - uint16_t syncTimeOut; -} LlPerAdvCreateSyncCmd_t; - -typedef struct -{ - uint8_t advAddrType; - uint8_t *pAdvAddr; - uint8_t advSID; -} LlDevicePerAdvList_t; - -/*! \} */ /* LL_API_CTRL */ - -/*! \addtogroup LL_API_TEST - * \{ */ - -/*! \brief Test packet payload type. */ -enum -{ - LL_TEST_PKT_TYPE_PRBS9 = 0x00, /*!< Pseudo-Random bit sequence 9. */ - LL_TEST_PKT_TYPE_0F = 0x01, /*!< 00001111'b packet payload type. */ - LL_TEST_PKT_TYPE_55 = 0x02, /*!< 01010101'b packet payload type. */ - LL_TEST_PKT_TYPE_PRBS15 = 0x03, /*!< Pseudo-Random bit sequence 15. */ - LL_TEST_PKT_TYPE_FF = 0x04, /*!< 11111111'b packet payload type. */ - LL_TEST_PKT_TYPE_00 = 0x05, /*!< 00000000'b packet payload type. */ - LL_TEST_PKT_TYPE_F0 = 0x06, /*!< 11110000'b packet payload type. */ - LL_TEST_PKT_TYPE_AA = 0x07 /*!< 10101010'b packet payload type. */ -}; - -/*! \brief Test report data. */ -typedef struct -{ - uint16_t numTx; /*!< Total transmit packet count. */ - uint16_t numRxSuccess; /*!< Successfully received packet count. */ - uint16_t numRxCrcError; /*!< CRC failed packet count. */ - uint16_t numRxMissed; /*!< Missed received packet count. */ -} llTestReport_t; - -/*! \} */ /* LL_API_TEST */ - -/*! \addtogroup LL_API_DATA - * \{ */ - -/*! \brief ACL callback events */ -enum -{ - LL_ACL_RX_IND, /*!< ACL data packet received */ - LL_ACL_TX_CNF /*!< ACL data packet transmitted */ -}; - -/*! \} */ /* LL_API_DATA */ - -/*! \addtogroup LL_API_CBACK - * \{ */ - -/*! \brief Link control callback interface events */ -enum -{ - LL_ERROR_IND = 0, /*!< Unrecoverable LL or radio error occurred. */ - /* --- Core Spec 4.0 --- */ - LL_RESET_CNF, /*!< Reset complete. */ - LL_ADV_REPORT_IND, /*!< LE advertising report. */ - LL_ADV_ENABLE_CNF, /*!< Advertising enable/disable complete. */ - LL_SCAN_ENABLE_CNF, /*!< Scan enable/disable complete. */ - LL_CONN_IND, /*!< LE connection complete. */ - LL_DISCONNECT_IND, /*!< Disconnect complete. */ - LL_CONN_UPDATE_IND, /*!< LE connection update complete. */ - LL_CREATE_CONN_CANCEL_CNF, /*!< LE create connection cancel status. */ - LL_READ_REMOTE_VER_INFO_CNF, /*!< Read remote version information complete. */ - LL_READ_REMOTE_FEAT_CNF, /*!< LE read remote features complete. */ - LL_ENC_CHANGE_IND, /*!< Encryption change. */ - LL_ENC_KEY_REFRESH_IND, /*!< Encryption key refresh. */ - LL_LTK_REQ_IND, /*!< LE LTK request. */ - LL_LTK_REQ_NEG_REPLY_CNF, /*!< LTK request negative reply status. */ - LL_LTK_REQ_REPLY_CNF, /*!< LTK request reply status. */ - /* --- Core Spec 4.2 --- */ - LL_REM_CONN_PARAM_IND, /*!< LE remote connection parameter change. */ - LL_AUTH_PAYLOAD_TIMEOUT_IND, /*!< Authenticated Payload Timeout occurred. */ - LL_DATA_LEN_CHANGE_IND, /*!< Date length change occurred. */ - LL_READ_LOCAL_P256_PUB_KEY_CMPL_IND, - LL_GENERATE_DHKEY_CMPL_IND, - LL_SCAN_REPORT_IND, - LL_ENH_CONN_IND, /*!< LE enhanced connection complete. */ - LL_DIR_ADV_REPORT_IND, /*!< LE directed advertising report. */ - /* --- Core Spec 5.0 --- */ - LL_PHY_UPDATE_IND, - LL_EXT_ADV_REPORT_IND, /*!< LE extended advertising report. */ - LL_EXT_SCAN_ENABLE_CNF, - LL_SCAN_TIMEOUT_IND, - LL_SCAN_REQ_RCVD_IND, - LL_EXT_ADV_ENABLE_CNF, - LL_ADV_SET_TERM_IND, - LL_PER_ADV_ENABLE_CNF, - LL_PER_ADV_SYNC_ESTD_IND, - LL_PER_ADV_SYNC_LOST_IND, - LL_PER_ADV_REPORT_IND, - LL_CH_SEL_ALGO_IND, - LL_API_EVENT_COUNT -}; - -/*! \brief Advertising report indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t *pData; /*!< Data buffer. */ - uint8_t len; /*!< Data buffer length. */ - int8_t rssi; /*!< RSSI. */ - uint8_t eventType; /*!< Event type. */ - uint8_t addrType; /*!< Address type. */ - bdAddr_t addr; /*!< Address. */ - - /* direct fields */ - uint8_t directAddrType; /*!< Directed address type. */ - bdAddr_t directAddr; /*!< Directed address. */ -} llAdvReportInd_t; - -/*! \brief Extended advertising report indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t eventType; /*!< Event type. */ - uint8_t addrType; /*!< Address type. */ - bdAddr_t addr; /*!< Address. */ - uint8_t priPhy; /*!< Primary PHY. */ - uint8_t secPhy; /*!< Secondary PHY. */ - uint8_t advSid; /*!< Advertising SID. */ - int8_t txPwr; /*!< Tx Power. */ - int8_t rssi; /*!< RSSI. */ - uint16_t perAdvInt; /*!< Periodic advertising interval. */ - uint8_t directAddrType; /*!< Directed address type. */ - bdAddr_t directAddr; /*!< Directed address. */ - - /** - * Data buffer length. - * \todo Explain why uint16_t is used. */ - //jo Spec Version 5.0 page 1217: Data_Length is 1 Octet - uint16_t len; - uint8_t *pData; /*!< Data buffer. */ -} llExtAdvReportInd_t; - -/*! \brief Connection indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t role; /*!< Role of this device. */ - uint8_t addrType; /*!< Peer Address type. */ - bdAddr_t peerAddr; /*!< Peer address. */ - uint16_t connInterval; /*!< Connection interval. */ - uint16_t connLatency; /*!< Connection latency. */ - uint16_t supTimeout; /*!< Supervision timeout. */ - uint8_t clockAccuracy; /*!< Clock accuracy. */ - - /* enhanced fields */ - bdAddr_t localRpa; /*!< Local resolvable private address. */ - bdAddr_t peerRpa; /*!< Peer resolvable private address. */ -} llConnInd_t; - -/*! \brief Channel Selection Algorithm indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t algo; /*!< Channel selection algorithm */ -} llChSelAlgo_t; - -/*! \brief Disconnect indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t reason; /*!< Reason code. */ -} llDisconnectInd_t; - -/*! \brief Connect update indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint16_t connInterval; /*!< Connection interval. */ - uint16_t connLatency; /*!< Connection latency. */ - uint16_t supTimeout; /*!< Supervision timeout. */ -} llConnUpdateInd_t; - -/*! \brief Connection parameter change indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t handle; /*!< Connection handle. */ - uint16_t connIntervalMin;/*!< Minimum connection interval. */ - uint16_t connIntervalMax;/*!< Maximum connection interval. */ - uint16_t connLatency; /*!< Connection latency. */ - uint16_t supTimeout; /*!< Supervision timeout. */ -} llRemConnParamInd_t; - -/*! \brief Create connection cancel confirm */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ -} llCreateConnCancelCnf_t; - -/*! \brief Read remote version information confirm */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t version; /*!< Bluetooth specification version. */ - uint16_t mfrName; /*!< Manufacturer ID. */ - uint16_t subversion; /*!< Subversion. */ -} llReadRemoteVerInfoCnf_t; - -/*! \brief Read remote feature confirm */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t features[LL_FEAT_LEN]; /*!< Features. */ -} llReadRemoteFeatCnf_t; - -/*! \brief Encryption change indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t enabled; /*!< Encryption enabled. */ -} llEncChangeInd_t; - -/*! \brief Encryption key refresh indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ -} llEncKeyRefreshInd_t; - -/*! \brief LTK request indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t randNum[LL_RAND_LEN]; /*!< Random number. */ - uint16_t encDiversifier; /*!< Encryption diversifier. */ -} llLtkReqInd_t; - -/*! \brief LTK request reply confirm */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ -} llLtkReqReplyCnf_t; - -/*! \brief LTK request negative reply */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ -} llLtkReqNegReplyCnf_t; - -/*! \brief Authenticated Payload Timeout Indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t handle; /*!< Connection handle. */ -} llAuthPayloadTimeoutInd_t; - -/*! \brief LE Data Length Change indication */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint16_t handle; /*!< Connection handle. */ - uint16_t maxTxOctets; /*!< Maximum TX Payload bytes. */ - uint16_t maxTxTime; /*!< Maximum TX Payload time. */ - uint16_t maxRxOctets; /*!< Maximum RX Payload bytes. */ - uint16_t maxRxTime; /*!< Maximum RX Payload time. */ -} llDataLenChangeInd_t; - -/*! \brief HW error event */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t status; /*!< Status. */ - uint16_t handle; /*!< Connection handle. */ - uint8_t txPhy; /*!< TX PHY being used for this connection. */ - uint8_t rxPhy; /*!< RX PHY being used for this connection. */ -} llPhyUpdateInd_t; - -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t key[2*LL_ECC_KEY_LEN];/*!< Local Public P256 Key. */ -} llReadLocalP256PubKeyCnf_t; - -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t key[LL_ECC_KEY_LEN]; /*!< Shared DH Key. */ -} llGenDHKeyCnf_t; - -/*! \brief HW error event */ -typedef struct -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - uint8_t code; /*!< Code. */ -} llHwErrorEvt_t; - -/*! \brief Union of all event types */ -typedef union -{ - wsfMsgHdr_t hdr; /*!< Event header. */ - llConnInd_t connInd; /*!< LE connection complete. */ - llChSelAlgo_t chSelAlgo; /*!< LE Channel Selection Algorithm Event */ - llDisconnectInd_t disconnectInd; /*!< LE disconnect complete. */ - llConnUpdateInd_t connUpdateInd; /*!< LE connection update complete. */ - llRemConnParamInd_t remConnParamInd; /*!< LE remote connection parameter request. */ - llAdvReportInd_t advReportInd; /*!< LE advertising report. */ - llExtAdvReportInd_t extAdvReportInd; /*!< LE extended advertising report. */ - llCreateConnCancelCnf_t createConnCancelCnf; /*!< LE create connection cancel status. */ - llReadRemoteVerInfoCnf_t readRemoteVerInfoCnf; /*!< Read remote version information complete. */ - llReadRemoteFeatCnf_t readRemoteFeatCnf; /*!< LE read remote features complete. */ - llEncChangeInd_t encChangeInd; /*!< Encryption change */ - llEncKeyRefreshInd_t encKeyRefreshInd; /*!< Encryption key refresh */ - llLtkReqInd_t ltkReqInd; /*!< LE LTK request. */ - llLtkReqReplyCnf_t ltkReqReplyCnf; /*!< LTK request reply status. */ - llLtkReqNegReplyCnf_t ltkReqNegReplyCnf; /*!< LTK request negative reply status. */ - llHwErrorEvt_t hwErrorEvt; /*!< Unrecoverable LL or radio error occurred. */ - llAuthPayloadTimeoutInd_t authPayloadTimeoutInd; /*!< Authenticated Payload Timeout occurred. */ - llDataLenChangeInd_t dataLenChagneInd; /*!< LE Data length change indication. */ - llPhyUpdateInd_t phyUpdateInd; /*!< PHY update complete indication. */ - llReadLocalP256PubKeyCnf_t readLocalP256Cnf; /*!< Read Local P256 Public Key complete. */ - llGenDHKeyCnf_t genDHKeyCnf; /*!< Generate DH Key complete. */ -} LlEvt_t; - -/*! \brief Event callback */ -typedef bool_t (*llEvtCback_t)(LlEvt_t *pEvent); - -/*! \brief ACL callback */ -typedef void (*llAclCback_t)(uint16_t handle, uint8_t numBufs); - -/*! \} */ /* LL_API_CBACK */ - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -/*! \addtogroup LL_API_INIT - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Initialize LL subsystem for operation as an advertising slave. - * - * \return None. - * - * This function initializes the LL subsystem for use as an advertising slave. - */ -/*************************************************************************************************/ -void LlAdvSlaveInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize LL subsystem for operation as a connectable slave. - * - * \return None. - * - * This function initializes the LL subsystem for use as an advertising and connectable slave. - */ -/*************************************************************************************************/ -void LlConnSlaveInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize LL subsystem for operation as a scanning master. - * - * \return None. - * - * This function initializes the LL subsystem for use as a scanning master. - */ -/*************************************************************************************************/ -void LlScanMasterInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize LL subsystem for operation as a connectable master. - * - * \return None. - * - * This function initializes the LL subsystem for use as a scanning and initiating master. - */ -/*************************************************************************************************/ -void LlConnMasterInit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize LL subsystem with task handler. - * - * \param handlerId WSF handler ID. - * - * \return None. - * - * This function initializes the LL subsystem. It is called once upon system initialization. - * It must be called before any other function in the LL API is called. - */ -/*************************************************************************************************/ -void LlHandlerInit(wsfHandlerId_t handlerId); - -/*************************************************************************************************/ -/*! - * \brief LL message dispatch handler. - * - * \param event WSF event. - * \param pMsg WSF message. - * - * \return None. - */ -/*************************************************************************************************/ -void LlHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); - -/*************************************************************************************************/ -/*! - * \brief Reset LL subsystem. - * - * \return None. - * - * Reset the LL subsystem. All active connections are closed and all radio procedures such as - * scanning or advertising are terminated. - */ -/*************************************************************************************************/ -void LlReset(void); - -/*************************************************************************************************/ -/*! - * \brief Register LL event handler. - * - * \param evtCback Client callback function. - * - * \return None. - * - * This function is called by a client to register for LL events. - */ -/*************************************************************************************************/ -void LlEvtRegister(llEvtCback_t evtCback); - -/*************************************************************************************************/ -/*! - * \brief Register ACL handler. - * - * \param sendCompCback Client ACL send complete callback function. - * \param recvPendCback Client ACL receive pending callback function. - * - * \return None. - * - * This function is called by a client to register for ACL data. - */ -/*************************************************************************************************/ -void LlAclRegister(llAclCback_t sendCompCback, llAclCback_t recvPendCback); - -/*! \} */ /* LL_API_INIT */ - -/*! \addtogroup LL_API_PARAM - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Set Bluetooth device address - * - * \param pAddr Bluetooth device address. - * - * \return None. - * - * Set the BD address to be used by LL. - */ -/*************************************************************************************************/ -void LlSetBdAddr(const uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Get Bluetooth device address - * - * \param pAddr Bluetooth device address. - * - * \return None. - * - * Get the BD address currently used by LL or all zeros if address is not set. - */ -/*************************************************************************************************/ -void LlGetBdAddr(uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Set random device address. - * - * \param pAddr Random Bluetooth device address. - * - * \return None. - * - * Set the random address to be used by LL. - */ -/*************************************************************************************************/ -void LlSetRandAddr(const uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Get random device address - * - * \param pAddr Random Bluetooth device address. - * - * \return None. - * - * Get the random address currently used by LL or all zeros if address is not set. - */ -/*************************************************************************************************/ -void LlGetRandAddr(uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Set advertising transmit power. - * - * \param advTxPwr Advertising transmit power level. - * - * \return None. - * - * Set the advertising transmit power. - */ -/*************************************************************************************************/ -void LlSetAdvTxPower(int8_t advTxPwr); - -/*************************************************************************************************/ -/*! - * \brief Get advertising transmit power. - * - * \param advTxPwr Advertising transmit power level. - * - * \return None. - * - * Get the advertising transmit power. - */ -/*************************************************************************************************/ -void LlGetAdvTxPower(int8_t *pAdvTxPwr); - -/*************************************************************************************************/ -/*! - * \brief Get supported states. - * - * \param pStates Supported states bitmask. - * - * \return None. - * - * Return the states supported by the LL. - */ -/*************************************************************************************************/ -void LlGetSupStates(uint8_t *pStates); - -/*************************************************************************************************/ -/*! - * \brief Get features. - * - * \param pFeatures Supported features bitmask. - * - * \return None. - * - * Return the LE features supported by the LL. - */ -/*************************************************************************************************/ -void LlGetFeatures(uint8_t *pFeatures); - -/*************************************************************************************************/ -/*! - * \brief Set features. - * - * \param pFeatures Supported features bitmask. - * \param pFeaturesMask Bitmask describing features to be modified. - * - * \return Status error code. - * - * Set the LE features supported by the LL. - */ -/*************************************************************************************************/ -uint8_t LlSetFeatures(const uint8_t *pFeatures, const uint8_t *pMask); - -/*************************************************************************************************/ -/*! - * \brief Vendor-specific set power level. - * - * \param param power level in dBm. - * - * \return None. - */ -/*************************************************************************************************/ -void LlSetTxPower(int8_t power); - -/*************************************************************************************************/ -/*! - * \brief Get white list size. - * - * \return Total number of white list entries. - * - * Read the white list capacity supported by the LL. - */ -/*************************************************************************************************/ -uint8_t LlGetWhitelistSize(void); - -/*************************************************************************************************/ -/*! - * \brief Clear all white list entries. - * - * \return Status error code. - * - * Clear all white list entries stored in the LL. - * - * \note This function must only be called when advertising or scan is disabled - * and not initiating. - */ -/*************************************************************************************************/ -uint8_t LlClearWhitelist(void); - -/*************************************************************************************************/ -/*! - * \brief Add device to the white list. - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Bluetooth device address. - * - * \return Status error code. - * - * Adds the given address to the white list stored in the LL. - * - * \note This function must only be called when advertising or scan is disabled - * and not initiating. - */ -/*************************************************************************************************/ -uint8_t LlAddDeviceToWhitelist(bool_t addrType, bdAddr_t pAddr); - -/*************************************************************************************************/ -/*! - * \brief Remove device from the white list. - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Bluetooth device address. - * - * \return Status error code. - * - * Removes the given address from the white list stored in the LL. - * - * \note This function must only be called when advertising or scan is disabled - * and not initiating. - */ -/*************************************************************************************************/ -uint8_t LlRemoveDeviceFromWhitelist(bool_t addrType, bdAddr_t pAddr); - -/*************************************************************************************************/ -/*! - * \brief Get random number. - * - * \param pRandNum Buffer to store 8 bytes random data. - * - * \return Status error code. - * - * Request the LL to generate a random number. - */ -/*************************************************************************************************/ -uint8_t LlGetRandNum(uint8_t *pRandNum); - -/*************************************************************************************************/ -/*! - * \brief Get RSSI of a connection. - * - * \param handle Connection handle. - * \param pRssi RSSI value. - * - * \return Status error code. - * - * Get the current RSSI of a connection. - */ -/*************************************************************************************************/ -uint8_t LlGetRssi(uint16_t handle, int8_t *pRssi); - -/*************************************************************************************************/ -/*! - * \brief Get connection's TX power level. - * - * \param handle Connection handle. - * \param pLevel Transmit power level. - * - * \return Status error code. - * - * Get the TX power of a connection. - */ -/*************************************************************************************************/ -uint8_t LlGetTxPowerLevel(uint16_t handle, uint8_t type, int8_t *pLevel); - -/*************************************************************************************************/ -/*! - * \brief Set connection's TX power level. - * - * \param handle Connection handle. - * \param level Transmit power level. - * - * \return Status error code. - * - * Set the TX power of a connection. - */ -/*************************************************************************************************/ -uint8_t LlSetTxPowerLevel(uint16_t handle, int8_t level); - -/*************************************************************************************************/ -/*! - * \brief Get connection's channel map. - * - * \param handle Connection handle. - * \param pChanMap Channel map. - * - * \return Status error code. - * - * Get the current channel map of a connection. - */ -/*************************************************************************************************/ -uint8_t LlGetChannelMap(uint16_t handle, uint8_t *pChanMap); - -/*************************************************************************************************/ -/*! - * \brief Set channel map. - * - * \param pChanMap Channel map. - * - * \return Status error code. - * - * Set the current channel map used by the link layer. - */ -/*************************************************************************************************/ -uint8_t LlSetChannelMap(uint8_t *pChanMap); - -/*************************************************************************************************/ -/*! - * \brief Get connection's Authenticated Payload Timeout. - * - * \param handle Connection handle. - * \param pTimeout Timeout (in milliseconds) - * - * \return Status error code. - * - * Get the Authenticated Payload Timeout of a connection. - */ -/*************************************************************************************************/ -uint8_t LlReadAuthPayloadTimeout(uint16_t handle, uint16_t *pTimeout); - -/*************************************************************************************************/ -/*! - * \brief Set connection's Authenticated Payload Timeout. - * - * \param handle Connection handle. - * \param timeout10Ms Timeout (in 10s of milliseconds). - * - * \return Status error code. - * - * Set the Authenticated Payload Timeout of a connection. - */ -/*************************************************************************************************/ -uint8_t LlWriteAuthPayloadTimeout(uint16_t handle, uint16_t timeout10Ms); - -/*************************************************************************************************/ -/*! - * \brief Set advertising parameter. - * - * \param advIntervalMin Minimum advertising interval. - * \param advIntervalMax Maximum advertising interval. - * \param advType Advertising type. - * \param ownAddrType Address type used by this device. - * \param peerAddrType Address type of peer device. Only used for directed advertising. - * \param pPeerAddr Address of peer device. Only used for directed advertising. - * \param advChanMap Advertising channel map. - * \param advFiltPolicy Advertising filter policy. - * - * \return Status error code. - * - * Set advertising parameters. - * - * \note This function must only be called when advertising is disabled. - */ -/*************************************************************************************************/ -uint8_t LlSetAdvParam(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, - uint8_t ownAddrType, uint8_t peerAddrType, const uint8_t *pPeerAddr, - uint8_t advChanMap, uint8_t advFiltPolicy); - -/*************************************************************************************************/ -/*! - * \brief Set advertising data. - * - * \param len Data buffer length. - * \param pData Advertising data buffer. - * - * \return Status error code. - * - * Set advertising data data. - */ -/*************************************************************************************************/ -uint8_t LlSetAdvData(uint8_t len, const uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Set scan parameters. - * - * \param param Scan parameters. - * - * \return Status error code. - * - * Set scan parameters. - * - * \note This function must only be called when scanning is disabled. - */ -/*************************************************************************************************/ -uint8_t LlSetScanParam(/*@temp@*/ LlScanParam_t *param); - -/*************************************************************************************************/ -/*! - * \brief Set scan response data. - * - * \param len Data buffer length. - * \param pData Scan response data buffer. - * - * \return Status error code. - * - * Set scan response data. - */ -/*************************************************************************************************/ -uint8_t LlSetScanRespData(uint8_t len, const uint8_t *pData); - -/*! \} */ /* LL_API_PARAM */ - -/*! \addtogroup LL_API_CTRL - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Advertising enable. - * - * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. - * - * \return None. - - * Enable or disable advertising. - */ -/*************************************************************************************************/ -void LlAdvEnable(uint8_t enable); - -/*************************************************************************************************/ -/*! - * \brief Scan enable. - * - * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. - * \param filterDup Set to TRUE to filter duplicates. - * - * \return None. - * - * Enable or disable scanning. This function is only used when operating in master role. - */ -/*************************************************************************************************/ -void LlScanEnable(uint8_t enable, uint8_t filterDup); - -/*************************************************************************************************/ -/*! - * \brief Create connection. - * - * \param scanInterval Scan interval. - * \param scanWindow Scan window. - * \param filterPolicy Scan filter policy. - * \param peerAddrType Address type used for peer device. - * \param pPeerAddr Address of peer device. - * \param ownAddrType Address type used by this device. - * \param pConnSpec Connection specification. - * - * \return Status for command status event. - * - * Create a connection to the specified peer address with the specified connection parameters. - * This function is only when operating in master role. - */ -/*************************************************************************************************/ -uint8_t LlCreateConn(LlInitParam_t *pInitParam, LlConnSpec_t *pConnSpec); - -/*************************************************************************************************/ -/*! - * \brief Disconnect a connection. - * - * \param handle Connection handle. - * \param reason Disconnect reason. - * - * \return Status error code. - * - * Disconnect a connection. - */ -/*************************************************************************************************/ -uint8_t LlDisconnect(uint16_t handle, uint8_t reason); - -/*************************************************************************************************/ -/*! - * \brief Cancel a create connection operation. - * - * \return Status error code. - * - * Cancel a connection before it is established. This function is only used when operating - * in master role. - */ -/*************************************************************************************************/ -uint8_t LlCreateConnCancel(void); - -/*************************************************************************************************/ -/*! - * \brief Update connection parameters. - * - * \param handle Connection handle. - * \param pConnSpec New connection specification. - * - * \return None. - * - * Update the connection parameters of a connection. - */ -/*************************************************************************************************/ -void LlConnUpdate(uint16_t handle, LlConnSpec_t *pConnSpec); - -/*************************************************************************************************/ -/*! - * \brief Remote connection parameter request reply. - * - * \param handle Connection handle. - * \param pConnSpec New connection specification. - * - * \return Status error code. - * - * Reply to a connection parameter request. - */ -/*************************************************************************************************/ -uint8_t LlRemoteConnParamReqReply(uint16_t handle, LlConnSpec_t *pConnSpec); - -/*************************************************************************************************/ -/*! - * \brief Remote connection parameter request negative reply. - * - * \param handle Connection handle. - * \param reason Reason code. - * - * \return None. - * - * Negative reply to a connection parameter request. - */ -/*************************************************************************************************/ -uint8_t LlRemoteConnParamReqNegReply(uint16_t handle, uint8_t reason); - -/*************************************************************************************************/ -/*! - * \brief Read remote features. - * - * \param handle Connection handle. - * - * \return Status error code. - * - * Read the link layer features of the remote device. - */ -/*************************************************************************************************/ -uint8_t LlReadRemoteFeat(uint16_t handle); - -/*************************************************************************************************/ -/*! - * \brief Read remote version information. - * - * \param handle Connection handle. - * - * \return Status error code. - * - * Read the version information of the remote device. - */ -/*************************************************************************************************/ -uint8_t LlReadRemoteVerInfo(uint16_t handle); - -/*************************************************************************************************/ -/*! - * \brief Encrypt data. - * - * \param pKey Encryption key. - * \param pData 16 bytes of plain text data. - * - * \return Status error code. - * - * Request the LL to encryption a block of data in place. - */ -/*************************************************************************************************/ -uint8_t LlEncrypt(uint8_t *pKey, uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Start encryption. - * - * \param handle Connection handle. - * \param pRand Random number. - * \param diversifier Diversifier value. - * \param pKey Pointer to the encryption key. - * - * \return None. - * - * Start or restart link layer encryption on a connection. This function is only used when - * operating in master role. - */ -/*************************************************************************************************/ -void LlStartEncryption(uint16_t handle, uint8_t *pRand, uint16_t diversifier, uint8_t *pKey); - -/*************************************************************************************************/ -/*! - * \brief Reply to a LTK request. - * - * \param handle Connection handle. - * \param pKey Pointer to new key. - * - * \return None. - * - * Provide the requested LTK encryption key. This function is only used when operating in - * slave mode. - */ -/*************************************************************************************************/ -void LlLtkReqReply(uint16_t handle, uint8_t *pKey); - -/*************************************************************************************************/ -/*! - * \brief Negative reply to a LTK request. - * - * \param handle Connection handle. - * - * \return None. - * - * Requested LTK encryption key not available. This function is only used when operating in - * slave mode. - */ -/*************************************************************************************************/ -void LlLtkReqNegReply(uint16_t handle); - -/*! \} */ /* LL_API_CTRL */ - -/*! \addtogroup LL_API_DATA - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Set the number of buffers in the LL ACL transmit queue. - * - * \param numBufs Number of buffers. - * - * \return None. - */ -/*************************************************************************************************/ -void LlSetAclTxBufs(uint8_t numBufs); - -/*************************************************************************************************/ -/*! - * \brief Get the number of buffers in the LL ACL transmit queue. - * - * \return Number of buffers. - */ -/*************************************************************************************************/ -uint8_t LlGetAclTxBufs(void); - -/*************************************************************************************************/ -/*! - * \brief Set the number of buffers in the LL ACL receive queue. - * - * \param numBufs Number of buffers. - * - * \return None. - */ -/*************************************************************************************************/ -void LlSetAclRxBufs(uint8_t numBufs); - -/*************************************************************************************************/ -/*! - * \brief Get the number of buffers in the LL ACL receive queue. - * - * \return Number of buffers. - */ -/*************************************************************************************************/ -uint8_t LlGetAclRxBufs(void); - -/*************************************************************************************************/ -/*! - * \brief Get the maximum size of an entry in the LL ACL queue. - * - * \return Number of bytes. - */ -/*************************************************************************************************/ -uint16_t LlGetAclMaxSize(void); - -/*************************************************************************************************/ -/*! - * \brief Set the data length for transmission PDU - * - * \param handle Connection handle. - * - * \param txOctets Preferred maximum number of payload octetes. 0x1B-0xFB. - * - * \param txTime Preferred maximum number of microseconds. 0x148-0x848. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetDataLen(uint16_t handle, uint16_t txOctets, uint16_t txTime); - -/*************************************************************************************************/ -/*! - * \brief Get the initial data length for transmission PDU for new connections - * - * \param txOctets Initial maximum payload octets. 0x1B-0xFB. - * - * \param txTime Initial maximum microseconds. 0x148-0x848. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadDefaulTxDataLen(uint16_t *txOctets, uint16_t *txTime); - -/*************************************************************************************************/ -/*! - * \brief Set the data length for transmission PDU for new connections - * - * \param txOctets Initial maximum payload octets. 0x1B-0xFB. - * - * \param txTime Initial maximum microseconds. 0x148-0x848. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlWriteDefaultDataLen(uint16_t suggestedMaxTxOctets, uint16_t suggestedMaxTxTime); - -/*************************************************************************************************/ -/*! - * \brief Read the maximum data lengths - * - * \param pMaxTxOctets Maximum transmit payload octets. - * - * \param pMaxTxTime Maximum transmit payload microseconds. - * - * \param pMaxRxOctets Maximum transmit payload octets. - * - * \param pMaxRxTime Maximum transmit payload microseconds. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadMaximumDataLen(uint16_t *pMaxTxOctets, uint16_t *pMaxTxTime, uint16_t *pMaxRxOctets, uint16_t *pMaxRxTime); - -/*************************************************************************************************/ -/*! - * \brief Send an ACL data packet. - * - * \param pData Data buffer - * - * \return None. - * - * Send an ACL data packet. pData points to an ACL buffer formatted according to [1]; the host - * must set the connection handle, flags, and length fields in the buffer. - */ -/*************************************************************************************************/ -void LlSendAclData(uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Receive an ACL data packet - * - * \return Data buffer. - * - * Receive an ACL data packet. This function returns a pointer to an ACL buffer formatted - * according to [1]. The host must parse the header to determine the connection handle, flags, - * and length fields. If no ACL buffers are available this function returns NULL. - * - * The host must deallocate the buffer by calling WsfMsgFree() and call LlRecvBufCmpl() to - * update LL accounting. - */ -/*************************************************************************************************/ -uint8_t *LlRecvAclData(void); - -/*************************************************************************************************/ -/*! - * \brief Receive packet processing completed. - * - * \param numBufs Number of completed packets. - * - * \return None. - * - * Indicate to the LL receives buffers are available and, if needed, release flow control. - */ -/*************************************************************************************************/ -void LlRecvBufCmpl(uint8_t numBufs); - -/*! \} */ /* LL_API_DATA */ - -/*! \addtogroup LL_API_TEST - * \{ */ - -/*************************************************************************************************/ -/*! - * \brief Set advertising event access address. - * - * \param accessAddr Access address. - * - * \return None. - * - * Set the access address used in advertising, scanning and in test modes. - */ -/*************************************************************************************************/ -void LlSetAdvAccessAddr(uint32_t accessAddr); - -/*************************************************************************************************/ -/*! - * \brief Set advertising event CRC init value. - * - * \param crcInit CRC initial value. - * - * \return None. - * - * Set the CRC initial value used in advertising, scanning and test modes. - */ -/*************************************************************************************************/ -void LlSetAdvCrcInit(uint16_t crcInit); - -/*************************************************************************************************/ -/*! - * \brief Set test mode synchronization delay. - * - * \param delay Delay in 625-us ticks. - * - * \return None. - * - * Set the synchronization delay used in test mode. - */ -/*************************************************************************************************/ -void LlSetTestSyncDelay(uint32_t delay); - -/*************************************************************************************************/ -/*! - * \brief Enter transmit test mode. - * - * \param chan Bluetooth channel. - * \param len Length of test data. - * \param pktType Test packet payload type. - * \param numPkt Auto terminate after number of packets, 0 for infinite. - * - * \return Status error code. - * - * Start the transmit test mode on the given channel. - */ -/*************************************************************************************************/ -uint8_t LlTxTest(uint8_t chan, uint8_t len, uint8_t pktType, uint16_t numPkt); - -/*************************************************************************************************/ -/*! - * \brief Enter receive test mode. - * - * \param chan Bluetooth channel. - * \param numPkt Auto terminate after number of successful packets, 0 for infinite. - * - * \return Status error code. - * - * Start the receive test mode on the given channel. - */ -/*************************************************************************************************/ -uint8_t LlRxTest(uint8_t chan, uint16_t numPkt); - -/*************************************************************************************************/ -/*! - * \brief Enter enhanced transmit test mode. - * - * \param chan Bluetooth channel. - * \param len Length of test data. - * \param pktType Test packet payload type. - * \param phy PHY to use for the test. LL_PHY_1M for legacy LlTxTest. - * \param numPkt Auto terminate after number of packets, 0 for infinite. - * - * \return Status error code. - * - * Start the transmit test mode on the given channel. - */ -/*************************************************************************************************/ -uint8_t LlEnhTxTest(uint8_t chan, uint8_t len, uint8_t pktType, uint8_t phy, uint16_t numPkt); - -/*************************************************************************************************/ -/*! - * \brief Enter enhanced receive test mode. - * - * \param chan Bluetooth channel. - * \param phy PHY to use for the test. LL_PHY_1M for legacy LlRxTest. - * \param modIndex Modulation Index, 0 = standard, 1 = stable. 0 for legacy LlRxTest. - * \param numPkt Auto terminate after number of successful packets, 0 for infinite. - * - * \return Status error code. - * - * Start the receive test mode on the given channel. - */ -/*************************************************************************************************/ -uint8_t LlEnhRxTest(uint8_t chan, uint8_t phy, uint8_t modIndex, uint16_t numPkt); - -/*************************************************************************************************/ -/*! - * \brief End test mode. - * - * \param pRpt Report return buffer. - * - * \return Status error code. - * - * End test mode and return the report. - */ -/*************************************************************************************************/ -uint8_t LlEndTest(llTestReport_t *pRpt); - -/*************************************************************************************************/ -/*! - * \brief Initiate a LE ping procedure. - * - * \param handle Connection handle. - * - * \return None. - * - * Initiate the LE ping LLCP. - */ -/*************************************************************************************************/ -void LlPing(uint16_t handle); - -/*************************************************************************************************/ -/*! - * \brief Add device to the address resolution list. - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Bluetooth device address. - * \param pPIRK Peer Identity Resolution Key. - * \param pLIRK Local Identity Resolution Key. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlAddDeviceToResolvingList(bool_t addrType, const uint8_t *pAddr, const uint8_t *pPIRK, const uint8_t *pLIRK); - -/*************************************************************************************************/ -/*! - * \brief Remove device from the address resolution list. - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Bluetooth device address. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlRemoveDeviceFromResolvingList(bool_t addrType, const uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Get the maximum number of entries in the address resolution list. - * - * \param pResListSize Resolving list size. - * - * \return Maximum number of entries in the address resolution list. - */ -/*************************************************************************************************/ -void LlReadResolvingListSize(uint8_t *pResListSize); - -/*************************************************************************************************/ -/*! - * \brief Get the peer resolvable private address - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Public Bluetooth device address. - * \param pPAddr Pointer to hold peer resolvable Bluetooth device address. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadPeerResolvableAddr(bool_t addrType, const uint8_t *pAddr, uint8_t *pPAddr); - -/*************************************************************************************************/ -/*! - * \brief Get the local resolvable private address - * - * \param addrType TRUE for random address. FALSE for public. - * \param pAddr Public Bluetooth device address. - * \param pPAddr Pointer to hold local resolvable Bluetooth device address. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadLocalResolvableAddr(bool_t addrType, const uint8_t *pAddr, uint8_t *pLAddr); - -/*************************************************************************************************/ -/*! - * \brief Clear the address resolution list. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlClearResolvingList(void); - -/*************************************************************************************************/ -/*! - * \brief Enable or disable the address resolution. - * - * \param enable TRUE to enable, FALSE to disable. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetAddrResolutionEnable(bool_t enable); - -/*************************************************************************************************/ -/*! - * \brief Set the length of time the controller will use a Resolvable Private Address. - * - * \param timeout Number of seconds. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetResolvablePrivateAddrTimeout(uint16_t timeout); - -//typedef void LlExtAdvParam_t; -/*! \brief Extended advertising parameters */ -typedef struct -{ - uint16_t advEventProp; /*!< \brief Advertising Event Properties. */ - uint32_t priAdvInterMin; /*!< \brief Primary Advertising Interval Minimum. */ - uint32_t priAdvInterMax; /*!< \brief Primary Advertising Interval Maximum. */ - uint8_t priAdvChanMap; /*!< \brief Primary Advertising Channel Map. */ - uint8_t ownAddrType; /*!< \brief Own Address Type. */ - uint8_t peerAddrType; /*!< \brief Peer Address Type. */ - uint8_t *pPeerAddr; /*!< \brief Peer Address. */ - uint8_t advFiltPolicy; /*!< \brief Advertising Filter Policy. */ - int8_t advTxPwr; /*!< \brief Advertising Tx Power. */ - uint8_t priAdvPhy; /*!< \brief Primary Advertising PHY. */ - uint8_t secAdvMaxSkip; /*!< \brief Secondary Advertising Maximum Skip. */ - uint8_t secAdvPhy; /*!< \brief Secondary Advertising PHY. */ - uint8_t advSetId; /*!< \brief Advertising set ID. */ - uint8_t scanReqNotifEna; /*!< \brief Scan Request Notification Enable. */ -} LlExtAdvParam_t; - -//typedef void LlExtAdvEnableParam_t; -/*! \brief Extended advertising enable parameters */ -typedef struct -{ - uint8_t advHandle; /*!< \brief Advertising handle. */ - uint16_t duration; /*!< \brief Advertising duration in 10 ms units. */ - uint8_t maxEaEvents; /*!< \brief Maximum number of extended advertising events. */ -} LlExtAdvEnableParam_t; - -/*! \brief This data structure is used in functions LlSetExtScanParam(). */ -typedef struct -{ - uint8_t scanType; /*!< \brief Scan type. */ - uint16_t scanInterval; /*!< \brief Scan interval. */ - uint16_t scanWindow; /*!< \brief Scan window. */ -} LlExtScanParamPhyParam_t; - -typedef struct -{ - uint8_t ownAddrType; - uint8_t scanFiltPolicy; - - /*! Scan phys. */ - bool_t phys[LL_MAX_NUM_PHYS]; - - /*! Scan perm phy parameters. */ - LlExtScanParamPhyParam_t phyParam[LL_MAX_NUM_PHYS]; -} LlExtScanParam_t; - -typedef void LlExtInitParam_t; -typedef void LlExtInitScanParam_t; - -void LlGetVersion(uint16_t *manufacturerName, uint8_t *pHciVersion, uint16_t *pHciRevision); -void LlSetPrivacyMode(uint8_t addrType, const uint8_t *pAddr, uint8_t mode); -void LlGenerateP256KeyPair(void); -void LlGenerateDhKey(uint8_t *pPubKeyX, uint8_t *pPubKeyY); -void LlSetAdvSetRandAddr(uint8_t advHandle, const uint8_t *pAddr); - -/*************************************************************************************************/ -/*! - * \brief Set extended advertising parameter. - * - * \param advHandle Advertising handle. - * \param pExtAdvParam Extended advertising parameters. - * - * \return Status error code. - * - * \note This function must only be called when advertising is disabled. - */ -/*************************************************************************************************/ -uint8_t LlSetExtAdvParam(uint8_t advHandle, LlExtAdvParam_t *pExtAdvParam); - -/*************************************************************************************************/ -/*! - * \brief Set extended advertising data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param fragPref Fragment preference. - * \param len Data buffer length. - * \param pData Advertising data buffer. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetExtAdvData(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Set extended scan response data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param fragPref Fragment preference. - * \param len Data buffer length. - * \param pData Scan response data buffer. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetExtScanRespData(uint8_t advHandle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Set extended advertising enable command. - * - * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. - * \param numSets Number of advertising sets. - * \param pEnableParam Advertising enable parameter array. - */ -/*************************************************************************************************/ -void LlExtAdvEnable(uint8_t enable, uint8_t numSets, LlExtAdvEnableParam_t *pEnableParam); - -/*************************************************************************************************/ -/*! - * \brief Remove advertising set command. - * - * \param advHandle Advertising handle. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlRemoveAdvSet(uint8_t advHandle); - -/*************************************************************************************************/ -/*! - * \brief Clear advertising sets command. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlClearAdvSets(void); - -/*************************************************************************************************/ -/*! - * \brief Read transmit power. - * - * \param minTxPower Minimum transmit power supported by the controller. - * \param maxTxPower Maximum transmit power supported by the controller. - */ -/*************************************************************************************************/ -void LlReadTxPower(int8_t *minTxPower, int8_t *maxTxPower); - -/*************************************************************************************************/ -/*! - * \brief Read RF path compensation parameters. - * - * \param txPathComp RF Path compensation value used for TX Power level calculation. - * \param rxPathComp RF Path compensation value used for RSSI calculation. - */ -/*************************************************************************************************/ -void LlReadRfPathComp(int16_t *txPathComp, int16_t *rxPathComp); - -/*************************************************************************************************/ -/*! - * \brief Write RF path compensation parameters. - * \param txPathComp RF Path compensation value used for TX Power level calculation. - * \param rxPathComp RF Path compensation value used for RSSI calculation. - */ -/*************************************************************************************************/ -void LlWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp); - -/*************************************************************************************************/ -/*! - * \brief Set extended scanning parameters command. - * - * \param pScanParam Scanning parameter array. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetExtScanParam(/*@temp@*/ LlExtScanParam_t *pScanParam); - -/*************************************************************************************************/ -/*! - * \brief Extended scan enable command. - * - * \param enable Set to TRUE to enable scanning, FALSE to disable scanning. - * \param filterDup Set to TRUE to filter duplicates. - * \param duration Duration. - * \param period Period. - */ -/*************************************************************************************************/ -void LlExtScanEnable(uint8_t enable, uint8_t filterDup, uint16_t duration, uint16_t period); - -/*************************************************************************************************/ -/*! - * \brief Extended create connection command. - * - * \param pInitParam Initiating parameters. - * \param pScanParam Initiating scan parameters. - * \param pConnSpec Connection specification. - * - * \return None. - */ -/*************************************************************************************************/ -uint8_t LlExtCreateConn(LlExtInitParam_t *pInitParam, LlExtInitScanParam_t *pScanParam, LlConnSpec_t *pConnSpec); - -/*************************************************************************************************/ -/*! - * \brief The LE_Read_PHY command is used to read the current transmitter PHY and - * receiver PHY on the connection identified by the Connection_Handle. - * - * \param handle Connection handle. - * \param pTxPhy PHY used for TX. - * \param pRxPhy PHY used for RX. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadPhy(uint16_t handle, uint8_t *pTxPhy, uint8_t *pRxPhy); - -/*************************************************************************************************/ -/*! - * \brief The LE_Set_Default_PHY command allows the Host to specify its preferred - * values for the transmitter PHY and receiver PHY to be used for all subsequent - * connections over the LE transport. - * - * \param allPhys The ALL_PHYS parameter is a bit field that allows the Host to specify, for each - * direction, whether it has no preference among the PHYs that the Controller - * supports in a given direction or whether it has specified particular PHYs that it - * prefers in the TX_PHYS or RX_PHYS parameter. - * - * \param TxPhys The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that - * the Host prefers the Controller to use. If the ALL_PHYS parameter specifies - * that the Host has no preference, the TX_PHYS parameter is ignored; - * otherwise at least one bit shall be set to 1. - * - * \param RxPhys The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the - * Host prefers the Controller to use. If the ALL_PHYS parameter specifies that - * the Host has no preference, the RX_PHYS parameter is ignored; otherwise at - * least one bit shall be set to 1. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys); - -/*************************************************************************************************/ -/*! - * \brief The LE_Set_PHY command is used to set the PHY preferences for the - * connection identified by the Connection_Handle. The Controller might not be - * able to make the change (e.g. because the peer does not support the - * requested PHY) or may decide that the current PHY is preferable. - * - * \param handle Connection handle. - * \param allPhys The ALL_PHYS parameter is a bit field that allows the Host to specify, for each - * direction, whether it has no preference among the PHYs that the Controller - * supports in a given direction or whether it has specified particular PHYs that it - * prefers in the TX_PHYS or RX_PHYS parameter. - * - * \param TxPhys The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that - * the Host prefers the Controller to use. If the ALL_PHYS parameter specifies - * that the Host has no preference, the TX_PHYS parameter is ignored; - * otherwise at least one bit shall be set to 1. - * - * \param RxPhys The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the - * Host prefers the Controller to use. If the ALL_PHYS parameter specifies that - * the Host has no preference, the RX_PHYS parameter is ignored; otherwise at - * least one bit shall be set to 1. - * - * \param phyOptions The PHY_options parameter is a bit field that allows the Host to specify options - * for PHYs. The default value for a new connection shall be all zero bits. The - * Controller may override any preferred coding for transmitting on the LE Coded - * PHY. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetPhy(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions); - -/*************************************************************************************************/ -/*! - * \brief Translate the PHY preference bit to the PHY value. - * - * \param pref PHY preference bit. - * - * \return PHY value. - */ -/*************************************************************************************************/ -uint8_t LlTranslatePhyPref(uint8_t pref); - -/*************************************************************************************************/ -/*! - * \brief Translate the PHY preference bit to the PHY value. - * - * \param value PHY value. - * - * \return PHY preference bit. - */ -/*************************************************************************************************/ -uint8_t LlTranslatePhyValue(uint8_t value); - -/*************************************************************************************************/ -/*! - * \brief Maximum length of data supported by the Controller for use asadvertisement data or - * scan response data in an advertising event or as periodic advertisement data. - * - * \param pMaxAdvDataLen Controller maximum advertisement (or scan response) data length. - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadMaxAdvDataLen(uint16_t *pMaxAdvDataLen); - -/*************************************************************************************************/ -/*! - * \brief Read the maximum number of advertising sets supported by the advertising Controller. - * - * \param pNumSupAdvSets Controller maximum number of advertising sets. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadNumSupAdvSets(uint8_t *pNumSupAdvSets); - -/*************************************************************************************************/ -/*! -* \brief Read the power used for advertising packets. -* -* \return Power level in dBm units. -* -*/ -/*************************************************************************************************/ -uint8_t LlReadAdvTxPower(int8_t *power); - -void LlRecvAclDataComplete(uint8_t); - -/*************************************************************************************************/ -/*! - * \brief Set periodic advertising parameters command. - * - * \param advHandle Advertising handle. - * \param advIntervalMin Periodic advertising interval minimum. - * \param advIntervalMax Periodic advertising interval maximum. - * \param advProps Periodic advertising properties. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetPeriodicAdvParam(uint8_t advHandle, LlPerAdvParam_t *pPerAdvParam); - -/*************************************************************************************************/ -/*! - * \brief Set periodic advertising data command. - * - * \param advHandle Advertising handle. - * \param op Operation. - * \param len Data buffer length. - * \param pData Advertising data buffer. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetPeriodicAdvData(uint8_t advHandle, uint8_t op, uint8_t len, const uint8_t *pData); - -/*************************************************************************************************/ -/*! - * \brief Set periodic advertising enable command. - * - * \param enable Set to TRUE to enable advertising, FALSE to disable advertising. - * \param advHandle Advertising handle. - */ -/*************************************************************************************************/ -void LlSetPeriodicAdvEnable(uint8_t advHandle, uint8_t enable); - -/*************************************************************************************************/ -/*! - * \brief Periodic advertising create sync command. - * - * \param filterPolicy Filter policy. - * \param advSid Advertising SID. - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param skip Number of periodic advertising packets that can be skipped after - * successful receive. - * \param syncTimeout Synchronization timeout. - * \param unused Reserved for future use (must be zero). - * - * \return None. - */ -/*************************************************************************************************/ -uint8_t LlPeriodicAdvCreateSync(LlPerAdvCreateSyncCmd_t *pParam); - -/*************************************************************************************************/ -/*! - * \brief Periodic advertising create sync cancel command. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlPeriodicAdvCreateSyncCancel(void); - -/*************************************************************************************************/ -/*! - * \brief Periodic advertising terminate sync command. - * - * \param syncHandle Sync handle. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlPeriodicAdvTerminateSync(uint16_t syncHandle); - -uint8_t LlGetPeriodicAdvListSize(uint8_t *pListSize); - -/*************************************************************************************************/ -/*! - * \brief Add device to periodic advertiser list command. - * - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param advSid Advertising SID. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlAddDeviceToPeriodicAdvList(LlDevicePerAdvList_t *pParam); - -/*************************************************************************************************/ -/*! - * \brief Remove device from periodic advertiser list command. - * - * \param advAddrType Advertiser address type. - * \param pAdvAddr Advertiser address. - * \param advSid Advertising SID. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlRemoveDeviceFromPeriodicAdvList(LlDevicePerAdvList_t *pParam); - -/*************************************************************************************************/ -/*! - * \brief HCI LE clear periodic advertiser list command. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlClearPeriodicAdvList(void); - -/*************************************************************************************************/ -/*! - * \brief The LE_Read_PHY command is used to read the current transmitter PHY and - * receiver PHY on the connection identified by the Connection_Handle. - * - * \param handle Connection handle. - * \param pTxPhy PHY used for TX. - * \param pRxPhy PHY used for RX. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlReadPhy(uint16_t handle, uint8_t *pTxPhy, uint8_t *pRxPhy); - -/*************************************************************************************************/ -/*! - * \brief The LE_Set_Default_PHY command allows the Host to specify its preferred - * values for the transmitter PHY and receiver PHY to be used for all subsequent - * connections over the LE transport. - * - * \param allPhys The ALL_PHYS parameter is a bit field that allows the Host to specify, for each - * direction, whether it has no preference among the PHYs that the Controller - * supports in a given direction or whether it has specified particular PHYs that it - * prefers in the TX_PHYS or RX_PHYS parameter. - * - * \param TxPhys The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that - * the Host prefers the Controller to use. If the ALL_PHYS parameter specifies - * that the Host has no preference, the TX_PHYS parameter is ignored; - * otherwise at least one bit shall be set to 1. - * - * \param RxPhys The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the - * Host prefers the Controller to use. If the ALL_PHYS parameter specifies that - * the Host has no preference, the RX_PHYS parameter is ignored; otherwise at - * least one bit shall be set to 1. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetDefaultPhy(uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys); - -/*************************************************************************************************/ -/*! - * \brief The LE_Set_PHY command is used to set the PHY preferences for the - * connection identified by the Connection_Handle. The Controller might not be - * able to make the change (e.g. because the peer does not support the - * requested PHY) or may decide that the current PHY is preferable. - * - * \param handle Connection handle. - * \param allPhys The ALL_PHYS parameter is a bit field that allows the Host to specify, for each - * direction, whether it has no preference among the PHYs that the Controller - * supports in a given direction or whether it has specified particular PHYs that it - * prefers in the TX_PHYS or RX_PHYS parameter. - * - * \param TxPhys The TX_PHYS parameter is a bit field that indicates the transmitter PHYs that - * the Host prefers the Controller to use. If the ALL_PHYS parameter specifies - * that the Host has no preference, the TX_PHYS parameter is ignored; - * otherwise at least one bit shall be set to 1. - * - * \param RxPhys The RX_PHYS parameter is a bit field that indicates the receiver PHYs that the - * Host prefers the Controller to use. If the ALL_PHYS parameter specifies that - * the Host has no preference, the RX_PHYS parameter is ignored; otherwise at - * least one bit shall be set to 1. - * - * \param phyOptions The PHY_options parameter is a bit field that allows the Host to specify options - * for PHYs. The default value for a new connection shall be all zero bits. The - * Controller may override any preferred coding for transmitting on the LE Coded - * PHY. - * - * \return Status error code. - */ -/*************************************************************************************************/ -uint8_t LlSetPhy(uint16_t handle, uint8_t allPhys, uint8_t txPhys, uint8_t rxPhys, uint16_t phyOptions); - -/*************************************************************************************************/ -/*! - * \brief Function to send custom LLCP PDUs - * - * \param handle Connection handle. - * \param type Type field for the LLCP PDU. - * \param length Length of the data to send. - * \param data Buffer holding the data to send. - */ -/*************************************************************************************************/ -void LlSendPdu(uint16_t handle, uint8_t type, uint8_t length, uint8_t *data); - -/*! \} */ /* LL_API_TEST */ - -#ifdef __cplusplus -}; -#endif - -#endif /* LL_API_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_defs.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_defs.h deleted file mode 100644 index ab28331142d9d9bbdff4eb9da57ca8e0f8af6ce6..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/ll_defs.h +++ /dev/null @@ -1,460 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Link layer constant definitions. - * - * Copyright (c) 2013-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#ifndef LL_DEFS_H -#define LL_DEFS_H - -#include "wsf_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Constants -**************************************************************************************************/ - -/*** Version ***/ - -#define LL_VER_BT_CORE_SPEC_4_0 0x06 /*!< Bluetooth core specification 4.0 */ -#define LL_VER_BT_CORE_SPEC_4_1 0x07 /*!< Bluetooth core specification 4.1 */ -#define LL_VER_BT_CORE_SPEC_4_2 0x08 /*!< Bluetooth core specification 4.2 */ -#define LL_VER_BT_CORE_SPEC_5_0 0x09 /*!< Bluetooth core specification 5.0 */ - -#define LL_COMP_ID_ARM 0x005F /*!< ARM Ltd. company ID. */ - -/*** Common ***/ - -#define LL_RSSI_MIN -127 /*!< Minimum RSSI value. */ -#define LL_RSSI_MAX 20 /*!< Maximum RSSI value. */ -#define LL_RSSI_NOT_AVAIL 127 /*!< RSSI is not available. */ - -#define LL_CRC_LEN 3 /*!< CRC length. */ -#define LL_AA_LEN 4 /*!< Access address length. */ -#define LL_PREAMBLE_LEN_1M 1 /*!< Preamble length (LE 1M PHY). */ -#define LL_PREAMBLE_LEN_2M 2 /*!< Preamble length (LE 2M PHY). */ -#define LL_PREAMBLE_LEN_CODED_BITS 10 /*!< Preamble length (LE Coded PHY). */ -#define LL_CI_LEN_BITS 2 /*!< Coding indicator length (LE Coded PHY). */ -#define LL_TERM1_LEN_BITS 3 /*!< TERM1 length (LE Coded PHY). */ -#define LL_TERM2_LEN_BITS 3 /*!< TERM2 length (LE Coded PHY). */ - -#define LL_RAND_ADDR_TYPE_MASK UINT64_C(0xC00000000000) /*!< BD Random Address type mask. */ -#define LL_RAND_ADDR_TYPE_STATIC UINT64_C(0xC00000000000) /*!< Static Random Address type. */ -#define LL_RAND_ADDR_TYPE_RPA UINT64_C(0x400000000000) /*!< Resolvable Private Address type. */ -#define LL_RAND_ADDR_TYPE_NRPA UINT64_C(0x000000000000) /*!< Non-Resolvable Private Address type. */ - -#define LL_MAX_NUM_PHYS (3) /*!< \brief Maximum number of scanning or initiating PHYs */ - -/** - * \brief PHY Definitions taken from LE Read PHY Commmand and LE Set PHY Command */ -#define LL_PHY_LE_PREF_TX (1) /*!< \brief Host preference for TX */ -#define LL_PHY_LE_PREF_RX (2) /*!< \brief Host preference for RX */ - -#define LL_PHY_LE_1M (1) /*!< \brief LE 1M PHY */ -#define LL_PHY_LE_2M (2) /*!< \brief LE 2M PHY */ -#define LL_PHY_LE_CODED (3) /*!< \brief LE Coded PHY */ -#define LL_PHY_LE_S8 (4) /*!< \brief LE Coded PHY S8 */ -#define LL_PHY_LE_S2 (5) /*!< \brief LE Coded PHY S2 */ - -#define LL_PHY_LE_CODED_PREF_NONE (0) /*!< \brief LE Coded PHY Options, no preference */ -#define LL_PHY_LE_CODED_PREF_S2 (1) /*!< \brief LE Coded PHY Options, pefer S2 */ -#define LL_PHY_LE_CODED_PREF_S8 (2) /*!< \brief LE Coded PHY Options, prefer S8 */ - -#define LL_PHY_LE_1M_BIT (0x1) /*!< \brief LE 1M PHY bit mask */ -#define LL_PHY_LE_2M_BIT (0x2) /*!< \brief LE 2M PHY bit mask */ -#define LL_PHY_LE_CODED_BIT (0x4) /*!< \brief LE Coded PHY bit mask */ - -/** - * \brief If defined, silently discards legacy advertisements. */ -#undef LL_DISCARD_LEGACY_ADVERTISEMENTS /*!< \brief If defined, silently discards legacy advertisements. */ - -/*** Advertising PDU ***/ - -/*! \brief Advertising channel PDU types. */ -enum -{ - /* --- Core Spec 4.0 --- */ - LL_PDU_ADV_IND = 0, /*!< Connectable undirected advertising PDU. */ - LL_PDU_ADV_DIRECT_IND = 1, /*!< Connectable directed advertising PDU. */ - LL_PDU_ADV_NONCONN_IND = 2, /*!< Non-connectable undirected advertising PDU. */ - LL_PDU_SCAN_REQ = 3, /*!< Scan request PDU. */ - LL_PDU_SCAN_RSP = 4, /*!< Scan response PDU. */ - LL_PDU_CONNECT_IND = 5, /*!< Connect indication PDU. */ - LL_PDU_ADV_SCAN_IND = 6, /*!< Scannable undirected advertising PDU. */ - /* --- Core Spec 5.0 --- */ - LL_PDU_AUX_SCAN_REQ = 3, /*!< Auxiliary scan request PDU. */ - LL_PDU_AUX_CONNECT_REQ = 5, /*!< Auxiliary connect request PDU. */ - LL_PDU_ADV_EXT_IND = 7, /*!< Extended advertising PDU. */ - LL_PDU_AUX_ADV_IND = 7, /*!< Auxiliary advertising PDU. */ - LL_PDU_AUX_SCAN_RSP = 7, /*!< Auxiliary scan response PDU. */ - LL_PDU_AUX_SYNC_IND = 7, /*!< Auxiliary synchronize PDU. */ - LL_PDU_AUX_CHAIN_IND = 7, /*!< Auxiliary chain PDU. */ - LL_PDU_AUX_CONNECT_RSP = 8, /*!< Auxiliary connect response PDU. */ -}; - -#define LL_SCAN_REQ_PDU_LEN 12 /*!< Size of a scan request PDU. */ -#define LL_CONN_IND_PDU_LEN 34 /*!< Size of a connect indication PDU. */ -#define LL_CONN_RSP_PDU_LEN 14 /*!< Size of an auxiliary connect response PDU. */ - -#define LL_CHAN_ADV_MIN_IDX 37 /*!< Minimum advertising channel index. */ -#define LL_CHAN_ADV_MAX_IDX 39 /*!< Maximum advertising channel index. */ -#define LL_NUM_CHAN_ADV 3 /*!< Total number of advertising channels. */ - -#define LL_ADVBU_MAX_LEN 31 /*!< Maximum advertising channel host data length. */ -/*** - * Maximum advertising channel host data length. - * \todo Need to readjust according to spec. */ -#define LL_ADV_AUX_U_MAX_LEN 31 - -/*! - * Maximum ACAD field length (63 less flags field). - * \sa BLUETOOTH SPECIFICATION Version 5.0, Vol 6, Part B, Section 2.3.4 */ -#define LL_ADVB_ACAD_MAX_LEN (63-1) -#define LL_ADVB_MAX_LEN 39 /*!< Maximum advertising channel PDU length. */ -#define LL_ADVB_MIN_LEN (LL_ADVB_MAX_LEN - LL_ADVBU_MAX_LEN) /*!< Minimum advertising channel packet length. */ -#define LL_ADVB_MAX_TIME_1M ((LL_BLE_US_PER_BYTE_1M * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_1M) - /*!< Maximum time for a 1M advertising channel PDU. */ -#define LL_ADVB_MAX_TIME_2M ((LL_BLE_US_PER_BYTE_2M * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_2M) - /*!< Maximum time for a 2M advertising channel PDU. */ -#define LL_ADVB_MAX_TIME_S2 ((LL_BLE_US_PER_BYTE_CODED_S2 * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_CODED_S2) - /*!< Maximum time for a Coded S2 advertising channel PDU. */ -#define LL_ADVB_MAX_TIME_S8 ((LL_BLE_US_PER_BYTE_CODED_S8 * (LL_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_CODED_S8) - /*!< Maximum time for a Coded S8 advertising channel PDU. */ - -#define LL_ADVB_PKT_MAX_USEC LL_ADVB_MAX_TIME_1M /*!< Maximum time in microseconds for an advertising packet. */ -/*** - * Maximum data channel PDU length. - * \sa BLUETOOTH SPECIFICATION Version 5.0, Vol 6, Part B, Section 2.3 */ -#define LL_ADV_AUX_MAX_LEN 258 -#define LL_ADV_AUX_MIN_LEN (LL_ADV_AUX_MAX_LEN - LL_ADV_AUX_U_MAX_LEN) /*!< Minimum auxillary advertising packet length. */ -#define LL_ADV_AUX_MAX_TIME_S8 (LL_BLE_US_PER_BYTE_CODED_S8 * LL_ADV_AUX_MAX_LEN) -#define LL_ADV_AUX_MIN_TIME_2M (LL_BLE_US_PER_BYTE_2M * LL_ADV_AUX_MIN_LEN) -#define LL_ADV_AUX_PKT_MAX_USEC (LL_ADV_AUX_MAX_TIME_S8) - -#define LL_SCAN_REQ_MAX_USEC ((8 * (LL_ADV_PREFIX_LEN + LL_SCAN_PREFIX_LEN)) + LL_MIN_PKT_TIME_US_1M) - /*!< Maximum time in microseconds for a scan request packet. */ -#define LL_SCAN_RSP_MAX_USEC LL_ADVB_MAX_TIME_1M /*!< Maximum time in microseconds for a scan response packet. */ - -#define LL_SCAN_MIN_TICKS 0x0004 /*! Minimum scan interval and window is 2.5 ms */ -#define LL_SCAN_MAX_TICKS 0x4000 /*! Maximum scan interval and window is 10,240 ms */ - -/*! Time required to process aux ptr and reschedule a new BOD. */ -#define LL_AUX_ADV_SCH_DELAY_USEC (0) /*< \todo Need to measure delay. */ - -/*! Minimum scan interval and window is 2.5 ms - * \todo Determine minimum time for auxillary operation. */ -#define LL_AUX_SCAN_MIN_TICKS 0x0004 - -/*! Maximum scan interval and window is 10,240 ms - * \todo Determine maximum time for auxillary operation. */ -#define LL_AUX_SCAN_MAX_TICKS 0x4000 - -#define LL_ADV_HDR_LEN 2 /*!< Advertising channel header length. */ -#define LL_ADV_HDR_TYPE_OFFS 0 /*!< Advertising header type offset. */ -#define LL_ADV_HDR_TYPE_MSK 0x0F /*!< Advertising header type mask. */ -#define LL_ADV_HDR_LEN_OFFS 1 /*!< Advertising header length offset. */ -#define LL_ADV_HDR_LEN_MSK 0x3F /*!< Advertising header length mask for 4.2. */ -#define LL_ADV_EXT_HDR_LEN_MSK 0xFF /*!< Advertising extension header length mask for 5.0. */ -#define LL_ADV_PREFIX_LEN 6 /*!< Advertising PDU payload prefix length (AdvA). */ -#define LL_SCAN_PREFIX_LEN 6 /*!< Scan request/response PDU payload prefix length (AdvA). */ - -#define LL_ADV_ACCESS_ADDR UINT32_C(0x8E89BED6) /*!< Advertising channel access address. */ -#define LL_ADV_CRC_INIT UINT32_C(0x555555) /*!< Advertising CRC initial value. */ - -#define LL_DIR_ADV_INTER_TICKS 6 /*!< Advertising interval between directed advertising events (3.75 ms). */ -#define LL_DIR_ADV_DUR_TICKS 2048 /*!< Maximum high duty cycle directed advertising duration (1.28 seconds). */ - -#define LL_ADV_EXT_HDR_MAX_LEN (63) -#define LL_ADV_EXTHDRLEN_ADVMODE_LEN (1) -#define LL_ADV_EXT_HDR_FLAGS_LEN (1) -#define LL_ADV_EXT_HDR_ADVA_LEN (6) -#define LL_ADV_EXT_HDR_TARGETA_LEN (6) -#define LL_ADV_EXT_HDR_RFU_LEN (1) -#define LL_ADV_EXT_HDR_ADI_LEN (2) -#define LL_ADV_EXT_HDR_AUXPTR_LEN (3) -#define LL_ADV_EXT_HDR_SYNCINFO_LEN (18) -#define LL_ADV_EXT_HDR_TXPWR_LEN (1) -#define LL_ADV_EXT_HDR_ACAD_MAX_LEN (LL_ADV_EXT_HDR_MAX_LEN - LL_ADV_EXT_HDR_FLAGS_LEN) -#define LL_ADV_EXT_HDR_MINUS_ACAD_MAX_LEN (38) -#define LL_ADV_DATA_MAX_LEN (254) /*!< Maximum AdvData length. */ -#define LL_ADV_EXT_IND_MAX_LEN (LL_ADV_HDR_LEN + LL_ADV_EXTHDRLEN_ADVMODE_LEN + LL_ADV_EXT_HDR_MINUS_ACAD_MAX_LEN - LL_ADV_EXT_HDR_SYNCINFO_LEN) /*!< Maximum ADV_EXT_IND PDU length. */ -#define LL_ADV_AUX_IND_MAX_LEN (LL_ADV_HDR_LEN + LL_ADV_EXTHDRLEN_ADVMODE_LEN + LL_ADV_DATA_MAX_LEN) /*!< Maximum AUX_ADV_IND or AUX_CHAIN_IND PDU length. */ - -#define LL_LLDATA_LEN (22) /*!< LLData field structure length in CONNECT_IND and AUX_CONNECT_REQ PDU's payload. */ - -/*!< Extended advertising data operations */ -#define LL_ADV_DATA_OP_FRAG_INTER 0x00 /*!< \brief Intermediate fragment */ -#define LL_ADV_DATA_OP_FRAG_FIRST 0x01 /*!< \brief First fragment */ -#define LL_ADV_DATA_OP_FRAG_LAST 0x02 /*!< \brief Last fragment */ -#define LL_ADV_DATA_OP_COMP_FRAG 0x03 /*!< \brief Complete extended advertising data */ -#define LL_ADV_DATA_OP_UNCHANGED_DATA 0x04 /*!< \brief Unchanged data (just update Advertising DID) */ - -/*!< Advertising data fragment preference */ -#define LL_ADV_DATA_FRAG_PREF_FRAG 0x00 /*!< \brief Controller may fragment all Host advertising data */ -#define LL_ADV_DATA_FRAG_PREF_NO_FRAG 0x01 /*!< \brief Controller should not fragment or minimize fragmentation of Host advertising data */ - -/*! \brief Extended header bit definition. */ -enum -{ - LL_EXT_HDR_ADV_ADDR_BIT = (1 << 0), /*!< Extended header AdvA bit. */ - LL_EXT_HDR_TGT_ADDR_BIT = (1 << 1), /*!< Extended header TargetA bit. */ - LL_EXT_HDR_SUPP_INFO_BIT = (1 << 2), /*!< Extended header SuppInfo bit. */ - LL_EXT_HDR_ADI_BIT = (1 << 3), /*!< Extended header AdvDataInfo bit. */ - LL_EXT_HDR_AUX_PTR_BIT = (1 << 4), /*!< Extended header AuxPtr bit. */ - LL_EXT_HDR_SYNC_INFO_BIT = (1 << 5), /*!< Extended header SyncInfo bit. */ - LL_EXT_HDR_TX_PWR_BIT = (1 << 6), /*!< Extended header TxPower bit. */ -}; - -/** \name Advertising event properties type bits - * - */ -/**@{*/ -#define LL_ADV_PROP_CONN_ADV_BIT (1<<0) /*!< \brief Connectable advertising bit */ -#define LL_ADV_PROP_SCAN_ADV_BIT (1<<1) /*!< \brief Scannable advertising bit */ -#define LL_ADV_PROP_DIRECT_ADV_BIT (1<<2) /*!< \brief Directed advertising bit */ -#define LL_ADV_PROP_CONN_DIRECT_ADV_BIT (1<<3) /*!< \brief High duty cycle connectable directed advertising bit */ -#define LL_ADV_PROP_USE_LEG_PDU_BIT (1<<4) /*!< \brief Use legacy advertising PDUs bit */ -#define LL_ADV_PROP_OMIT_ADV_ADDR_BIT (1<<5) /*!< \brief Omit advertiser's address from all PDUs (anonymous advertising) bit */ -#define LL_ADV_PROP_INC_TX_PWR_BIT (1<<6) /*!< \brief Include TxPower in extended header of advertising PDU bit */ -/**@}*/ - -/** \name Advertising event properties for legacy PDUs - * - */ -/**@{*/ -#define LL_ADV_PROP_LEG_CONN_UNDIRECT 0x13 /*!< \brief Connectable and scannable undirected advertising (00010011b) */ -#define LL_ADV_PROP_LEG_CONN_DIRECT 0x1D /*!< \brief Connectable directed high duty cycle advertising (00011101b) */ -#define LL_ADV_PROP_LEG_SCAN_UNDIRECT 0x12 /*!< \brief Scannable undirected advertising (00010010b) */ -#define LL_ADV_PROP_LEG_NONCONN_UNDIRECT 0x10 /*!< \brief Non-connectable and non-scannable undirected advertising (00010000b) */ -#define LL_ADV_PROP_LEG_CONN_DIRECT_LO_DUTY 0x15 /*!< \brief Connectable directed low duty cycle advertising (00010101b) */ -/**@}*/ - -#define LL_MAX_ADV_HANDLE 0xEF /*!< Maximum advertising handle. */ -#define LL_MAX_ADV_SID 0x0F /*!< Maximum advertising SID */ - -#define LL_EXT_ADV_HDR_MIN_LEN 1 /*!< Minimum extended advertising header length (ExtHdrLen and AdvMode fields). */ -#define LL_EXT_ADV_HDR_MAX_LEN 64 /*!< Maximum extended advertising header length (ExtHdrLen, AdvMode fields and Extended header). */ -#define LL_EXT_ADVBU_MAX_LEN 251 /*!< Maximum extended advertising channel PDU host data length. */ -#define LL_EXT_ADVB_MAX_LEN 257 /*!< Maximum extended advertising channel PDU length. */ - -#define LL_EXT_ADVB_MAX_TIME_1M ((LL_BLE_US_PER_BYTE_1M * (LL_EXT_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_1M) - /*!< Maximum time for a 1M advertising channel PDU. */ -#define LL_EXT_ADVB_MAX_TIME_2M ((LL_BLE_US_PER_BYTE_2M * (LL_EXT_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_2M) - /*!< Maximum time for a 2M advertising channel PDU. */ -#define LL_EXT_ADVB_MAX_TIME_S2 ((LL_BLE_US_PER_BYTE_CODED_S2 * (LL_EXT_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_CODED_S2) - /*!< Maximum time for a Coded S2 advertising channel PDU. */ -#define LL_EXT_ADVB_MAX_TIME_S8 ((LL_BLE_US_PER_BYTE_CODED_S8 * (LL_EXT_ADVB_MAX_LEN - LL_ADV_HDR_LEN)) + LL_MIN_PKT_TIME_US_CODED_S8) - /*!< Maximum time for a Coded S8 advertising channel PDU. */ - -#define LL_AUX_PTR_MAX_USEC 2457600 /*!< Maximum AuxPtr offset value in microseconds. */ - -#define LL_SYNC_MIN_TIMEOUT 0x000A /*!< Minimum synchronization timeout. */ -#define LL_SYNC_MAX_TIMEOUT 0x4000 /*!< Maximum synchronization timeout. */ -#define LL_SYNC_MAX_SKIP 0x01F3 /*!< Maximum synchronization skip. */ -#define LL_SYNC_MAX_HANDLE 0x0EFF /*!< Maximum synchronization handle. */ - -#define LL_PER_ADV_INT_MIN 0x0006 /*!< Minimum periodic advertising interval. */ - - -/*** Data PDU ***/ - -/*! \brief Data channel LL Control PDU types. */ -enum -{ - /* --- Core Spec 4.0 --- */ - LL_PDU_CONN_UPDATE_IND = 0x00, /*!< Connection update indication PDU. */ - LL_PDU_CHANNEL_MAP_IND = 0x01, /*!< Channel map indication PDU. */ - LL_PDU_TERMINATE_IND = 0x02, /*!< Terminate indication PDU. */ - LL_PDU_ENC_REQ = 0x03, /*!< Encryption request PDU. */ - LL_PDU_ENC_RSP = 0x04, /*!< Encryption response PDU. */ - LL_PDU_START_ENC_REQ = 0x05, /*!< Start encryption request PDU. */ - LL_PDU_START_ENC_RSP = 0x06, /*!< Start encryption response PDU. */ - LL_PDU_UNKNOWN_RSP = 0x07, /*!< Unknown response PDU. */ - LL_PDU_FEATURE_REQ = 0x08, /*!< Feature request PDU. */ - LL_PDU_FEATURE_RSP = 0x09, /*!< Feature response PDU. */ - LL_PDU_PAUSE_ENC_REQ = 0x0A, /*!< Pause encryption request PDU. */ - LL_PDU_PAUSE_ENC_RSP = 0x0B, /*!< Pause encryption response PDU. */ - LL_PDU_VERSION_IND = 0x0C, /*!< Version indication PDU. */ - LL_PDU_REJECT_IND = 0x0D, /*!< Reject indication PDU. */ - /* --- Core Spec 4.2 --- */ - LL_PDU_SLV_FEATURE_REQ = 0x0E, /*!< Slave feature request PDU. */ - LL_PDU_CONN_PARAM_REQ = 0x0F, /*!< Connection parameter request PDU. */ - LL_PDU_CONN_PARAM_RSP = 0x10, /*!< Connection parameter response PDU. */ - LL_PDU_REJECT_EXT_IND = 0x11, /*!< Reject extended indication PDU. */ - LL_PDU_PING_REQ = 0x12, /*!< Ping request PDU. */ - LL_PDU_PING_RSP = 0x13, /*!< Ping response PDU. */ - LL_PDU_LENGTH_REQ = 0x14, /*!< Data length request PDU. */ - LL_PDU_LENGTH_RSP = 0x15, /*!< Data length response PDU. */ - /* --- Core Spec 5.0 --- */ - LL_PDU_PHY_REQ = 0x16, /*!< PHY request PDU. */ - LL_PDU_PHY_RSP = 0x17, /*!< PHY response PDU. */ - LL_PDU_PHY_UPDATE_IND = 0x18, /*!< PHY update indication PDU. */ - LL_PDU_MIN_USED_CHAN_IND = 0x19, /*!< Minimum used channels indication PDU. */ - LL_PDU_UNSPECIFIED = 0xFF /*!< Unspecified PDU. */ -}; - -/* Data PDU length */ -/* --- Core Spec 4.0 --- */ -#define LL_CONN_UPD_IND_PDU_LEN 12 /*!< Connection update indication PDU length. */ -#define LL_CHAN_MAP_IND_PDU_LEN 8 /*!< Channel map indication PDU length. */ -#define LL_TERMINATE_IND_PDU_LEN 2 /*!< Terminate indication PDU length. */ -#define LL_ENC_REQ_LEN 23 /*!< Encryption request PDU length. */ -#define LL_ENC_RSP_LEN 13 /*!< Encryption response PDU length. */ -#define LL_START_ENC_LEN 1 /*!< Start encryption request/response PDU length. */ -#define LL_UNKNOWN_RSP_LEN 2 /*!< Unknown response PDU length. */ -#define LL_FEATURE_PDU_LEN 9 /*!< Feature request/response PDU length. */ -#define LL_PAUSE_ENC_LEN 1 /*!< Pause encryption request/response PDU length. */ -#define LL_VERSION_IND_PDU_LEN 6 /*!< Version indication PDU length. */ -#define LL_REJECT_IND_PDU_LEN 2 /*!< Reject indication PDU length. */ -/* --- Core Spec 4.2 --- */ -#define LL_CONN_PARAM_PDU_LEN 24 /*!< Connection parameter request or response PDU length. */ -#define LL_REJECT_EXT_IND_PDU_LEN 3 /*!< Reject extended indication PDU length. */ -#define LL_PING_PDU_LEN 1 /*!< Ping request/response PDU length. */ -#define LL_DATA_LEN_PDU_LEN 9 /*!< Data length request or response PDU length. */ -/* --- Core Spec 5.0 --- */ -#define LL_PHY_PDU_LEN 3 /*!< PHY request/response PDU length. */ -#define LL_PHY_UPD_IND_PDU_LEN 5 /*!< PHY update indication PDU length. */ -#define LL_MIN_USED_CHAN_PDU_LEN 3 /*!< Minimum used channels indication PDU length. */ - -#define LL_EMPTY_PDU_LEN 2 /*!< Length of an empty data PDU. */ - -#define LL_DATA_HDR_LEN 2 /*!< Data channel header length. */ -#define LL_DATA_MIC_LEN 4 /*!< Data channel PDU MIC length. */ - -#define LL_DATA_HDR_LLID_MSK 0x03 /*!< Data PDU LLID mask. */ -#define LL_DATA_HDR_LEN_MSK 0xFF /*!< Data header length mask. BLE 4.2 data len extension allows 8 bits. */ - -#define LL_MAX_NUM_CHAN_DATA 37 /*!< Maximum number of used data channels. */ -#define LL_MIN_NUM_CHAN_DATA 2 /*!< Minimum number of used data channels. */ - -/*! \brief Data PDU LLID types. */ -enum -{ - LL_LLID_VS_PDU = 0x00, /*!< Vendor specific PDU. */ - /* N.B. next two enumerations intentionally use identical values. */ - LL_LLID_EMPTY_PDU = 0x01, /*!< Empty PDU. */ - LL_LLID_CONT_PDU = 0x01, /*!< Data PDU: continuation fragment of an L2CAP message. */ - LL_LLID_START_PDU = 0x02, /*!< Data PDU: start of an L2CAP message or a complete L2CAP message with no fragmentation. */ - LL_LLID_CTRL_PDU = 0x03, /*!< Control PDU. */ -}; - -/*** Encryption ***/ - -#define LL_ECC_KEY_LEN 32 /*!< ECC key length. */ - -#define LL_DEF_RES_ADDR_TO_SEC 900 /*!< Default resolvable address timeout in seconds. */ - -#define LL_RAND_LEN 8 /*!< Length of random number */ -#define LL_KEY_LEN 16 /*!< Encryption key length. */ -#define LL_SKD_LEN LL_KEY_LEN /*!< Session key diversifier length. */ -#define LL_IV_LEN 8 /*!< Initialization vector length. */ -#define LL_ENCRYPT_DATA_LEN 16 /*!< Number of bytes in the encryption block */ - -#define LL_DEF_AUTH_TO_MS 30000 /*!< Default authentication timeout in milliseconds. */ - -/*** LLCP ***/ - -#define LL_DATA_LEN_TO_TIME_1M(len) ((LL_BLE_US_PER_BYTE_1M * ((len) + LL_DATA_MIC_LEN)) + LL_MIN_PKT_TIME_US_1M) - /*!< Convert data length to time. */ -#define LL_DATA_LEN_TO_TIME_2M(len) ((LL_BLE_US_PER_BYTE_2M * ((len) + LL_DATA_MIC_LEN)) + LL_MIN_PKT_TIME_US_2M) - /*!< Convert data length to time. */ -#define LL_DATA_LEN_TO_TIME_CODED_S8(len) ((LL_BLE_US_PER_BYTE_CODED_S8 * ((len) + LL_DATA_MIC_LEN)) + LL_MIN_PKT_TIME_US_CODED_S8) - /*!< Convert data length to time. */ -#define LL_DATA_LEN_TO_TIME_CODED_S2(len) ((LL_BLE_US_PER_BYTE_CODED_S2 * ((len) + LL_DATA_MIC_LEN)) + LL_MIN_PKT_TIME_US_CODED_S2) - /*!< Convert data length to time. */ - -#define LL_MIN_INSTANT 6 /*!< Minimum number of CE to apply a CONN_UPD or CHAN_MAP. */ - -#define LL_MAX_ADV_DATA_LEN 1650 /*!< Maximum advertising data length. */ - -#define LL_MAX_DATA_LEN_MIN 27 /*!< Minimum value for maximum Data PDU length */ -#define LL_MAX_DATA_LEN_ABS_MAX 251 /*!< Absolute maximum limit for maximum Data PDU length */ - -#define LL_MAX_DATA_TIME_MIN 328 /*!< Minimum value for maximum Data PDU time */ -#define LL_MAX_DATA_TIME_MIN_CODED 2704 /*!< Minimum value for maximum Data PDU time for the Coded PHY */ -#define LL_MAX_DATA_TIME_ABS_MAX 17040 /*!< Absolute maximum limit for maximum Data PDU time */ -#define LL_MAX_DATA_TIME_ABS_MAX_1M 2120 /*!< Absolute maximum limit for maximum Data PDU time (LE 1M PHY) */ - -#define LL_T_PRT_SEC 40 /*!< LLCP procedure response timeout in seconds. */ - -#define LL_MAX_ADV_DLY_MS 10 /*!< Maximum advertising delay in milliseconds. */ - -#define LL_MIN_CONN_INTERVAL 6 /*!< Minimum value for connection interval. */ -#define LL_MAX_CONN_INTERVAL 3200 /*!< Maximum value for connection interval. */ - -#define LL_MIN_TX_WIN_SIZE 1 /*!< Minimum value for transmit window size. */ -#define LL_MAX_TX_WIN_SIZE 8 /*!< Maximum value for transmit window size. */ - -#define LL_MAX_CONN_LATENCY 499 /*!< Maximum value for connection slave latency. */ - -#define LL_MIN_SUP_TIMEOUT 10 /*!< Minimum value for connection supervision timeout. */ -#define LL_MAX_SUP_TIMEOUT 3200 /*!< Maximum value for connection supervision timeout. */ - -#define LL_MIN_POWER_THRESHOLD -128 /*!< Minimum value for power threshold. */ -#define LL_MAX_POWER_THRESHOLD 127 /*!< Maximum value for power threshold. */ - -#define LL_MAX_PHYS 3 /*!< Number of LE PHYs. */ -#define LL_ALL_PHYS_MSK 0x7 /*!< All supported LE PHYs mask. */ - -/*** DTM ***/ - -#define LL_DTM_HDR_LEN 2 /*!< Direct Test Mode PDU header length. */ -#define LL_DTM_SYNC_WORD UINT32_C(0x71764129) /*!< Direct Test Mode sync word. */ -#define LL_DTM_CRC_INIT UINT32_C(0x555555) /*!< Direct Test Mode CRC initial value. */ -#define LL_DTM_MAX_INT_US 12500 /*!< Maximum time interval between packets in microseconds. */ -#define LL_DTM_PDU_ABS_MAX_LEN 255 /*!< Absolute maximum DTM PDU length. */ -#define LL_DTM_MAX_CHAN_IDX 39 /*!< Maximum channel index. */ - -/*** Baseband ***/ - -#define LL_CHAN_DATA_MIN_IDX 0 /*!< Minimum data channel index. */ -#define LL_CHAN_DATA_MAX_IDX 36 /*!< Maximum data channel index. */ -#define LL_CHAN_DATA_ALL UINT64_C(0x0000001FFFFFFFFF) /*!< Maximum data channel index. */ - -#define LL_BLE_BIT_PER_US 1 /*!< BLE PHY rate. */ -#define LL_BLE_US_PER_BYTE_1M 8 /*!< BLE PHY speed (LE 1M PHY). */ -#define LL_BLE_US_PER_BYTE_2M 4 /*!< BLE PHY speed (LE 2M PHY). */ -#define LL_BLE_US_PER_BYTE_CODED_S8 64 /*!< BLE PHY speed (LE Coded PHY, S=8). */ -#define LL_BLE_US_PER_BIT_CODED_S8 8 /*!< BLE PHY speed (LE Coded PHY, S=8). */ -#define LL_BLE_US_PER_BYTE_CODED_S2 16 /*!< BLE PHY speed (LE Coded PHY, S=2). */ -#define LL_BLE_US_PER_BIT_CODED_S2 2 /*!< BLE PHY speed (LE Coded PHY, S=2). */ -#define LL_BLE_TIFS_US 150 /*!< BLE inter-frame space. */ -#define LL_BLE_MAFS_US 300 /*!< BLE minimum AUX frame space. */ -#define LL_BLE_US_PER_TICK 625 /*!< Microseconds per BLE tick. */ - -#define LL_MIN_PKT_TIME_US_1M 80 /*!< Minimum packet time (i.e. empty PDU) on LE 1M PHY. */ -#define LL_MIN_PKT_TIME_US_2M 44 /*!< Minimum packet time (i.e. empty PDU) on LE 2M PHY. */ -#define LL_MIN_PKT_TIME_US_CODED_S8 720 /*!< Minimum packet time (i.e. empty PDU) on LE Coded PHY, S=8. */ -#define LL_MIN_PKT_TIME_US_CODED_S2 462 /*!< Minimum packet time (i.e. empty PDU) on LE Coded PHY, S=2. */ - -#define LL_MIN_ADV_TX_PWR_LVL -20 /*!< Minimum Tx power level for advertising. */ -#define LL_MAX_ADV_TX_PWR_LVL 10 /*!< Maximum Tx power level for advertising. */ - -#define LL_MIN_TX_PWR_LVL -30 /*!< Minimum Tx power level for connections. */ -#define LL_MAX_TX_PWR_LVL 20 /*!< Maximum Tx power level for connections. */ - -#define LL_MAX_TIFS_DEVIATION 2 /*!< Maximum TIFS deviation in microseconds. */ - -#define LL_MAX_CE_DEVIATION_USEC 16 /*!< Maximum connection event deviation in microseconds. */ - -#ifdef __cplusplus -}; -#endif - -#endif /* LL_DEFS_H */ diff --git a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/sch_api.h b/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/sch_api.h deleted file mode 100644 index 05974d4c91138957e998264bd780b6674f1a9b7d..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/controller/sources/mac/include/sch_api.h +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Multi-protocol scheduler interface file. - * - * $Date: 2019-02-25 17:25:06 +0000 (Mon, 25 Feb 2019) $ - * $Revision: 41190 $ - * - * Copyright (c) 2013 Wicentric, Inc., all rights reserved. - * Wicentric confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Wicentric, Inc. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#ifndef SCH_API_H -#define SCH_API_H - -#include "wsf_types.h" -#include "wsf_os.h" -#include "bb_api.h" -#include "cfg_mac.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Constants -**************************************************************************************************/ - -/*! \brief Minimum time between operations in BB ticks. */ -#define SCH_INTER_OP_GAP (2 * SCH_SETUP_DELAY) - -/*! \brief Time needed for operation post-processing. */ -#define SCH_OP_PROC_TICKS 130 - -#define SCH_NUM_OFFSETS 6 - -/*! \brief Maximum highest priority of a BOD. */ -#define SCH_MAX_BOD_PRIORITY 0xFF - -/************************************************************************************************** - Data Types -**************************************************************************************************/ - -typedef struct -{ - uint32_t interval; - uint32_t periodicity; - uint32_t offset[SCH_NUM_OFFSETS]; - uint32_t offsetCount; -} SchParams_t; - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -/* Initialization */ -void SchInit(wsfHandlerId_t handlerId); -void SchHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); - -/* Operation scheduling */ -bool_t SchScheduleOperation(BbOpDesc_t *pBod, uint32_t minInterval, uint32_t maxInterval); -uint32_t SchSelectInterval(BbOpDesc_t *pBod, uint32_t minInterval, uint32_t maxInterval, uint32_t *periodicity); -bool_t SchGetParams(BbOpDesc_t *pBod, uint32_t minInterval, uint32_t maxInterval, SchParams_t *pSchParams); -bool_t SchCheckOffsets(BbOpDesc_t *pBod, SchParams_t *pSchParams); -uint32_t SchGetBandwidth(BbOpDesc_t *pBod, uint32_t bodInterval); -void SchSetNextDue(BbOpDesc_t *pBod); -void SchSetNextDueAfter(BbOpDesc_t *pBod, uint32_t earliestStart); - -/* List maintenance */ -void SchInsertNextAvailable(BbOpDesc_t *pBod); -void SchInsertNextAvailableAfter(BbOpDesc_t *pBod, uint32_t earliestStart); -void SchInsertNextAvailableInterval(BbOpDesc_t *pBod); -bool_t SchInsertAtDueTime(BbOpDesc_t *pBod); -bool_t SchInsertLateAsPossible(BbOpDesc_t *pBod, uint32_t min, uint32_t max); -bool_t SchSearchRemove(BbOpDesc_t *pBod); -void SchRemove(BbOpDesc_t *pBod); - -/*************************************************************************************************/ -/*! - * \brief Compare two times - * - * \param time1 First time - * \param time2 Second time - * - * \return TRUE if time1 is earlier than time2 - */ -/*************************************************************************************************/ -static inline bool_t schIsEarlier(uint32_t time1, uint32_t time2) -{ - return ((int)(time2 - time1) > 0); -} - -/*************************************************************************************************/ -/*! - * \brief Increase the priority of a BOD. - * - * \param pBod Pointer to the BOD. - * - * \return None. - */ -/*************************************************************************************************/ -static inline void schPriorityIncr(BbOpDesc_t *pBod) -{ - if (pBod->priority < 0xFF) { - pBod->priority++; - } -} - -/*************************************************************************************************/ -/*! - * \brief Reset the priority of a BOD to its base priority. - * - * \param pBod Pointer to the BOD. - * - * \return None. - */ -/*************************************************************************************************/ -static inline void schPriorityReset(BbOpDesc_t *pBod) -{ - pBod->priority = pBod->basePriority; -} - -#ifdef __cplusplus -}; -#endif - -#endif /* SCH_API_H */ diff --git a/lib/sdk/NDALibraries/BTLE/lib/GCC/cordiolib.a b/lib/sdk/NDALibraries/BTLE/lib/GCC/cordiolib.a deleted file mode 100644 index ae9d36d4430e7677efd323a34546266f4aa826fc..0000000000000000000000000000000000000000 Binary files a/lib/sdk/NDALibraries/BTLE/lib/GCC/cordiolib.a and /dev/null differ diff --git a/lib/sdk/NDALibraries/BTLE/lib/GCC/libmaclib.a b/lib/sdk/NDALibraries/BTLE/lib/GCC/libmaclib.a deleted file mode 100644 index 2f84382af3e28f0a0827c745c24d72641d909774..0000000000000000000000000000000000000000 Binary files a/lib/sdk/NDALibraries/BTLE/lib/GCC/libmaclib.a and /dev/null differ diff --git a/lib/sdk/NDALibraries/BTLE/platform/max32665/sources/ll_math.c b/lib/sdk/NDALibraries/BTLE/platform/max32665/sources/ll_math.c deleted file mode 100644 index 74982e31d97131dcaedfdb68c42878a7e250842d..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/platform/max32665/sources/ll_math.c +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES -* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -* Except as contained in this notice, the name of Maxim Integrated -* Products, Inc. shall not be used except as stated in the Maxim Integrated -* Products, Inc. Branding Policy. -* -* The mere transfer of this software does not imply any licenses -* of trade secrets, proprietary technology, copyrights, patents, -* trademarks, maskwork rights, or any other form of intellectual -* property whatsoever. Maxim Integrated Products, Inc. retains all -* ownership rights. -* -* $Id: ll_math.c 41190 2019-02-25 17:25:06Z zach.metzinger $ -* -******************************************************************************** -*/ - -#include "ll_math.h" -#include "max32665.h" -#include "trng_regs.h" -#include "tpu_regs.h" -#include "gcr_regs.h" - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -#define MXC_F_TPU_CTRL_DONE_FLAGS (MXC_F_TPU_CTRL_DMA_DONE | MXC_F_TPU_CTRL_GLS_DONE | MXC_F_TPU_CTRL_HSH_DONE | MXC_F_TPU_CTRL_CPH_DONE | MXC_F_TPU_CTRL_MAA_DONE) -#define AES_BLOCK_SIZE 16 - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -uint32_t dbb_event_get_current_tstamp(void); /* FIXME: Intial parts didn't have TRNG enabled, had to roll our own */ - -/*************************************************************************************************/ -/*! - * \brief Generate random number. - * - * \return 32-bit random number. - */ -/*************************************************************************************************/ -uint32_t LlMathRandNum(void) -{ -#if 0 - - // Wait for TRNG to be ready - while(!(MXC_TRNG->st & MXC_F_TRNG_ST_RND_RDY)) {} - - return ((uint32_t)(MXC_TRNG->data)); -#else - static unsigned int rnd = 0; - - /* Sorta-kinda random number generator */ - if (rnd == 0) { - rnd = dbb_event_get_current_tstamp(); - } else { - rnd <<= 1; - rnd ^= dbb_event_get_current_tstamp(); - } - - return rnd; -#endif -} - -/******************************************************************************/ -void memcpy32(uint32_t * dst, uint32_t * src, unsigned int len) -{ - while (len) { - *dst = *src; - dst++; - src++; - len -= 4; - } -} - -/*************************************************************************************************/ -/*! - * \brief Calculate AES ECB. - * - * \param pKey Encryption key. - * \param pOut Output data. - * \param pIn Input data. - * - * \return None. - */ -/*************************************************************************************************/ -void LlMathAesEcb(const uint8_t *pKey, uint8_t *pOut, const uint8_t *pIn) -{ - /* Save the state of the crypto clock enable bit */ - uint32_t perckcn0 = MXC_GCR->perckcn0; - - /* Save the state of the HIRC EN */ - uint32_t clkcn = MXC_GCR->clkcn; - - /* Enable CRYPTO clock */ - if ((MXC_GCR->clkcn & MXC_F_GCR_CLKCN_HIRC_EN) == 0) { - MXC_GCR->clkcn |= MXC_F_GCR_CLKCN_HIRC_EN; - } - - /* Disable CRYPTO clock gate */ - if (MXC_GCR->perckcn0 & MXC_F_GCR_PERCKCN0_CRYPTOD) { - MXC_GCR->perckcn0 &= ~(MXC_F_GCR_PERCKCN0_CRYPTOD); - } - - /* Reset Crypto block and clear state */ - MXC_TPU->ctrl = MXC_F_TPU_CTRL_RST; - - /* Set the legacy bit */ - MXC_TPU->ctrl |= MXC_F_TPU_CTRL_FLAG_MODE; - - /* Byte swap the input and output */ - MXC_TPU->ctrl |= MXC_F_TPU_CTRL_BSO; - MXC_TPU->ctrl |= MXC_F_TPU_CTRL_BSI; - - MXC_TPU->cipher_ctrl = (MXC_S_TPU_CIPHER_CTRL_MODE_ECB | - MXC_S_TPU_CIPHER_CTRL_CIPHER_AES128 | MXC_S_TPU_CIPHER_CTRL_SRC_CIPHERKEY); - - /* Clear all done flags */ - MXC_TPU->ctrl |= MXC_F_TPU_CTRL_DONE_FLAGS; - - /* Load the Key */ - memcpy32((void*)&MXC_TPU->cipher_key[0], (void*)&pKey[12], 4); - memcpy32((void*)&MXC_TPU->cipher_key[1], (void*)&pKey[8], 4); - memcpy32((void*)&MXC_TPU->cipher_key[2], (void*)&pKey[4], 4); - memcpy32((void*)&MXC_TPU->cipher_key[3], (void*)&pKey[0], 4); - - /* Wait until ready for data */ - while (!(MXC_TPU->ctrl & MXC_F_TPU_CTRL_RDY)); - - /* Copy data to start the operation */ - memcpy32((void*)&MXC_TPU->din[0], (void*)&pIn[12], 4); - memcpy32((void*)&MXC_TPU->din[1], (void*)&pIn[8], 4); - memcpy32((void*)&MXC_TPU->din[2], (void*)&pIn[4], 4); - memcpy32((void*)&MXC_TPU->din[3], (void*)&pIn[0], 4); - - /* Wait until operation is complete */ - while (!(MXC_TPU->ctrl & MXC_F_TPU_CTRL_CPH_DONE)); - - /* Clear all done flags */ - MXC_TPU->ctrl |= MXC_F_TPU_CTRL_DONE_FLAGS; - - /* Copy data out */ - memcpy32((void*)&pOut[12], (void*)&MXC_TPU->dout[0], 4); - memcpy32((void*)&pOut[8], (void*)&MXC_TPU->dout[1], 4); - memcpy32((void*)&pOut[4], (void*)&MXC_TPU->dout[2], 4); - memcpy32((void*)&pOut[0], (void*)&MXC_TPU->dout[3], 4); - - /* Restore clock settings */ - MXC_GCR->perckcn0 = perckcn0; - MXC_GCR->clkcn = clkcn; -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/makefile deleted file mode 100644 index 8c6df47b1a527f7bfb52d5959d5542c3f7e3ef80..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the cycling sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := cycling.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/sources.mk deleted file mode 100644 index 786dde21a06de3342be7f6b6f5114527c3c6c5f0..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/cycling/cycling_main.c \ - $(ROOT_DIR)/projects/ble-apps/cycling/main.c \ - $(ROOT_DIR)/projects/ble-apps/cycling/stack_cycling.c \ - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvoptx deleted file mode 100644 index e1a44b5abcab8304b0b1ea93a7c2d2d708806322..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>cycling-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvprojx deleted file mode 100644 index 1a660ce9e42812f882732085b94a63dc85b7bd19..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/keil/cycling-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>cycling-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>cycling-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/cycling-bt4-obj.bin _build/cycling-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/cycling-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/cycling-bt4-obj.img _build/cycling-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>cycling_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\cycling\cycling_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\cycling\main.c</FilePath> - </File> - <File> - <FileName>stack_cycling.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\cycling\stack_cycling.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/main.c deleted file mode 100644 index 3c12db8b87b9ff71d625665a78ab29a53e5a5f0b..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for cycling application. - * - * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "cycling/cycling_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitCycling(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitCycling(); - CyclingStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/stack_cycling.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/stack_cycling.c deleted file mode 100644 index e5022325b90fc92066b7e2b933b5f53d1670ca19..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/cycling/stack_cycling.c +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for cycling. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "cycling/cycling_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitCycling(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(CyclingHandler); - CyclingHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/makefile deleted file mode 100644 index 3f166194dc10964abad7cb3ce0dc515e595f58df..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/makefile +++ /dev/null @@ -1,59 +0,0 @@ -################################################################################################### -# -# Makefile for building the datc sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := datc.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -WDXC_INCLUDED := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_CENTRAL INIT_ENCRYPTED -CFG_DEV += WDXC_INCLUDED=$(WDXC_INCLUDED) -CFG_DEV += $(CFG_APP) - -ifeq ($(BT_VER),8) -CFG_DEV += CS50_INCLUDED=FALSE -else -CFG_DEV += CS50_INCLUDED=TRUE -endif - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/sources.mk deleted file mode 100644 index 3b0b03bf5698259fc56168a0d05d7047190ee509..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/datc/datc_main.c \ - $(ROOT_DIR)/projects/ble-apps/datc/main.c \ - $(ROOT_DIR)/projects/ble-apps/datc/stack_datc.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvprojx deleted file mode 100644 index cd72bfa1ef7d8dad05b3bf21a1a50e17f5bde04f..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/keil/datc-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>datc-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>datc-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/datc-bt4-obj.bin _build/datc-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/datc-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/datc-bt4-obj.img _build/datc-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>WDXC_INCLUDED=1 INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_MS_PER_TICK=10 CS50_INCLUDED=FALSE WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 INIT_CENTRAL WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>datc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\datc\datc_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\datc\main.c</FilePath> - </File> - <File> - <FileName>stack_datc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\datc\stack_datc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/main.c deleted file mode 100644 index 4eeb9152ec0b60cedb0ebe87641726c104cb7437..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/main.c +++ /dev/null @@ -1,198 +0,0 @@ -/*************************************************************************************************/ -/*! -* \file main.c -* -* \brief Main file for datc application. -* -* Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. -* ARM Ltd. confidential and proprietary. -* -* IMPORTANT. Your use of this file is governed by a Software License Agreement -* ("Agreement") that must be accepted in order to download or otherwise receive a -* copy of this file. You may not use or copy this file for any purpose other than -* as described in the Agreement. If you do not agree to all of the terms of the -* Agreement do not use this file and delete all copies in your possession or control; -* if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -* to any use, copying or further distribution of this software. -*/ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "datc/datc_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitDatc(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - /* Set 5.0 requirements. */ - mainLlRtCfg.btVer = LL_VER_BT_CORE_SPEC_5_0; - #endif - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - PlatformGetBlePhyFeatures(&mainLlRtCfg.phy2mSup, &mainLlRtCfg.phyCodedSup, - &mainLlRtCfg.stableModIdxTxSup, &mainLlRtCfg.stableModIdxRxSup); - #endif -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - memUsed = LlInitExtInit(&llCfg); - #else - memUsed = LlInitStdInit(&llCfg); - #endif - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitDatc(); - DatcStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/stack_datc.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/stack_datc.c deleted file mode 100644 index c6abea9b79d5d3e91bfa53127b7f9514371800a7..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/datc/stack_datc.c +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for datc. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "datc/datc_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitDatc(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmDevPrivInit(); - DmScanInit(); - DmConnInit(); - DmConnMasterInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - L2cInit(); - L2cMasterInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - AttcInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmpiInit(); - SmpiScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DatcHandler); - DatcHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/makefile deleted file mode 100644 index 4479455fed130dd40bb67fba689da3c550c8f8eb..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/makefile +++ /dev/null @@ -1,60 +0,0 @@ -################################################################################################### -# -# Makefile for building the dats sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := dats.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -WDXS_INCLUDED := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += HCI_ACL_QUEUE_LO=4 -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += WDXS_INCLUDED=$(WDXS_INCLUDED) -CFG_DEV += $(CFG_APP) - -ifeq ($(BT_VER),8) -CFG_DEV += CS50_INCLUDED=0 -else -CFG_DEV += CS50_INCLUDED=1 -endif - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/sources.mk deleted file mode 100644 index a6c293b0e875776a3ee42f12dace725f39b0201b..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/dats/dats_main.c \ - $(ROOT_DIR)/projects/ble-apps/dats/main.c \ - $(ROOT_DIR)/projects/ble-apps/dats/stack_dats.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvoptx deleted file mode 100644 index 3431f999df09bb103b2eccf479bb700a4bdba8c7..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>dats-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvprojx deleted file mode 100644 index 099abdfb5f2e1f6bde004db443740fb3d35de2c2..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/keil/dats-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>dats-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>dats-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/dats-bt4-obj.bin _build/dats-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/dats-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/dats-bt4-obj.img _build/dats-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 HCI_ACL_QUEUE_LO=4 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 WSF_TRACE_ENABLED=1 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 WDXS_INCLUDED=1 INIT_ENCRYPTED BT_VER=8 CS50_INCLUDED=0 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 CONFIG_HOST_TYPE_ASIC=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dats_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\dats\dats_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\dats\main.c</FilePath> - </File> - <File> - <FileName>stack_dats.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\dats\stack_dats.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/main.c deleted file mode 100644 index c4b97bbe565982f41a38e9ca764fb69e4795041e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/main.c +++ /dev/null @@ -1,198 +0,0 @@ -/*************************************************************************************************/ -/*! -* \file main.c -* -* \brief Main file for dats application. -* -* Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. -* ARM Ltd. confidential and proprietary. -* -* IMPORTANT. Your use of this file is governed by a Software License Agreement -* ("Agreement") that must be accepted in order to download or otherwise receive a -* copy of this file. You may not use or copy this file for any purpose other than -* as described in the Agreement. If you do not agree to all of the terms of the -* Agreement do not use this file and delete all copies in your possession or control; -* if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -* to any use, copying or further distribution of this software. -*/ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "dats/dats_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitDats(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - /* Set 5.0 requirements. */ - mainLlRtCfg.btVer = LL_VER_BT_CORE_SPEC_5_0; - #endif - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - PlatformGetBlePhyFeatures(&mainLlRtCfg.phy2mSup, &mainLlRtCfg.phyCodedSup, - &mainLlRtCfg.stableModIdxTxSup, &mainLlRtCfg.stableModIdxRxSup); - #endif -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - memUsed = LlInitExtInit(&llCfg); - #else - memUsed = LlInitStdInit(&llCfg); - #endif - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitDats(); - DatsStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/stack_dats.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/stack_dats.c deleted file mode 100644 index f8d9b88bd27c519caa951ea32b8e49358df10fe1..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/dats/stack_dats.c +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for dats. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "dats/dats_api.h" -#include "wdxs/wdxs_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitDats(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DatsHandler); - DatsHandlerInit(handlerId); - -#if WDXS_INCLUDED == TRUE - handlerId = WsfOsSetNextHandler(WdxsHandler); - WdxsHandlerInit(handlerId); -#endif -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/makefile deleted file mode 100644 index cfbcfb849a35769e879d5f7d0cf2925eb87495ca..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the fit sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := fit.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/sources.mk deleted file mode 100644 index df48ed37f32fd5d4f6b32c7c1b4d300e3d5879c2..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/gcc/sources.mk +++ /dev/null @@ -1,87 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/fit/fit_main.c \ - $(ROOT_DIR)/projects/ble-apps/fit/main.c \ - $(ROOT_DIR)/projects/ble-apps/fit/stack_fit.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -INC_DIRS += \ - $(ROOT_DIR)/controller/include/common \ - $(ROOT_DIR)/controller/include/ble - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvoptx deleted file mode 100644 index 05048900bdddf6cb5478b0d7068748e641cb8daa..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>fit-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvprojx deleted file mode 100644 index d337a4cf463b3df8df726fee227ff0945717bf65..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/keil/fit-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>fit-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>fit-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/fit-bt4-obj.bin _build/fit-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/fit-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/fit-bt4-obj.img _build/fit-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\controller\include\common;..\..\..\..\controller\include\ble;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fit_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\fit\fit_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\fit\main.c</FilePath> - </File> - <File> - <FileName>stack_fit.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\fit\stack_fit.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/main.c deleted file mode 100644 index f86188d0b641251cf7cebcf23257c0961a72f358..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/main.c +++ /dev/null @@ -1,198 +0,0 @@ -/*************************************************************************************************/ -/*! -* \file main.c -* -* \brief Main file for fit application. -* -* Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. -* ARM Ltd. confidential and proprietary. -* -* IMPORTANT. Your use of this file is governed by a Software License Agreement -* ("Agreement") that must be accepted in order to download or otherwise receive a -* copy of this file. You may not use or copy this file for any purpose other than -* as described in the Agreement. If you do not agree to all of the terms of the -* Agreement do not use this file and delete all copies in your possession or control; -* if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -* to any use, copying or further distribution of this software. -*/ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "fit/fit_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitFit(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - /* Set 5.0 requirements. */ - mainLlRtCfg.btVer = LL_VER_BT_CORE_SPEC_5_0; - #endif - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - PlatformGetBlePhyFeatures(&mainLlRtCfg.phy2mSup, &mainLlRtCfg.phyCodedSup, - &mainLlRtCfg.stableModIdxTxSup, &mainLlRtCfg.stableModIdxRxSup); - #endif -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - #if (BT_VER >= LL_VER_BT_CORE_SPEC_5_0) - memUsed = LlInitExtInit(&llCfg); - #else - memUsed = LlInitStdInit(&llCfg); - #endif - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitFit(); - FitStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/stack_fit.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/stack_fit.c deleted file mode 100644 index 9c2c1f46c650bf15c3620789b6f3102ed5a762ba..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/fit/stack_fit.c +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for fit. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "fit/fit_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitFit(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(FitHandler); - FitHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/makefile deleted file mode 100644 index 0dbd3bfe52263f9ec78be862b7f009c4047abde3..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the hidapp sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := hidapp.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/sources.mk deleted file mode 100644 index ff061166cc8b1b9d94fbcd7f2c1143c268eb52d1..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/hidapp/hidapp_main.c \ - $(ROOT_DIR)/projects/ble-apps/hidapp/main.c \ - $(ROOT_DIR)/projects/ble-apps/hidapp/stack_hidapp.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvoptx deleted file mode 100644 index 7ae31b872184461299c77cfbc4d6ccbdaa7b13b9..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>hidapp-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvprojx deleted file mode 100644 index f7d6ed7c2286216d21da594e0a21308e5915fa9f..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/keil/hidapp-bt4.uvprojx +++ /dev/null @@ -1,1315 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>hidapp-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>hidapp-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/hidapp-bt4-obj.bin _build/hidapp-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/hidapp-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/hidapp-bt4-obj.img _build/hidapp-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\hidapp\main.c</FilePath> - </File> - <File> - <FileName>stack_hidapp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\hidapp\stack_hidapp.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/main.c deleted file mode 100644 index 64013aedb44e259edd62c0ebc686a292859bd785..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for hidapp application. - * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "hidapp/hidapp_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitHidApp(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitHidApp(); - HidAppStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/stack_hidapp.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/stack_hidapp.c deleted file mode 100644 index cc2dbfa64bbb6b8f32ee070608680aaeeee35fba..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/hidapp/stack_hidapp.c +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for hidapp. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "hidapp/hidapp_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitHidApp(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(HidAppHandler); - HidAppHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/makefile deleted file mode 100644 index c0dcdfb2ed0d87415ad5d0ef9f7dd3b58987b244..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the medc sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := medc.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_CENTRAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/sources.mk deleted file mode 100644 index 6f61dc9f3708792bd1b5976c3ce80eac5e0f4f6c..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/medc/*.c)) \ - $(ROOT_DIR)/projects/ble-apps/medc/main.c \ - $(ROOT_DIR)/projects/ble-apps/medc/stack_medc.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvoptx deleted file mode 100644 index e933b7784d2cd00d393ad772be28feae3d6ee55e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>medc-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvprojx deleted file mode 100644 index b1e2e56238b2a13904f5de6a50972ce519466193..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/keil/medc-bt4.uvprojx +++ /dev/null @@ -1,1350 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>medc-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>medc-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/medc-bt4-obj.bin _build/medc-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/medc-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/medc-bt4-obj.img _build/medc-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_MS_PER_TICK=10 WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 INIT_CENTRAL WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>medc_blp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_blp.c</FilePath> - </File> - <File> - <FileName>medc_glp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_glp.c</FilePath> - </File> - <File> - <FileName>medc_hrp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_hrp.c</FilePath> - </File> - <File> - <FileName>medc_htp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_htp.c</FilePath> - </File> - <File> - <FileName>medc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_main.c</FilePath> - </File> - <File> - <FileName>medc_plx.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_plx.c</FilePath> - </File> - <File> - <FileName>medc_wsp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\medc\medc_wsp.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\medc\main.c</FilePath> - </File> - <File> - <FileName>stack_medc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\medc\stack_medc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/main.c deleted file mode 100644 index 78599d68acc286c4fe66e404ecc2e4d971e60861..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for medc application. - * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "medc/medc_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitMedc(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitMedc(); - MedcStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/stack_medc.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/stack_medc.c deleted file mode 100644 index 904112ea939a7dfdb81cab616e398c719350008e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/medc/stack_medc.c +++ /dev/null @@ -1,89 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for medc. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "medc/medc_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitMedc(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmScanInit(); - DmConnInit(); - DmConnMasterInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - L2cInit(); - L2cMasterInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - AttcInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmpiInit(); - SmpiScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(MedcHandler); - MedcHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/makefile deleted file mode 100644 index 617fcdbe9d12b3de904cf43a6cf14f035c86e63b..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the meds sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := meds.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/sources.mk deleted file mode 100644 index e5809a502dfdaab4a22c1302f0dc76ea4431e038..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/meds/*.c)) \ - $(ROOT_DIR)/projects/ble-apps/meds/main.c \ - $(ROOT_DIR)/projects/ble-apps/meds/stack_meds.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvoptx deleted file mode 100644 index 055acfa2b94f2fe7c6797726c91d9ac18d425e8b..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>meds-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvprojx deleted file mode 100644 index ef4aa22bb7e065f964ee37b1cf47c7ee2361b44a..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/keil/meds-bt4.uvprojx +++ /dev/null @@ -1,1345 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>meds-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>meds-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/meds-bt4-obj.bin _build/meds-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/meds-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/meds-bt4-obj.img _build/meds-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>meds_blp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_blp.c</FilePath> - </File> - <File> - <FileName>meds_glp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_glp.c</FilePath> - </File> - <File> - <FileName>meds_htp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_htp.c</FilePath> - </File> - <File> - <FileName>meds_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_main.c</FilePath> - </File> - <File> - <FileName>meds_plx.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_plx.c</FilePath> - </File> - <File> - <FileName>meds_wsp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\meds\meds_wsp.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\meds\main.c</FilePath> - </File> - <File> - <FileName>stack_meds.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\meds\stack_meds.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/main.c deleted file mode 100644 index e297d11c55b12d4f4d60c830d65205787693a947..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for meds application. - * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "meds/meds_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitMeds(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitMeds(); - MedsStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/stack_meds.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/stack_meds.c deleted file mode 100644 index 34eb6a191b1046210e47a94320ab191e9be28fd1..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/meds/stack_meds.c +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for meds. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "meds/meds_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitMeds(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(MedsHandler); - MedsHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/makefile deleted file mode 100644 index 67099770459cc837061aacb79f10adc9ae0c224b..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/makefile +++ /dev/null @@ -1,52 +0,0 @@ -################################################################################################### -# -# Makefile for building the simple test sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := ota-boot.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -HOST_REV ?= 2.2 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV := WSF_MS_PER_TICK=10 -CFG_DEV += WSF_PRINTF_MAX_LEN=128 -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/sources.mk deleted file mode 100644 index 37ebb3a63ae8592f14c6c883f335b57e7103ccb6..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/gcc/sources.mk +++ /dev/null @@ -1,39 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -INC_DIRS += \ - $(ROOT_DIR)/platform/$(PLATFORM)/include \ - $(ROOT_DIR)/platform/$(PLATFORM)/sources/ota \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps - - -C_FILES += \ - $(ROOT_DIR)/projects/ble-apps/ota-boot/main.c \ - $(ROOT_DIR)/platform/$(PLATFORM)/sources/ota/ota_common.c - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ota.mk - diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/main.c deleted file mode 100644 index 1e9520c90558bab97e62e05cc977731f57e56f06..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/main.c +++ /dev/null @@ -1,131 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for OTA bootloader. - * - * Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "ota-relocate-obj.h" -#include "cordio_sdk_version.h" - -#include "wsf_buf.h" -#include "wsf_math.h" -#include "wsf_trace.h" -#include "util/bstream.h" -#include "util/crc32.h" - -#include "cordio_tc2.h" -#include "cordio_tc2_defs.h" - -#include "board.h" -#include "board_flash.h" - -#include "platform.h" - -#include "ota_api.h" -#include "ota_common.h" - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*************************************************************************************************/ -/*! - * \brief Initialize the platform. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainPlatformInit(void) -{ - BoardHwInit(); -} - -/*************************************************************************************************/ -/*! - * \brief Entry point for demo software. - * - * \param None. - * - * \return None. - */ -/*************************************************************************************************/ -int main(void) -{ - /* ---------- init ---------- */ - - WsfTraceEnable(TRUE); - BoardWsfInit(); - mainPlatformInit(); - - /* ---------- OTA load ---------- */ - - OtaInit(); - if (OtaNewFileAvailable()) - { - APP_TRACE_INFO0("ota: copying image from data to run"); - if (!OtaCopyDownImage()) - { - APP_TRACE_INFO0("ota: image copy failed"); - if (!OtaCheckExistingFileCrc()) - { - APP_TRACE_INFO0("ota: existing file CRC failed"); - goto Error; - } - } - } - else - { - if (!OtaCheckExistingFileCrc()) - { - APP_TRACE_INFO0("ota: existing file CRC failed"); - goto Error; - } - } - - /* ---------- boot ---------- */ - - /* Load image; will not return. */ - CordioTc2ImgHdr_t hdr; - - BoardFlashWake(); - BoardFlashRead(OTA_ROM_SEG_RUN, (uint8_t *)&hdr, sizeof(hdr)); - BoardFlashSleep(); - - if (hdr.cookie != CORDIO_TC2_HEADER_COOKIE) - { - APP_TRACE_INFO2("img hdr: expected %08X, found %08X", CORDIO_TC2_HEADER_COOKIE, hdr.cookie); - goto Error; - } - if (hdr.type != CORDIO_TC2_IMG_TYPE_HOST_FW) - { - APP_TRACE_INFO2("img type: expected %02X, found %02X", CORDIO_TC2_IMG_TYPE_HOST_FW, hdr.type); - goto Error; - } - APP_TRACE_INFO2("img load: length %u, addr %08X", hdr.dataLen & CORDIO_TC2_DATA_LEN_MASK, OTA_ROM_SEG_RUN + hdr.hdrLen); - - ota_relocate_fnc(0x20000000, OTA_ROM_SEG_RUN + hdr.hdrLen, hdr.dataLen & CORDIO_TC2_DATA_LEN_MASK); - - /* ---------- error --------- */ - - /* No valid image; blink LED for error. */ - -Error: - while (TRUE) - { - - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.h b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.h deleted file mode 100644 index 53e23c95c3e1471ed748df930a08db75bd8884d9..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.h +++ /dev/null @@ -1,813 +0,0 @@ -/* auto-generated firmware header */ -typedef void (*ota_relocate_fnc_t)(uint32_t addrDst, uint32_t spfAddrSrc, uint32_t len); -#define ota_relocate_fnc ((ota_relocate_fnc_t)(ota_relocate_obj + 0x00000306 + 1)) -static /* const */ uint8_t ota_relocate_obj[] __attribute__ ((aligned (4))) = { -0x80, -0x22, -0x30, -0xb5, -0x01, -0x24, -0x0b, -0x49, -0x52, -0x02, -0xcd, -0x68, -0x09, -0x4b, -0x25, -0x42, -0x02, -0xd1, -0x01, -0x3a, -0x00, -0x2a, -0xf8, -0xd1, -0x80, -0x22, -0x04, -0x21, -0x98, -0x60, -0x52, -0x02, -0xd8, -0x68, -0x08, -0x42, -0x02, -0xd1, -0x01, -0x3a, -0x00, -0x2a, -0xf9, -0xd1, -0x98, -0x68, -0xc0, -0xb2, -0x30, -0xbd, -0xc0, -0x46, -0x00, -0x30, -0x00, -0x40, -0x10, -0xb5, -0x09, -0x4a, -0x09, -0x4b, -0x00, -0x28, -0x04, -0xd1, -0x80, -0x21, -0x50, -0x60, -0x5a, -0x68, -0x0a, -0x43, -0x04, -0xe0, -0x02, -0x21, -0x51, -0x60, -0x5a, -0x68, -0x7e, -0x31, -0x8a, -0x43, -0x5a, -0x60, -0x01, -0x20, -0x00, -0xf0, -0x49, -0xf9, -0x10, -0xbd, -0x00, -0x30, -0x00, -0x40, -0x00, -0x00, -0x01, -0x40, -0x10, -0xb5, -0x01, -0x20, -0xff, -0xf7, -0xe4, -0xff, -0xab, -0x20, -0xff, -0xf7, -0xc5, -0xff, -0x00, -0x20, -0xff, -0xf7, -0xc2, -0xff, -0x00, -0x20, -0xff, -0xf7, -0xbf, -0xff, -0x01, -0x20, -0xff, -0xf7, -0xbc, -0xff, -0x00, -0x20, -0xff, -0xf7, -0xb9, -0xff, -0x04, -0x00, -0x00, -0x20, -0x86, -0x3c, -0xff, -0xf7, -0xd0, -0xff, -0x60, -0x42, -0x60, -0x41, -0xc0, -0xb2, -0x10, -0xbd, -0x10, -0xb5, -0x01, -0x20, -0xff, -0xf7, -0xc8, -0xff, -0x06, -0x20, -0xff, -0xf7, -0xa9, -0xff, -0x00, -0x20, -0xff, -0xf7, -0xc2, -0xff, -0x10, -0xbd, -0x00, -0x00, -0x80, -0x21, -0x09, -0x4b, -0x49, -0x00, -0x10, -0xb5, -0x19, -0x61, -0x00, -0x28, -0x02, -0xd0, -0x5a, -0x68, -0x0a, -0x43, -0x02, -0xe0, -0x59, -0x68, -0x05, -0x4a, -0x0a, -0x40, -0xfa, -0x20, -0x5a, -0x60, -0x40, -0x00, -0x00, -0xf0, -0x0a, -0xf9, -0x10, -0xbd, -0xc0, -0x46, -0x00, -0x00, -0x01, -0x40, -0xff, -0xfe, -0xff, -0xff, -0x70, -0xb5, -0x0b, -0x24, -0x01, -0x3c, -0x00, -0x2c, -0x13, -0xd0, -0x01, -0x20, -0xff, -0xf7, -0xa0, -0xff, -0x05, -0x20, -0xff, -0xf7, -0x81, -0xff, -0xaa, -0x20, -0xff, -0xf7, -0x7e, -0xff, -0x05, -0x00, -0x00, -0x20, -0xff, -0xf7, -0x96, -0xff, -0xeb, -0x07, -0x04, -0xd5, -0xfa, -0x20, -0x80, -0x00, -0x00, -0xf0, -0xec, -0xf8, -0xe8, -0xe7, -0x70, -0xbd, -0x70, -0x22, -0x07, -0x21, -0x0d, -0x4b, -0x10, -0xb5, -0x9a, -0x61, -0x10, -0x32, -0xda, -0x61, -0x0c, -0x4a, -0x00, -0x20, -0x11, -0x60, -0x05, -0x39, -0x11, -0x61, -0xf0, -0x22, -0x5a, -0x62, -0x10, -0x3a, -0x1a, -0x61, -0xd0, -0x3a, -0x5a, -0x61, -0xff, -0xf7, -0xba, -0xff, -0x00, -0x20, -0xff, -0xf7, -0x77, -0xff, -0x01, -0x20, -0xff, -0xf7, -0xb4, -0xff, -0xff, -0xf7, -0x8a, -0xff, -0x10, -0xbd, -0xc0, -0x46, -0x00, -0x00, -0x01, -0x40, -0x00, -0x30, -0x00, -0x40, -0xf8, -0xb5, -0x06, -0x00, -0x15, -0x00, -0x01, -0x20, -0x0c, -0x00, -0xff, -0xf7, -0x65, -0xff, -0x03, -0x20, -0xff, -0xf7, -0x46, -0xff, -0x30, -0x0c, -0xc0, -0xb2, -0xff, -0xf7, -0x42, -0xff, -0x30, -0x0a, -0xc0, -0xb2, -0xff, -0xf7, -0x3e, -0xff, -0xf0, -0xb2, -0xff, -0xf7, -0x3b, -0xff, -0x16, -0x4b, -0x28, -0x00, -0x9c, -0x46, -0x00, -0x28, -0x22, -0xd0, -0x02, -0x00, -0x08, -0x28, -0x00, -0xd9, -0x08, -0x22, -0xd1, -0xb2, -0x63, -0x46, -0x10, -0x26, -0xdb, -0x68, -0x33, -0x40, -0xfa, -0xd1, -0x1f, -0x00, -0x0e, -0x4e, -0x01, -0x33, -0xdb, -0xb2, -0xb7, -0x60, -0x99, -0x42, -0xf9, -0xd8, -0x23, -0x00, -0x0a, -0x4e, -0xf7, -0x68, -0x04, -0x26, -0x37, -0x42, -0xfa, -0xd0, -0x08, -0x4f, -0x01, -0x33, -0xbe, -0x68, -0x5f, -0x1e, -0x3e, -0x70, -0x1f, -0x1b, -0xff, -0xb2, -0xb9, -0x42, -0xf1, -0xd8, -0x80, -0x1a, -0x1c, -0x00, -0xda, -0xe7, -0xff, -0xf7, -0x2d, -0xff, -0x28, -0x00, -0xf8, -0xbd, -0xc0, -0x46, -0x00, -0x30, -0x00, -0x40, -0x70, -0xb5, -0x05, -0x00, -0x00, -0x20, -0x0e, -0x00, -0x82, -0x42, -0x2b, -0xd0, -0x16, -0x4b, -0x9d, -0x42, -0x28, -0xd8, -0x80, -0x23, -0xe9, -0xb2, -0x5b, -0x00, -0x5b, -0x1a, -0x14, -0x00, -0x9a, -0x42, -0x00, -0xd9, -0x1c, -0x00, -0xff, -0xf7, -0x49, -0xff, -0x01, -0x20, -0xff, -0xf7, -0x12, -0xff, -0x02, -0x20, -0xff, -0xf7, -0xf3, -0xfe, -0x28, -0x0c, -0xc0, -0xb2, -0xff, -0xf7, -0xef, -0xfe, -0x28, -0x0a, -0xc0, -0xb2, -0xff, -0xf7, -0xeb, -0xfe, -0xe8, -0xb2, -0xff, -0xf7, -0xe8, -0xfe, -0x35, -0x00, -0x28, -0x78, -0x01, -0x35, -0xff, -0xf7, -0xe3, -0xfe, -0xab, -0x1b, -0xa3, -0x42, -0xf8, -0xd3, -0x00, -0x20, -0xff, -0xf7, -0xf9, -0xfe, -0xff, -0xf7, -0x4f, -0xff, -0x20, -0x00, -0x70, -0xbd, -0xc0, -0x46, -0xff, -0xff, -0x0f, -0x00, -0x10, -0xb5, -0x04, -0x00, -0xff, -0xf7, -0x22, -0xff, -0x01, -0x20, -0xff, -0xf7, -0xeb, -0xfe, -0x20, -0x20, -0xff, -0xf7, -0xcc, -0xfe, -0x20, -0x0c, -0xc0, -0xb2, -0xff, -0xf7, -0xc8, -0xfe, -0x20, -0x0a, -0xc0, -0xb2, -0xff, -0xf7, -0xc4, -0xfe, -0xe0, -0xb2, -0xff, -0xf7, -0xc1, -0xfe, -0x00, -0x20, -0xff, -0xf7, -0xda, -0xfe, -0xff, -0xf7, -0x30, -0xff, -0x10, -0xbd, -0x10, -0xb5, -0xff, -0xf7, -0x08, -0xff, -0x01, -0x20, -0xff, -0xf7, -0xd1, -0xfe, -0x60, -0x20, -0xff, -0xf7, -0xb2, -0xfe, -0x00, -0x20, -0xff, -0xf7, -0xcb, -0xfe, -0xff, -0xf7, -0x21, -0xff, -0x10, -0xbd, -0x10, -0xb5, -0x01, -0x20, -0xff, -0xf7, -0xc4, -0xfe, -0xb9, -0x20, -0xff, -0xf7, -0xa5, -0xfe, -0x00, -0x20, -0xff, -0xf7, -0xbe, -0xfe, -0x00, -0x20, -0xff, -0xf7, -0xfb, -0xfe, -0x10, -0xbd, -0x10, -0xb5, -0x01, -0x20, -0xff, -0xf7, -0xf6, -0xfe, -0x0b, -0x24, -0x01, -0x3c, -0x00, -0x2c, -0x08, -0xd0, -0xff, -0xf7, -0xc8, -0xfe, -0x00, -0x28, -0x04, -0xd1, -0xf5, -0x30, -0xff, -0x30, -0x00, -0xf0, -0x06, -0xf8, -0xf3, -0xe7, -0x10, -0xbd, -0x01, -0x68, -0x42, -0x68, -0x8d, -0x46, -0x97, -0x46, -0x00, -0x01, -0x82, -0xb0, -0xc0, -0x08, -0x01, -0x90, -0x01, -0x9b, -0x5a, -0x1e, -0x01, -0x92, -0x00, -0x2b, -0xfa, -0xd1, -0x02, -0xb0, -0x70, -0x47, -0x70, -0xb5, -0x04, -0x00, -0x0d, -0x00, -0x16, -0x00, -0xff, -0xf7, -0xd9, -0xff, -0x32, -0x00, -0x21, -0x00, -0x28, -0x00, -0xff, -0xf7, -0x22, -0xff, -0xff, -0xf7, -0xc4, -0xff, -0x20, -0x00, -0xff, -0xf7, -0xe1, -0xff, -0x70, -0xbd, -}; diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.lst b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.lst deleted file mode 100644 index ec394688c629296fa116c9fde676f096408cf2d0..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/ota-boot/ota-relocate-obj.lst +++ /dev/null @@ -1,25 +0,0 @@ -0000028a T BoardFlashEraseChip -00000254 T BoardFlashEraseSector -0000011c T BoardFlashInit -00000160 T BoardFlashRead -000002a8 T BoardFlashSleep -000002c4 T BoardFlashWake -000001e8 T BoardFlashWrite -000002f0 T PlatformDelayUsec -00010328 T __bss_end__ -00010328 T __bss_start -00010328 T __bss_start__ -00010328 T __data_start -00010328 T __end__ -00010328 T _bss_end__ -00010328 T _edata -00010328 T _end -00080000 N _stack -00000068 t boardFlashCheckId -000000b8 t boardFlashEna -00000038 t boardFlashSpiCs -00000000 t boardFlashSpiTr -000000e8 t boardFlashWaitWhileBusy -000000a0 t boardFlashWriteEnable -000002e8 t mainBootJump -00000306 T mainLoadImg diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/makefile deleted file mode 100644 index c71580b42fae40c00477d6b13bcd4342ad658646..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/makefile +++ /dev/null @@ -1,53 +0,0 @@ -################################################################################################### -# -# Makefile for building the tag sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := tag.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -WDXS_INCLUDED := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += WDXS_INCLUDED=$(WDXS_INCLUDED) -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/sources.mk deleted file mode 100644 index d486c56cc5598e9d429606a2de07efbb52f72c8d..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/gcc/sources.mk +++ /dev/null @@ -1,92 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/projects/ble-apps/tag/main.c \ - $(ROOT_DIR)/projects/ble-apps/tag/stack_tag.c - -ifeq ($(WDXS_INCLUDED),1) -C_FILES += \ - $(ROOT_DIR)/ble-profiles/sources/apps/tag/tag_main_wdxs.c \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/wdxs/*.c)) -else -C_FILES += \ - $(ROOT_DIR)/ble-profiles/sources/apps/tag/tag_main.c -endif - - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvoptx deleted file mode 100644 index 2ca2c1909c351215a75d78f3fb38b5ceab58eefc..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>tag-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvprojx deleted file mode 100644 index 97b4e5e261b83ed4c5886f100c0302469c0aa107..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/keil/tag-bt4.uvprojx +++ /dev/null @@ -1,1325 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>tag-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>tag-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/tag-bt4-obj.bin _build/tag-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/tag-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/tag-bt4-obj.img _build/tag-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 WDXS_INCLUDED=1 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>tag_main_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\tag\tag_main_wdxs.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_oad.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\wdxs\wdxs_oad.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\tag\main.c</FilePath> - </File> - <File> - <FileName>stack_tag.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\tag\stack_tag.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/main.c deleted file mode 100644 index ee9169b8bcef4e80afea7ed3f2b4f417e41f3685..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for tag application. - * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "tag/tag_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitTag(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitTag(); - TagStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/stack_tag.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/stack_tag.c deleted file mode 100644 index c383afd0e32f8e997b80ca1644604e99eea98909..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/tag/stack_tag.c +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for tag. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "tag/tag_api.h" -#include "wdxs/wdxs_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitTag(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevPrivInit(); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - AttcInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(TagHandler); - TagHandlerInit(handlerId); - -#if WDXS_INCLUDED == TRUE - handlerId = WsfOsSetNextHandler(WdxsHandler); - WdxsHandlerInit(handlerId); -#endif -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/makefile deleted file mode 100644 index 4f1c7eb144fbc2b3110b9184562a8db3370ad3f2..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the UriBeacon sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := uribeacon.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/sources.mk deleted file mode 100644 index 8d1ccafded608e2e84634953d5a84a96be7f6a34..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/uribeacon/uribeacon_main.c \ - $(ROOT_DIR)/projects/ble-apps/uribeacon/main.c \ - $(ROOT_DIR)/projects/ble-apps/uribeacon/stack_uribeacon.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvoptx deleted file mode 100644 index d79c79768b528af86169e97ff3e482cc2f0c2332..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>uribeacon-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvprojx deleted file mode 100644 index d56191ccd8878ca2048bfb39efed39f9355ed219..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/keil/uribeacon-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>uribeacon-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>uribeacon-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/uribeacon-bt4-obj.bin _build/uribeacon-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/uribeacon-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/uribeacon-bt4-obj.img _build/uribeacon-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uribeacon_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\uribeacon\uribeacon_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\uribeacon\main.c</FilePath> - </File> - <File> - <FileName>stack_uribeacon.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\uribeacon\stack_uribeacon.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/main.c deleted file mode 100644 index bfdedc442a17714238038d1e271c57f4ac9c59d0..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for UriBeacon application. - * - * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "uribeacon/uribeacon_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitUriBeacon(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitUriBeacon(); - UriBeaconStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/stack_uribeacon.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/stack_uribeacon.c deleted file mode 100644 index e35e9aade5c014cf12af68135d6ca19dfd86ee2e..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/uribeacon/stack_uribeacon.c +++ /dev/null @@ -1,89 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for uribeacon. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "uribeacon/uribeacon_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "app_param.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitUriBeacon(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmAdvInit(); - DmConnInit(); - DmConnSlaveInit(); - DmSecInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmprInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(UriBeaconHandler); - UriBeaconHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/makefile b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/makefile deleted file mode 100644 index 0243fce14c1efe7d2851e0c28225900aaa45d2bb..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/makefile +++ /dev/null @@ -1,51 +0,0 @@ -################################################################################################### -# -# Makefile for building the watch sample application -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Project -#-------------------------------------------------------------------------------------------------- - -# Inputs -ROOT_DIR := ../../../.. -PLATFORM := bt4 -RTOS := baremetal - -# Output -BIN_FILE := watch.elf - -# Options -DEBUG := 0 -TOKEN := 0 -TRACE := 1 -BT_VER := 9 -USE_EXACTLE := 0 -USE_UECC := 1 -CFG_APP := - -#-------------------------------------------------------------------------------------------------- -# Configuration -#-------------------------------------------------------------------------------------------------- - -CFG_DEV += INIT_PERIPHERAL INIT_CENTRAL INIT_ENCRYPTED -CFG_DEV += $(CFG_APP) - -#-------------------------------------------------------------------------------------------------- -# Targets -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/platform/$(PLATFORM)/build/build.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/install.mk diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/sources.mk b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/sources.mk deleted file mode 100644 index c1c2c5785c49c85d83d400c868477bcefdfc34cd..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/gcc/sources.mk +++ /dev/null @@ -1,83 +0,0 @@ -################################################################################################### -# -# Source and include definition -# -# Copyright (c) 2015-2017 ARM Ltd. All Rights Reserved. -# ARM Ltd. confidential and proprietary. -# -# IMPORTANT. Your use of this file is governed by a Software License Agreement -# ("Agreement") that must be accepted in order to download or otherwise receive a -# copy of this file. You may not use or copy this file for any purpose other than -# as described in the Agreement. If you do not agree to all of the terms of the -# Agreement do not use this file and delete all copies in your possession or control; -# if you do not have a copy of the Agreement, you must contact ARM Ltd. prior -# to any use, copying or further distribution of this software. -# -################################################################################################### - -#-------------------------------------------------------------------------------------------------- -# Application -#-------------------------------------------------------------------------------------------------- - -ifeq ($(BT_VER),8) -APP_FILTER_OUT := \ - $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*ae*.c) -else -APP_FILTER_OUT := -endif - -INC_DIRS += \ - $(ROOT_DIR)/ble-profiles/include/app \ - $(ROOT_DIR)/ble-profiles/sources/apps \ - $(ROOT_DIR)/ble-profiles/sources/apps/app - -C_FILES += \ - $(sort $(filter-out $(APP_FILTER_OUT),$(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/*.c))) \ - $(sort $(wildcard $(ROOT_DIR)/ble-profiles/sources/apps/app/common/*.c)) \ - $(ROOT_DIR)/ble-profiles/sources/apps/watch/watch_main.c \ - $(ROOT_DIR)/projects/ble-apps/watch/main.c \ - $(ROOT_DIR)/projects/ble-apps/watch/stack_watch.c - -#-------------------------------------------------------------------------------------------------- -# Host -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/ble-profiles/build/sources_services.mk - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_5.mk -else -include $(ROOT_DIR)/ble-profiles/build/sources_profiles_4.mk -endif - -ifeq ($(BT_VER),9) -include $(ROOT_DIR)/ble-host/build/sources_stack_5.mk -else -include $(ROOT_DIR)/ble-host/build/sources_stack_4.mk -endif - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/ble-host/build/sources_hci_exactle.mk -else -include $(ROOT_DIR)/ble-host/build/sources_hci_dual_chip.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Controller -#-------------------------------------------------------------------------------------------------- - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/controller/build/sources_ll_5.mk -endif - -#-------------------------------------------------------------------------------------------------- -# Platform -#-------------------------------------------------------------------------------------------------- - -include $(ROOT_DIR)/wsf/$(RTOS)/build/sources.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_common.mk -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ble-host.mk - -ifeq ($(USE_EXACTLE),1) -include $(ROOT_DIR)/platform/$(PLATFORM)/build/sources_ll.mk -endif diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvoptx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvoptx deleted file mode 100644 index 93cf73c961ea29fe6d57f87fb087f39822d3d709..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvoptx +++ /dev/null @@ -1,186 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> - - <SchemaVersion>1.0</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Extensions> - <cExt>*.c</cExt> - <aExt>*.s*; *.src; *.a*</aExt> - <oExt>*.obj</oExt> - <lExt>*.lib</lExt> - <tExt>*.txt; *.h; *.inc</tExt> - <pExt>*.plm</pExt> - <CppX>*.cpp</CppX> - <nMigrate>0</nMigrate> - </Extensions> - - <DaveTm> - <dwLowDateTime>0</dwLowDateTime> - <dwHighDateTime>0</dwHighDateTime> - </DaveTm> - - <Target> - <TargetName>watch-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <TargetOption> - <CLKADS>12000000</CLKADS> - <OPTTT> - <gFlags>1</gFlags> - <BeepAtEnd>1</BeepAtEnd> - <RunSim>0</RunSim> - <RunTarget>1</RunTarget> - <RunAbUc>0</RunAbUc> - </OPTTT> - <OPTHX> - <HexSelection>1</HexSelection> - <FlashByte>65535</FlashByte> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - </OPTHX> - <OPTLEX> - <PageWidth>79</PageWidth> - <PageLength>66</PageLength> - <TabStop>8</TabStop> - <ListingPath>.\_build\</ListingPath> - </OPTLEX> - <ListingPage> - <CreateCListing>1</CreateCListing> - <CreateAListing>1</CreateAListing> - <CreateLListing>1</CreateLListing> - <CreateIListing>0</CreateIListing> - <AsmCond>1</AsmCond> - <AsmSymb>1</AsmSymb> - <AsmXref>0</AsmXref> - <CCond>1</CCond> - <CCode>0</CCode> - <CListInc>0</CListInc> - <CSymb>0</CSymb> - <LinkerCodeListing>0</LinkerCodeListing> - </ListingPage> - <OPTXL> - <LMap>1</LMap> - <LComments>1</LComments> - <LGenerateSymbols>1</LGenerateSymbols> - <LLibSym>1</LLibSym> - <LLines>1</LLines> - <LLocSym>1</LLocSym> - <LPubSym>1</LPubSym> - <LXref>0</LXref> - <LExpSel>0</LExpSel> - </OPTXL> - <OPTFL> - <tvExp>1</tvExp> - <tvExpOptDlg>0</tvExpOptDlg> - <IsCurrentTarget>1</IsCurrentTarget> - </OPTFL> - <CpuCode>7</CpuCode> - <DebugOpt> - <uSim>0</uSim> - <uTrg>1</uTrg> - <sLdApp>1</sLdApp> - <sGomain>1</sGomain> - <sRbreak>1</sRbreak> - <sRwatch>1</sRwatch> - <sRmem>1</sRmem> - <sRfunc>1</sRfunc> - <sRbox>1</sRbox> - <tLdApp>1</tLdApp> - <tGomain>1</tGomain> - <tRbreak>1</tRbreak> - <tRwatch>1</tRwatch> - <tRmem>1</tRmem> - <tRfunc>0</tRfunc> - <tRbox>1</tRbox> - <tRtrace>1</tRtrace> - <sRSysVw>1</sRSysVw> - <tRSysVw>1</tRSysVw> - <sRunDeb>0</sRunDeb> - <sLrtime>0</sLrtime> - <nTsel>4</nTsel> - <sDll></sDll> - <sDllPa></sDllPa> - <sDlgDll></sDlgDll> - <sDlgPa></sDlgPa> - <sIfile></sIfile> - <tDll></tDll> - <tDllPa></tDllPa> - <tDlgDll></tDlgDll> - <tDlgPa></tDlgPa> - <tIfile>.\debug.ini</tIfile> - <pMon>BIN\CMSIS_AGDI.dll</pMon> - </DebugOpt> - <TargetDriverDllRegistry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMRTXEVENTFLAGS</Key> - <Name>-L70 -Z18 -C0 -M0 -T1</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGTARM</Key> - <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>ARMDBGFLAGS</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>CMSIS_AGDI</Key> - <Name>-X"" -O206 -S0 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(0BC11477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE.FLM -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM)</Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>DLGUARM</Key> - <Name></Name> - </SetRegEntry> - <SetRegEntry> - <Number>0</Number> - <Key>UL2CM3</Key> - <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</Name> - </SetRegEntry> - </TargetDriverDllRegistry> - <Breakpoint/> - <Tracepoint> - <THDelay>0</THDelay> - </Tracepoint> - <DebugFlag> - <trace>0</trace> - <periodic>0</periodic> - <aLwin>1</aLwin> - <aCover>0</aCover> - <aSer1>0</aSer1> - <aSer2>0</aSer2> - <aPa>0</aPa> - <viewmode>1</viewmode> - <vrSel>0</vrSel> - <aSym>0</aSym> - <aTbox>0</aTbox> - <AscS1>0</AscS1> - <AscS2>0</AscS2> - <AscS3>0</AscS3> - <aSer3>0</aSer3> - <eProf>0</eProf> - <aLa>0</aLa> - <aPa1>0</aPa1> - <AscS4>0</AscS4> - <aSer4>0</aSer4> - <StkLoc>0</StkLoc> - <TrcWin>0</TrcWin> - <newCpu>0</newCpu> - <uProt>0</uProt> - </DebugFlag> - <LintExecutable></LintExecutable> - <LintConfigFile></LintConfigFile> - <bLintAuto>0</bLintAuto> - </TargetOption> - </Target> - <Group> - </Group> - -</ProjectOpt> diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvprojx b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvprojx deleted file mode 100644 index 23f8bffda5df5b50d59d62b49cbab1599b60c939..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/keil/watch-bt4.uvprojx +++ /dev/null @@ -1,1320 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="no" ?> -<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd"> - - <SchemaVersion>2.1</SchemaVersion> - - <Header>### uVision Project, (C) Keil Software</Header> - - <Targets> - <Target> - <TargetName>watch-bt4</TargetName> - <ToolsetNumber>0x4</ToolsetNumber> - <ToolsetName>ARM-ADS</ToolsetName> - <pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed> - <TargetOption> - <TargetCommonOption> - <Device>ARMCM0P</Device> - <Vendor>ARM</Vendor> - <PackID>ARM.CMSIS.4.3.0</PackID> - <PackURL>http://www.keil.com/pack/</PackURL> - <Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ESEL ELITTLE</Cpu> - <FlashUtilSpec></FlashUtilSpec> - <StartupFile></StartupFile> - <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0NEW_DEVICE -FS00 -FL040000 -FP0($$Device:ARMCM0P$Device\ARM\Flash\NEW_DEVICE.FLM))</FlashDriverDll> - <DeviceId>0</DeviceId> - <RegisterFile>$$Device:ARMCM0P$Device\ARM\ARMCM0plus\Include\ARMCM0plus.h</RegisterFile> - <MemoryEnv></MemoryEnv> - <Cmp></Cmp> - <Asm></Asm> - <Linker></Linker> - <OHString></OHString> - <InfinionOptionDll></InfinionOptionDll> - <SLE66CMisc></SLE66CMisc> - <SLE66AMisc></SLE66AMisc> - <SLE66LinkerMisc></SLE66LinkerMisc> - <SFDFile>$$Device:ARMCM0P$Device\ARM\SVD\ARMCM0P.svd</SFDFile> - <bCustSvd>0</bCustSvd> - <UseEnv>0</UseEnv> - <BinPath></BinPath> - <IncludePath></IncludePath> - <LibPath></LibPath> - <RegisterFilePath></RegisterFilePath> - <DBRegisterFilePath></DBRegisterFilePath> - <TargetStatus> - <Error>0</Error> - <ExitCodeStop>0</ExitCodeStop> - <ButtonStop>0</ButtonStop> - <NotGenerated>0</NotGenerated> - <InvalidFlash>1</InvalidFlash> - </TargetStatus> - <OutputDirectory>.\_build\</OutputDirectory> - <OutputName>watch-bt4-obj</OutputName> - <CreateExecutable>1</CreateExecutable> - <CreateLib>0</CreateLib> - <CreateHexFile>1</CreateHexFile> - <DebugInformation>1</DebugInformation> - <BrowseInformation>1</BrowseInformation> - <ListingPath>.\_build\</ListingPath> - <HexFormatSelection>1</HexFormatSelection> - <Merge32K>0</Merge32K> - <CreateBatchFile>0</CreateBatchFile> - <BeforeCompile> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopU1X>0</nStopU1X> - <nStopU2X>0</nStopU2X> - </BeforeCompile> - <BeforeMake> - <RunUserProg1>0</RunUserProg1> - <RunUserProg2>0</RunUserProg2> - <UserProg1Name></UserProg1Name> - <UserProg2Name></UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopB1X>0</nStopB1X> - <nStopB2X>0</nStopB2X> - </BeforeMake> - <AfterMake> - <RunUserProg1>1</RunUserProg1> - <RunUserProg2>1</RunUserProg2> - <UserProg1Name>fromelf.exe --bin --output _build/watch-bt4-obj.bin _build/watch-bt4-obj.axf</UserProg1Name> - <UserProg2Name>python ../../../../platform/bt4/build/pack_all.py _build/watch-bt4-obj.bin ../../../../platform/bt4/img/ASIC-2.2-ble_ctr.img _build/watch-bt4-obj.img _build/watch-bt4-obj.spf old</UserProg2Name> - <UserProg1Dos16Mode>0</UserProg1Dos16Mode> - <UserProg2Dos16Mode>0</UserProg2Dos16Mode> - <nStopA1X>0</nStopA1X> - <nStopA2X>0</nStopA2X> - </AfterMake> - <SelectedForBatchBuild>0</SelectedForBatchBuild> - <SVCSIdString></SVCSIdString> - </TargetCommonOption> - <CommonProperty> - <UseCPPCompiler>0</UseCPPCompiler> - <RVCTCodeConst>0</RVCTCodeConst> - <RVCTZI>0</RVCTZI> - <RVCTOtherData>0</RVCTOtherData> - <ModuleSelection>0</ModuleSelection> - <IncludeInBuild>1</IncludeInBuild> - <AlwaysBuild>0</AlwaysBuild> - <GenerateAssemblyFile>0</GenerateAssemblyFile> - <AssembleAssemblyFile>0</AssembleAssemblyFile> - <PublicsOnly>0</PublicsOnly> - <StopOnExitCode>3</StopOnExitCode> - <CustomArgument></CustomArgument> - <IncludeLibraryModules></IncludeLibraryModules> - <ComprImg>1</ComprImg> - </CommonProperty> - <DllOption> - <SimDllName>SARMCM3.DLL</SimDllName> - <SimDllArguments> </SimDllArguments> - <SimDlgDll>DARMCM1.DLL</SimDlgDll> - <SimDlgDllArguments>-pCM0+</SimDlgDllArguments> - <TargetDllName>SARMCM3.DLL</TargetDllName> - <TargetDllArguments> </TargetDllArguments> - <TargetDlgDll>TARMCM1.DLL</TargetDlgDll> - <TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments> - </DllOption> - <DebugOption> - <OPTHX> - <HexSelection>1</HexSelection> - <HexRangeLowAddress>0</HexRangeLowAddress> - <HexRangeHighAddress>0</HexRangeHighAddress> - <HexOffset>0</HexOffset> - <Oh166RecLen>16</Oh166RecLen> - </OPTHX> - <Simulator> - <UseSimulator>0</UseSimulator> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>1</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <LimitSpeedToRealTime>0</LimitSpeedToRealTime> - <RestoreSysVw>1</RestoreSysVw> - </Simulator> - <Target> - <UseTarget>1</UseTarget> - <LoadApplicationAtStartup>1</LoadApplicationAtStartup> - <RunToMain>1</RunToMain> - <RestoreBreakpoints>1</RestoreBreakpoints> - <RestoreWatchpoints>1</RestoreWatchpoints> - <RestoreMemoryDisplay>1</RestoreMemoryDisplay> - <RestoreFunctions>0</RestoreFunctions> - <RestoreToolbox>1</RestoreToolbox> - <RestoreTracepoints>1</RestoreTracepoints> - <RestoreSysVw>1</RestoreSysVw> - </Target> - <RunDebugAfterBuild>0</RunDebugAfterBuild> - <TargetSelection>4</TargetSelection> - <SimDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - </SimDlls> - <TargetDlls> - <CpuDll></CpuDll> - <CpuDllArguments></CpuDllArguments> - <PeripheralDll></PeripheralDll> - <PeripheralDllArguments></PeripheralDllArguments> - <InitializationFile></InitializationFile> - <Driver>BIN\CMSIS_AGDI.dll</Driver> - </TargetDlls> - </DebugOption> - <Utilities> - <Flash1> - <UseTargetDll>1</UseTargetDll> - <UseExternalTool>0</UseExternalTool> - <RunIndependent>0</RunIndependent> - <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging> - <Capability>1</Capability> - <DriverSelection>4096</DriverSelection> - </Flash1> - <bUseTDR>1</bUseTDR> - <Flash2>BIN\UL2CM3.DLL</Flash2> - <Flash3>"" ()</Flash3> - <Flash4></Flash4> - <pFcarmOut></pFcarmOut> - <pFcarmGrp>projects</pFcarmGrp> - <pFcArmRoot></pFcArmRoot> - <FcArmLst>0</FcArmLst> - </Utilities> - <TargetArmAds> - <ArmAdsMisc> - <GenerateListings>0</GenerateListings> - <asHll>1</asHll> - <asAsm>1</asAsm> - <asMacX>1</asMacX> - <asSyms>1</asSyms> - <asFals>1</asFals> - <asDbgD>1</asDbgD> - <asForm>1</asForm> - <ldLst>0</ldLst> - <ldmm>1</ldmm> - <ldXref>1</ldXref> - <BigEnd>0</BigEnd> - <AdsALst>1</AdsALst> - <AdsACrf>1</AdsACrf> - <AdsANop>0</AdsANop> - <AdsANot>0</AdsANot> - <AdsLLst>1</AdsLLst> - <AdsLmap>1</AdsLmap> - <AdsLcgr>1</AdsLcgr> - <AdsLsym>1</AdsLsym> - <AdsLszi>1</AdsLszi> - <AdsLtoi>1</AdsLtoi> - <AdsLsun>1</AdsLsun> - <AdsLven>1</AdsLven> - <AdsLsxf>1</AdsLsxf> - <RvctClst>1</RvctClst> - <GenPPlst>0</GenPPlst> - <AdsCpuType>"Cortex-M0+"</AdsCpuType> - <RvctDeviceName></RvctDeviceName> - <mOS>0</mOS> - <uocRom>0</uocRom> - <uocRam>0</uocRam> - <hadIROM>1</hadIROM> - <hadIRAM>1</hadIRAM> - <hadXRAM>0</hadXRAM> - <uocXRam>0</uocXRam> - <RvdsVP>0</RvdsVP> - <hadIRAM2>0</hadIRAM2> - <hadIROM2>0</hadIROM2> - <StupSel>8</StupSel> - <useUlib>0</useUlib> - <EndSel>1</EndSel> - <uLtcg>0</uLtcg> - <nSecure>0</nSecure> - <RoSelD>3</RoSelD> - <RwSelD>3</RwSelD> - <CodeSel>0</CodeSel> - <OptFeed>0</OptFeed> - <NoZi1>0</NoZi1> - <NoZi2>0</NoZi2> - <NoZi3>0</NoZi3> - <NoZi4>0</NoZi4> - <NoZi5>0</NoZi5> - <Ro1Chk>0</Ro1Chk> - <Ro2Chk>0</Ro2Chk> - <Ro3Chk>0</Ro3Chk> - <Ir1Chk>1</Ir1Chk> - <Ir2Chk>0</Ir2Chk> - <Ra1Chk>0</Ra1Chk> - <Ra2Chk>0</Ra2Chk> - <Ra3Chk>0</Ra3Chk> - <Im1Chk>1</Im1Chk> - <Im2Chk>0</Im2Chk> - <OnChipMemories> - <Ocm1> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm1> - <Ocm2> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm2> - <Ocm3> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm3> - <Ocm4> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm4> - <Ocm5> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm5> - <Ocm6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </Ocm6> - <IRAM> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </IRAM> - <IROM> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x40000</Size> - </IROM> - <XRAM> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </XRAM> - <OCR_RVCT1> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT1> - <OCR_RVCT2> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT2> - <OCR_RVCT3> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT3> - <OCR_RVCT4> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x2000</Size> - </OCR_RVCT4> - <OCR_RVCT5> - <Type>1</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT5> - <OCR_RVCT6> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT6> - <OCR_RVCT7> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT7> - <OCR_RVCT8> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT8> - <OCR_RVCT9> - <Type>0</Type> - <StartAddress>0x20000000</StartAddress> - <Size>0x20000</Size> - </OCR_RVCT9> - <OCR_RVCT10> - <Type>0</Type> - <StartAddress>0x0</StartAddress> - <Size>0x0</Size> - </OCR_RVCT10> - </OnChipMemories> - <RvctStartVector></RvctStartVector> - </ArmAdsMisc> - <Cads> - <interw>1</interw> - <Optim>4</Optim> - <oTime>0</oTime> - <SplitLS>0</SplitLS> - <OneElfS>1</OneElfS> - <Strict>0</Strict> - <EnumInt>0</EnumInt> - <PlainCh>0</PlainCh> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <wLevel>2</wLevel> - <uThumb>0</uThumb> - <uSurpInc>1</uSurpInc> - <uC99>1</uC99> - <useXO>0</useXO> - <v6Lang>0</v6Lang> - <v6LangP>0</v6LangP> - <vShortEn>1</vShortEn> - <vShortWch>1</vShortWch> - <VariousControls> - <MiscControls>--wchar16 --diag_suppress=1296</MiscControls> - <Define>INIT_WAKEUP=1 INIT_FLASH=1 INIT_GPO=1 CONFIG_ALLOW_SETTING_WRITE=TRUE WSF_BUF_ALLOC_FAIL_ASSERT=0 WSF_MS_PER_TICK=10 INIT_PERIPHERAL WSF_PRINTF_MAX_LEN=128 INIT_ENCRYPTED BT_VER=8 CONFIG_HOST_TYPE_ASIC=1 WSF_BUF_STATS=1 INIT_CENTRAL WSF_TRACE_ENABLED=1 CONFIG_HOST_REV=0x22 CONFIG_ALLOW_DEEP_SLEEP=FALSE WSF_CS_STATS=1 WSF_MAX_HANDLERS=20</Define> - <Undefine></Undefine> - <IncludePath>..\..\..\..\ble-profiles\include\app;..\..\..\..\ble-profiles\sources\apps;..\..\..\..\ble-profiles\sources\apps\app;..\..\..\..\ble-profiles\sources\services;..\..\..\..\ble-profiles\sources\profiles\include;..\..\..\..\ble-profiles\sources\profiles;..\..\..\..\ble-host\include;..\..\..\..\ble-host\sources\stack\att;..\..\..\..\ble-host\sources\stack\cfg;..\..\..\..\ble-host\sources\stack\dm;..\..\..\..\ble-host\sources\stack\hci;..\..\..\..\ble-host\sources\stack\l2c;..\..\..\..\ble-host\sources\stack\smp;..\..\..\..\platform\common\include;..\..\..\..\ble-host\sources\hci\dual_chip;..\..\..\..\wsf\common\include;..\..\..\..\controller\sources\ble\include;..\..\..\..\controller\include\ble;..\..\..\..\controller\include\common;..\..\..\..\platform\common\include;..\..\..\..\platform\bt4\include;..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Include;..\..\..\..\platform\bt4\sources\board\CMSIS\Include;..\..\..\..\platform\bt4\sources\llc\include;..\..\..\..\platform\bt4\sources\board;..\..\..\..\platform\bt4\sw\llc\include</IncludePath> - </VariousControls> - </Cads> - <Aads> - <interw>1</interw> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <thumb>0</thumb> - <SplitLS>0</SplitLS> - <SwStkChk>0</SwStkChk> - <NoWarn>0</NoWarn> - <uSurpInc>0</uSurpInc> - <useXO>0</useXO> - <VariousControls> - <MiscControls></MiscControls> - <Define></Define> - <Undefine></Undefine> - <IncludePath></IncludePath> - </VariousControls> - </Aads> - <LDads> - <umfTarg>0</umfTarg> - <Ropi>0</Ropi> - <Rwpi>0</Rwpi> - <noStLib>0</noStLib> - <RepFail>1</RepFail> - <useFile>0</useFile> - <TextAddressRange>0x20000000</TextAddressRange> - <DataAddressRange>0x20018000</DataAddressRange> - <pXoBase></pXoBase> - <ScatterFile>..\..\..\..\platform\bt4\build\cordio_tc-ram.sct</ScatterFile> - <IncludeLibs></IncludeLibs> - <IncludeLibsPath></IncludeLibsPath> - <Misc></Misc> - <LinkerInputFile></LinkerInputFile> - <DisabledWarnings></DisabledWarnings> - </LDads> - </TargetArmAds> - </TargetOption> - <Groups> - <Group> - <GroupName>ble-host</GroupName> - <Files> - <File> - <FileName>att_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_main.c</FilePath> - </File> - <File> - <FileName>att_uuid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\att_uuid.c</FilePath> - </File> - <File> - <FileName>attc_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_disc.c</FilePath> - </File> - <File> - <FileName>attc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_main.c</FilePath> - </File> - <File> - <FileName>attc_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_proc.c</FilePath> - </File> - <File> - <FileName>attc_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_read.c</FilePath> - </File> - <File> - <FileName>attc_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_sign.c</FilePath> - </File> - <File> - <FileName>attc_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\attc_write.c</FilePath> - </File> - <File> - <FileName>atts_ccc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ccc.c</FilePath> - </File> - <File> - <FileName>atts_dyn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_dyn.c</FilePath> - </File> - <File> - <FileName>atts_ind.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_ind.c</FilePath> - </File> - <File> - <FileName>atts_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_main.c</FilePath> - </File> - <File> - <FileName>atts_proc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_proc.c</FilePath> - </File> - <File> - <FileName>atts_read.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_read.c</FilePath> - </File> - <File> - <FileName>atts_sign.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_sign.c</FilePath> - </File> - <File> - <FileName>atts_write.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\att\atts_write.c</FilePath> - </File> - <File> - <FileName>cfg_stack.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\cfg\cfg_stack.c</FilePath> - </File> - <File> - <FileName>dm_adv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv.c</FilePath> - </File> - <File> - <FileName>dm_adv_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_adv_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn.c</FilePath> - </File> - <File> - <FileName>dm_conn_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master.c</FilePath> - </File> - <File> - <FileName>dm_conn_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_master_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave.c</FilePath> - </File> - <File> - <FileName>dm_conn_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_slave_leg.c</FilePath> - </File> - <File> - <FileName>dm_conn_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_conn_sm.c</FilePath> - </File> - <File> - <FileName>dm_dev.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev.c</FilePath> - </File> - <File> - <FileName>dm_dev_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_dev_priv.c</FilePath> - </File> - <File> - <FileName>dm_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_main.c</FilePath> - </File> - <File> - <FileName>dm_priv.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_priv.c</FilePath> - </File> - <File> - <FileName>dm_scan.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan.c</FilePath> - </File> - <File> - <FileName>dm_scan_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_scan_leg.c</FilePath> - </File> - <File> - <FileName>dm_sec.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec.c</FilePath> - </File> - <File> - <FileName>dm_sec_lesc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_lesc.c</FilePath> - </File> - <File> - <FileName>dm_sec_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_master.c</FilePath> - </File> - <File> - <FileName>dm_sec_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\dm\dm_sec_slave.c</FilePath> - </File> - <File> - <FileName>hci_cmd.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_cmd.c</FilePath> - </File> - <File> - <FileName>hci_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\common\hci_core.c</FilePath> - </File> - <File> - <FileName>hci_core_ps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_core_ps.c</FilePath> - </File> - <File> - <FileName>hci_evt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\hci\dual_chip\hci_evt.c</FilePath> - </File> - <File> - <FileName>hci_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\hci\hci_main.c</FilePath> - </File> - <File> - <FileName>l2c_coc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_coc.c</FilePath> - </File> - <File> - <FileName>l2c_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_main.c</FilePath> - </File> - <File> - <FileName>l2c_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_master.c</FilePath> - </File> - <File> - <FileName>l2c_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\l2c\l2c_slave.c</FilePath> - </File> - <File> - <FileName>sec_aes.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_aes.c</FilePath> - </File> - <File> - <FileName>sec_cmac.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_cmac.c</FilePath> - </File> - <File> - <FileName>sec_ecc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_ecc_hci.c</FilePath> - </File> - <File> - <FileName>sec_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\sec\common\sec_main.c</FilePath> - </File> - <File> - <FileName>smp_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_act.c</FilePath> - </File> - <File> - <FileName>smp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_main.c</FilePath> - </File> - <File> - <FileName>smp_non.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_non.c</FilePath> - </File> - <File> - <FileName>smp_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_act.c</FilePath> - </File> - <File> - <FileName>smp_sc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smp_sc_main.c</FilePath> - </File> - <File> - <FileName>smpi_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_act.c</FilePath> - </File> - <File> - <FileName>smpi_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpi_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpi_sm.c</FilePath> - </File> - <File> - <FileName>smpr_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_act.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_act.c</FilePath> - </File> - <File> - <FileName>smpr_sc_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sc_sm.c</FilePath> - </File> - <File> - <FileName>smpr_sm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-host\sources\stack\smp\smpr_sm.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>ble-profiles</GroupName> - <Files> - <File> - <FileName>anpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\anpc\anpc_main.c</FilePath> - </File> - <File> - <FileName>app_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_db.c</FilePath> - </File> - <File> - <FileName>app_disc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_disc.c</FilePath> - </File> - <File> - <FileName>app_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_hw.c</FilePath> - </File> - <File> - <FileName>app_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_main.c</FilePath> - </File> - <File> - <FileName>app_master.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master.c</FilePath> - </File> - <File> - <FileName>app_master_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_master_leg.c</FilePath> - </File> - <File> - <FileName>app_server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_server.c</FilePath> - </File> - <File> - <FileName>app_slave.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave.c</FilePath> - </File> - <File> - <FileName>app_slave_leg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_slave_leg.c</FilePath> - </File> - <File> - <FileName>app_terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\app_terminal.c</FilePath> - </File> - <File> - <FileName>app_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\app\common\app_ui.c</FilePath> - </File> - <File> - <FileName>bas_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\bas\bas_main.c</FilePath> - </File> - <File> - <FileName>blpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blpc\blpc_main.c</FilePath> - </File> - <File> - <FileName>blps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\blps\blps_main.c</FilePath> - </File> - <File> - <FileName>cpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cpp\cpps_main.c</FilePath> - </File> - <File> - <FileName>cscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\cscp\cscps_main.c</FilePath> - </File> - <File> - <FileName>dis_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\dis\dis_main.c</FilePath> - </File> - <File> - <FileName>fmpl_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\fmpl\fmpl_main.c</FilePath> - </File> - <File> - <FileName>gap_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gap\gap_main.c</FilePath> - </File> - <File> - <FileName>gatt_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\gatt\gatt_main.c</FilePath> - </File> - <File> - <FileName>glpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glpc\glpc_main.c</FilePath> - </File> - <File> - <FileName>glps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_db.c</FilePath> - </File> - <File> - <FileName>glps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\glps\glps_main.c</FilePath> - </File> - <File> - <FileName>gyro_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\gyro_main.c</FilePath> - </File> - <File> - <FileName>hid_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hid\hid_main.c</FilePath> - </File> - <File> - <FileName>hidapp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\hidapp\hidapp_main.c</FilePath> - </File> - <File> - <FileName>hrpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrpc\hrpc_main.c</FilePath> - </File> - <File> - <FileName>hrps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\hrps\hrps_main.c</FilePath> - </File> - <File> - <FileName>htpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htpc\htpc_main.c</FilePath> - </File> - <File> - <FileName>htps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\htps\htps_main.c</FilePath> - </File> - <File> - <FileName>paspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\paspc\paspc_main.c</FilePath> - </File> - <File> - <FileName>plxpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxpc\plxpc_main.c</FilePath> - </File> - <File> - <FileName>plxps_db.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_db.c</FilePath> - </File> - <File> - <FileName>plxps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\plxps\plxps_main.c</FilePath> - </File> - <File> - <FileName>rscps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\rscp\rscps_main.c</FilePath> - </File> - <File> - <FileName>scpps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\scpps\scpps_main.c</FilePath> - </File> - <File> - <FileName>svc_alert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_alert.c</FilePath> - </File> - <File> - <FileName>svc_batt.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_batt.c</FilePath> - </File> - <File> - <FileName>svc_bps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_bps.c</FilePath> - </File> - <File> - <FileName>svc_core.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_core.c</FilePath> - </File> - <File> - <FileName>svc_cps.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cps.c</FilePath> - </File> - <File> - <FileName>svc_cscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_cscs.c</FilePath> - </File> - <File> - <FileName>svc_dis.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_dis.c</FilePath> - </File> - <File> - <FileName>svc_gls.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gls.c</FilePath> - </File> - <File> - <FileName>svc_gyro.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_gyro.c</FilePath> - </File> - <File> - <FileName>svc_hid.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hid.c</FilePath> - </File> - <File> - <FileName>svc_hrs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hrs.c</FilePath> - </File> - <File> - <FileName>svc_hts.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_hts.c</FilePath> - </File> - <File> - <FileName>svc_ipss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_ipss.c</FilePath> - </File> - <File> - <FileName>svc_plxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_plxs.c</FilePath> - </File> - <File> - <FileName>svc_px.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_px.c</FilePath> - </File> - <File> - <FileName>svc_rscs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_rscs.c</FilePath> - </File> - <File> - <FileName>svc_scpss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_scpss.c</FilePath> - </File> - <File> - <FileName>svc_temp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_temp.c</FilePath> - </File> - <File> - <FileName>svc_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_time.c</FilePath> - </File> - <File> - <FileName>svc_uricfg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_uricfg.c</FilePath> - </File> - <File> - <FileName>svc_wdxs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wdxs.c</FilePath> - </File> - <File> - <FileName>svc_wp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wp.c</FilePath> - </File> - <File> - <FileName>svc_wss.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\services\svc_wss.c</FilePath> - </File> - <File> - <FileName>temp_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\sensor\temp_main.c</FilePath> - </File> - <File> - <FileName>tipc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\tipc\tipc_main.c</FilePath> - </File> - <File> - <FileName>udsc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\udsc\udsc_main.c</FilePath> - </File> - <File> - <FileName>uricfg_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\uribeacon\uricfg_main.c</FilePath> - </File> - <File> - <FileName>watch_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\apps\watch\watch_main.c</FilePath> - </File> - <File> - <FileName>wdxc_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_ft.c</FilePath> - </File> - <File> - <FileName>wdxc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_main.c</FilePath> - </File> - <File> - <FileName>wdxc_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxc\wdxc_stream.c</FilePath> - </File> - <File> - <FileName>wdxs_au.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_au.c</FilePath> - </File> - <File> - <FileName>wdxs_dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_dc.c</FilePath> - </File> - <File> - <FileName>wdxs_ft.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_ft.c</FilePath> - </File> - <File> - <FileName>wdxs_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_main.c</FilePath> - </File> - <File> - <FileName>wdxs_stream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wdxs\wdxs_stream.c</FilePath> - </File> - <File> - <FileName>wpc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wpc\wpc_main.c</FilePath> - </File> - <File> - <FileName>wspc_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wspc\wspc_main.c</FilePath> - </File> - <File> - <FileName>wsps_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\ble-profiles\sources\profiles\wsps\wsps_main.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>platform-bt4</GroupName> - <Files> - <File> - <FileName>app_param.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\app\app_param.c</FilePath> - </File> - <File> - <FileName>board.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board.c</FilePath> - </File> - <File> - <FileName>board_flash.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_flash.c</FilePath> - </File> - <File> - <FileName>board_heap.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_heap.c</FilePath> - </File> - <File> - <FileName>board_main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_main.c</FilePath> - </File> - <File> - <FileName>board_rtc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_rtc.c</FilePath> - </File> - <File> - <FileName>board_time.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_time.c</FilePath> - </File> - <File> - <FileName>board_ui.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_ui.c</FilePath> - </File> - <File> - <FileName>board_wsf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\board_wsf.c</FilePath> - </File> - <File> - <FileName>cordio_tc2.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\cordio_tc2.c</FilePath> - </File> - <File> - <FileName>hci_tr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_tr.c</FilePath> - </File> - <File> - <FileName>hci_vs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\hci\hci_vs.c</FilePath> - </File> - <File> - <FileName>llc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\cordio-tc2\llc.c</FilePath> - </File> - <File> - <FileName>llc_hci.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_hci.c</FilePath> - </File> - <File> - <FileName>llc_init.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\llc\generic\llc_init.c</FilePath> - </File> - <File> - <FileName>ota_common.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_common.c</FilePath> - </File> - <File> - <FileName>ota_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\ota\ota_efs.c</FilePath> - </File> - <File> - <FileName>platform.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\platform.c</FilePath> - </File> - <File> - <FileName>startup_smd_tc.s</FileName> - <FileType>2</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\ARM\startup_smd_tc.s</FilePath> - </File> - <File> - <FileName>system_smd_tc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\platform\bt4\sources\board\CMSIS\Device\SMD\TC\Source\system_smd_tc.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>projects</GroupName> - <Files> - <File> - <FileName>main.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\watch\main.c</FilePath> - </File> - <File> - <FileName>stack_watch.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\projects\ble-apps\watch\stack_watch.c</FilePath> - </File> - </Files> - </Group> - <Group> - <GroupName>wsf</GroupName> - <Files> - <File> - <FileName>bda.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bda.c</FilePath> - </File> - <File> - <FileName>bstream.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\bstream.c</FilePath> - </File> - <File> - <FileName>calc128.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\calc128.c</FilePath> - </File> - <File> - <FileName>crc32.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\crc32.c</FilePath> - </File> - <File> - <FileName>print.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\print.c</FilePath> - </File> - <File> - <FileName>terminal.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\terminal.c</FilePath> - </File> - <File> - <FileName>wsf_assert.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_assert.c</FilePath> - </File> - <File> - <FileName>wsf_buf.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_buf.c</FilePath> - </File> - <File> - <FileName>wsf_cs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_cs.c</FilePath> - </File> - <File> - <FileName>wsf_efs.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_efs.c</FilePath> - </File> - <File> - <FileName>wsf_msg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_msg.c</FilePath> - </File> - <File> - <FileName>wsf_os.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_os.c</FilePath> - </File> - <File> - <FileName>wsf_queue.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_queue.c</FilePath> - </File> - <File> - <FileName>wsf_timer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_timer.c</FilePath> - </File> - <File> - <FileName>wsf_trace.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\baremetal\sources\wsf_trace.c</FilePath> - </File> - <File> - <FileName>wstr.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\..\..\wsf\common\sources\util\wstr.c</FilePath> - </File> - </Files> - </Group> - </Groups> - </Target> - </Targets> - -</Project> \ No newline at end of file diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/main.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/main.c deleted file mode 100644 index 6e43e0391c5a458ae534925d3331f4e52f0500f3..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/main.c +++ /dev/null @@ -1,186 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file main.c - * - * \brief Main file for watch application. - * - * Copyright (c) 2015-2018 Arm Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_msg.h" -#include "wsf_assert.h" -#include "wsf_buf.h" -#include "wsf_cs.h" -#include "wsf_timer.h" - -#include "sec_api.h" -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "sec_api.h" - -#ifdef USE_EXACTLE -#include "ll_init_api.h" -#endif - -#include "platform_api.h" -#include "platform_ble_api.h" - -#include "watch/watch_api.h" -#include "app_ui.h" - -#include <string.h> - -/************************************************************************************************** - Global Variables -**************************************************************************************************/ - -/*! \brief Pool runtime configuration. */ -static wsfBufPoolDesc_t mainPoolDesc[] = -{ - { 16, 8 }, - { 32, 4 }, - { 192, 8 }, - { 256, 8 } -}; - -#ifdef USE_EXACTLE - static LlRtCfg_t mainLlRtCfg; -#endif - -/************************************************************************************************** - Functions -**************************************************************************************************/ - -/*! \brief Stack initialization for app. */ -extern void StackInitWatch(void); - -/*************************************************************************************************/ -/*! - * \brief Initialize WSF. - * - * \return None. - */ -/*************************************************************************************************/ -static void mainWsfInit(void) -{ -#ifdef USE_EXACTLE - /* +12 for message headroom, + 2 event header, +255 maximum parameter length. */ - const uint16_t maxRptBufSize = 12 + 2 + 255; - - /* +12 for message headroom, +4 for header. */ - const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM; - - /* Adjust buffer allocation based on platform configuration. */ - mainPoolDesc[2].len = maxRptBufSize; - mainPoolDesc[2].num = mainLlRtCfg.maxAdvReports; - mainPoolDesc[3].len = aclBufSize; - mainPoolDesc[3].num = mainLlRtCfg.numTxBufs + mainLlRtCfg.numRxBufs; -#endif - - const uint8_t numPools = sizeof(mainPoolDesc) / sizeof(mainPoolDesc[0]); - - uint16_t memUsed; - memUsed = WsfBufInit(PlatformGetHeapAvailable(), PlatformGetHeapStart(), numPools, mainPoolDesc); - PlatformReserveHeap(memUsed); - - WsfTimerInit(); - WsfTraceEnable(TRUE); - #if (WSF_TOKEN_ENABLED == TRUE) - WsfTokenRegisterHandler(LhciVsEncodeTraceMsgEvtPkt); - #endif -} - -/*************************************************************************************************/ -/*! -* \fn main -* -* \brief Entry point for demo software. -* -* \param None. -* -* \return None. -*/ -/*************************************************************************************************/ -int main(void) -{ -#ifdef USE_EXACTLE - /* Configurations must be persistent. */ - static BbRtCfg_t mainBbRtCfg; - - PlatformInitControllerHardware(); - PlatformLoadBbConfig((PlatformBbCfg_t *)&mainBbRtCfg); - LlGetDefaultRunTimeCfg(&mainLlRtCfg); - PlatformLoadLlConfig((PlatformLlCfg_t *)&mainLlRtCfg.maxAdvSets); -#endif - - PlatformInitHostHardware(); - PlatformInit(); - - mainWsfInit(); - -#ifdef USE_EXACTLE - LlInitRtCfg_t llCfg = - { - .pBbRtCfg = &mainBbRtCfg, - .wlSizeCfg = 4, - .rlSizeCfg = 4, - .plSizeCfg = 4, - .pLlRtCfg = &mainLlRtCfg, - .pFreeMem = PlatformGetHeapStart(), - .freeMemAvail = PlatformGetHeapAvailable() - }; - - uint32_t memUsed; - memUsed = LlInitStdInit(&llCfg); - PlatformReserveHeap(memUsed); - - bdAddr_t bdAddr; - PlatformLoadBdAddress(bdAddr); - LlSetBdAddr((uint8_t *)&bdAddr); - LlMathSetSeed((uint32_t *)&bdAddr); -#else - PlatformInitDualChip(); -#endif - - StackInitWatch(); - WatchStart(); - - bool_t tracePending = FALSE; - - while (TRUE) - { - PlatformTimeUpdate(); - - wsfOsDispatcher(); - -#if WSF_TOKEN_ENABLED == TRUE - /* Allow only a single token to be processed at a time. */ - tracePending = WsfTokenService(); -#endif - - if (!tracePending) - { - PlatformTimeSleep(); - } - } -} diff --git a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/stack_watch.c b/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/stack_watch.c deleted file mode 100644 index 089f12e8ecf5e54b3a5a1b04c2b6b06e9da45db6..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/projects/ble-apps/watch/stack_watch.c +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file - * - * \brief Stack initialization for watch. - * - * Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_os.h" -#include "util/bstream.h" - -#include "watch/watch_api.h" - -#include "hci_handler.h" -#include "dm_handler.h" -#include "l2c_handler.h" -#include "att_handler.h" -#include "smp_handler.h" -#include "l2c_api.h" -#include "att_api.h" -#include "smp_api.h" -#include "app_api.h" -#include "hci_core.h" -#include "svc_dis.h" -#include "svc_core.h" -#include "sec_api.h" - -/*************************************************************************************************/ -/*! - * \brief Initialize stack. - * - * \return None. - */ -/*************************************************************************************************/ -void StackInitWatch(void) -{ - wsfHandlerId_t handlerId; - - SecInit(); - SecAesInit(); - SecCmacInit(); - SecEccInit(); - - handlerId = WsfOsSetNextHandler(HciHandler); - HciHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(DmHandler); - DmDevVsInit(0); - DmScanInit(); - DmAdvInit(); - DmConnInit(); - DmConnMasterInit(); - DmConnSlaveInit(); - DmSecInit(); - DmSecLescInit(); - DmPrivInit(); - DmHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(L2cSlaveHandler); - L2cSlaveHandlerInit(handlerId); - L2cInit(); - L2cMasterInit(); - L2cSlaveInit(); - - handlerId = WsfOsSetNextHandler(AttHandler); - AttHandlerInit(handlerId); - AttsInit(); - AttsIndInit(); - AttcInit(); - - handlerId = WsfOsSetNextHandler(SmpHandler); - SmpHandlerInit(handlerId); - SmpiInit(); - SmprInit(); - SmpiScInit(); - SmprScInit(); - HciSetMaxRxAclLen(100); - - handlerId = WsfOsSetNextHandler(AppHandler); - AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(WatchHandler); - WatchHandlerInit(handlerId); -} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_trace.c b/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_trace.c deleted file mode 100644 index 5d0957a5eb25754308a591351f5b76857e6ce3ac..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/wsf/baremetal/sources/wsf_trace.c +++ /dev/null @@ -1,202 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file wsf_trace.c - * - * \brief Trace message implementation. - * - * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. - * Arm Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ - -#include "wsf_types.h" -#include "wsf_trace.h" -#include "wsf_assert.h" -#include "wsf_cs.h" - -#include <string.h> -#include <stdarg.h> -#include <stdio.h> - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -#ifndef WSF_RING_BUF_SIZE -/*! \brief Size of token ring buffer (multiple of 2^N). */ -#define WSF_RING_BUF_SIZE 32 -#endif - -/*! \brief Ring buffer flow control condition detected. */ -#define WSF_TOKEN_FLAG_FLOW_CTRL (1 << 28) - -/************************************************************************************************** - Data types -**************************************************************************************************/ - -/*! \brief Trace control block. */ -struct -{ - struct - { - uint32_t token; /*!< Token. */ - uint32_t param; /*!< Parameter. */ - } ringBuf[WSF_RING_BUF_SIZE]; /*!< Tokenized tracing ring buffer. */ - - volatile uint32_t prodIdx; /*!< Ring buffer producer index. */ - volatile uint32_t consIdx; /*!< Ring buffer consumer index. */ - - WsfTokenHandler_t tokenCback; /*!< Token event callback. */ - - bool_t ringBufEmpty; /*!< Ring buffer state. */ - - bool_t enabled; /*!< Tracing state. */ - - wsfTraceCback_t cback; /*!< Platform trace callback */ -} wsfTraceCb; - -#if WSF_TRACE_ENABLED == TRUE - -/*************************************************************************************************/ -/*! - * \brief Print a trace message. - * - * \param pStr Message format string - * \param ... Additional arguments, printf-style - * - * \return None. - */ -/*************************************************************************************************/ -void WsfTrace(const char *pStr, ...) -{ - va_list args; - - va_start(args, pStr); - if (wsfTraceCb.cback) - { - (*wsfTraceCb.cback)(pStr, args); - } - va_end(args); -} - -#endif - -/*************************************************************************************************/ -/*! - * \brief Register platform trace callback function. - * - * \param cback Callback function - * - * \return None. - */ -/*************************************************************************************************/ -void WsfTraceRegister(wsfTraceCback_t cback) -{ - wsfTraceCb.cback = cback; -} - -/*************************************************************************************************/ -/*! - * \brief Output tokenized message. - * - * \param tok Token - * \param var Variable - * - * \return None. - */ -/*************************************************************************************************/ -void WsfToken(uint32_t tok, uint32_t var) -{ - static uint32_t flags = 0; - - if (!wsfTraceCb.enabled) - { - return; - } - - WSF_CS_INIT(cs); - WSF_CS_ENTER(cs); - - uint32_t prodIdx = (wsfTraceCb.prodIdx + 1) & (WSF_RING_BUF_SIZE - 1); - - if (prodIdx != wsfTraceCb.consIdx) - { - wsfTraceCb.ringBuf[wsfTraceCb.prodIdx].token = tok | flags; - wsfTraceCb.ringBuf[wsfTraceCb.prodIdx].param = var; - wsfTraceCb.prodIdx = prodIdx; - flags = 0; - } - else - { - flags = WSF_TOKEN_FLAG_FLOW_CTRL; - } - - WSF_CS_EXIT(cs); -} - -/*************************************************************************************************/ -/*! - * \brief Enable trace messages. - * - * \param enable TRUE to enable, FALSE to disable - * - * \return None. - */ -/*************************************************************************************************/ -void WsfTraceEnable(bool_t enable) -{ -#if WSF_TOKEN_ENABLED == TRUE - wsfTraceCb.enabled = enable; -#endif -} - -/*************************************************************************************************/ -/*! - * \brief Service the trace ring buffer. - * - * \return TRUE if trace messages pending, FALSE otherwise. - * - * This routine is called in the main loop for a "push" type trace systems. - */ -/*************************************************************************************************/ -bool_t WsfTokenService(void) -{ - if (wsfTraceCb.tokenCback == NULL) - { - return FALSE; - } - - if (wsfTraceCb.consIdx != wsfTraceCb.prodIdx) - { - wsfTraceCb.tokenCback((uint8_t *)&wsfTraceCb.ringBuf[wsfTraceCb.consIdx], sizeof(wsfTraceCb.ringBuf[0])); - wsfTraceCb.consIdx = (wsfTraceCb.consIdx + 1) & (WSF_RING_BUF_SIZE - 1); - return TRUE; - } - - return FALSE; -} - -/*************************************************************************************************/ -/*! - * \brief Regsiter token handler. - * - * \param tokenCback Token event handler. - * - * \return None. - * - * This routine registers a token callback. This callback is called when the next token event - * is ready to be written to the I/O. - */ -/*************************************************************************************************/ -void WsfTokenRegisterHandler(WsfTokenHandler_t tokenCback) -{ - wsfTraceCb.tokenCback = tokenCback; -} diff --git a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bstream.h b/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bstream.h deleted file mode 100644 index 03be5b3bbbcc9d3e08b94b5ce2577d952380be45..0000000000000000000000000000000000000000 --- a/lib/sdk/NDALibraries/BTLE/wsf/common/include/util/bstream.h +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************************************/ -/*! - * \file bstream.h - * - * \brief Byte stream to integer conversion macros. - * - * Copyright (c) 2009-2017 ARM Ltd. All Rights Reserved. - * ARM Ltd. confidential and proprietary. - * - * IMPORTANT. Your use of this file is governed by a Software License Agreement - * ("Agreement") that must be accepted in order to download or otherwise receive a - * copy of this file. You may not use or copy this file for any purpose other than - * as described in the Agreement. If you do not agree to all of the terms of the - * Agreement do not use this file and delete all copies in your possession or control; - * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior - * to any use, copying or further distribution of this software. - */ -/*************************************************************************************************/ -#ifndef BSTREAM_H -#define BSTREAM_H - -#include "util/bda.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - Macros -**************************************************************************************************/ - -/*! - * Macros for converting a little endian byte buffer to integers. - */ -#define BYTES_TO_UINT16(n, p) {n = ((uint16_t)(p)[0] + ((uint16_t)(p)[1] << 8));} - -#define BYTES_TO_UINT24(n, p) {n = ((uint16_t)(p)[0] + ((uint16_t)(p)[1] << 8) + \ - ((uint16_t)(p)[2] << 16));} - -#define BYTES_TO_UINT32(n, p) {n = ((uint32_t)(p)[0] + ((uint32_t)(p)[1] << 8) + \ - ((uint32_t)(p)[2] << 16) + ((uint32_t)(p)[3] << 24));} - -#define BYTES_TO_UINT40(n, p) {n = ((uint64_t)(p)[0] + ((uint64_t)(p)[1] << 8) + \ - ((uint64_t)(p)[2] << 16) + ((uint64_t)(p)[3] << 24) + \ - ((uint64_t)(p)[4] << 32));} - -#define BYTES_TO_UINT64(n, p) {n = ((uint64_t)(p)[0] + ((uint64_t)(p)[1] << 8) + \ - ((uint64_t)(p)[2] << 16) + ((uint64_t)(p)[3] << 24) + \ - ((uint64_t)(p)[4] << 32) + ((uint64_t)(p)[5] << 40) + \ - ((uint64_t)(p)[6] << 48) + ((uint64_t)(p)[7] << 56));} - -/*! - * Macros for converting little endian integers to array of bytes - */ -#define UINT16_TO_BYTES(n) ((uint8_t) (n)), ((uint8_t)((n) >> 8)) -#define UINT32_TO_BYTES(n) ((uint8_t) (n)), ((uint8_t)((n) >> 8)), ((uint8_t)((n) >> 16)), ((uint8_t)((n) >> 24)) - -/*! - * Macros for converting little endian integers to single bytes - */ -#define UINT16_TO_BYTE0(n) ((uint8_t) (n)) -#define UINT16_TO_BYTE1(n) ((uint8_t) ((n) >> 8)) - -#define UINT32_TO_BYTE0(n) ((uint8_t) (n)) -#define UINT32_TO_BYTE1(n) ((uint8_t) ((n) >> 8)) -#define UINT32_TO_BYTE2(n) ((uint8_t) ((n) >> 16)) -#define UINT32_TO_BYTE3(n) ((uint8_t) ((n) >> 24)) - -/*! - * Macros for converting a little endian byte stream to integers, with increment. - */ -#define BSTREAM_TO_INT8(n, p) {n = (int8_t)(*(p)++);} -#define BSTREAM_TO_UINT8(n, p) {n = (uint8_t)(*(p)++);} -#define BSTREAM_TO_UINT16(n, p) {BYTES_TO_UINT16(n, p); p += 2;} -#define BSTREAM_TO_UINT24(n, p) {BYTES_TO_UINT24(n, p); p += 3;} -#define BSTREAM_TO_UINT32(n, p) {BYTES_TO_UINT32(n, p); p += 4;} -#define BSTREAM_TO_UINT40(n, p) {BYTES_TO_UINT40(n, p); p += 5;} -#define BSTREAM_TO_UINT64(n, p) {n = BstreamToUint64(p); p += 8;} -#define BSTREAM_TO_BDA(bda, p) {BdaCpy(bda, p); p += BDA_ADDR_LEN;} -#define BSTREAM_TO_BDA64(bda, p) {bda = BstreamToBda64(p); p += BDA_ADDR_LEN;} - -/*! - * Macros for converting integers to a little endian byte stream, with increment. - */ -#define UINT8_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n);} -#define UINT16_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8);} -#define UINT24_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ - *(p)++ = (uint8_t)((n) >> 16);} -#define UINT32_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ - *(p)++ = (uint8_t)((n) >> 16); *(p)++ = (uint8_t)((n) >> 24);} -#define UINT40_TO_BSTREAM(p, n) {*(p)++ = (uint8_t)(n); *(p)++ = (uint8_t)((n) >> 8); \ - *(p)++ = (uint8_t)((n) >> 16); *(p)++ = (uint8_t)((n) >> 24); \ - *(p)++ = (uint8_t)((n) >> 32);} -#define UINT64_TO_BSTREAM(p, n) {Uint64ToBstream(p, n); p += sizeof(uint64_t);} -#define BDA_TO_BSTREAM(p, bda) {BdaCpy(p, bda); p += BDA_ADDR_LEN;} -#define BDA64_TO_BSTREAM(p, bda) {Bda64ToBstream(p, bda); p += BDA_ADDR_LEN;} - -/*! - * Macros for converting integers to a little endian byte stream, without increment. - */ -#define UINT16_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8);} -#define UINT24_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ - (p)[2] = (uint8_t)((n) >> 16);} -#define UINT32_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ - (p)[2] = (uint8_t)((n) >> 16); (p)[3] = (uint8_t)((n) >> 24);} -#define UINT40_TO_BUF(p, n) {(p)[0] = (uint8_t)(n); (p)[1] = (uint8_t)((n) >> 8); \ - (p)[2] = (uint8_t)((n) >> 16); (p)[3] = (uint8_t)((n) >> 24);\ - (p)[4] = (uint8_t)((n) >> 32);} - -/*! - * Macros for comparing a little endian byte buffer to integers. - */ -#define BYTES_UINT16_CMP(p, n) ((p)[1] == UINT16_TO_BYTE1(n) && (p)[0] == UINT16_TO_BYTE0(n)) - -/*! - * Macros for IEEE FLOAT type: exponent = byte 3, mantissa = bytes 2-0 - */ -#define FLT_TO_UINT32(m, e) ((m) | ((int32_t)(e) * 16777216)) -#define UINT32_TO_FLT(m, e, n) {m = UINT32_TO_FLT_M(n); e = UINT32_TO_FLT_E(n);} -#define UINT32_TO_FLT_M(n) ((((n) & 0x00FFFFFF) >= 0x00800000) ? \ - ((int32_t)(((n) | 0xFF000000))) : ((int32_t)((n) & 0x00FFFFFF))) -#define UINT32_TO_FLT_E(n) ((int8_t)(n >> 24)) -/*! - * Macros for IEEE SFLOAT type: exponent = bits 15-12, mantissa = bits 11-0 - */ -#define SFLT_TO_UINT16(m, e) ((m) | (0xF000 & ((int16_t)(e) * 4096))) -#define UINT16_TO_SFLT(m, e, n) {m = UINT16_TO_SFLT_M(n); e = UINT16_TO_SFLT_E(n);} -#define UINT16_TO_SFLT_M(n) ((((n) & 0x0FFF) >= 0x0800) ? \ - ((int16_t)(((n) | 0xF000))) : ((int16_t)((n) & 0x0FFF))) -#define UINT16_TO_SFLT_E(n) (((n >> 12) >= 0x0008) ? \ - ((int8_t)(((n >> 12) | 0xF0))) : ((int8_t)(n >> 12))) - -/************************************************************************************************** - Function Declarations -**************************************************************************************************/ - -uint64_t BstreamToBda64(const uint8_t *p); -uint64_t BstreamToUint64(const uint8_t *p); -void Bda64ToBstream(uint8_t *p, uint64_t bda); -void Uint64ToBstream(uint8_t *p, uint64_t n); - -#ifdef __cplusplus -}; -#endif - -#endif /* BSTREAM_H */ diff --git a/lib/sdk/meson.build b/lib/sdk/meson.build index e71031e577d7942f506dd1deae8124dec3dcb15c..2adfa1c3fe406e13ccf675f0df28c06d58e63530 100644 --- a/lib/sdk/meson.build +++ b/lib/sdk/meson.build @@ -6,3 +6,5 @@ subdir('./Libraries/Boards/card10/') subdir('./Libraries/FreeRTOS/') subdir('./Libraries/MAXUSB/') + +subdir('./Libraries/BTLE/')